Mercurial > hg
annotate mcabber/configure.ac @ 1040:b6c6734a781b
Add libgpgme detection
author | Mikael Berthe <mikael@lilotux.net> |
---|---|
date | Sun, 26 Nov 2006 10:14:47 +0100 |
parents | f79e6d3d7190 |
children | a61c3311a5bb |
rev | line source |
---|---|
68 | 1 # -*- Autoconf -*- |
2 # Process this file with autoconf to produce a configure script. | |
3 | |
4 AC_PREREQ(2.59) | |
1037 | 5 AC_INIT([mcabber],[0.8.4-dev],[mcabber@lilotux.net]) |
68 | 6 AM_INIT_AUTOMAKE |
7 AC_CONFIG_SRCDIR([src]) | |
145 | 8 AM_CONFIG_HEADER(config.h) |
68 | 9 |
1039
f79e6d3d7190
configure.ac: s/AC_PROG_RANLIB/AC_PROG_LIBTOOL/
Mikael Berthe <mikael@lilotux.net>
parents:
1037
diff
changeset
|
10 AC_PROG_LIBTOOL |
68 | 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 | |
1040 | 95 # Check for gpgme |
96 AC_ARG_ENABLE(gpgme, AC_HELP_STRING([--disable-gpgme], [Disable GPGME support]), | |
97 [ if test x"$enableval" = x"no"; then | |
98 enable_gpgme=no | |
99 fi | |
100 ]) | |
101 | |
102 if test x"${enable_gpgme}" != x"no"; then | |
103 AM_PATH_GPGME(1.0.0, AC_DEFINE(HAVE_GPGME, 1, | |
104 [Define if you use GPGME to support OpenPGP])) | |
105 fi | |
106 | |
69 | 107 AC_ARG_WITH(ssl, [ --with-ssl enable SSL secured connections using either OpenSSL |
742 | 108 or GnuTLS], |
109 [with_ssl=$withval]) | |
69 | 110 |
111 if test "$with_ssl" != "no"; then | |
112 AC_ARG_WITH(openssl, | |
742 | 113 [ --with-openssl=[DIR] enable SSL secured connections using the OpenSSL |
114 library in DIR (optional)], | |
115 [with_openssl=$withval]) | |
69 | 116 |
117 if test -z "$with_openssl"; then | |
742 | 118 for ac_dir in /usr/local /usr; do |
119 if test -f "$ac_dir/include/openssl/ssl.h"; then | |
120 with_openssl=$ac_dir | |
121 break; | |
122 fi | |
123 done | |
69 | 124 fi |
125 | |
126 AC_MSG_CHECKING(for OpenSSL) | |
127 | |
128 if test -n "$with_openssl" -a "$with_openssl" != "no"; then | |
742 | 129 if test "$with_openssl" = "yes"; then with_openssl="/usr"; fi |
130 CFLAGS="$CFLAGS -I${with_openssl}" | |
131 AC_DEFINE([HAVE_OPENSSL], [], [OpenSSL]) | |
132 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
|
133 AC_CHECK_LIB(crypto, main) |
742 | 134 AC_CHECK_LIB(ssl, main) |
69 | 135 else |
742 | 136 AC_MSG_RESULT([not found or disabled]) |
69 | 137 |
778
a22665116104
Comment out gnutls in autoconf, as it doesn't work currently
Mikael Berthe <mikael@lilotux.net>
parents:
744
diff
changeset
|
138 # 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
|
139 # 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
|
140 # 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
|
141 # 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
|
142 # ]) |
69 | 143 fi |
144 fi | |
145 | |
68 | 146 AC_DEFINE(BUILD_JABBER, 1, [build with jabber support]) |
147 | |
882
c3c2f7a0c5d5
autoconf: use datadir, not datarootdir
Mikael Berthe <mikael@lilotux.net>
parents:
881
diff
changeset
|
148 # Export $datadir to the source tree. |
c3c2f7a0c5d5
autoconf: use datadir, not datarootdir
Mikael Berthe <mikael@lilotux.net>
parents:
881
diff
changeset
|
149 if test x"${datadir}" != x""; then |
c3c2f7a0c5d5
autoconf: use datadir, not datarootdir
Mikael Berthe <mikael@lilotux.net>
parents:
881
diff
changeset
|
150 AC_DEFINE_DIR(DATA_DIR, "${datadir}", [Data files directory]) |
868
cefdaeb42e67
Add online /help command
Mikael Berthe <mikael@lilotux.net>
parents:
821
diff
changeset
|
151 fi |
cefdaeb42e67
Add online /help command
Mikael Berthe <mikael@lilotux.net>
parents:
821
diff
changeset
|
152 |
741 | 153 AC_ARG_ENABLE(debug, |
154 [AC_HELP_STRING(--enable-debug, Add development compilation options)], | |
155 debug=$enableval, debug="") | |
1040 | 156 if test x"${debug}" = x"yes"; then |
741 | 157 AC_DEFINE_UNQUOTED([DEBUG_ENABLE],[1],[Devel compilation options]) |
821
8c64874c449e
More gcc configure checks
Mikael Berthe <mikael@lilotux.net>
parents:
813
diff
changeset
|
158 if test "x$GCC" = "xyes"; then |
8c64874c449e
More gcc configure checks
Mikael Berthe <mikael@lilotux.net>
parents:
813
diff
changeset
|
159 if test "$gccvernum" -ge "400"; then |
8c64874c449e
More gcc configure checks
Mikael Berthe <mikael@lilotux.net>
parents:
813
diff
changeset
|
160 CFLAGS="$CFLAGS -Wextra" |
8c64874c449e
More gcc configure checks
Mikael Berthe <mikael@lilotux.net>
parents:
813
diff
changeset
|
161 else |
8c64874c449e
More gcc configure checks
Mikael Berthe <mikael@lilotux.net>
parents:
813
diff
changeset
|
162 CFLAGS="$CFLAGS -W" |
8c64874c449e
More gcc configure checks
Mikael Berthe <mikael@lilotux.net>
parents:
813
diff
changeset
|
163 fi |
8c64874c449e
More gcc configure checks
Mikael Berthe <mikael@lilotux.net>
parents:
813
diff
changeset
|
164 CFLAGS="$CFLAGS -Wno-unused-parameter -pedantic -std=gnu99 -O0" |
8c64874c449e
More gcc configure checks
Mikael Berthe <mikael@lilotux.net>
parents:
813
diff
changeset
|
165 fi # gcc |
8c64874c449e
More gcc configure checks
Mikael Berthe <mikael@lilotux.net>
parents:
813
diff
changeset
|
166 CFLAGS="$CFLAGS -g" |
741 | 167 else |
168 CFLAGS="$CFLAGS -O2" | |
169 fi | |
170 | |
781
d3af6877a7df
Add --enable-hgcset to configure script
Mikael Berthe <mikael@lilotux.net>
parents:
778
diff
changeset
|
171 AC_ARG_ENABLE(hgcset, |
d3af6877a7df
Add --enable-hgcset to configure script
Mikael Berthe <mikael@lilotux.net>
parents:
778
diff
changeset
|
172 [AC_HELP_STRING(--enable-hgcset, Add Mercurial changeset)], |
d3af6877a7df
Add --enable-hgcset to configure script
Mikael Berthe <mikael@lilotux.net>
parents:
778
diff
changeset
|
173 hgcset=$enableval, hgcset="") |
d3af6877a7df
Add --enable-hgcset to configure script
Mikael Berthe <mikael@lilotux.net>
parents:
778
diff
changeset
|
174 AM_CONDITIONAL(HGCSET, test x$hgcset = xyes) |
d3af6877a7df
Add --enable-hgcset to configure script
Mikael Berthe <mikael@lilotux.net>
parents:
778
diff
changeset
|
175 if test "${hgcset}" = "yes"; then |
d3af6877a7df
Add --enable-hgcset to configure script
Mikael Berthe <mikael@lilotux.net>
parents:
778
diff
changeset
|
176 AC_DEFINE(ENABLE_HGCSET, 1, [Use Mercurial changeset]) |
d3af6877a7df
Add --enable-hgcset to configure script
Mikael Berthe <mikael@lilotux.net>
parents:
778
diff
changeset
|
177 fi |
d3af6877a7df
Add --enable-hgcset to configure script
Mikael Berthe <mikael@lilotux.net>
parents:
778
diff
changeset
|
178 |
924
a07bd351008b
Move _GNU_SOURCE define to the Makefile (Reimar Döffinger)
Mikael Berthe <mikael@lilotux.net>
parents:
923
diff
changeset
|
179 # 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
|
180 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
|
181 |
68 | 182 AC_CONFIG_FILES([connwrap/Makefile |
183 libjabber/Makefile | |
184 src/Makefile | |
233 | 185 doc/Makefile |
903 | 186 doc/help/Makefile |
68 | 187 Makefile]) |
188 AC_OUTPUT |