author | Mikael Berthe <mikael@lilotux.net> |
Mon, 21 Aug 2006 20:50:31 +0200 | |
changeset 950 | e79d82933dea |
parent 948 | 388b43cea2c5 |
child 953 | 1757f8b03b8f |
permissions | -rw-r--r-- |
68 | 1 |
# -*- Autoconf -*- |
2 |
# Process this file with autoconf to produce a configure script. |
|
3 |
||
4 |
AC_PREREQ(2.59) |
|
950 | 5 |
AC_INIT([mcabber],[0.8.1],[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. |
926
8a31dd49130d
configure: Improve ncurses detection (use ncursesw if available)
Mikael Berthe <mikael@lilotux.net>
parents:
924
diff
changeset
|
29 |
|
8a31dd49130d
configure: Improve ncurses detection (use ncursesw if available)
Mikael Berthe <mikael@lilotux.net>
parents:
924
diff
changeset
|
30 |
AC_CHECK_FUNC(initscr,, |
8a31dd49130d
configure: Improve ncurses detection (use ncursesw if available)
Mikael Berthe <mikael@lilotux.net>
parents:
924
diff
changeset
|
31 |
[ |
8a31dd49130d
configure: Improve ncurses detection (use ncursesw if available)
Mikael Berthe <mikael@lilotux.net>
parents:
924
diff
changeset
|
32 |
cf_ncurses="ncurses" |
8a31dd49130d
configure: Improve ncurses detection (use ncursesw if available)
Mikael Berthe <mikael@lilotux.net>
parents:
924
diff
changeset
|
33 |
for lib in ncursesw ncurses |
8a31dd49130d
configure: Improve ncurses detection (use ncursesw if available)
Mikael Berthe <mikael@lilotux.net>
parents:
924
diff
changeset
|
34 |
do |
8a31dd49130d
configure: Improve ncurses detection (use ncursesw if available)
Mikael Berthe <mikael@lilotux.net>
parents:
924
diff
changeset
|
35 |
AC_CHECK_LIB($lib, waddnwstr, [cf_ncurses="$lib"; break]) |
8a31dd49130d
configure: Improve ncurses detection (use ncursesw if available)
Mikael Berthe <mikael@lilotux.net>
parents:
924
diff
changeset
|
36 |
done |
8a31dd49130d
configure: Improve ncurses detection (use ncursesw if available)
Mikael Berthe <mikael@lilotux.net>
parents:
924
diff
changeset
|
37 |
AC_CHECK_LIB($cf_ncurses, initscr, |
8a31dd49130d
configure: Improve ncurses detection (use ncursesw if available)
Mikael Berthe <mikael@lilotux.net>
parents:
924
diff
changeset
|
38 |
[LIBS="$LIBS -l$cf_ncurses" |
8a31dd49130d
configure: Improve ncurses detection (use ncursesw if available)
Mikael Berthe <mikael@lilotux.net>
parents:
924
diff
changeset
|
39 |
if test "$cf_ncurses" = ncursesw; then |
8a31dd49130d
configure: Improve ncurses detection (use ncursesw if available)
Mikael Berthe <mikael@lilotux.net>
parents:
924
diff
changeset
|
40 |
AC_CHECK_HEADERS([ncursesw/ncurses.h ncursesw/panel.h],, |
948
388b43cea2c5
Fix configure on Slackware
Mikael Berthe <mikael@lilotux.net>
parents:
946
diff
changeset
|
41 |
[AC_CHECK_HEADERS([ncurses.h panel.h],, |
388b43cea2c5
Fix configure on Slackware
Mikael Berthe <mikael@lilotux.net>
parents:
946
diff
changeset
|
42 |
AC_MSG_ERROR([Missing header file]))]) |
926
8a31dd49130d
configure: Improve ncurses detection (use ncursesw if available)
Mikael Berthe <mikael@lilotux.net>
parents:
924
diff
changeset
|
43 |
else |
8a31dd49130d
configure: Improve ncurses detection (use ncursesw if available)
Mikael Berthe <mikael@lilotux.net>
parents:
924
diff
changeset
|
44 |
AC_CHECK_HEADERS([ncurses/ncurses.h ncurses/panel.h],, |
8a31dd49130d
configure: Improve ncurses detection (use ncursesw if available)
Mikael Berthe <mikael@lilotux.net>
parents:
924
diff
changeset
|
45 |
[AC_CHECK_HEADERS([ncurses.h panel.h],, |
8a31dd49130d
configure: Improve ncurses detection (use ncursesw if available)
Mikael Berthe <mikael@lilotux.net>
parents:
924
diff
changeset
|
46 |
AC_MSG_ERROR([Missing header file]))]) |
8a31dd49130d
configure: Improve ncurses detection (use ncursesw if available)
Mikael Berthe <mikael@lilotux.net>
parents:
924
diff
changeset
|
47 |
fi |
8a31dd49130d
configure: Improve ncurses detection (use ncursesw if available)
Mikael Berthe <mikael@lilotux.net>
parents:
924
diff
changeset
|
48 |
], |
8a31dd49130d
configure: Improve ncurses detection (use ncursesw if available)
Mikael Berthe <mikael@lilotux.net>
parents:
924
diff
changeset
|
49 |
[CF_CURSES_LIBS]) |
8a31dd49130d
configure: Improve ncurses detection (use ncursesw if available)
Mikael Berthe <mikael@lilotux.net>
parents:
924
diff
changeset
|
50 |
]) |
8a31dd49130d
configure: Improve ncurses detection (use ncursesw if available)
Mikael Berthe <mikael@lilotux.net>
parents:
924
diff
changeset
|
51 |
|
8a31dd49130d
configure: Improve ncurses detection (use ncursesw if available)
Mikael Berthe <mikael@lilotux.net>
parents:
924
diff
changeset
|
52 |
AC_CHECK_LIB([panelw], [new_panel],, |
8a31dd49130d
configure: Improve ncurses detection (use ncursesw if available)
Mikael Berthe <mikael@lilotux.net>
parents:
924
diff
changeset
|
53 |
AC_CHECK_LIB([panel], [new_panel]) |
8a31dd49130d
configure: Improve ncurses detection (use ncursesw if available)
Mikael Berthe <mikael@lilotux.net>
parents:
924
diff
changeset
|
54 |
) |
68 | 55 |
|
237 | 56 |
AC_CHECK_DECLS([strptime],,, |
57 |
[#define _GNU_SOURCE |
|
58 |
#include <time.h>]) |
|
59 |
||
68 | 60 |
# Checks for header files. |
61 |
AC_HEADER_STDC |
|
744
c3b76a1a07cb
Fix wrapping error introduced in changeset 76e00324c404
Mikael Berthe <mikael@lilotux.net>
parents:
742
diff
changeset
|
62 |
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
|
63 |
stdlib.h string.h strings.h sys/socket.h sys/time.h \ |
928
dcd6d23d7a13
configure: check for presence of wchar.h and wctype.h
Mikael Berthe <mikael@lilotux.net>
parents:
926
diff
changeset
|
64 |
syslog.h termios.h unistd.h getopt.h wchar.h wctype.h]) |
926
8a31dd49130d
configure: Improve ncurses detection (use ncursesw if available)
Mikael Berthe <mikael@lilotux.net>
parents:
924
diff
changeset
|
65 |
AC_CHECK_HEADERS([getopt.h], , AC_MSG_ERROR([Missing header file])) |
800 | 66 |
AC_VAR_TIMEZONE_EXTERNALS |
68 | 67 |
|
68 |
# Checks for typedefs, structures, and compiler characteristics. |
|
69 |
AC_HEADER_STDBOOL |
|
70 |
AC_C_CONST |
|
71 |
AC_C_INLINE |
|
72 |
AC_TYPE_SIZE_T |
|
73 |
AC_HEADER_TIME |
|
74 |
AC_STRUCT_TM |
|
75 |
||
76 |
# Checks for library functions. |
|
77 |
AC_FUNC_ERROR_AT_LINE |
|
78 |
AC_FUNC_MALLOC |
|
79 |
AC_FUNC_MEMCMP |
|
80 |
AC_FUNC_REALLOC |
|
81 |
AC_FUNC_SELECT_ARGTYPES |
|
82 |
AC_TYPE_SIGNAL |
|
83 |
AC_FUNC_STRFTIME |
|
84 |
AC_FUNC_VPRINTF |
|
744
c3b76a1a07cb
Fix wrapping error introduced in changeset 76e00324c404
Mikael Berthe <mikael@lilotux.net>
parents:
742
diff
changeset
|
85 |
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
|
86 |
memmove memset modf select setlocale socket strcasecmp \ |
800 | 87 |
strchr strdup strncasecmp strrchr strstr strcasestr]) |
88 |
||
89 |
# Check for tm_gmtoff |
|
90 |
MC_TM_GMTOFF |
|
68 | 91 |
|
73 | 92 |
# Check for glib |
93 |
AM_PATH_GLIB_2_0(2.0.0, , AC_MSG_ERROR([glib is required]),[g_list_append]) |
|
94 |
||
69 | 95 |
AC_ARG_WITH(ssl, [ --with-ssl enable SSL secured connections using either OpenSSL |
742 | 96 |
or GnuTLS], |
97 |
[with_ssl=$withval]) |
|
69 | 98 |
|
99 |
if test "$with_ssl" != "no"; then |
|
100 |
AC_ARG_WITH(openssl, |
|
742 | 101 |
[ --with-openssl=[DIR] enable SSL secured connections using the OpenSSL |
102 |
library in DIR (optional)], |
|
103 |
[with_openssl=$withval]) |
|
69 | 104 |
|
105 |
if test -z "$with_openssl"; then |
|
742 | 106 |
for ac_dir in /usr/local /usr; do |
107 |
if test -f "$ac_dir/include/openssl/ssl.h"; then |
|
108 |
with_openssl=$ac_dir |
|
109 |
break; |
|
110 |
fi |
|
111 |
done |
|
69 | 112 |
fi |
113 |
||
114 |
AC_MSG_CHECKING(for OpenSSL) |
|
115 |
||
116 |
if test -n "$with_openssl" -a "$with_openssl" != "no"; then |
|
742 | 117 |
if test "$with_openssl" = "yes"; then with_openssl="/usr"; fi |
118 |
CFLAGS="$CFLAGS -I${with_openssl}" |
|
119 |
AC_DEFINE([HAVE_OPENSSL], [], [OpenSSL]) |
|
120 |
AC_MSG_RESULT([found in $with_openssl]) |
|
121 |
AC_CHECK_LIB(crypto, main, [ |
|
122 |
AC_CHECK_LIB(crypto, SSLeay_add_all_algorithms, [ |
|
123 |
AC_DEFINE([HAVE_SSLEAY], [], [SSLeay]) |
|
124 |
]) |
|
125 |
]) |
|
126 |
AC_CHECK_LIB(ssl, main) |
|
69 | 127 |
else |
742 | 128 |
AC_MSG_RESULT([not found or disabled]) |
69 | 129 |
|
778
a22665116104
Comment out gnutls in autoconf, as it doesn't work currently
Mikael Berthe <mikael@lilotux.net>
parents:
744
diff
changeset
|
130 |
# 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
|
131 |
# 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
|
132 |
# 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
|
133 |
# 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
|
134 |
# ]) |
69 | 135 |
fi |
136 |
fi |
|
137 |
||
68 | 138 |
AC_DEFINE(BUILD_JABBER, 1, [build with jabber support]) |
139 |
||
882
c3c2f7a0c5d5
autoconf: use datadir, not datarootdir
Mikael Berthe <mikael@lilotux.net>
parents:
881
diff
changeset
|
140 |
# Export $datadir to the source tree. |
c3c2f7a0c5d5
autoconf: use datadir, not datarootdir
Mikael Berthe <mikael@lilotux.net>
parents:
881
diff
changeset
|
141 |
if test x"${datadir}" != x""; then |
c3c2f7a0c5d5
autoconf: use datadir, not datarootdir
Mikael Berthe <mikael@lilotux.net>
parents:
881
diff
changeset
|
142 |
AC_DEFINE_DIR(DATA_DIR, "${datadir}", [Data files directory]) |
868
cefdaeb42e67
Add online /help command
Mikael Berthe <mikael@lilotux.net>
parents:
821
diff
changeset
|
143 |
fi |
cefdaeb42e67
Add online /help command
Mikael Berthe <mikael@lilotux.net>
parents:
821
diff
changeset
|
144 |
|
741 | 145 |
AC_ARG_ENABLE(debug, |
146 |
[AC_HELP_STRING(--enable-debug, Add development compilation options)], |
|
147 |
debug=$enableval, debug="") |
|
148 |
if test "${debug}" = "yes"; then |
|
149 |
AC_DEFINE_UNQUOTED([DEBUG_ENABLE],[1],[Devel compilation options]) |
|
821
8c64874c449e
More gcc configure checks
Mikael Berthe <mikael@lilotux.net>
parents:
813
diff
changeset
|
150 |
if test "x$GCC" = "xyes"; then |
8c64874c449e
More gcc configure checks
Mikael Berthe <mikael@lilotux.net>
parents:
813
diff
changeset
|
151 |
if test "$gccvernum" -ge "400"; then |
8c64874c449e
More gcc configure checks
Mikael Berthe <mikael@lilotux.net>
parents:
813
diff
changeset
|
152 |
CFLAGS="$CFLAGS -Wextra" |
8c64874c449e
More gcc configure checks
Mikael Berthe <mikael@lilotux.net>
parents:
813
diff
changeset
|
153 |
else |
8c64874c449e
More gcc configure checks
Mikael Berthe <mikael@lilotux.net>
parents:
813
diff
changeset
|
154 |
CFLAGS="$CFLAGS -W" |
8c64874c449e
More gcc configure checks
Mikael Berthe <mikael@lilotux.net>
parents:
813
diff
changeset
|
155 |
fi |
8c64874c449e
More gcc configure checks
Mikael Berthe <mikael@lilotux.net>
parents:
813
diff
changeset
|
156 |
CFLAGS="$CFLAGS -Wno-unused-parameter -pedantic -std=gnu99 -O0" |
8c64874c449e
More gcc configure checks
Mikael Berthe <mikael@lilotux.net>
parents:
813
diff
changeset
|
157 |
fi # gcc |
8c64874c449e
More gcc configure checks
Mikael Berthe <mikael@lilotux.net>
parents:
813
diff
changeset
|
158 |
CFLAGS="$CFLAGS -g" |
741 | 159 |
else |
160 |
CFLAGS="$CFLAGS -O2" |
|
161 |
fi |
|
162 |
||
781
d3af6877a7df
Add --enable-hgcset to configure script
Mikael Berthe <mikael@lilotux.net>
parents:
778
diff
changeset
|
163 |
AC_ARG_ENABLE(hgcset, |
d3af6877a7df
Add --enable-hgcset to configure script
Mikael Berthe <mikael@lilotux.net>
parents:
778
diff
changeset
|
164 |
[AC_HELP_STRING(--enable-hgcset, Add Mercurial changeset)], |
d3af6877a7df
Add --enable-hgcset to configure script
Mikael Berthe <mikael@lilotux.net>
parents:
778
diff
changeset
|
165 |
hgcset=$enableval, hgcset="") |
d3af6877a7df
Add --enable-hgcset to configure script
Mikael Berthe <mikael@lilotux.net>
parents:
778
diff
changeset
|
166 |
AM_CONDITIONAL(HGCSET, test x$hgcset = xyes) |
d3af6877a7df
Add --enable-hgcset to configure script
Mikael Berthe <mikael@lilotux.net>
parents:
778
diff
changeset
|
167 |
if test "${hgcset}" = "yes"; then |
d3af6877a7df
Add --enable-hgcset to configure script
Mikael Berthe <mikael@lilotux.net>
parents:
778
diff
changeset
|
168 |
AC_DEFINE(ENABLE_HGCSET, 1, [Use Mercurial changeset]) |
d3af6877a7df
Add --enable-hgcset to configure script
Mikael Berthe <mikael@lilotux.net>
parents:
778
diff
changeset
|
169 |
fi |
d3af6877a7df
Add --enable-hgcset to configure script
Mikael Berthe <mikael@lilotux.net>
parents:
778
diff
changeset
|
170 |
|
924
a07bd351008b
Move _GNU_SOURCE define to the Makefile (Reimar Döffinger)
Mikael Berthe <mikael@lilotux.net>
parents:
923
diff
changeset
|
171 |
# We need _GNU_SOURCE for strptime() and strcasestr() |
a07bd351008b
Move _GNU_SOURCE define to the Makefile (Reimar Döffinger)
Mikael Berthe <mikael@lilotux.net>
parents:
923
diff
changeset
|
172 |
CFLAGS="$CFLAGS -D_GNU_SOURCE" |
a07bd351008b
Move _GNU_SOURCE define to the Makefile (Reimar Döffinger)
Mikael Berthe <mikael@lilotux.net>
parents:
923
diff
changeset
|
173 |
|
68 | 174 |
AC_CONFIG_FILES([connwrap/Makefile |
175 |
libjabber/Makefile |
|
176 |
src/Makefile |
|
233 | 177 |
doc/Makefile |
903 | 178 |
doc/help/Makefile |
68 | 179 |
Makefile]) |
180 |
AC_OUTPUT |