68
|
1 # -*- Autoconf -*-
|
|
2 # Process this file with autoconf to produce a configure script.
|
|
3
|
|
4 AC_PREREQ(2.59)
|
674
|
5 AC_INIT([mcabber],[0.7.5-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
|
742
|
29 AC_CHECK_HEADERS([arpa/inet.h fcntl.h locale.h netdb.h netinet/in.h stddef.h
|
|
30 stdlib.h string.h strings.h sys/socket.h sys/time.h
|
|
31 syslog.h termios.h unistd.h ncurses.h panel.h getopt.h])
|
68
|
32
|
|
33 # Checks for typedefs, structures, and compiler characteristics.
|
|
34 AC_HEADER_STDBOOL
|
|
35 AC_C_CONST
|
|
36 AC_C_INLINE
|
|
37 AC_TYPE_SIZE_T
|
|
38 AC_HEADER_TIME
|
|
39 AC_STRUCT_TM
|
|
40
|
|
41 # Checks for library functions.
|
|
42 AC_FUNC_ERROR_AT_LINE
|
|
43 AC_FUNC_MALLOC
|
|
44 AC_FUNC_MEMCMP
|
|
45 AC_FUNC_REALLOC
|
|
46 AC_FUNC_SELECT_ARGTYPES
|
|
47 AC_TYPE_SIGNAL
|
|
48 AC_FUNC_STRFTIME
|
|
49 AC_FUNC_VPRINTF
|
742
|
50 AC_CHECK_FUNCS([alarm bzero gethostbyname gethostname inet_ntoa isascii
|
|
51 memmove memset modf select setlocale socket strcasecmp
|
|
52 strchr strdup strncasecmp strrchr strstr])
|
68
|
53
|
73
|
54 # Check for glib
|
|
55 AM_PATH_GLIB_2_0(2.0.0, , AC_MSG_ERROR([glib is required]),[g_list_append])
|
|
56
|
69
|
57 AC_ARG_WITH(ssl, [ --with-ssl enable SSL secured connections using either OpenSSL
|
742
|
58 or GnuTLS],
|
|
59 [with_ssl=$withval])
|
69
|
60
|
|
61 if test "$with_ssl" != "no"; then
|
|
62 AC_ARG_WITH(openssl,
|
742
|
63 [ --with-openssl=[DIR] enable SSL secured connections using the OpenSSL
|
|
64 library in DIR (optional)],
|
|
65 [with_openssl=$withval])
|
69
|
66
|
|
67 if test -z "$with_openssl"; then
|
742
|
68 for ac_dir in /usr/local /usr; do
|
|
69 if test -f "$ac_dir/include/openssl/ssl.h"; then
|
|
70 with_openssl=$ac_dir
|
|
71 break;
|
|
72 fi
|
|
73 done
|
69
|
74 fi
|
|
75
|
|
76 AC_MSG_CHECKING(for OpenSSL)
|
|
77
|
|
78 if test -n "$with_openssl" -a "$with_openssl" != "no"; then
|
742
|
79 if test "$with_openssl" = "yes"; then with_openssl="/usr"; fi
|
|
80 CFLAGS="$CFLAGS -I${with_openssl}"
|
|
81 AC_DEFINE([HAVE_OPENSSL], [], [OpenSSL])
|
|
82 AC_MSG_RESULT([found in $with_openssl])
|
|
83 AC_CHECK_LIB(crypto, main, [
|
|
84 AC_CHECK_LIB(crypto, SSLeay_add_all_algorithms, [
|
|
85 AC_DEFINE([HAVE_SSLEAY], [], [SSLeay])
|
|
86 ])
|
|
87 ])
|
|
88 AC_CHECK_LIB(ssl, main)
|
69
|
89 else
|
742
|
90 AC_MSG_RESULT([not found or disabled])
|
69
|
91
|
742
|
92 AM_PATH_LIBGNUTLS_EXTRA(0.0.1, [
|
|
93 CXXFLAGS="$CXXFLAGS $LIBGNUTLS_CFLAGS"
|
|
94 LIBS="$LIBS $LIBGNUTLS_LIBS -lgnutls-extra -lgnutls-openssl"
|
|
95 AC_DEFINE([HAVE_GNUTLS], [], [GNU TLS])
|
|
96 ])
|
69
|
97 fi
|
|
98 fi
|
|
99
|
68
|
100 AC_DEFINE(BUILD_JABBER, 1, [build with jabber support])
|
|
101
|
741
|
102 AC_ARG_ENABLE(debug,
|
|
103 [AC_HELP_STRING(--enable-debug, Add development compilation options)],
|
|
104 debug=$enableval, debug="")
|
|
105 if test "${debug}" = "yes"; then
|
|
106 AC_DEFINE_UNQUOTED([DEBUG_ENABLE],[1],[Devel compilation options])
|
|
107 CFLAGS="$CFLAGS -Wextra -Wno-unused-parameter -pedantic -std=gnu99 -O0 -g"
|
|
108 else
|
|
109 CFLAGS="$CFLAGS -O2"
|
|
110 fi
|
|
111
|
68
|
112 AC_CONFIG_FILES([connwrap/Makefile
|
|
113 libjabber/Makefile
|
|
114 src/Makefile
|
233
|
115 doc/Makefile
|
68
|
116 Makefile])
|
|
117 AC_OUTPUT
|