]> jfr.im git - solanum.git/blame_incremental - configure.ac
document +M cmode (#417)
[solanum.git] / configure.ac
... / ...
CommitLineData
1dnl TODO: clean up all the OpenSSL and shared module checking stuff;
2dnl the most major changes have already been made and it looks like
3dnl said functions need to be just about as complex as they already are.
4
5AC_PREREQ(2.60)
6
7AC_INIT([solanum], [1.0-dev])
8
9AC_LANG(C)
10AC_USE_SYSTEM_EXTENSIONS
11AC_GNU_SOURCE
12
13AC_PROG_CC_C99
14
15if test x"$ac_cv_prog_cc_c99" = "xno"; then
16 AC_ERROR([solanum requires a C99 capable compiler])
17fi
18
19AC_PREFIX_DEFAULT($HOME/ircd)
20AC_CONFIG_MACRO_DIR([m4])
21AC_CONFIG_HEADER(include/setup.h)
22
23AC_CONFIG_SUBDIRS([librb])
24AC_CONFIG_AUX_DIR([libltdl/config])
25
26AM_INIT_AUTOMAKE([subdir-objects])
27AM_SILENT_RULES([yes])
28AM_PROG_AR
29
30LT_INIT([dlopen disable-static])
31LT_CONFIG_LTDL_DIR([libltdl])
32LTDL_INIT
33
34build_ltdl=$with_included_ltdl
35AM_CONDITIONAL([BUILD_LTDL], [test x"$build_ltdl" = x"yes"])
36
37if test "$ac_cv_c_compiler_gnu" = yes; then
38 IRC_CFLAGS="$IRC_CFLAGS -O0 -Wall"
39fi
40
41dnl If we support -g, use it!
42if test "$ac_cv_prog_cc_g" = yes; then
43 IRC_CFLAGS="$IRC_CFLAGS -g"
44fi
45
46dnl check for /dev/null so we can use it to hold evil fd's
47AC_MSG_CHECKING([for /dev/null])
48if test -c /dev/null ; then
49 AC_DEFINE(PATH_DEVNULL, "/dev/null", [Path to /dev/null])
50 AC_MSG_RESULT(yes)
51else
52 AC_DEFINE(PATH_DEVNULL, "devnull.log", [Path to /dev/null])
53 AC_MSG_RESULT(no - using devnull.log)
54fi
55
56dnl jdc -- If CFLAGS is defined, best use it everywhere...
57dnl NOTE: jv says it must be added to the *END*, because things like
58dnl "gcc -O9 -O2" will result in -O2 getting preference. How stupid.
59if test ! -z "$CFLAGS"; then
60 IRC_CFLAGS="$IRC_CFLAGS $CFLAGS"
61fi
62
63AC_ISC_POSIX
64AC_C_INLINE
65AC_PROG_MAKE_SET
66AC_PROG_INSTALL
67AC_PATH_PROG(RM, rm)
68AC_PATH_PROG(CP, cp)
69AC_PATH_PROG(MV, mv)
70AC_PATH_PROG(LN, ln)
71AC_PATH_PROG(SED, sed)
72AC_PATH_PROG(AR, ar)
73AC_PATH_PROG(LD, ld)
74AC_PATH_PROG(RANLIB, ranlib)
75AC_PATH_PROG(TOUCH, touch)
76
77AC_PROG_YACC
78
79dnl AC_PROG_YACC defaults to yacc unconditionally if nothing can be found
80if test "$YACC" = "yacc" -a -z "`which $YACC 2>/dev/null`"; then
81 AC_MSG_ERROR([could not locate a suitable parser generator; install bison, yacc, or byacc])
82fi
83
84AC_PROG_LEX
85
86if test "$LEX" = ":"; then
87 AC_MSG_ERROR([could not locate a suitable lexical generator, install flex or lex.])
88fi
89
90AC_ARG_ENABLE([fhs-paths],
91 [AS_HELP_STRING([--enable-fhs-paths], [Use more FHS-like pathnames (for packagers).])],
92 [],
93 [dnl detect if the user appears to want --enable-fhs-paths
94 AS_IF([test "$libexecdir" = '${exec_prefix}/libexec' && \
95 test "$localstatedir" = '${prefix}/var' && \
96 test "$libdir" = '${exec_prefix}/lib'],
97 [enable_fhs_paths=no],
98 [enable_fhs_paths=yes])
99 ])
100dnl use directory structure of cached as default (hack)
101AS_IF([test "x$enable_fhs_paths" = "xyes"],
102 [dnl Avoid name collisions.
103 pkglibexecdir='${libexecdir}/${PACKAGE_TARNAME}'
104 rundir=${rundir-'${prefix}/run'}
105 pkgrundir='${rundir}/${PACKAGE_TARNAME}'
106 pkglocalstatedir='${localstatedir}/${PACKAGE_TARNAME}'
107 AC_DEFINE([ENABLE_FHS_PATHS], [1], [Uncomment if FHS pathnames are enabled])],
108 [libexecdir='${bindir}'
109 pkglibexecdir='${libexecdir}'
110 rundir='${sysconfdir}'
111 pkgrundir='${rundir}'
112 localstatedir='${prefix}'
113 pkglocalstatedir='${sysconfdir}'])
114pkglibdir='${libdir}/${PACKAGE_TARNAME}'
115AC_SUBST([pkglibdir])
116AC_SUBST([rundir])
117AC_SUBST([pkgrundir])
118AC_SUBST([pkglocalstatedir])
119AC_DEFINE_DIR([PKGLOCALSTATEDIR], [pkglocalstatedir], [[Directory in which to store state, such as ban database]])
120AC_SUBST([pkglibexecdir])
121AC_DEFINE_DIR([PKGLIBEXECDIR], [pkglibexecdir], [Directory where binaries the IRCd itself spawns live])
122
123dnl Checks for header files.
124AC_HEADER_STDC
125AC_HEADER_STDBOOL
126
127AC_CHECK_HEADERS([crypt.h sys/param.h sys/syslog.h sys/epoll.h machine/endian.h])
128
129dnl Stuff that the memory manager (imalloc) depends on
130dnl ==================================================
131
132AC_C_CONST
133if test "$ac_cv_header_machine_endian_h" = "no" ; then
134 AC_C_BIGENDIAN
135fi
136AC_TYPE_PID_T
137AC_TYPE_SIZE_T
138AC_CHECK_SIZEOF(short)
139AC_CHECK_SIZEOF(int)
140AC_CHECK_SIZEOF(long)
141AC_CHECK_SIZEOF(long long)
142
143dnl Networking Functions
144dnl ====================
145
146AC_SEARCH_LIBS(socket, socket,, [AC_MSG_ERROR([You have no socket()! Aborting.])])
147
148dnl SunOS/Solaris required libnsl for inet_ntoa()
149if test x"$SUN" = xyes; then
150 AC_SEARCH_LIBS(inet_ntoa, nsl,, [AC_MSG_ERROR([libnsl not found! Aborting.])])
151fi
152
153AC_SEARCH_LIBS(crypt, [crypt descrypt],,)
154
155CRYPT_LIB=$ac_cv_search_crypt
156
157if test "$CRYPT_LIB" = "none required"; then
158 unset CRYPT_LIB
159elif test "$CRYPT_LIB" = no; then
160 unset CRYPT_LIB
161fi
162
163AC_SUBST(CRYPT_LIB)
164
165AC_C_BIGENDIAN
166
167dnl Check for stdarg.h - if we can't find it, halt configure
168AC_CHECK_HEADER(stdarg.h, , [AC_MSG_ERROR([** stdarg.h could not be found - solanum will not compile without it **])])
169AC_CHECK_FUNCS([strlcat strlcpy])
170
171AC_TYPE_INT16_T
172AC_TYPE_INT32_T
173
174AC_CHECK_TYPES([uintptr_t])
175
176dnl check for various functions...
177
178AC_FUNC_ALLOCA
179
180dnl OpenSSL support
181AC_MSG_CHECKING(for OpenSSL)
182AC_ARG_ENABLE(openssl,
183[AC_HELP_STRING([--enable-openssl[=DIR]],[Enable OpenSSL support (DIR optional).])
184AC_HELP_STRING([--disable-openssl],[Disable OpenSSL support.])],
185[cf_enable_openssl=$enableval],
186[cf_enable_openssl="auto"])
187
188if test "$cf_enable_openssl" != "no" ; then
189 cf_openssl_basedir=""
190 if test "$cf_enable_openssl" != "auto" &&
191 test "$cf_enable_openssl" != "yes" ; then
192 dnl Support for --enable-openssl=/some/place
193 cf_openssl_basedir="`echo ${cf_enable_openssl} | sed 's/\/$//'`"
194 else
195 dnl Do the auto-probe here. Check some common directory paths.
196 for dirs in /usr/local/ssl /usr/pkg /usr/local \
197 /usr/local/openssl ; do
198 if test -f "${dirs}/include/openssl/opensslv.h" ; then
199 cf_openssl_basedir="${dirs}"
200 break
201 fi
202 done
203 unset dirs
204 fi
205 dnl Now check cf_openssl_found to see if we found anything.
206 if test ! -z "$cf_openssl_basedir"; then
207 if test -f "${cf_openssl_basedir}/include/openssl/opensslv.h" ; then
208 SSL_INCLUDES="-I${cf_openssl_basedir}/include"
209 SSL_LIBS="-L${cf_openssl_basedir}/lib"
210 else
211 dnl OpenSSL wasn't found in the directory specified. Naughty
212 dnl administrator...
213 cf_openssl_basedir=""
214 fi
215 else
216 dnl Check for stock FreeBSD 4.x and 5.x systems, since their files
217 dnl are in /usr/include and /usr/lib. In this case, we don't want to
218 dnl change INCLUDES or LIBS, but still want to enable OpenSSL.
219 dnl We can't do this check above, because some people want two versions
220 dnl of OpenSSL installed (stock FreeBSD 4.x/5.x and /usr/local/ssl)
221 dnl and they want /usr/local/ssl to have preference.
222 if test -f "/usr/include/openssl/opensslv.h" ; then
223 cf_openssl_basedir="/usr"
224 fi
225 fi
226
227 dnl If we have a basedir defined, then everything is okay. Otherwise,
228 dnl we have a problem.
229 if test ! -z "$cf_openssl_basedir"; then
230 AC_MSG_RESULT($cf_openssl_basedir)
231 cf_enable_openssl="yes"
232 else
233 AC_MSG_RESULT([not found. Specify a correct path?])
234 cf_enable_openssl="no"
235 fi
236 unset cf_openssl_basedir
237else
238 dnl If --disable-openssl was specified
239 AC_MSG_RESULT(disabled)
240fi
241
242save_CPPFLAGS="$CPPFLAGS"
243CPPFLAGS="$CPPFLAGS $SSL_INCLUDES"
244save_LIBS="$LIBS"
245LIBS="$LIBS $SSL_LIBS"
246if test "$cf_enable_openssl" != no; then
247 dnl Check OpenSSL version (must be 0.9.6 or above!)
248 AC_MSG_CHECKING(for OpenSSL 0.9.6 or above)
249 AC_RUN_IFELSE(
250 [AC_LANG_PROGRAM(
251 [#include <openssl/opensslv.h>
252 #include <stdlib.h>],
253 [[if ( OPENSSL_VERSION_NUMBER >= 0x00906000)
254 exit(0); else exit(1);]])],
255 cf_openssl_version_ok=yes,
256 cf_openssl_version_ok=no,
257 cf_openssl_version_ok=no)
258
259 if test "$cf_openssl_version_ok" = yes; then
260 AC_MSG_RESULT(found)
261
262 dnl Work around pmake/gmake conditional incompatibilities
263 AC_SUBST(ENCSPEED, encspeed)
264
265 dnl Do all the HAVE_LIBCRYPTO magic -- and check for ciphers
266 CPPFLAGS="$CPPFLAGS $SSL_LIBS"
267 AC_CHECK_LIB(crypto, RSA_free)
268 SSL_LIBS="$SSL_LIBS -lcrypto"
269 SSL_SRCS_ENABLE='$(SSL_SRCS)'
270 else
271 AC_MSG_RESULT(no - OpenSSL support disabled)
272 fi
273fi
274
275CPPFLAGS="$save_CPPFLAGS"
276LIBS="$save_LIBS"
277
278dnl End OpenSSL detection
279
280
281dnl Specialized functions and libraries
282dnl ===================================
283
284AC_ARG_ENABLE(hyperscan,
285AC_HELP_STRING([--disable-hyperscan],[Disable hyperscan support]),
286[hyperscan=$enableval],[hyperscan=yes])
287
288AS_IF([test "$hyperscan" = yes], [
289 save_CPPFLAGS="$CPPFLAGS"
290 save_LIBS="$LIBS"
291 PKG_CHECK_MODULES([HS], [libhs >= 4], [], [hyperscan=no])
292 CPPFLAGS="$CPPFLAGS $HS_CFLAGS"
293 LIBS="$LIBS $HS_LIBS"
294 AC_CHECK_HEADER([hs_common.h], [], [hyperscan=no])
295 AC_CHECK_FUNC([hs_scan], [], [hyperscan=no])
296])
297
298AS_IF([test "$hyperscan" = no], [
299 CPPFLAGS="$save_CPPFLAGS"
300 LIBS="$save_LIBS"
301])
302
303AM_CONDITIONAL([HAVE_HYPERSCAN], [test "$hyperscan" = "yes"])
304
305
306AC_ARG_WITH(sctp-path,
307AC_HELP_STRING([--with-sctp-path=DIR],[Path to libsctp.so for SCTP support.]),
308[LIBS="$LIBS -L$withval"],)
309
310AC_ARG_ENABLE(sctp,
311AC_HELP_STRING([--disable-sctp],[Disable SCTP support]),
312[sctp=$enableval],[sctp=yes])
313
314if test "$sctp" = yes; then
315
316AC_CHECK_HEADER(netinet/sctp.h, [
317 AC_SEARCH_LIBS(sctp_bindx, sctp,
318 [
319 AC_DEFINE(HAVE_LIBSCTP, 1, [Define to 1 if libsctp (-lsctp) is available.])
320 ], sctp=no)
321], sctp=no)
322
323fi
324
325dnl Check for shared sqlite
326dnl ======================
327PKG_CHECK_MODULES(SQLITE, [sqlite3], [], AC_ERROR([sqlite3 is required]))
328
329AC_SUBST(SQLITE_LD, "$SQLITE_LIBS")
330AC_SUBST(SQLITE_INCLUDES, "$SQLITE_CFLAGS")
331
332dnl **********************************************************************
333dnl Check for --with-confdir [deprecated, use --sysconfdir instead]
334dnl **********************************************************************
335
336AC_ARG_WITH([confdir],
337 [AC_HELP_STRING([--with-confdir=DIR],
338 [Directory to install config files [deprecated, use --sysconfdir instead].])],
339 [ sysconfdir=`echo $withval | sed 's/\/$//'` ],
340 [ confdir='${sysconfdir}' ])
341AC_DEFINE_DIR([ETC_DIR], [sysconfdir], [Prefix where config files are installed.])
342
343dnl **********************************************************************
344dnl Check for --with-logdir
345dnl **********************************************************************
346
347AC_MSG_CHECKING([whether to modify logdir])
348AC_ARG_WITH(logdir,
349AC_HELP_STRING([--with-logdir=DIR],
350 [Directory where to write logfiles.]),
351 [ logdir=`echo $withval | sed 's/\/$//'`
352 AC_MSG_RESULT(yes)],
353 [ AS_IF([test "x$enable_fhs_paths" = "xyes"],
354 [logdir='${localstatedir}/log/${PACKAGE_TARNAME}'],
355 [logdir='${prefix}/logs'])
356 AC_MSG_RESULT(no)])
357AC_DEFINE_DIR([LOG_DIR], [logdir], [Prefix where to write logfiles.])
358AC_SUBST_DIR([logdir])
359
360dnl **********************************************************************
361dnl Check for --with-helpdir
362dnl **********************************************************************
363
364AC_MSG_CHECKING([whether to modify helpdir])
365AC_ARG_WITH(helpdir,
366AC_HELP_STRING([--with-helpdir=DIR],
367 [Directory to install help files.]),
368 [ helpdir=`echo $withval | sed 's/\/$//'`
369 AC_MSG_RESULT(yes) ],
370 [ AS_IF([test "x$enable_fhs_paths" = "xyes"],
371 [helpdir='${datadir}/${PACKAGE_TARNAME}/help'],
372 [helpdir='${prefix}/help'])
373 AC_MSG_RESULT(no) ])
374AC_DEFINE_DIR([HELP_DIR], [helpdir], [Prefix where help files are installed.])
375AC_SUBST_DIR([helpdir])
376
377dnl **********************************************************************
378dnl Check for --with-moduledir
379dnl **********************************************************************
380
381AC_MSG_CHECKING([whether to modify moduledir])
382AC_ARG_WITH(moduledir,
383 [AC_HELP_STRING([--with-moduledir=DIR],
384 [Directory to install modules.])],
385 [ moduledir=`echo $withval | sed 's/\/$//'`
386 AC_MSG_RESULT(yes)],
387 [ AS_IF([test "x$enable_fhs_paths" = "xyes"],
388 [moduledir='${pkglibdir}/modules'],
389 [moduledir='${prefix}/modules'])
390 AC_MSG_RESULT(no)
391 ])
392AC_DEFINE_DIR(MODULE_DIR, moduledir, [Prefix where modules are installed.])
393AC_SUBST_DIR([moduledir])
394
395dnl Check for --with-rundir
396
397AC_MSG_CHECKING([whether or modify rundir])
398AC_ARG_WITH([rundir],
399 [AC_HELP_STRING([--with-rundir=DIR],
400 [Directory in which to store pidfile.])],
401 [AC_MSG_RESULT([yes])
402 rundir=`echo $withval | sed 's/\/$//'`],
403 [AC_MSG_RESULT([no])
404 AS_IF([test "x$enable_fhs_paths" = "xyes"],
405 [rundir='${prefix}/run'],
406 [rundir='${sysconfdir}'])])
407AC_SUBST([rundir])
408AC_DEFINE_DIR([PKGRUNDIR], [pkgrundir], [Directory to store pidfile in.])
409
410dnl Installed utility program prefixes (does not affect binaries
411dnl installed into pkglibexecdir)
412AC_MSG_CHECKING([for program prefix])
413AC_ARG_WITH([program-prefix],
414 [AS_HELP_STRING([--with-program-prefix=], [If set, programs installed into PATH will be installed with names prefixed by this prefix.])],
415 [test "x$with_program_prefix" = "xno" && with_program_prefix=],
416 [with_program_prefix=])
417AC_MSG_RESULT(["$with_program_prefix"])
418PROGRAM_PREFIX="$with_program_prefix"
419AC_SUBST([PROGRAM_PREFIX])
420AC_DEFINE_UNQUOTED([PROGRAM_PREFIX], ["$with_program_prefix"], [String with which all programs intended to be in PATH are prefixed.])
421
422dnl **********************************************************************
423dnl Branding
424dnl **********************************************************************
425
426AC_MSG_CHECKING([whether custom branding is requested])
427AC_ARG_WITH(custom-branding,
428AC_HELP_STRING([--with-custom-branding=NAME],
429 [Custom branding name.]),
430 [BRANDING_NAME=$withval
431 AC_MSG_RESULT([yes])],
432 [BRANDING_NAME=$PACKAGE_NAME
433 AC_MSG_RESULT([no])]
434)
435
436AC_MSG_CHECKING([whether a custom version is requested])
437AC_ARG_WITH(custom-version,
438AC_HELP_STRING([--with-custom-version=NAME],
439 [Custom version branding.]),
440 [BRANDING_VERSION=$withval
441 AC_MSG_RESULT([yes])],
442 [BRANDING_VERSION=$PACKAGE_VERSION
443 AC_MSG_RESULT([no])]
444)
445
446AC_DEFINE_UNQUOTED(BRANDING_NAME, ["$BRANDING_NAME"], [Custom branding name.])
447AC_DEFINE_UNQUOTED(BRANDING_VERSION, ["$BRANDING_VERSION"], [Custom branding name.])
448
449if test "x$BRANDING_NAME" != "x$PACKAGE_NAME"; then
450 AC_DEFINE(CUSTOM_BRANDING, 1, [Define if custom branding is enabled.])
451fi
452
453dnl **********************************************************************
454dnl Enable oper chghost
455dnl **********************************************************************
456
457AC_ARG_ENABLE(oper-chghost,
458AC_HELP_STRING([--enable-oper-chghost],[Enable opers to use the CHGHOST command]),
459[operchghost=$enableval],[operchghost=no])
460
461if test "$operchghost" = yes; then
462 AC_DEFINE(ENABLE_OPER_CHGHOST, 1, [Define this to enable opers to use the CHGHOST command.])
463fi
464
465dnl Debug-related options
466dnl =====================
467
468AC_ARG_ENABLE(assert,
469AC_HELP_STRING([--enable-assert],[Enable assert(). Choose between soft(warnings) and hard(aborts the daemon)]),
470[assert=$enableval], [assert=no])
471
472if test "$assert" = no; then
473 AC_DEFINE(NDEBUG, 1, [Define this to disable debugging support.])
474elif test "$assert" = soft; then
475 AC_DEFINE(SOFT_ASSERT, 1, [Define this to enable soft asserts.])
476 AC_DEFINE(NDEBUG, 1, [Define this to disable debugging support.])
477elif test "$assert" = yes; then
478 assert="hard"
479fi
480
481AC_MSG_CHECKING(if you want to do a profile build)
482AC_ARG_ENABLE(profile,
483AC_HELP_STRING([--enable-profile],[Enable profiling]),
484[profile=$enableval], [profile=no])
485
486if test "$profile" = yes; then
487 if test "$ac_cv_c_compiler_gnu" = yes; then
488 IRC_CFLAGS="$IRC_CFLAGS -pg"
489 AC_MSG_RESULT([yes, adding -pg])
490 AC_DEFINE(SOLANUM_PROFILE, 1, [Define this if you are profiling.])
491 else
492 AC_MSG_RESULT([no, profile builds only work with gcc])
493 fi
494else
495 AC_MSG_RESULT(no)
496fi
497
498AC_DEFINE([NICKNAMEHISTORYLENGTH], 15000, [Size of the WHOWAS array.])
499AC_DEFINE([CHANNEL_HEAP_SIZE], 8192, [Size of the channel heap.])
500AC_DEFINE([BAN_HEAP_SIZE], 4096, [Size of the ban heap.])
501AC_DEFINE([CLIENT_HEAP_SIZE], 8192, [Size of the client heap.])
502AC_DEFINE([LCLIENT_HEAP_SIZE], 1024, [Size of the local client heap.])
503AC_DEFINE([PCLIENT_HEAP_SIZE], 256, [Size of the pre-client heap.])
504AC_DEFINE([USER_HEAP_SIZE], 8192, [Size of the user heap.])
505AC_DEFINE([DNODE_HEAP_SIZE], 8192, [Size of the dlink_node heap.])
506AC_DEFINE([TOPIC_HEAP_SIZE], 4096, [Size of the topic heap.])
507AC_DEFINE([LINEBUF_HEAP_SIZE], 2048, [Size of the linebuf heap.])
508AC_DEFINE([MEMBER_HEAP_SIZE], 32768, [Sizeof member heap.])
509AC_DEFINE([ND_HEAP_SIZE], 512, [Size of the nick delay heap.])
510AC_DEFINE([CONFITEM_HEAP_SIZE], 256, [Size of the confitem heap.])
511AC_DEFINE([MONITOR_HEAP_SIZE], 1024, [Size of the monitor heap.])
512AC_DEFINE([FD_HEAP_SIZE], 1024, [Size of fd heap.])
513AC_DEFINE([AWAY_HEAP_SIZE], 512, [Size of away heap.])
514
515AC_ARG_WITH(nicklen,
516AC_HELP_STRING([--with-nicklen=LENGTH],[Set the upper-bound nick length to LENGTH (default 31, max 50)]),
517[
518 if ! expr "$withval" + 0 >/dev/null 2>&1; then
519 AC_ERROR([NICKLEN must be a numeric value])
520 fi
521 if test $withval -gt 50; then
522 NICKLEN=50
523 AC_MSG_WARN([NICKLEN has a hard limit of 50. Setting NICKLEN=50])
524 elif test $withval -lt 9; then
525 NICKLEN=9
526 AC_MSG_WARN([NICKLEN has a lower limit of 9. Setting NICKLEN=9])
527 else
528 NICKLEN="$withval"
529 fi
530], [NICKLEN=31])
531
532AC_ARG_WITH(topiclen,
533AC_HELP_STRING([--with-topiclen=NUMBER],[Set the max topic length to NUMBER (default 390, max 390)]),
534[
535 if test $withval -gt 390; then
536 TOPICLEN=390
537 AC_MSG_WARN([TOPICLEN has a hard limit of 390. Setting TOPICLEN=390])
538 else
539 TOPICLEN=$withval
540 fi
541], [TOPICLEN=390])
542
543AC_DEFINE_UNQUOTED(TOPICLEN, ${TOPICLEN}, [Maximum topic length (<=390)])
544AC_DEFINE_UNQUOTED(NICKLEN, (${NICKLEN}+1), [Nickname length])
545
546
547AC_ARG_WITH(asan,
548AC_HELP_STRING([--with-asan],[Build with Address Sanitizer]),
549[
550 CFLAGS="$CFLAGS -fsanitize=address"
551 LDFLAGS="$LDFLAGS -fsanitize=address"
552])
553
554# rpath, for finding librb.so at run time
555hold_ldflags=$LDFLAGS
556AC_MSG_CHECKING(for the ld -rpath flag)
557LDFLAGS="${LDFLAGS} -Wl,-rpath=${libdir}"
558AC_LINK_IFELSE([AC_LANG_PROGRAM([],[int i;])], found=yes, found=no)
559LDFLAGS=$hold_ldflags
560AC_MSG_RESULT($found)
561if test "$found" = yes; then
562 LDFLAGS="${LDFLAGS} -Wl,-rpath=\${libdir}"
563fi
564
565# This must be down here, or it will mess up checks like the ones
566# for -Wl,-export-dynamic
567# -- jilles
568CWARNS=""
569AC_ARG_ENABLE(warnings,
570AC_HELP_STRING([--enable-warnings],[Enable all sorts of warnings for debugging.]),
571[
572IRC_CFLAGS="$IRC_CFLAGS -O0"
573CFLAGS="$IRC_CFLAGS"
574
575SOLANUM_C_GCC_TRY_FLAGS([-Wall], solanum_cv_c_gcc_w_all)
576SOLANUM_C_GCC_TRY_FLAGS([-Wpointer-arith], solanum_cv_c_gcc_w_pointer_arith)
577SOLANUM_C_GCC_TRY_FLAGS([-Wimplicit -Wnested-externs], solanum_cv_c_gcc_w_implicit)
578SOLANUM_C_GCC_TRY_FLAGS([-Wcast-align], solanum_cv_c_gcc_w_cast_align)
579SOLANUM_C_GCC_TRY_FLAGS([-Wcast-qual], solanum_cv_c_gcc_w_cast_qual)
580SOLANUM_C_GCC_TRY_FLAGS([-Wwrite-strings], solanum_cv_c_gcc_w_write_strings)
581SOLANUM_C_GCC_TRY_FLAGS([-Werror-implicit-function-declaration], solanum_cv_c_gcc_w_error_implicit_function_declaration)
582SOLANUM_C_GCC_TRY_FLAGS([-Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations], solanum_cv_c_gcc_prototypes)
583SOLANUM_C_GCC_TRY_FLAGS([-Wparentheses], solanum_cv_c_gcc_parentheses)
584SOLANUM_C_GCC_TRY_FLAGS([-W -Wno-unused], solanum_cv_c_gcc_w)
585SOLANUM_C_GCC_TRY_FLAGS([-Wextra], solanum_cv_c_gcc_w_extra)
586SOLANUM_C_GCC_TRY_FLAGS([-Wshadow], solanum_cv_c_gcc_w_shadow)
587SOLANUM_C_GCC_TRY_FLAGS([-Wmissing-noreturn], solanum_cv_c_gcc_w_missing_noreturn)
588SOLANUM_C_GCC_TRY_FLAGS([-Wundef], solanum_cv_c_gcc_w_undef)
589SOLANUM_C_GCC_TRY_FLAGS([-Wpacked], solanum_cv_c_gcc_w_packed)
590SOLANUM_C_GCC_TRY_FLAGS([-Wnested-externs], solanum_cv_c_gcc_w_nested_externs)
591SOLANUM_C_GCC_TRY_FLAGS([-Wunused-function -Wunused-label -Wunused-value -Wunused-variable], solanum_cv_c_gcc_w_unused)
592SOLANUM_C_GCC_TRY_FLAGS([-Wredundant-decls], solanum_cv_c_gcc_w_redundant_decls)
593SOLANUM_C_GCC_TRY_FLAGS([-Wfloat-equal], solanum_cv_c_gcc_w_float_equal)
594SOLANUM_C_GCC_TRY_FLAGS([-Wformat -Wformat-y2k -Wno-format-security], solanum_cv_c_gcc_w_format)
595
596IRC_CFLAGS="$CFLAGS"
597],[])
598
599IRC_CFLAGS="$IRC_CFLAGS $CWARNS"
600
601AC_SUBST(MODULES_LIBS)
602AC_SUBST(MOD_TARGET)
603
604AC_SUBST(SSL_SRCS_ENABLE)
605AC_SUBST(SSL_INCLUDES)
606AC_SUBST(SSL_LIBS)
607
608AC_SUBST(LDFLAGS)
609AC_SUBST(PICFLAGS)
610AC_SUBST(IRC_CFLAGS)
611AC_SUBST(SEDOBJ)
612
613
614if test "$prefix" = "NONE"; then
615 AC_DEFINE_UNQUOTED(IRCD_PREFIX, "$ac_default_prefix", [Prefix where the ircd is installed.])
616else
617 dnl Strip trailing slashes to prevent a path of '//'
618 prefix=`echo $prefix | sed 's/\/$//'`
619 AC_DEFINE_UNQUOTED(IRCD_PREFIX, "$prefix", [Prefix where the ircd is installed.])
620fi
621
622AC_CONFIG_FILES( \
623 Makefile \
624 authd/Makefile \
625 bandb/Makefile \
626 ssld/Makefile \
627 wsockd/Makefile \
628 extensions/Makefile \
629 ircd/Makefile \
630 modules/Makefile \
631 tests/Makefile \
632 tools/Makefile \
633 tools/genssl \
634 doc/Makefile \
635 help/Makefile \
636)
637AC_CONFIG_COMMANDS([tools/genssl_chmod], [chmod 755 tools/genssl])
638
639AC_OUTPUT
640
641if test "$cf_openssl_version_ok" = yes; then
642 openssl="yes"
643else
644 openssl="no"
645fi
646
647echo "
648Configuration of ${BRANDING_NAME}-${BRANDING_VERSION}:
649 Install directory : $prefix
650
651 OpenSSL : $openssl
652 SCTP : $sctp
653
654 Nickname length : $NICKLEN
655 Topic length : $TOPICLEN
656
657Use (g)make to compile $BRANDING_NAME, then (g)make install to install it.
658"