/[svn]/ircd-hybrid/configure.ac
ViewVC logotype

Contents of /ircd-hybrid/configure.ac

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1096 - (show annotations)
Mon Aug 2 20:14:40 2010 UTC (9 years, 4 months ago) by michael
File size: 9008 byte(s)
- autoconf 2.67

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

Properties

Name Value
svn:eol-style native
svn:keywords Id Revision

svnadmin@ircd-hybrid.org
ViewVC Help
Powered by ViewVC 1.1.26