]> CyberLeo.Net >> Repos - FreeBSD/releng/10.2.git/blob - contrib/ntp/sntp/libevent/m4/libevent_openssl.m4
- Copy stable/10@285827 to releng/10.2 in preparation for 10.2-RC1
[FreeBSD/releng/10.2.git] / contrib / ntp / sntp / libevent / m4 / libevent_openssl.m4
1 dnl ######################################################################
2 dnl OpenSSL support
3 AC_DEFUN([LIBEVENT_OPENSSL], [
4 AC_REQUIRE([NTP_PKG_CONFIG])dnl
5
6 case "$enable_openssl" in
7  yes)
8     have_openssl=no
9     case "$PKG_CONFIG" in
10      '')
11         ;;
12      *)
13         OPENSSL_LIBS=`$PKG_CONFIG --libs openssl 2>/dev/null`
14         case "$OPENSSL_LIBS" in
15          '') ;;
16          *) OPENSSL_LIBS="$OPENSSL_LIBS $EV_LIB_GDI $EV_LIB_WS32 $OPENSSL_LIBADD"
17             have_openssl=yes
18             ;;
19         esac
20         OPENSSL_INCS=`$PKG_CONFIG --cflags openssl 2>/dev/null`
21         ;;
22     esac
23     case "$have_openssl" in
24      yes) ;;
25      *)
26         save_LIBS="$LIBS"
27         LIBS=""
28         OPENSSL_LIBS=""
29         AC_SEARCH_LIBS([SSL_new], [ssl],
30             [have_openssl=yes
31             OPENSSL_LIBS="$LIBS -lcrypto $EV_LIB_GDI $EV_LIB_WS32 $OPENSSL_LIBADD"],
32             [have_openssl=no],
33             [-lcrypto $EV_LIB_GDI $EV_LIB_WS32 $OPENSSL_LIBADD])
34         LIBS="$save_LIBS"
35         ;;
36     esac
37     AC_SUBST(OPENSSL_INCS)
38     AC_SUBST(OPENSSL_LIBS)
39     case "$have_openssl" in
40      yes)  AC_DEFINE(HAVE_OPENSSL, 1, [Define if the system has openssl]) ;;
41     esac
42     ;;
43 esac
44
45 # check if we have and should use openssl
46 AM_CONDITIONAL(OPENSSL, [test "$enable_openssl" != "no" && test "$have_openssl" = "yes"])
47 ])