Mercurial > hg
annotate mcabber/configure.ac @ 1113:2b1274d7ce35
Post-0.9.0 changes
author | Mikael Berthe <mikael@lilotux.net> |
---|---|
date | Sat, 16 Dec 2006 19:45:30 +0100 |
parents | f64af9258f3c |
children | 0b71fd194877 |
rev | line source |
---|---|
68 | 1 # -*- Autoconf -*- |
2 # Process this file with autoconf to produce a configure script. | |
3 | |
4 AC_PREREQ(2.59) | |
1113 | 5 AC_INIT([mcabber],[0.9.1-dev],[mcabber@lilotux.net]) |
68 | 6 AM_INIT_AUTOMAKE |
7 AC_CONFIG_SRCDIR([src]) | |
145 | 8 AM_CONFIG_HEADER(config.h) |
68 | 9 |
1089
a61c3311a5bb
Hopefully fix unicode detection on BSD systems
Mikael Berthe <mikael@lilotux.net>
parents:
1040
diff
changeset
|
10 #AC_PROG_LIBTOOL |
a61c3311a5bb
Hopefully fix unicode detection on BSD systems
Mikael Berthe <mikael@lilotux.net>
parents:
1040
diff
changeset
|
11 AC_PROG_RANLIB |
68 | 12 |
13 # Checks for programs. | |
14 AC_PROG_CC | |
15 AC_PROG_INSTALL | |
16 | |
821
8c64874c449e
More gcc configure checks
Mikael Berthe <mikael@lilotux.net>
parents:
813
diff
changeset
|
17 if test "x$GCC" = "xyes"; then |
8c64874c449e
More gcc configure checks
Mikael Berthe <mikael@lilotux.net>
parents:
813
diff
changeset
|
18 dnl Get gcc version |
8c64874c449e
More gcc configure checks
Mikael Berthe <mikael@lilotux.net>
parents:
813
diff
changeset
|
19 AC_MSG_CHECKING([gcc version]) |
8c64874c449e
More gcc configure checks
Mikael Berthe <mikael@lilotux.net>
parents:
813
diff
changeset
|
20 gccver=$($CC -dumpversion) |
8c64874c449e
More gcc configure checks
Mikael Berthe <mikael@lilotux.net>
parents:
813
diff
changeset
|
21 gccvermajor=$(echo $gccver | cut -d . -f1) |
8c64874c449e
More gcc configure checks
Mikael Berthe <mikael@lilotux.net>
parents:
813
diff
changeset
|
22 gccverminor=$(echo $gccver | cut -d . -f2) |
8c64874c449e
More gcc configure checks
Mikael Berthe <mikael@lilotux.net>
parents:
813
diff
changeset
|
23 gccvernum=$(expr $gccvermajor "*" 100 + $gccverminor) |
8c64874c449e
More gcc configure checks
Mikael Berthe <mikael@lilotux.net>
parents:
813
diff
changeset
|
24 AC_MSG_RESULT($gccver) |
8c64874c449e
More gcc configure checks
Mikael Berthe <mikael@lilotux.net>
parents:
813
diff
changeset
|
25 |
8c64874c449e
More gcc configure checks
Mikael Berthe <mikael@lilotux.net>
parents:
813
diff
changeset
|
26 CFLAGS="$CFLAGS -Wall" |
8c64874c449e
More gcc configure checks
Mikael Berthe <mikael@lilotux.net>
parents:
813
diff
changeset
|
27 fi |
8c64874c449e
More gcc configure checks
Mikael Berthe <mikael@lilotux.net>
parents:
813
diff
changeset
|
28 |
68 | 29 # Checks for header files. |
30 AC_HEADER_STDC | |
744
c3b76a1a07cb
Fix wrapping error introduced in changeset 76e00324c404
Mikael Berthe <mikael@lilotux.net>
parents:
742
diff
changeset
|
31 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
|
32 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
|
33 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
|
34 AC_CHECK_HEADERS([getopt.h], , AC_MSG_ERROR([Missing header file])) |
800 | 35 AC_VAR_TIMEZONE_EXTERNALS |
68 | 36 |
37 # Checks for typedefs, structures, and compiler characteristics. | |
38 AC_HEADER_STDBOOL | |
39 AC_C_CONST | |
40 AC_C_INLINE | |
41 AC_TYPE_SIZE_T | |
42 AC_HEADER_TIME | |
43 AC_STRUCT_TM | |
44 | |
45 # Checks for library functions. | |
46 AC_FUNC_ERROR_AT_LINE | |
47 AC_FUNC_MALLOC | |
48 AC_FUNC_MEMCMP | |
49 AC_FUNC_REALLOC | |
50 AC_FUNC_SELECT_ARGTYPES | |
51 AC_TYPE_SIGNAL | |
52 AC_FUNC_STRFTIME | |
53 AC_FUNC_VPRINTF | |
744
c3b76a1a07cb
Fix wrapping error introduced in changeset 76e00324c404
Mikael Berthe <mikael@lilotux.net>
parents:
742
diff
changeset
|
54 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
|
55 memmove memset modf select setlocale socket strcasecmp \ |
800 | 56 strchr strdup strncasecmp strrchr strstr strcasestr]) |
57 | |
1089
a61c3311a5bb
Hopefully fix unicode detection on BSD systems
Mikael Berthe <mikael@lilotux.net>
parents:
1040
diff
changeset
|
58 |
a61c3311a5bb
Hopefully fix unicode detection on BSD systems
Mikael Berthe <mikael@lilotux.net>
parents:
1040
diff
changeset
|
59 AC_CHECK_DECLS([strptime],,, |
a61c3311a5bb
Hopefully fix unicode detection on BSD systems
Mikael Berthe <mikael@lilotux.net>
parents:
1040
diff
changeset
|
60 [#define _GNU_SOURCE |
a61c3311a5bb
Hopefully fix unicode detection on BSD systems
Mikael Berthe <mikael@lilotux.net>
parents:
1040
diff
changeset
|
61 #include <time.h>]) |
a61c3311a5bb
Hopefully fix unicode detection on BSD systems
Mikael Berthe <mikael@lilotux.net>
parents:
1040
diff
changeset
|
62 |
800 | 63 # Check for tm_gmtoff |
64 MC_TM_GMTOFF | |
68 | 65 |
1089
a61c3311a5bb
Hopefully fix unicode detection on BSD systems
Mikael Berthe <mikael@lilotux.net>
parents:
1040
diff
changeset
|
66 # Checks for libraries. |
a61c3311a5bb
Hopefully fix unicode detection on BSD systems
Mikael Berthe <mikael@lilotux.net>
parents:
1040
diff
changeset
|
67 |
a61c3311a5bb
Hopefully fix unicode detection on BSD systems
Mikael Berthe <mikael@lilotux.net>
parents:
1040
diff
changeset
|
68 AC_CHECK_FUNC(initscr,, |
a61c3311a5bb
Hopefully fix unicode detection on BSD systems
Mikael Berthe <mikael@lilotux.net>
parents:
1040
diff
changeset
|
69 [ |
a61c3311a5bb
Hopefully fix unicode detection on BSD systems
Mikael Berthe <mikael@lilotux.net>
parents:
1040
diff
changeset
|
70 cf_ncurses="ncurses" |
a61c3311a5bb
Hopefully fix unicode detection on BSD systems
Mikael Berthe <mikael@lilotux.net>
parents:
1040
diff
changeset
|
71 for lib in ncursesw ncurses |
a61c3311a5bb
Hopefully fix unicode detection on BSD systems
Mikael Berthe <mikael@lilotux.net>
parents:
1040
diff
changeset
|
72 do |
a61c3311a5bb
Hopefully fix unicode detection on BSD systems
Mikael Berthe <mikael@lilotux.net>
parents:
1040
diff
changeset
|
73 AC_CHECK_LIB($lib, waddnwstr, |
a61c3311a5bb
Hopefully fix unicode detection on BSD systems
Mikael Berthe <mikael@lilotux.net>
parents:
1040
diff
changeset
|
74 [cf_ncurses="$lib"; cf_ncurses_unicode="yes"; break]) |
a61c3311a5bb
Hopefully fix unicode detection on BSD systems
Mikael Berthe <mikael@lilotux.net>
parents:
1040
diff
changeset
|
75 done |
a61c3311a5bb
Hopefully fix unicode detection on BSD systems
Mikael Berthe <mikael@lilotux.net>
parents:
1040
diff
changeset
|
76 AC_CHECK_LIB($cf_ncurses, initscr, |
a61c3311a5bb
Hopefully fix unicode detection on BSD systems
Mikael Berthe <mikael@lilotux.net>
parents:
1040
diff
changeset
|
77 [LIBS="$LIBS -l$cf_ncurses" |
a61c3311a5bb
Hopefully fix unicode detection on BSD systems
Mikael Berthe <mikael@lilotux.net>
parents:
1040
diff
changeset
|
78 if test "$cf_ncurses" = ncursesw; then |
a61c3311a5bb
Hopefully fix unicode detection on BSD systems
Mikael Berthe <mikael@lilotux.net>
parents:
1040
diff
changeset
|
79 AC_CHECK_HEADERS([ncursesw/ncurses.h ncursesw/panel.h],, |
a61c3311a5bb
Hopefully fix unicode detection on BSD systems
Mikael Berthe <mikael@lilotux.net>
parents:
1040
diff
changeset
|
80 [AC_CHECK_HEADERS([ncurses.h panel.h],, |
a61c3311a5bb
Hopefully fix unicode detection on BSD systems
Mikael Berthe <mikael@lilotux.net>
parents:
1040
diff
changeset
|
81 AC_MSG_ERROR([Missing header file]))]) |
a61c3311a5bb
Hopefully fix unicode detection on BSD systems
Mikael Berthe <mikael@lilotux.net>
parents:
1040
diff
changeset
|
82 else |
a61c3311a5bb
Hopefully fix unicode detection on BSD systems
Mikael Berthe <mikael@lilotux.net>
parents:
1040
diff
changeset
|
83 AC_CHECK_HEADERS([ncurses/ncurses.h ncurses/panel.h],, |
a61c3311a5bb
Hopefully fix unicode detection on BSD systems
Mikael Berthe <mikael@lilotux.net>
parents:
1040
diff
changeset
|
84 [AC_CHECK_HEADERS([ncurses.h panel.h],, |
a61c3311a5bb
Hopefully fix unicode detection on BSD systems
Mikael Berthe <mikael@lilotux.net>
parents:
1040
diff
changeset
|
85 AC_MSG_ERROR([Missing header file]))]) |
a61c3311a5bb
Hopefully fix unicode detection on BSD systems
Mikael Berthe <mikael@lilotux.net>
parents:
1040
diff
changeset
|
86 fi |
a61c3311a5bb
Hopefully fix unicode detection on BSD systems
Mikael Berthe <mikael@lilotux.net>
parents:
1040
diff
changeset
|
87 ], |
a61c3311a5bb
Hopefully fix unicode detection on BSD systems
Mikael Berthe <mikael@lilotux.net>
parents:
1040
diff
changeset
|
88 [CF_CURSES_LIBS]) |
a61c3311a5bb
Hopefully fix unicode detection on BSD systems
Mikael Berthe <mikael@lilotux.net>
parents:
1040
diff
changeset
|
89 ]) |
a61c3311a5bb
Hopefully fix unicode detection on BSD systems
Mikael Berthe <mikael@lilotux.net>
parents:
1040
diff
changeset
|
90 |
a61c3311a5bb
Hopefully fix unicode detection on BSD systems
Mikael Berthe <mikael@lilotux.net>
parents:
1040
diff
changeset
|
91 AC_CHECK_LIB([panelw], [new_panel],, |
a61c3311a5bb
Hopefully fix unicode detection on BSD systems
Mikael Berthe <mikael@lilotux.net>
parents:
1040
diff
changeset
|
92 AC_CHECK_LIB([panel], [new_panel]) |
a61c3311a5bb
Hopefully fix unicode detection on BSD systems
Mikael Berthe <mikael@lilotux.net>
parents:
1040
diff
changeset
|
93 ) |
a61c3311a5bb
Hopefully fix unicode detection on BSD systems
Mikael Berthe <mikael@lilotux.net>
parents:
1040
diff
changeset
|
94 |
a61c3311a5bb
Hopefully fix unicode detection on BSD systems
Mikael Berthe <mikael@lilotux.net>
parents:
1040
diff
changeset
|
95 if test x"$cf_ncurses_unicode" = x"yes"; then |
a61c3311a5bb
Hopefully fix unicode detection on BSD systems
Mikael Berthe <mikael@lilotux.net>
parents:
1040
diff
changeset
|
96 AC_DEFINE([HAVE_UNICODE], [], [Define if ncurses have unicode support]) |
a61c3311a5bb
Hopefully fix unicode detection on BSD systems
Mikael Berthe <mikael@lilotux.net>
parents:
1040
diff
changeset
|
97 else |
a61c3311a5bb
Hopefully fix unicode detection on BSD systems
Mikael Berthe <mikael@lilotux.net>
parents:
1040
diff
changeset
|
98 AC_MSG_WARN([Your ncurses installation does not support unicode]) |
a61c3311a5bb
Hopefully fix unicode detection on BSD systems
Mikael Berthe <mikael@lilotux.net>
parents:
1040
diff
changeset
|
99 fi |
a61c3311a5bb
Hopefully fix unicode detection on BSD systems
Mikael Berthe <mikael@lilotux.net>
parents:
1040
diff
changeset
|
100 |
73 | 101 # Check for glib |
102 AM_PATH_GLIB_2_0(2.0.0, , AC_MSG_ERROR([glib is required]),[g_list_append]) | |
103 | |
1040 | 104 # Check for gpgme |
105 AC_ARG_ENABLE(gpgme, AC_HELP_STRING([--disable-gpgme], [Disable GPGME support]), | |
106 [ if test x"$enableval" = x"no"; then | |
107 enable_gpgme=no | |
108 fi | |
109 ]) | |
110 | |
111 if test x"${enable_gpgme}" != x"no"; then | |
112 AM_PATH_GPGME(1.0.0, AC_DEFINE(HAVE_GPGME, 1, | |
113 [Define if you use GPGME to support OpenPGP])) | |
114 fi | |
115 | |
69 | 116 AC_ARG_WITH(ssl, [ --with-ssl enable SSL secured connections using either OpenSSL |
742 | 117 or GnuTLS], |
118 [with_ssl=$withval]) | |
69 | 119 |
120 if test "$with_ssl" != "no"; then | |
121 AC_ARG_WITH(openssl, | |
742 | 122 [ --with-openssl=[DIR] enable SSL secured connections using the OpenSSL |
123 library in DIR (optional)], | |
124 [with_openssl=$withval]) | |
69 | 125 |
126 if test -z "$with_openssl"; then | |
742 | 127 for ac_dir in /usr/local /usr; do |
128 if test -f "$ac_dir/include/openssl/ssl.h"; then | |
129 with_openssl=$ac_dir | |
130 break; | |
131 fi | |
132 done | |
69 | 133 fi |
134 | |
135 AC_MSG_CHECKING(for OpenSSL) | |
136 | |
137 if test -n "$with_openssl" -a "$with_openssl" != "no"; then | |
742 | 138 if test "$with_openssl" = "yes"; then with_openssl="/usr"; fi |
139 CFLAGS="$CFLAGS -I${with_openssl}" | |
140 AC_DEFINE([HAVE_OPENSSL], [], [OpenSSL]) | |
141 AC_MSG_RESULT([found in $with_openssl]) | |
1025
804aebb39028
[BP-d530e5fb506a] Fix SSL on OS X
Mikael Berthe <mikael@lilotux.net>
parents:
1024
diff
changeset
|
142 AC_CHECK_LIB(crypto, main) |
742 | 143 AC_CHECK_LIB(ssl, main) |
69 | 144 else |
742 | 145 AC_MSG_RESULT([not found or disabled]) |
69 | 146 |
778
a22665116104
Comment out gnutls in autoconf, as it doesn't work currently
Mikael Berthe <mikael@lilotux.net>
parents:
744
diff
changeset
|
147 # 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
|
148 # 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
|
149 # 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
|
150 # 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
|
151 # ]) |
69 | 152 fi |
153 fi | |
154 | |
68 | 155 AC_DEFINE(BUILD_JABBER, 1, [build with jabber support]) |
156 | |
882
c3c2f7a0c5d5
autoconf: use datadir, not datarootdir
Mikael Berthe <mikael@lilotux.net>
parents:
881
diff
changeset
|
157 # Export $datadir to the source tree. |
c3c2f7a0c5d5
autoconf: use datadir, not datarootdir
Mikael Berthe <mikael@lilotux.net>
parents:
881
diff
changeset
|
158 if test x"${datadir}" != x""; then |
c3c2f7a0c5d5
autoconf: use datadir, not datarootdir
Mikael Berthe <mikael@lilotux.net>
parents:
881
diff
changeset
|
159 AC_DEFINE_DIR(DATA_DIR, "${datadir}", [Data files directory]) |
868
cefdaeb42e67
Add online /help command
Mikael Berthe <mikael@lilotux.net>
parents:
821
diff
changeset
|
160 fi |
cefdaeb42e67
Add online /help command
Mikael Berthe <mikael@lilotux.net>
parents:
821
diff
changeset
|
161 |
741 | 162 AC_ARG_ENABLE(debug, |
163 [AC_HELP_STRING(--enable-debug, Add development compilation options)], | |
164 debug=$enableval, debug="") | |
1040 | 165 if test x"${debug}" = x"yes"; then |
741 | 166 AC_DEFINE_UNQUOTED([DEBUG_ENABLE],[1],[Devel compilation options]) |
821
8c64874c449e
More gcc configure checks
Mikael Berthe <mikael@lilotux.net>
parents:
813
diff
changeset
|
167 if test "x$GCC" = "xyes"; then |
8c64874c449e
More gcc configure checks
Mikael Berthe <mikael@lilotux.net>
parents:
813
diff
changeset
|
168 if test "$gccvernum" -ge "400"; then |
8c64874c449e
More gcc configure checks
Mikael Berthe <mikael@lilotux.net>
parents:
813
diff
changeset
|
169 CFLAGS="$CFLAGS -Wextra" |
8c64874c449e
More gcc configure checks
Mikael Berthe <mikael@lilotux.net>
parents:
813
diff
changeset
|
170 else |
8c64874c449e
More gcc configure checks
Mikael Berthe <mikael@lilotux.net>
parents:
813
diff
changeset
|
171 CFLAGS="$CFLAGS -W" |
8c64874c449e
More gcc configure checks
Mikael Berthe <mikael@lilotux.net>
parents:
813
diff
changeset
|
172 fi |
8c64874c449e
More gcc configure checks
Mikael Berthe <mikael@lilotux.net>
parents:
813
diff
changeset
|
173 CFLAGS="$CFLAGS -Wno-unused-parameter -pedantic -std=gnu99 -O0" |
8c64874c449e
More gcc configure checks
Mikael Berthe <mikael@lilotux.net>
parents:
813
diff
changeset
|
174 fi # gcc |
8c64874c449e
More gcc configure checks
Mikael Berthe <mikael@lilotux.net>
parents:
813
diff
changeset
|
175 CFLAGS="$CFLAGS -g" |
741 | 176 else |
177 CFLAGS="$CFLAGS -O2" | |
178 fi | |
179 | |
781
d3af6877a7df
Add --enable-hgcset to configure script
Mikael Berthe <mikael@lilotux.net>
parents:
778
diff
changeset
|
180 AC_ARG_ENABLE(hgcset, |
d3af6877a7df
Add --enable-hgcset to configure script
Mikael Berthe <mikael@lilotux.net>
parents:
778
diff
changeset
|
181 [AC_HELP_STRING(--enable-hgcset, Add Mercurial changeset)], |
d3af6877a7df
Add --enable-hgcset to configure script
Mikael Berthe <mikael@lilotux.net>
parents:
778
diff
changeset
|
182 hgcset=$enableval, hgcset="") |
d3af6877a7df
Add --enable-hgcset to configure script
Mikael Berthe <mikael@lilotux.net>
parents:
778
diff
changeset
|
183 AM_CONDITIONAL(HGCSET, test x$hgcset = xyes) |
d3af6877a7df
Add --enable-hgcset to configure script
Mikael Berthe <mikael@lilotux.net>
parents:
778
diff
changeset
|
184 if test "${hgcset}" = "yes"; then |
d3af6877a7df
Add --enable-hgcset to configure script
Mikael Berthe <mikael@lilotux.net>
parents:
778
diff
changeset
|
185 AC_DEFINE(ENABLE_HGCSET, 1, [Use Mercurial changeset]) |
d3af6877a7df
Add --enable-hgcset to configure script
Mikael Berthe <mikael@lilotux.net>
parents:
778
diff
changeset
|
186 fi |
d3af6877a7df
Add --enable-hgcset to configure script
Mikael Berthe <mikael@lilotux.net>
parents:
778
diff
changeset
|
187 |
924
a07bd351008b
Move _GNU_SOURCE define to the Makefile (Reimar Döffinger)
Mikael Berthe <mikael@lilotux.net>
parents:
923
diff
changeset
|
188 # 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
|
189 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
|
190 |
68 | 191 AC_CONFIG_FILES([connwrap/Makefile |
192 libjabber/Makefile | |
193 src/Makefile | |
233 | 194 doc/Makefile |
903 | 195 doc/help/Makefile |
68 | 196 Makefile]) |
197 AC_OUTPUT |