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 |
1010 |
AC_PREREQ(2.64)
|
7 |
michael |
923 |
AC_INIT([ircd-hybrid], [7.2.4])
|
8 |
michael |
955 |
AM_INIT_AUTOMAKE(1.11)
|
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 |
|
|
#ltdl stuff
|
22 |
michael |
977 |
LT_INIT([dlopen disable-static])
|
23 |
michael |
945 |
LTDL_INIT
|
24 |
stu |
908 |
LIBTOOL="$LIBTOOL --silent"
|
25 |
adx |
30 |
|
26 |
stu |
908 |
# Checks for libraries.
|
27 |
|
|
AX_CHECK_LIB_IPV4
|
28 |
|
|
AX_CHECK_LIB_IPV6
|
29 |
adx |
30 |
|
30 |
stu |
908 |
# Checks for typedefs, structures, and compiler characteristics.
|
31 |
adx |
30 |
AC_C_BIGENDIAN
|
32 |
|
|
|
33 |
stu |
908 |
# Checks for library functions.
|
34 |
michael |
1010 |
AC_CHECK_FUNCS_ONCE(mmap \
|
35 |
|
|
strtok_r \
|
36 |
|
|
usleep \
|
37 |
|
|
strlcat \
|
38 |
michael |
978 |
strlcpy)
|
39 |
adx |
30 |
|
40 |
michael |
923 |
# Checks for header files.
|
41 |
michael |
912 |
AC_CHECK_HEADERS_ONCE(crypt.h \
|
42 |
|
|
inttypes.h \
|
43 |
|
|
stdint.h \
|
44 |
|
|
sys/resource.h \
|
45 |
|
|
sys/param.h \
|
46 |
|
|
errno.h \
|
47 |
|
|
sys/syslog.h \
|
48 |
|
|
stddef.h \
|
49 |
|
|
libgen.h \
|
50 |
db |
941 |
types.h \
|
51 |
|
|
socket.h \
|
52 |
michael |
912 |
sys/wait.h \
|
53 |
|
|
wait.h \
|
54 |
|
|
link.h)
|
55 |
|
|
|
56 |
michael |
923 |
dnl check for /dev/null so we can use it to hold evil fd's
|
57 |
|
|
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 |
|
|
AC_ARG_WITH(zlib-path,
|
69 |
michael |
955 |
AS_HELP_STRING([--with-zlib-path=DIR], [Path to libz.so for ziplinks support.]),
|
70 |
michael |
923 |
[LDFLAGS="-L$withval $LDFLAGS"],)
|
71 |
|
|
|
72 |
michael |
955 |
AC_ARG_ENABLE(zlib, AS_HELP_STRING([--disable-zlib],[Disable ziplinks support]),
|
73 |
michael |
923 |
[zlib=$enableval],[zlib=yes])
|
74 |
|
|
|
75 |
michael |
1010 |
AS_IF([test "$zlib" = "yes"], [
|
76 |
michael |
923 |
AC_CHECK_HEADER(zlib.h, [AC_CHECK_LIB(z, zlibVersion,
|
77 |
|
|
[
|
78 |
|
|
LIBS="-lz $LIBS"
|
79 |
|
|
AC_DEFINE(HAVE_LIBZ, 1, [Define to 1 if zlib (-lz) is available.])
|
80 |
|
|
], zlib=no)
|
81 |
|
|
], zlib=no)
|
82 |
michael |
1010 |
])
|
83 |
michael |
923 |
|
84 |
michael |
1009 |
AC_ARG_WITH(libpcre-path,
|
85 |
|
|
AS_HELP_STRING([--with-libpcre-path=DIR], [Path to libpcre.so for PCRE support.]),
|
86 |
|
|
[LDFLAGS="-L$withval $LDFLAGS"],)
|
87 |
michael |
923 |
|
88 |
michael |
1009 |
AC_ARG_ENABLE(libpcre, AS_HELP_STRING([--disable-libpcre],[Disable PCRE support]),
|
89 |
|
|
[libpcre=$enableval],[libpcre=yes])
|
90 |
|
|
|
91 |
michael |
1010 |
AS_IF([test "$libpcre" = "yes"], [
|
92 |
michael |
1009 |
AC_CHECK_HEADER(pcre.h, [AC_CHECK_LIB(pcre, pcre_study,
|
93 |
|
|
[
|
94 |
|
|
LIBS="-lpcre $LIBS"
|
95 |
|
|
AC_DEFINE(HAVE_LIBPCRE, 1, [Define to 1 if libpcre (-lpcre) is available.])
|
96 |
|
|
], libpcre=no)
|
97 |
|
|
], libpcre=no)
|
98 |
michael |
1010 |
])
|
99 |
michael |
1009 |
AM_CONDITIONAL(ENABLE_PCRE, [test "$libpcre" = yes])
|
100 |
|
|
|
101 |
|
|
|
102 |
michael |
912 |
dnl Openssl checks
|
103 |
|
|
AC_ARG_ENABLE(openssl,
|
104 |
|
|
[ --enable-openssl[=DIR] Enable OpenSSL support (DIR optional).
|
105 |
|
|
--disable-openssl Disable OpenSSL support. ],
|
106 |
|
|
[ cf_enable_openssl=$enableval ],
|
107 |
|
|
[ cf_enable_openssl="auto" ])
|
108 |
michael |
1010 |
AC_MSG_CHECKING([for OpenSSL])
|
109 |
michael |
912 |
if test "$cf_enable_openssl" != "no"; then
|
110 |
|
|
cf_openssl_basedir=""
|
111 |
|
|
if test "$cf_enable_openssl" != "auto" &&
|
112 |
|
|
test "$cf_enable_openssl" != "yes"; then
|
113 |
|
|
dnl Support for --enable-openssl=/some/place
|
114 |
|
|
cf_openssl_basedir="${cf_enable_openssl}"
|
115 |
|
|
else
|
116 |
|
|
dnl Do the auto-probe here. Check some common directory paths.
|
117 |
|
|
for dirs in /usr/local/ssl /usr/pkg /usr/local /usr/lib /usr/lib/ssl\
|
118 |
|
|
/opt /opt/openssl /usr/local/openssl; do
|
119 |
|
|
if test -f "${dirs}/include/openssl/opensslv.h"; then
|
120 |
|
|
cf_openssl_basedir="${dirs}"
|
121 |
|
|
break
|
122 |
|
|
fi
|
123 |
|
|
done
|
124 |
|
|
unset dirs
|
125 |
|
|
fi
|
126 |
|
|
|
127 |
|
|
dnl Now check cf_openssl_found to see if we found anything.
|
128 |
|
|
if test ! -z "$cf_openssl_basedir"; then
|
129 |
|
|
if test -f "${cf_openssl_basedir}/include/openssl/opensslv.h"; then
|
130 |
|
|
CPPFLAGS="-I${cf_openssl_basedir}/include $CPPFLAGS"
|
131 |
|
|
LDFLAGS="-L${cf_openssl_basedir}/lib $LDFLAGS"
|
132 |
|
|
else
|
133 |
|
|
dnl OpenSSL wasn't found in the directory specified. Naughty
|
134 |
|
|
dnl administrator...
|
135 |
|
|
cf_openssl_basedir=""
|
136 |
|
|
fi
|
137 |
|
|
else
|
138 |
|
|
dnl Check for stock FreeBSD 4.x and 5.x systems, since their files
|
139 |
|
|
dnl are in /usr/include and /usr/lib. In this case, we don't want to
|
140 |
|
|
dnl change INCLUDES or LIBS, but still want to enable OpenSSL.
|
141 |
|
|
dnl We can't do this check above, because some people want two versions
|
142 |
|
|
dnl of OpenSSL installed (stock FreeBSD 4.x/5.x and /usr/local/ssl)
|
143 |
|
|
dnl and they want /usr/local/ssl to have preference.
|
144 |
|
|
if test -f "/usr/include/openssl/opensslv.h"; then
|
145 |
|
|
cf_openssl_basedir="/usr"
|
146 |
|
|
fi
|
147 |
|
|
fi
|
148 |
|
|
|
149 |
|
|
dnl If we have a basedir defined, then everything is okay. Otherwise,
|
150 |
|
|
dnl we have a problem.
|
151 |
|
|
if test ! -z "$cf_openssl_basedir"; then
|
152 |
|
|
LIBS="-lcrypto -lssl $LIBS"
|
153 |
michael |
1010 |
AC_MSG_RESULT([$cf_openssl_basedir])
|
154 |
michael |
912 |
cf_enable_openssl="yes"
|
155 |
michael |
924 |
AC_DEFINE(HAVE_LIBCRYPTO, 1, [If we support ssl])
|
156 |
michael |
912 |
else
|
157 |
michael |
1010 |
AC_MSG_RESULT([not found. Please check your path.])
|
158 |
michael |
912 |
cf_enable_openssl="no"
|
159 |
|
|
fi
|
160 |
|
|
unset cf_openssl_basedir
|
161 |
|
|
else
|
162 |
|
|
dnl If --disable-openssl was specified
|
163 |
michael |
1010 |
AC_MSG_RESULT([disabled])
|
164 |
michael |
912 |
fi
|
165 |
michael |
924 |
AM_CONDITIONAL(ENABLE_SSL, [test "$cf_enable_openssl" = yes])
|
166 |
michael |
912 |
|
167 |
|
|
|
168 |
michael |
955 |
AC_ARG_ENABLE(assert, AS_HELP_STRING([--enable-assert],
|
169 |
|
|
[Enable assert() statements]),
|
170 |
michael |
924 |
[assert=$enableval], [assert=no])
|
171 |
|
|
|
172 |
michael |
1010 |
AS_IF([test "$assert" = "no"],
|
173 |
|
|
[AC_DEFINE(NDEBUG, 1, [Define to disable assert() statements.])])
|
174 |
michael |
924 |
|
175 |
michael |
1010 |
|
176 |
michael |
955 |
AC_ARG_ENABLE(small-net, AS_HELP_STRING([--enable-small-net],
|
177 |
|
|
[Enable small network support.]),
|
178 |
michael |
925 |
[small_net=$enableval], [small_net=no])
|
179 |
|
|
|
180 |
|
|
if test "$small_net" = yes; then
|
181 |
|
|
AC_DEFINE([NICKNAMEHISTORYLENGTH], 1500, [Size of the WHOWAS array.])
|
182 |
|
|
AC_DEFINE([CHANNEL_HEAP_SIZE], 256, [Size of the channel heap.])
|
183 |
|
|
AC_DEFINE([BAN_HEAP_SIZE], 128, [Size of the ban heap.])
|
184 |
|
|
AC_DEFINE([CLIENT_HEAP_SIZE], 256, [Size of the client heap.])
|
185 |
|
|
AC_DEFINE([LCLIENT_HEAP_SIZE], 128, [Size of the local client heap.])
|
186 |
|
|
AC_DEFINE([DNODE_HEAP_SIZE], 256, [Size of the dlink_node heap.])
|
187 |
|
|
AC_DEFINE([TOPIC_HEAP_SIZE], 256, [Size of the topic heap.])
|
188 |
|
|
AC_DEFINE([DBUF_HEAP_SIZE], 64, [Size of the dbuf heap.])
|
189 |
michael |
998 |
AC_DEFINE([AUTH_HEAP_SIZE], 128, [Size of the auth heap.])
|
190 |
|
|
AC_DEFINE([DNS_HEAP_SIZE], 128, [Size of the dns heap.])
|
191 |
michael |
925 |
else
|
192 |
|
|
AC_DEFINE([NICKNAMEHISTORYLENGTH], 15000, [Size of the WHOWAS array.])
|
193 |
|
|
AC_DEFINE([CHANNEL_HEAP_SIZE], 1024, [Size of the channel heap.])
|
194 |
|
|
AC_DEFINE([BAN_HEAP_SIZE], 1024, [Size of the ban heap.])
|
195 |
|
|
AC_DEFINE([CLIENT_HEAP_SIZE], 1024, [Size of the client heap.])
|
196 |
|
|
AC_DEFINE([LCLIENT_HEAP_SIZE], 512, [Size of the local client heap.])
|
197 |
|
|
AC_DEFINE([DNODE_HEAP_SIZE], 1024, [Size of the dlink_node heap.])
|
198 |
|
|
AC_DEFINE([TOPIC_HEAP_SIZE], 1024, [Size of the topic heap.])
|
199 |
|
|
AC_DEFINE([DBUF_HEAP_SIZE], 512, [Size of the dbuf heap.])
|
200 |
michael |
998 |
AC_DEFINE([AUTH_HEAP_SIZE], 512, [Size of the auth heap.])
|
201 |
|
|
AC_DEFINE([DNS_HEAP_SIZE], 512, [Size of the dns heap.])
|
202 |
michael |
925 |
fi
|
203 |
|
|
|
204 |
michael |
942 |
|
205 |
stu |
908 |
# Argument processing.
|
206 |
|
|
AX_ARG_ENABLE_IOLOOP_MECHANISM
|
207 |
|
|
AX_ARG_WITH_NICKLEN
|
208 |
|
|
AX_ARG_WITH_TOPICLEN
|
209 |
|
|
AX_ARG_WITH_SYSLOG
|
210 |
|
|
AX_ARG_ENABLE_EFNET
|
211 |
|
|
AX_ARG_ENABLE_HALFOPS
|
212 |
|
|
AX_ARG_ENABLE_DEBUGGING
|
213 |
|
|
AX_ARG_ENABLE_WARNINGS
|
214 |
|
|
AX_ARG_ENABLE_SYSLOG
|
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 |
|
|
etc/example.conf \
|
226 |
|
|
etc/example.conf.quick \
|
227 |
|
|
etc/example.efnet.conf \
|
228 |
|
|
servlink/Makefile \
|
229 |
|
|
contrib/Makefile \
|
230 |
|
|
contrib/help/Makefile \
|
231 |
|
|
src/Makefile \
|
232 |
|
|
messages/Makefile \
|
233 |
|
|
modules/Makefile \
|
234 |
|
|
modules/core/Makefile \
|
235 |
|
|
doc/Makefile \
|
236 |
|
|
help/Makefile \
|
237 |
|
|
help/opers/Makefile \
|
238 |
|
|
help/users/Makefile \
|
239 |
|
|
tools/Makefile
|
240 |
adx |
30 |
)
|
241 |
|
|
|
242 |
|
|
AC_OUTPUT
|