author | Mikael Berthe <mikael@lilotux.net> |
Sat, 27 May 2006 17:35:19 +0200 | |
changeset 881 | 618967a008a2 |
parent 877 | b38760d9ec2d |
child 882 | c3c2f7a0c5d5 |
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_CXX |
|
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 libraries. |
30 |
AC_CHECK_LIB([ncurses], [initscr]) |
|
31 |
AC_CHECK_LIB([panel], [new_panel]) |
|
32 |
||
237 | 33 |
AC_CHECK_DECLS([strptime],,, |
34 |
[#define _GNU_SOURCE |
|
35 |
#include <time.h>]) |
|
36 |
||
68 | 37 |
# Checks for header files. |
38 |
AC_HEADER_STDC |
|
744
c3b76a1a07cb
Fix wrapping error introduced in changeset 76e00324c404
Mikael Berthe <mikael@lilotux.net>
parents:
742
diff
changeset
|
39 |
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
|
40 |
stdlib.h string.h strings.h sys/socket.h sys/time.h \ |
742 | 41 |
syslog.h termios.h unistd.h ncurses.h panel.h getopt.h]) |
800 | 42 |
AC_VAR_TIMEZONE_EXTERNALS |
68 | 43 |
|
44 |
# Checks for typedefs, structures, and compiler characteristics. |
|
45 |
AC_HEADER_STDBOOL |
|
46 |
AC_C_CONST |
|
47 |
AC_C_INLINE |
|
48 |
AC_TYPE_SIZE_T |
|
49 |
AC_HEADER_TIME |
|
50 |
AC_STRUCT_TM |
|
51 |
||
52 |
# Checks for library functions. |
|
53 |
AC_FUNC_ERROR_AT_LINE |
|
54 |
AC_FUNC_MALLOC |
|
55 |
AC_FUNC_MEMCMP |
|
56 |
AC_FUNC_REALLOC |
|
57 |
AC_FUNC_SELECT_ARGTYPES |
|
58 |
AC_TYPE_SIGNAL |
|
59 |
AC_FUNC_STRFTIME |
|
60 |
AC_FUNC_VPRINTF |
|
744
c3b76a1a07cb
Fix wrapping error introduced in changeset 76e00324c404
Mikael Berthe <mikael@lilotux.net>
parents:
742
diff
changeset
|
61 |
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
|
62 |
memmove memset modf select setlocale socket strcasecmp \ |
800 | 63 |
strchr strdup strncasecmp strrchr strstr strcasestr]) |
64 |
||
65 |
# Check for tm_gmtoff |
|
66 |
MC_TM_GMTOFF |
|
68 | 67 |
|
73 | 68 |
# Check for glib |
69 |
AM_PATH_GLIB_2_0(2.0.0, , AC_MSG_ERROR([glib is required]),[g_list_append]) |
|
70 |
||
69 | 71 |
AC_ARG_WITH(ssl, [ --with-ssl enable SSL secured connections using either OpenSSL |
742 | 72 |
or GnuTLS], |
73 |
[with_ssl=$withval]) |
|
69 | 74 |
|
75 |
if test "$with_ssl" != "no"; then |
|
76 |
AC_ARG_WITH(openssl, |
|
742 | 77 |
[ --with-openssl=[DIR] enable SSL secured connections using the OpenSSL |
78 |
library in DIR (optional)], |
|
79 |
[with_openssl=$withval]) |
|
69 | 80 |
|
81 |
if test -z "$with_openssl"; then |
|
742 | 82 |
for ac_dir in /usr/local /usr; do |
83 |
if test -f "$ac_dir/include/openssl/ssl.h"; then |
|
84 |
with_openssl=$ac_dir |
|
85 |
break; |
|
86 |
fi |
|
87 |
done |
|
69 | 88 |
fi |
89 |
||
90 |
AC_MSG_CHECKING(for OpenSSL) |
|
91 |
||
92 |
if test -n "$with_openssl" -a "$with_openssl" != "no"; then |
|
742 | 93 |
if test "$with_openssl" = "yes"; then with_openssl="/usr"; fi |
94 |
CFLAGS="$CFLAGS -I${with_openssl}" |
|
95 |
AC_DEFINE([HAVE_OPENSSL], [], [OpenSSL]) |
|
96 |
AC_MSG_RESULT([found in $with_openssl]) |
|
97 |
AC_CHECK_LIB(crypto, main, [ |
|
98 |
AC_CHECK_LIB(crypto, SSLeay_add_all_algorithms, [ |
|
99 |
AC_DEFINE([HAVE_SSLEAY], [], [SSLeay]) |
|
100 |
]) |
|
101 |
]) |
|
102 |
AC_CHECK_LIB(ssl, main) |
|
69 | 103 |
else |
742 | 104 |
AC_MSG_RESULT([not found or disabled]) |
69 | 105 |
|
778
a22665116104
Comment out gnutls in autoconf, as it doesn't work currently
Mikael Berthe <mikael@lilotux.net>
parents:
744
diff
changeset
|
106 |
# 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
|
107 |
# 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
|
108 |
# 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
|
109 |
# 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
|
110 |
# ]) |
69 | 111 |
fi |
112 |
fi |
|
113 |
||
68 | 114 |
AC_DEFINE(BUILD_JABBER, 1, [build with jabber support]) |
115 |
||
877
b38760d9ec2d
autoconf: Remove --with-datadir, use built-in --datarootdir option
Mikael Berthe <mikael@lilotux.net>
parents:
868
diff
changeset
|
116 |
# Export $datarootdir to the source tree. |
b38760d9ec2d
autoconf: Remove --with-datadir, use built-in --datarootdir option
Mikael Berthe <mikael@lilotux.net>
parents:
868
diff
changeset
|
117 |
if test x"${datarootdir}" != x""; then |
881
618967a008a2
Try to fix autoconf setup
Mikael Berthe <mikael@lilotux.net>
parents:
877
diff
changeset
|
118 |
AC_DEFINE_DIR(DATA_ROOT_DIR, "${datarootdir}", [Data files directory]) |
618967a008a2
Try to fix autoconf setup
Mikael Berthe <mikael@lilotux.net>
parents:
877
diff
changeset
|
119 |
elif test x"${datadir}" != x""; then |
618967a008a2
Try to fix autoconf setup
Mikael Berthe <mikael@lilotux.net>
parents:
877
diff
changeset
|
120 |
AC_DEFINE_DIR(DATA_ROOT_DIR, "${datadir}", [Data files directory]) |
868
cefdaeb42e67
Add online /help command
Mikael Berthe <mikael@lilotux.net>
parents:
821
diff
changeset
|
121 |
fi |
cefdaeb42e67
Add online /help command
Mikael Berthe <mikael@lilotux.net>
parents:
821
diff
changeset
|
122 |
|
741 | 123 |
AC_ARG_ENABLE(debug, |
124 |
[AC_HELP_STRING(--enable-debug, Add development compilation options)], |
|
125 |
debug=$enableval, debug="") |
|
126 |
if test "${debug}" = "yes"; then |
|
127 |
AC_DEFINE_UNQUOTED([DEBUG_ENABLE],[1],[Devel compilation options]) |
|
821
8c64874c449e
More gcc configure checks
Mikael Berthe <mikael@lilotux.net>
parents:
813
diff
changeset
|
128 |
if test "x$GCC" = "xyes"; then |
8c64874c449e
More gcc configure checks
Mikael Berthe <mikael@lilotux.net>
parents:
813
diff
changeset
|
129 |
if test "$gccvernum" -ge "400"; then |
8c64874c449e
More gcc configure checks
Mikael Berthe <mikael@lilotux.net>
parents:
813
diff
changeset
|
130 |
CFLAGS="$CFLAGS -Wextra" |
8c64874c449e
More gcc configure checks
Mikael Berthe <mikael@lilotux.net>
parents:
813
diff
changeset
|
131 |
else |
8c64874c449e
More gcc configure checks
Mikael Berthe <mikael@lilotux.net>
parents:
813
diff
changeset
|
132 |
CFLAGS="$CFLAGS -W" |
8c64874c449e
More gcc configure checks
Mikael Berthe <mikael@lilotux.net>
parents:
813
diff
changeset
|
133 |
fi |
8c64874c449e
More gcc configure checks
Mikael Berthe <mikael@lilotux.net>
parents:
813
diff
changeset
|
134 |
CFLAGS="$CFLAGS -Wno-unused-parameter -pedantic -std=gnu99 -O0" |
8c64874c449e
More gcc configure checks
Mikael Berthe <mikael@lilotux.net>
parents:
813
diff
changeset
|
135 |
fi # gcc |
8c64874c449e
More gcc configure checks
Mikael Berthe <mikael@lilotux.net>
parents:
813
diff
changeset
|
136 |
CFLAGS="$CFLAGS -g" |
741 | 137 |
else |
138 |
CFLAGS="$CFLAGS -O2" |
|
139 |
fi |
|
140 |
||
781
d3af6877a7df
Add --enable-hgcset to configure script
Mikael Berthe <mikael@lilotux.net>
parents:
778
diff
changeset
|
141 |
AC_ARG_ENABLE(hgcset, |
d3af6877a7df
Add --enable-hgcset to configure script
Mikael Berthe <mikael@lilotux.net>
parents:
778
diff
changeset
|
142 |
[AC_HELP_STRING(--enable-hgcset, Add Mercurial changeset)], |
d3af6877a7df
Add --enable-hgcset to configure script
Mikael Berthe <mikael@lilotux.net>
parents:
778
diff
changeset
|
143 |
hgcset=$enableval, hgcset="") |
d3af6877a7df
Add --enable-hgcset to configure script
Mikael Berthe <mikael@lilotux.net>
parents:
778
diff
changeset
|
144 |
AM_CONDITIONAL(HGCSET, test x$hgcset = xyes) |
d3af6877a7df
Add --enable-hgcset to configure script
Mikael Berthe <mikael@lilotux.net>
parents:
778
diff
changeset
|
145 |
if test "${hgcset}" = "yes"; then |
d3af6877a7df
Add --enable-hgcset to configure script
Mikael Berthe <mikael@lilotux.net>
parents:
778
diff
changeset
|
146 |
AC_DEFINE(ENABLE_HGCSET, 1, [Use Mercurial changeset]) |
d3af6877a7df
Add --enable-hgcset to configure script
Mikael Berthe <mikael@lilotux.net>
parents:
778
diff
changeset
|
147 |
fi |
d3af6877a7df
Add --enable-hgcset to configure script
Mikael Berthe <mikael@lilotux.net>
parents:
778
diff
changeset
|
148 |
|
68 | 149 |
AC_CONFIG_FILES([connwrap/Makefile |
150 |
libjabber/Makefile |
|
151 |
src/Makefile |
|
233 | 152 |
doc/Makefile |
68 | 153 |
Makefile]) |
154 |
AC_OUTPUT |