25
|
1 AC_INIT(aclocal.m4)
|
|
2 AM_INIT_AUTOMAKE(connwrap, 0.1)
|
|
3
|
|
4 AC_PROG_RANLIB
|
|
5
|
|
6 AC_PROG_CC
|
|
7 AC_PROG_CXX
|
|
8
|
|
9 ###
|
|
10 ### SSL libs
|
|
11 ###
|
|
12
|
|
13 AC_ARG_WITH(ssl, [ --with-ssl enable SSL secured connections using either OpenSSL
|
|
14 or GnuTLS],
|
|
15 [with_ssl=$withval])
|
|
16
|
|
17 if test "$with_ssl" != "no"; then
|
|
18 AC_ARG_WITH(openssl,
|
|
19 [ --with-openssl=[DIR] enable SSL secured connections using the OpenSSL
|
|
20 library in DIR (optional)],
|
|
21 [with_openssl=$withval])
|
|
22
|
|
23 if test -z "$with_openssl"; then
|
|
24 for ac_dir in /usr/local /usr; do
|
|
25 if test -f "$ac_dir/include/openssl/ssl.h"; then
|
|
26 with_openssl=$ac_dir
|
|
27 break;
|
|
28 fi
|
|
29 done
|
|
30 fi
|
|
31
|
|
32 AC_MSG_CHECKING(for OpenSSL)
|
|
33
|
|
34 if test -n "$with_openssl" -a "$with_openssl" != "no"; then
|
|
35 if test "$with_openssl" = "yes"; then with_openssl="/usr"; fi
|
|
36 CFLAGS="$CFLAGS -I${with_openssl}"
|
|
37 AC_DEFINE(HAVE_OPENSSL)
|
|
38 AC_MSG_RESULT([found in $with_openssl])
|
|
39 AC_CHECK_LIB(crypto, main, [
|
|
40 AC_CHECK_LIB(crypto, SSLeay_add_all_algorithms, [
|
|
41 AC_DEFINE(HAVE_SSLEAY)
|
|
42 ])
|
|
43 ])
|
|
44 AC_CHECK_LIB(ssl, main)
|
|
45 else
|
|
46 AC_MSG_RESULT([not found or disabled])
|
|
47
|
|
48 AM_PATH_LIBGNUTLS_EXTRA(0.0.1, [
|
|
49 CXXFLAGS="$CXXFLAGS $LIBGNUTLS_CFLAGS"
|
|
50 LIBS="$LIBS $LIBGNUTLS_LIBS -lgnutls-extra"
|
|
51 AC_DEFINE(HAVE_GNUTLS)
|
|
52 ])
|
|
53 fi
|
|
54 fi
|
|
55
|
|
56 AC_MSG_CHECKING(for inet_aton() presence)
|
|
57
|
|
58 AC_TRY_LINK([
|
|
59
|
|
60 #include <sys/types.h>
|
|
61 #include <sys/socket.h>
|
|
62 #include <netinet/in.h>
|
|
63 #include <arpa/inet.h>
|
|
64
|
|
65 ], [
|
|
66
|
|
67 struct in_addr inp;
|
|
68 inet_aton("address", &inp);
|
|
69
|
|
70 ], have_aton=yes, have_aton=no)
|
|
71
|
|
72 if test "$have_aton" = "yes"; then
|
|
73 AC_DEFINE(HAVE_INET_ATON)
|
|
74 AC_MSG_RESULT(yes)
|
|
75 else
|
|
76 AC_MSG_RESULT(no)
|
|
77 fi
|
|
78
|
|
79 AC_OUTPUT(Makefile)
|