68
|
1 # -*- Autoconf -*-
|
|
2 # Process this file with autoconf to produce a configure script.
|
|
3
|
|
4 AC_PREREQ(2.59)
|
630
|
5 AC_INIT([mcabber],[0.7.3-dev],[mcabber@lilotux.net])
|
68
|
6 AM_INIT_AUTOMAKE
|
|
7 AC_CONFIG_SRCDIR([src])
|
145
|
8 AM_CONFIG_HEADER(config.h)
|
68
|
9
|
|
10 AC_PROG_RANLIB
|
|
11
|
|
12 CFLAGS="$CFLAGS -Wall"
|
|
13
|
|
14 # Checks for programs.
|
|
15 AC_PROG_CXX
|
|
16 AC_PROG_CC
|
|
17 AC_PROG_INSTALL
|
|
18
|
|
19 # Checks for libraries.
|
|
20 AC_CHECK_LIB([ncurses], [initscr])
|
|
21 AC_CHECK_LIB([panel], [new_panel])
|
|
22
|
237
|
23 AC_CHECK_DECLS([strptime],,,
|
|
24 [#define _GNU_SOURCE
|
|
25 #include <time.h>])
|
|
26
|
68
|
27 # Checks for header files.
|
|
28 AC_HEADER_STDC
|
|
29 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])
|
|
30
|
|
31 # Checks for typedefs, structures, and compiler characteristics.
|
|
32 AC_HEADER_STDBOOL
|
|
33 AC_C_CONST
|
|
34 AC_C_INLINE
|
|
35 AC_TYPE_SIZE_T
|
|
36 AC_HEADER_TIME
|
|
37 AC_STRUCT_TM
|
|
38
|
|
39 # Checks for library functions.
|
|
40 AC_FUNC_ERROR_AT_LINE
|
|
41 AC_FUNC_MALLOC
|
|
42 AC_FUNC_MEMCMP
|
|
43 AC_FUNC_REALLOC
|
|
44 AC_FUNC_SELECT_ARGTYPES
|
|
45 AC_TYPE_SIGNAL
|
|
46 AC_FUNC_STRFTIME
|
|
47 AC_FUNC_VPRINTF
|
|
48 AC_CHECK_FUNCS([alarm bzero gethostbyname gethostname inet_ntoa isascii memmove memset modf select setlocale socket strcasecmp strchr strdup strncasecmp strrchr strstr])
|
|
49
|
73
|
50 # Check for glib
|
|
51 AM_PATH_GLIB_2_0(2.0.0, , AC_MSG_ERROR([glib is required]),[g_list_append])
|
|
52
|
69
|
53 AC_ARG_WITH(ssl, [ --with-ssl enable SSL secured connections using either OpenSSL
|
|
54 or GnuTLS],
|
|
55 [with_ssl=$withval])
|
|
56
|
|
57 if test "$with_ssl" != "no"; then
|
|
58 AC_ARG_WITH(openssl,
|
|
59 [ --with-openssl=[DIR] enable SSL secured connections using the OpenSSL
|
|
60 library in DIR (optional)],
|
|
61 [with_openssl=$withval])
|
|
62
|
|
63 if test -z "$with_openssl"; then
|
|
64 for ac_dir in /usr/local /usr; do
|
|
65 if test -f "$ac_dir/include/openssl/ssl.h"; then
|
|
66 with_openssl=$ac_dir
|
|
67 break;
|
|
68 fi
|
|
69 done
|
|
70 fi
|
|
71
|
|
72 AC_MSG_CHECKING(for OpenSSL)
|
|
73
|
|
74 if test -n "$with_openssl" -a "$with_openssl" != "no"; then
|
|
75 if test "$with_openssl" = "yes"; then with_openssl="/usr"; fi
|
|
76 CFLAGS="$CFLAGS -I${with_openssl}"
|
|
77 AC_DEFINE([HAVE_OPENSSL], [], [OpenSSL])
|
|
78 AC_MSG_RESULT([found in $with_openssl])
|
|
79 AC_CHECK_LIB(crypto, main, [
|
|
80 AC_CHECK_LIB(crypto, SSLeay_add_all_algorithms, [
|
|
81 AC_DEFINE([HAVE_SSLEAY], [], [SSLeay])
|
|
82 ])
|
|
83 ])
|
|
84 AC_CHECK_LIB(ssl, main)
|
|
85 else
|
|
86 AC_MSG_RESULT([not found or disabled])
|
|
87
|
|
88 AM_PATH_LIBGNUTLS_EXTRA(0.0.1, [
|
|
89 CXXFLAGS="$CXXFLAGS $LIBGNUTLS_CFLAGS"
|
145
|
90 LIBS="$LIBS $LIBGNUTLS_LIBS -lgnutls-extra -lgnutls-openssl"
|
69
|
91 AC_DEFINE([HAVE_GNUTLS], [], [GNU TLS])
|
|
92 ])
|
|
93 fi
|
|
94 fi
|
|
95
|
68
|
96 AC_DEFINE(BUILD_JABBER, 1, [build with jabber support])
|
|
97
|
|
98 AC_CONFIG_FILES([connwrap/Makefile
|
|
99 libjabber/Makefile
|
|
100 src/Makefile
|
233
|
101 doc/Makefile
|
68
|
102 Makefile])
|
|
103 AC_OUTPUT
|