3 |
3 |
4 AC_PREREQ(2.59) |
4 AC_PREREQ(2.59) |
5 AC_INIT(mcabber, 0.6.0-dev, bmikael@lists.lilotux.net) |
5 AC_INIT(mcabber, 0.6.0-dev, bmikael@lists.lilotux.net) |
6 AM_INIT_AUTOMAKE |
6 AM_INIT_AUTOMAKE |
7 AC_CONFIG_SRCDIR([src]) |
7 AC_CONFIG_SRCDIR([src]) |
8 AM_CONFIG_HEADER(config.h) |
8 AC_CONFIG_HEADER(config.h) |
9 |
9 |
10 AC_PROG_RANLIB |
10 AC_PROG_RANLIB |
11 |
11 |
12 CFLAGS="$CFLAGS -Wall" |
12 CFLAGS="$CFLAGS -Wall" |
13 |
13 |
15 AC_PROG_CXX |
15 AC_PROG_CXX |
16 AC_PROG_CC |
16 AC_PROG_CC |
17 AC_PROG_INSTALL |
17 AC_PROG_INSTALL |
18 |
18 |
19 # Checks for libraries. |
19 # Checks for libraries. |
20 #AC_CHECK_LIB([connwrap], [cw_nb_connect]) |
|
21 #AC_CHECK_LIB([libjabber], [jab_new]) |
|
22 AC_CHECK_LIB([ncurses], [initscr]) |
20 AC_CHECK_LIB([ncurses], [initscr]) |
23 AC_CHECK_LIB([panel], [new_panel]) |
21 AC_CHECK_LIB([panel], [new_panel]) |
24 AC_CHECK_LIB([ssl], [SSL_new]) |
|
25 |
22 |
26 # Checks for header files. |
23 # Checks for header files. |
27 AC_HEADER_STDC |
24 AC_HEADER_STDC |
28 AC_CHECK_HEADERS([arpa/inet.h fcntl.h locale.h netdb.h netinet/in.h stddef.h stdlib.h string.h strings.h sys/socket.h sys/time.h syslog.h termios.h unistd.h ncurses.h panel.h getopt.h]) |
25 AC_CHECK_HEADERS([arpa/inet.h fcntl.h locale.h netdb.h netinet/in.h stddef.h stdlib.h string.h strings.h sys/socket.h sys/time.h syslog.h termios.h unistd.h ncurses.h panel.h getopt.h]) |
29 |
26 |
44 AC_TYPE_SIGNAL |
41 AC_TYPE_SIGNAL |
45 AC_FUNC_STRFTIME |
42 AC_FUNC_STRFTIME |
46 AC_FUNC_VPRINTF |
43 AC_FUNC_VPRINTF |
47 AC_CHECK_FUNCS([alarm bzero gethostbyname gethostname inet_ntoa isascii memmove memset modf select setlocale socket strcasecmp strchr strdup strncasecmp strrchr strstr]) |
44 AC_CHECK_FUNCS([alarm bzero gethostbyname gethostname inet_ntoa isascii memmove memset modf select setlocale socket strcasecmp strchr strdup strncasecmp strrchr strstr]) |
48 |
45 |
|
46 AC_ARG_WITH(ssl, [ --with-ssl enable SSL secured connections using either OpenSSL |
|
47 or GnuTLS], |
|
48 [with_ssl=$withval]) |
|
49 |
|
50 if test "$with_ssl" != "no"; then |
|
51 AC_ARG_WITH(openssl, |
|
52 [ --with-openssl=[DIR] enable SSL secured connections using the OpenSSL |
|
53 library in DIR (optional)], |
|
54 [with_openssl=$withval]) |
|
55 |
|
56 if test -z "$with_openssl"; then |
|
57 for ac_dir in /usr/local /usr; do |
|
58 if test -f "$ac_dir/include/openssl/ssl.h"; then |
|
59 with_openssl=$ac_dir |
|
60 break; |
|
61 fi |
|
62 done |
|
63 fi |
|
64 |
|
65 AC_MSG_CHECKING(for OpenSSL) |
|
66 |
|
67 if test -n "$with_openssl" -a "$with_openssl" != "no"; then |
|
68 if test "$with_openssl" = "yes"; then with_openssl="/usr"; fi |
|
69 CFLAGS="$CFLAGS -I${with_openssl}" |
|
70 AC_DEFINE([HAVE_OPENSSL], [], [OpenSSL]) |
|
71 AC_MSG_RESULT([found in $with_openssl]) |
|
72 AC_CHECK_LIB(crypto, main, [ |
|
73 AC_CHECK_LIB(crypto, SSLeay_add_all_algorithms, [ |
|
74 AC_DEFINE([HAVE_SSLEAY], [], [SSLeay]) |
|
75 ]) |
|
76 ]) |
|
77 AC_CHECK_LIB(ssl, main) |
|
78 else |
|
79 AC_MSG_RESULT([not found or disabled]) |
|
80 |
|
81 AM_PATH_LIBGNUTLS_EXTRA(0.0.1, [ |
|
82 CXXFLAGS="$CXXFLAGS $LIBGNUTLS_CFLAGS" |
|
83 LIBS="$LIBS $LIBGNUTLS_LIBS -lgnutls-extra" |
|
84 AC_DEFINE([HAVE_GNUTLS], [], [GNU TLS]) |
|
85 ]) |
|
86 fi |
|
87 fi |
|
88 |
49 AC_DEFINE(BUILD_JABBER, 1, [build with jabber support]) |
89 AC_DEFINE(BUILD_JABBER, 1, [build with jabber support]) |
50 |
90 |
51 AC_CONFIG_FILES([connwrap/Makefile |
91 AC_CONFIG_FILES([connwrap/Makefile |
52 libjabber/Makefile |
92 libjabber/Makefile |
53 src/Makefile |
93 src/Makefile |