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