author | Mikael Berthe <mikael@lilotux.net> |
Wed, 21 Jun 2006 20:54:44 +0200 | |
changeset 903 | c4f164c4b0d3 |
parent 890 | 788e088702d6 |
child 906 | ead2d49f2a88 |
permissions | -rw-r--r-- |
68 | 1 |
# -*- Autoconf -*- |
2 |
# Process this file with autoconf to produce a configure script. |
|
3 |
||
4 |
AC_PREREQ(2.59) |
|
813 | 5 |
AC_INIT([mcabber],[0.7.7-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 |
# Checks for programs. |
|
13 |
AC_PROG_CC |
|
14 |
AC_PROG_INSTALL |
|
15 |
||
821
8c64874c449e
More gcc configure checks
Mikael Berthe <mikael@lilotux.net>
parents:
813
diff
changeset
|
16 |
if test "x$GCC" = "xyes"; then |
8c64874c449e
More gcc configure checks
Mikael Berthe <mikael@lilotux.net>
parents:
813
diff
changeset
|
17 |
dnl Get gcc version |
8c64874c449e
More gcc configure checks
Mikael Berthe <mikael@lilotux.net>
parents:
813
diff
changeset
|
18 |
AC_MSG_CHECKING([gcc version]) |
8c64874c449e
More gcc configure checks
Mikael Berthe <mikael@lilotux.net>
parents:
813
diff
changeset
|
19 |
gccver=$($CC -dumpversion) |
8c64874c449e
More gcc configure checks
Mikael Berthe <mikael@lilotux.net>
parents:
813
diff
changeset
|
20 |
gccvermajor=$(echo $gccver | cut -d . -f1) |
8c64874c449e
More gcc configure checks
Mikael Berthe <mikael@lilotux.net>
parents:
813
diff
changeset
|
21 |
gccverminor=$(echo $gccver | cut -d . -f2) |
8c64874c449e
More gcc configure checks
Mikael Berthe <mikael@lilotux.net>
parents:
813
diff
changeset
|
22 |
gccvernum=$(expr $gccvermajor "*" 100 + $gccverminor) |
8c64874c449e
More gcc configure checks
Mikael Berthe <mikael@lilotux.net>
parents:
813
diff
changeset
|
23 |
AC_MSG_RESULT($gccver) |
8c64874c449e
More gcc configure checks
Mikael Berthe <mikael@lilotux.net>
parents:
813
diff
changeset
|
24 |
|
8c64874c449e
More gcc configure checks
Mikael Berthe <mikael@lilotux.net>
parents:
813
diff
changeset
|
25 |
CFLAGS="$CFLAGS -Wall" |
8c64874c449e
More gcc configure checks
Mikael Berthe <mikael@lilotux.net>
parents:
813
diff
changeset
|
26 |
fi |
8c64874c449e
More gcc configure checks
Mikael Berthe <mikael@lilotux.net>
parents:
813
diff
changeset
|
27 |
|
68 | 28 |
# Checks for libraries. |
890
788e088702d6
Improve configure checks
Mikael Berthe <mikael@lilotux.net>
parents:
882
diff
changeset
|
29 |
AC_CHECK_LIB([ncurses], [initscr], , AC_MSG_ERROR([NCURSES library needed])) |
68 | 30 |
AC_CHECK_LIB([panel], [new_panel]) |
31 |
||
237 | 32 |
AC_CHECK_DECLS([strptime],,, |
33 |
[#define _GNU_SOURCE |
|
34 |
#include <time.h>]) |
|
35 |
||
68 | 36 |
# Checks for header files. |
37 |
AC_HEADER_STDC |
|
744
c3b76a1a07cb
Fix wrapping error introduced in changeset 76e00324c404
Mikael Berthe <mikael@lilotux.net>
parents:
742
diff
changeset
|
38 |
AC_CHECK_HEADERS([arpa/inet.h fcntl.h locale.h netdb.h netinet/in.h stddef.h \ |
c3b76a1a07cb
Fix wrapping error introduced in changeset 76e00324c404
Mikael Berthe <mikael@lilotux.net>
parents:
742
diff
changeset
|
39 |
stdlib.h string.h strings.h sys/socket.h sys/time.h \ |
890
788e088702d6
Improve configure checks
Mikael Berthe <mikael@lilotux.net>
parents:
882
diff
changeset
|
40 |
syslog.h termios.h unistd.h getopt.h]) |
788e088702d6
Improve configure checks
Mikael Berthe <mikael@lilotux.net>
parents:
882
diff
changeset
|
41 |
AC_CHECK_HEADERS([ncurses.h panel.h getopt.h], , |
788e088702d6
Improve configure checks
Mikael Berthe <mikael@lilotux.net>
parents:
882
diff
changeset
|
42 |
AC_MSG_ERROR([Missing header file])) |
800 | 43 |
AC_VAR_TIMEZONE_EXTERNALS |
68 | 44 |
|
45 |
# Checks for typedefs, structures, and compiler characteristics. |
|
46 |
AC_HEADER_STDBOOL |
|
47 |
AC_C_CONST |
|
48 |
AC_C_INLINE |
|
49 |
AC_TYPE_SIZE_T |
|
50 |
AC_HEADER_TIME |
|
51 |
AC_STRUCT_TM |
|
52 |
||
53 |
# Checks for library functions. |
|
54 |
AC_FUNC_ERROR_AT_LINE |
|
55 |
AC_FUNC_MALLOC |
|
56 |
AC_FUNC_MEMCMP |
|
57 |
AC_FUNC_REALLOC |
|
58 |
AC_FUNC_SELECT_ARGTYPES |
|
59 |
AC_TYPE_SIGNAL |
|
60 |
AC_FUNC_STRFTIME |
|
61 |
AC_FUNC_VPRINTF |
|
744
c3b76a1a07cb
Fix wrapping error introduced in changeset 76e00324c404
Mikael Berthe <mikael@lilotux.net>
parents:
742
diff
changeset
|
62 |
AC_CHECK_FUNCS([alarm bzero gethostbyname gethostname inet_ntoa isascii \ |
c3b76a1a07cb
Fix wrapping error introduced in changeset 76e00324c404
Mikael Berthe <mikael@lilotux.net>
parents:
742
diff
changeset
|
63 |
memmove memset modf select setlocale socket strcasecmp \ |
800 | 64 |
strchr strdup strncasecmp strrchr strstr strcasestr]) |
65 |
||
66 |
# Check for tm_gmtoff |
|
67 |
MC_TM_GMTOFF |
|
68 | 68 |
|
73 | 69 |
# Check for glib |
70 |
AM_PATH_GLIB_2_0(2.0.0, , AC_MSG_ERROR([glib is required]),[g_list_append]) |
|
71 |
||
69 | 72 |
AC_ARG_WITH(ssl, [ --with-ssl enable SSL secured connections using either OpenSSL |
742 | 73 |
or GnuTLS], |
74 |
[with_ssl=$withval]) |
|
69 | 75 |
|
76 |
if test "$with_ssl" != "no"; then |
|
77 |
AC_ARG_WITH(openssl, |
|
742 | 78 |
[ --with-openssl=[DIR] enable SSL secured connections using the OpenSSL |
79 |
library in DIR (optional)], |
|
80 |
[with_openssl=$withval]) |
|
69 | 81 |
|
82 |
if test -z "$with_openssl"; then |
|
742 | 83 |
for ac_dir in /usr/local /usr; do |
84 |
if test -f "$ac_dir/include/openssl/ssl.h"; then |
|
85 |
with_openssl=$ac_dir |
|
86 |
break; |
|
87 |
fi |
|
88 |
done |
|
69 | 89 |
fi |
90 |
||
91 |
AC_MSG_CHECKING(for OpenSSL) |
|
92 |
||
93 |
if test -n "$with_openssl" -a "$with_openssl" != "no"; then |
|
742 | 94 |
if test "$with_openssl" = "yes"; then with_openssl="/usr"; fi |
95 |
CFLAGS="$CFLAGS -I${with_openssl}" |
|
96 |
AC_DEFINE([HAVE_OPENSSL], [], [OpenSSL]) |
|
97 |
AC_MSG_RESULT([found in $with_openssl]) |
|
98 |
AC_CHECK_LIB(crypto, main, [ |
|
99 |
AC_CHECK_LIB(crypto, SSLeay_add_all_algorithms, [ |
|
100 |
AC_DEFINE([HAVE_SSLEAY], [], [SSLeay]) |
|
101 |
]) |
|
102 |
]) |
|
103 |
AC_CHECK_LIB(ssl, main) |
|
69 | 104 |
else |
742 | 105 |
AC_MSG_RESULT([not found or disabled]) |
69 | 106 |
|
778
a22665116104
Comment out gnutls in autoconf, as it doesn't work currently
Mikael Berthe <mikael@lilotux.net>
parents:
744
diff
changeset
|
107 |
# AM_PATH_LIBGNUTLS_EXTRA(0.0.1, [ |
a22665116104
Comment out gnutls in autoconf, as it doesn't work currently
Mikael Berthe <mikael@lilotux.net>
parents:
744
diff
changeset
|
108 |
# CXXFLAGS="$CXXFLAGS $LIBGNUTLS_CFLAGS" |
a22665116104
Comment out gnutls in autoconf, as it doesn't work currently
Mikael Berthe <mikael@lilotux.net>
parents:
744
diff
changeset
|
109 |
# LIBS="$LIBS $LIBGNUTLS_LIBS -lgnutls-extra -lgnutls-openssl" |
a22665116104
Comment out gnutls in autoconf, as it doesn't work currently
Mikael Berthe <mikael@lilotux.net>
parents:
744
diff
changeset
|
110 |
# AC_DEFINE([HAVE_GNUTLS], [], [GNU TLS]) |
a22665116104
Comment out gnutls in autoconf, as it doesn't work currently
Mikael Berthe <mikael@lilotux.net>
parents:
744
diff
changeset
|
111 |
# ]) |
69 | 112 |
fi |
113 |
fi |
|
114 |
||
68 | 115 |
AC_DEFINE(BUILD_JABBER, 1, [build with jabber support]) |
116 |
||
882
c3c2f7a0c5d5
autoconf: use datadir, not datarootdir
Mikael Berthe <mikael@lilotux.net>
parents:
881
diff
changeset
|
117 |
# Export $datadir to the source tree. |
c3c2f7a0c5d5
autoconf: use datadir, not datarootdir
Mikael Berthe <mikael@lilotux.net>
parents:
881
diff
changeset
|
118 |
if test x"${datadir}" != x""; then |
c3c2f7a0c5d5
autoconf: use datadir, not datarootdir
Mikael Berthe <mikael@lilotux.net>
parents:
881
diff
changeset
|
119 |
AC_DEFINE_DIR(DATA_DIR, "${datadir}", [Data files directory]) |
868
cefdaeb42e67
Add online /help command
Mikael Berthe <mikael@lilotux.net>
parents:
821
diff
changeset
|
120 |
fi |
cefdaeb42e67
Add online /help command
Mikael Berthe <mikael@lilotux.net>
parents:
821
diff
changeset
|
121 |
|
741 | 122 |
AC_ARG_ENABLE(debug, |
123 |
[AC_HELP_STRING(--enable-debug, Add development compilation options)], |
|
124 |
debug=$enableval, debug="") |
|
125 |
if test "${debug}" = "yes"; then |
|
126 |
AC_DEFINE_UNQUOTED([DEBUG_ENABLE],[1],[Devel compilation options]) |
|
821
8c64874c449e
More gcc configure checks
Mikael Berthe <mikael@lilotux.net>
parents:
813
diff
changeset
|
127 |
if test "x$GCC" = "xyes"; then |
8c64874c449e
More gcc configure checks
Mikael Berthe <mikael@lilotux.net>
parents:
813
diff
changeset
|
128 |
if test "$gccvernum" -ge "400"; then |
8c64874c449e
More gcc configure checks
Mikael Berthe <mikael@lilotux.net>
parents:
813
diff
changeset
|
129 |
CFLAGS="$CFLAGS -Wextra" |
8c64874c449e
More gcc configure checks
Mikael Berthe <mikael@lilotux.net>
parents:
813
diff
changeset
|
130 |
else |
8c64874c449e
More gcc configure checks
Mikael Berthe <mikael@lilotux.net>
parents:
813
diff
changeset
|
131 |
CFLAGS="$CFLAGS -W" |
8c64874c449e
More gcc configure checks
Mikael Berthe <mikael@lilotux.net>
parents:
813
diff
changeset
|
132 |
fi |
8c64874c449e
More gcc configure checks
Mikael Berthe <mikael@lilotux.net>
parents:
813
diff
changeset
|
133 |
CFLAGS="$CFLAGS -Wno-unused-parameter -pedantic -std=gnu99 -O0" |
8c64874c449e
More gcc configure checks
Mikael Berthe <mikael@lilotux.net>
parents:
813
diff
changeset
|
134 |
fi # gcc |
8c64874c449e
More gcc configure checks
Mikael Berthe <mikael@lilotux.net>
parents:
813
diff
changeset
|
135 |
CFLAGS="$CFLAGS -g" |
741 | 136 |
else |
137 |
CFLAGS="$CFLAGS -O2" |
|
138 |
fi |
|
139 |
||
781
d3af6877a7df
Add --enable-hgcset to configure script
Mikael Berthe <mikael@lilotux.net>
parents:
778
diff
changeset
|
140 |
AC_ARG_ENABLE(hgcset, |
d3af6877a7df
Add --enable-hgcset to configure script
Mikael Berthe <mikael@lilotux.net>
parents:
778
diff
changeset
|
141 |
[AC_HELP_STRING(--enable-hgcset, Add Mercurial changeset)], |
d3af6877a7df
Add --enable-hgcset to configure script
Mikael Berthe <mikael@lilotux.net>
parents:
778
diff
changeset
|
142 |
hgcset=$enableval, hgcset="") |
d3af6877a7df
Add --enable-hgcset to configure script
Mikael Berthe <mikael@lilotux.net>
parents:
778
diff
changeset
|
143 |
AM_CONDITIONAL(HGCSET, test x$hgcset = xyes) |
d3af6877a7df
Add --enable-hgcset to configure script
Mikael Berthe <mikael@lilotux.net>
parents:
778
diff
changeset
|
144 |
if test "${hgcset}" = "yes"; then |
d3af6877a7df
Add --enable-hgcset to configure script
Mikael Berthe <mikael@lilotux.net>
parents:
778
diff
changeset
|
145 |
AC_DEFINE(ENABLE_HGCSET, 1, [Use Mercurial changeset]) |
d3af6877a7df
Add --enable-hgcset to configure script
Mikael Berthe <mikael@lilotux.net>
parents:
778
diff
changeset
|
146 |
fi |
d3af6877a7df
Add --enable-hgcset to configure script
Mikael Berthe <mikael@lilotux.net>
parents:
778
diff
changeset
|
147 |
|
68 | 148 |
AC_CONFIG_FILES([connwrap/Makefile |
149 |
libjabber/Makefile |
|
150 |
src/Makefile |
|
233 | 151 |
doc/Makefile |
903 | 152 |
doc/help/Makefile |
68 | 153 |
Makefile]) |
154 |
AC_OUTPUT |