1 |
stu |
908 |
# Inspired by work Copyright (C) 2006 Luca Filipozzi |
2 |
|
|
# vim: set fdm=marker ts=2 sw=2 et: |
3 |
adx |
30 |
|
4 |
michael |
953 |
AC_REVISION([$Id$]) |
5 |
|
|
|
6 |
michael |
1107 |
AC_PREREQ(2.68) |
7 |
michael |
1245 |
AC_INIT([ircd-hybrid], [8beta1], [bugs@ircd-hybrid.org]) |
8 |
michael |
1292 |
AM_INIT_AUTOMAKE(1.11.3) |
9 |
stu |
908 |
AM_MAINTAINER_MODE |
10 |
michael |
912 |
AC_CONFIG_HEADER(config.h) |
11 |
|
|
AC_CONFIG_SRCDIR(src/ircd.c) |
12 |
adx |
30 |
|
13 |
stu |
908 |
# Checks for programs. |
14 |
michael |
1010 |
AC_PROG_CC_C99 |
15 |
|
|
AS_IF([test "$ac_cv_prog_cc_c99" = "no"], |
16 |
|
|
[AC_MSG_ERROR([no C99 compiler found. Aborting.])]) |
17 |
michael |
912 |
AC_PROG_YACC |
18 |
|
|
AM_PROG_LEX |
19 |
stu |
908 |
AC_PROG_INSTALL |
20 |
michael |
945 |
|
21 |
michael |
1015 |
# Initializing libtool. |
22 |
michael |
1084 |
LT_CONFIG_LTDL_DIR([libltdl]) |
23 |
michael |
977 |
LT_INIT([dlopen disable-static]) |
24 |
michael |
1092 |
LTDL_INIT([recursive convenience]) |
25 |
michael |
1053 |
LIBTOOL="$LIBTOOL --silent" |
26 |
adx |
30 |
|
27 |
stu |
908 |
# Checks for libraries. |
28 |
|
|
AX_CHECK_LIB_IPV4 |
29 |
|
|
AX_CHECK_LIB_IPV6 |
30 |
adx |
30 |
|
31 |
stu |
908 |
# Checks for typedefs, structures, and compiler characteristics. |
32 |
adx |
30 |
AC_C_BIGENDIAN |
33 |
|
|
|
34 |
stu |
908 |
# Checks for library functions. |
35 |
michael |
1010 |
AC_CHECK_FUNCS_ONCE(mmap \ |
36 |
|
|
strtok_r \ |
37 |
|
|
usleep \ |
38 |
|
|
strlcat \ |
39 |
michael |
1111 |
strlcpy \ |
40 |
|
|
socketpair) |
41 |
adx |
30 |
|
42 |
michael |
923 |
# Checks for header files. |
43 |
michael |
912 |
AC_CHECK_HEADERS_ONCE(crypt.h \ |
44 |
|
|
inttypes.h \ |
45 |
|
|
stdint.h \ |
46 |
|
|
sys/resource.h \ |
47 |
|
|
sys/param.h \ |
48 |
|
|
errno.h \ |
49 |
|
|
sys/syslog.h \ |
50 |
db |
941 |
types.h \ |
51 |
|
|
socket.h \ |
52 |
michael |
912 |
sys/wait.h \ |
53 |
|
|
wait.h \ |
54 |
|
|
link.h) |
55 |
|
|
|
56 |
michael |
1015 |
# check for /dev/null so we can use it to hold evil fd's |
57 |
michael |
923 |
AC_MSG_CHECKING([for /dev/null]) |
58 |
michael |
1010 |
AS_IF([test -c /dev/null], [ |
59 |
|
|
AC_DEFINE(PATH_DEVNULL, "/dev/null", [Path to /dev/null]) |
60 |
|
|
AC_MSG_RESULT([yes])], [ |
61 |
michael |
923 |
AC_DEFINE(PATH_DEVNULL, "devnull.log", [Path to /dev/null]) |
62 |
michael |
1010 |
AC_MSG_RESULT([no - using devnull.log])]) |
63 |
michael |
923 |
|
64 |
|
|
|
65 |
michael |
977 |
AC_SEARCH_LIBS(crypt, crypt) |
66 |
michael |
923 |
|
67 |
|
|
|
68 |
michael |
1009 |
AC_ARG_WITH(libpcre-path, |
69 |
|
|
AS_HELP_STRING([--with-libpcre-path=DIR], [Path to libpcre.so for PCRE support.]), |
70 |
|
|
[LDFLAGS="-L$withval $LDFLAGS"],) |
71 |
michael |
923 |
|
72 |
michael |
1009 |
AC_ARG_ENABLE(libpcre, AS_HELP_STRING([--disable-libpcre],[Disable PCRE support]), |
73 |
|
|
[libpcre=$enableval],[libpcre=yes]) |
74 |
|
|
|
75 |
michael |
1010 |
AS_IF([test "$libpcre" = "yes"], [ |
76 |
michael |
1009 |
AC_CHECK_HEADER(pcre.h, [AC_CHECK_LIB(pcre, pcre_study, |
77 |
|
|
[ |
78 |
|
|
LIBS="-lpcre $LIBS" |
79 |
|
|
AC_DEFINE(HAVE_LIBPCRE, 1, [Define to 1 if libpcre (-lpcre) is available.]) |
80 |
|
|
], libpcre=no) |
81 |
|
|
], libpcre=no) |
82 |
michael |
1010 |
]) |
83 |
michael |
1009 |
AM_CONDITIONAL(ENABLE_PCRE, [test "$libpcre" = yes]) |
84 |
|
|
|
85 |
|
|
|
86 |
michael |
912 |
dnl Openssl checks |
87 |
|
|
AC_ARG_ENABLE(openssl, |
88 |
|
|
[ --enable-openssl[=DIR] Enable OpenSSL support (DIR optional). |
89 |
|
|
--disable-openssl Disable OpenSSL support. ], |
90 |
|
|
[ cf_enable_openssl=$enableval ], |
91 |
|
|
[ cf_enable_openssl="auto" ]) |
92 |
michael |
1010 |
AC_MSG_CHECKING([for OpenSSL]) |
93 |
michael |
912 |
if test "$cf_enable_openssl" != "no"; then |
94 |
|
|
cf_openssl_basedir="" |
95 |
|
|
if test "$cf_enable_openssl" != "auto" && |
96 |
|
|
test "$cf_enable_openssl" != "yes"; then |
97 |
|
|
dnl Support for --enable-openssl=/some/place |
98 |
|
|
cf_openssl_basedir="${cf_enable_openssl}" |
99 |
|
|
else |
100 |
|
|
dnl Do the auto-probe here. Check some common directory paths. |
101 |
|
|
for dirs in /usr/local/ssl /usr/pkg /usr/local /usr/lib /usr/lib/ssl\ |
102 |
|
|
/opt /opt/openssl /usr/local/openssl; do |
103 |
|
|
if test -f "${dirs}/include/openssl/opensslv.h"; then |
104 |
|
|
cf_openssl_basedir="${dirs}" |
105 |
|
|
break |
106 |
|
|
fi |
107 |
|
|
done |
108 |
|
|
unset dirs |
109 |
|
|
fi |
110 |
|
|
|
111 |
|
|
dnl Now check cf_openssl_found to see if we found anything. |
112 |
|
|
if test ! -z "$cf_openssl_basedir"; then |
113 |
|
|
if test -f "${cf_openssl_basedir}/include/openssl/opensslv.h"; then |
114 |
|
|
CPPFLAGS="-I${cf_openssl_basedir}/include $CPPFLAGS" |
115 |
|
|
LDFLAGS="-L${cf_openssl_basedir}/lib $LDFLAGS" |
116 |
|
|
else |
117 |
|
|
dnl OpenSSL wasn't found in the directory specified. Naughty |
118 |
|
|
dnl administrator... |
119 |
|
|
cf_openssl_basedir="" |
120 |
|
|
fi |
121 |
|
|
else |
122 |
|
|
dnl Check for stock FreeBSD 4.x and 5.x systems, since their files |
123 |
|
|
dnl are in /usr/include and /usr/lib. In this case, we don't want to |
124 |
|
|
dnl change INCLUDES or LIBS, but still want to enable OpenSSL. |
125 |
|
|
dnl We can't do this check above, because some people want two versions |
126 |
|
|
dnl of OpenSSL installed (stock FreeBSD 4.x/5.x and /usr/local/ssl) |
127 |
|
|
dnl and they want /usr/local/ssl to have preference. |
128 |
|
|
if test -f "/usr/include/openssl/opensslv.h"; then |
129 |
|
|
cf_openssl_basedir="/usr" |
130 |
|
|
fi |
131 |
|
|
fi |
132 |
|
|
|
133 |
|
|
dnl If we have a basedir defined, then everything is okay. Otherwise, |
134 |
|
|
dnl we have a problem. |
135 |
|
|
if test ! -z "$cf_openssl_basedir"; then |
136 |
michael |
1010 |
AC_MSG_RESULT([$cf_openssl_basedir]) |
137 |
michael |
912 |
cf_enable_openssl="yes" |
138 |
|
|
else |
139 |
michael |
1010 |
AC_MSG_RESULT([not found. Please check your path.]) |
140 |
michael |
912 |
cf_enable_openssl="no" |
141 |
|
|
fi |
142 |
|
|
unset cf_openssl_basedir |
143 |
|
|
else |
144 |
|
|
dnl If --disable-openssl was specified |
145 |
michael |
1010 |
AC_MSG_RESULT([disabled]) |
146 |
michael |
912 |
fi |
147 |
michael |
1015 |
|
148 |
|
|
AS_IF([test "$cf_enable_openssl" != "no"], |
149 |
michael |
1304 |
[AC_MSG_CHECKING(for OpenSSL 0.9.8 or above) |
150 |
michael |
1106 |
AC_RUN_IFELSE([ |
151 |
michael |
1015 |
AC_LANG_PROGRAM([ |
152 |
|
|
#include <openssl/opensslv.h> |
153 |
|
|
#include <stdlib.h>], |
154 |
michael |
1304 |
[[ exit(!(OPENSSL_VERSION_NUMBER >= 0x00908000)); ]])], |
155 |
michael |
1015 |
[cf_openssl_version_ok=yes], |
156 |
|
|
[cf_openssl_version_ok=no], |
157 |
|
|
[cf_openssl_version_ok=no]) |
158 |
|
|
|
159 |
|
|
AS_IF([test "$cf_openssl_version_ok" = "yes"], |
160 |
|
|
[AC_MSG_RESULT(found) |
161 |
michael |
1106 |
|
162 |
michael |
1304 |
AC_CHECK_LIB(ssl, SSL_connect) |
163 |
|
|
AS_IF([test "$ac_cv_lib_ssl_SSL_connect" = "yes"], |
164 |
|
|
[AC_CHECK_LIB(crypto, RSA_free)]) |
165 |
michael |
1015 |
],[AC_MSG_RESULT(no - OpenSSL support disabled) |
166 |
|
|
cf_enable_openssl="no"])]) |
167 |
|
|
|
168 |
michael |
1304 |
AM_CONDITIONAL(ENABLE_SSL, [test "$ac_cv_lib_crypto_RSA_free" = yes]) |
169 |
michael |
912 |
|
170 |
|
|
|
171 |
michael |
955 |
AC_ARG_ENABLE(assert, AS_HELP_STRING([--enable-assert], |
172 |
|
|
[Enable assert() statements]), |
173 |
michael |
924 |
[assert=$enableval], [assert=no]) |
174 |
|
|
|
175 |
michael |
1010 |
AS_IF([test "$assert" = "no"], |
176 |
|
|
[AC_DEFINE(NDEBUG, 1, [Define to disable assert() statements.])]) |
177 |
michael |
924 |
|
178 |
michael |
1010 |
|
179 |
michael |
955 |
AC_ARG_ENABLE(small-net, AS_HELP_STRING([--enable-small-net], |
180 |
|
|
[Enable small network support.]), |
181 |
michael |
925 |
[small_net=$enableval], [small_net=no]) |
182 |
|
|
|
183 |
michael |
1015 |
AS_IF([test "$small_net" = "yes"], [ |
184 |
michael |
925 |
AC_DEFINE([NICKNAMEHISTORYLENGTH], 1500, [Size of the WHOWAS array.]) |
185 |
|
|
AC_DEFINE([CHANNEL_HEAP_SIZE], 256, [Size of the channel heap.]) |
186 |
|
|
AC_DEFINE([BAN_HEAP_SIZE], 128, [Size of the ban heap.]) |
187 |
|
|
AC_DEFINE([CLIENT_HEAP_SIZE], 256, [Size of the client heap.]) |
188 |
|
|
AC_DEFINE([LCLIENT_HEAP_SIZE], 128, [Size of the local client heap.]) |
189 |
|
|
AC_DEFINE([DNODE_HEAP_SIZE], 256, [Size of the dlink_node heap.]) |
190 |
|
|
AC_DEFINE([TOPIC_HEAP_SIZE], 256, [Size of the topic heap.]) |
191 |
|
|
AC_DEFINE([DBUF_HEAP_SIZE], 64, [Size of the dbuf heap.]) |
192 |
michael |
998 |
AC_DEFINE([AUTH_HEAP_SIZE], 128, [Size of the auth heap.]) |
193 |
michael |
1015 |
AC_DEFINE([DNS_HEAP_SIZE], 128, [Size of the dns heap.])], [ |
194 |
|
|
|
195 |
michael |
925 |
AC_DEFINE([NICKNAMEHISTORYLENGTH], 15000, [Size of the WHOWAS array.]) |
196 |
|
|
AC_DEFINE([CHANNEL_HEAP_SIZE], 1024, [Size of the channel heap.]) |
197 |
|
|
AC_DEFINE([BAN_HEAP_SIZE], 1024, [Size of the ban heap.]) |
198 |
|
|
AC_DEFINE([CLIENT_HEAP_SIZE], 1024, [Size of the client heap.]) |
199 |
|
|
AC_DEFINE([LCLIENT_HEAP_SIZE], 512, [Size of the local client heap.]) |
200 |
|
|
AC_DEFINE([DNODE_HEAP_SIZE], 1024, [Size of the dlink_node heap.]) |
201 |
|
|
AC_DEFINE([TOPIC_HEAP_SIZE], 1024, [Size of the topic heap.]) |
202 |
|
|
AC_DEFINE([DBUF_HEAP_SIZE], 512, [Size of the dbuf heap.]) |
203 |
michael |
998 |
AC_DEFINE([AUTH_HEAP_SIZE], 512, [Size of the auth heap.]) |
204 |
michael |
1015 |
AC_DEFINE([DNS_HEAP_SIZE], 512, [Size of the dns heap.])]) |
205 |
michael |
925 |
|
206 |
michael |
942 |
|
207 |
stu |
908 |
# Argument processing. |
208 |
|
|
AX_ARG_ENABLE_IOLOOP_MECHANISM |
209 |
|
|
AX_ARG_WITH_NICKLEN |
210 |
|
|
AX_ARG_WITH_TOPICLEN |
211 |
|
|
AX_ARG_ENABLE_EFNET |
212 |
|
|
AX_ARG_ENABLE_HALFOPS |
213 |
|
|
AX_ARG_ENABLE_DEBUGGING |
214 |
|
|
AX_ARG_ENABLE_WARNINGS |
215 |
adx |
30 |
|
216 |
stu |
908 |
AC_DEFINE_DIR([PREFIX],[prefix],[Set to prefix.]) |
217 |
|
|
AC_DEFINE_DIR([SYSCONFDIR],[sysconfdir],[Set to sysconfdir.]) |
218 |
|
|
AC_DEFINE_DIR([LIBDIR],[libdir],[Set to libdir.]) |
219 |
|
|
AC_DEFINE_DIR([DATADIR],[datadir],[Set to datadir.]) |
220 |
|
|
AC_DEFINE_DIR([LOCALSTATEDIR],[localstatedir],[Set to localstatedir.]) |
221 |
adx |
30 |
|
222 |
michael |
922 |
AC_CONFIG_FILES( \ |
223 |
|
|
Makefile \ |
224 |
|
|
etc/Makefile \ |
225 |
|
|
contrib/Makefile \ |
226 |
|
|
contrib/help/Makefile \ |
227 |
|
|
src/Makefile \ |
228 |
michael |
1092 |
libltdl/Makefile \ |
229 |
michael |
922 |
messages/Makefile \ |
230 |
|
|
modules/Makefile \ |
231 |
michael |
1053 |
modules/core/Makefile \ |
232 |
michael |
922 |
doc/Makefile \ |
233 |
|
|
help/Makefile \ |
234 |
michael |
1053 |
help/opers/Makefile \ |
235 |
|
|
help/users/Makefile \ |
236 |
michael |
1015 |
tools/Makefile) |
237 |
adx |
30 |
|
238 |
|
|
AC_OUTPUT |