]> jfr.im git - irc/rqf/shadowircd.git/blame - configure.ac
rerun autoconf
[irc/rqf/shadowircd.git] / configure.ac
CommitLineData
88cb7f99 1dnl $Id: configure.ac 3516 2007-06-10 16:14:03Z jilles $
212380e3 2dnl Process this file with autoconf to produce a configure script.
3
4dnl TODO: clean up all the OpenSSL and shared module checking stuff;
5dnl the most major changes have already been made and it looks like
6dnl said functions need to be just about as complex as they already are.
7
8AC_PREREQ(2.57)
9
10dnl Sneaky way to get an Id tag into the configure script
88cb7f99 11AC_COPYRIGHT([$Id: configure.ac 3516 2007-06-10 16:14:03Z jilles $])
212380e3 12
06093b41 13AC_INIT([charybdis],[3.0.0-beta1])
212380e3 14
15AC_CONFIG_HEADER(include/setup.h)
16
17AC_PREFIX_DEFAULT($HOME/ircd)
18
19AC_GNU_SOURCE
20
21OLD_CFLAGS="$CFLAGS"
22dnl Checks for programs.
23AC_PROG_CC
24AC_LANG(C)
25
26dnl Make sure autoconf doesn't interfere with cflags -jmallett
27CFLAGS="$OLD_CFLAGS"
28
b57f37fb
WP
29AC_CONFIG_SUBDIRS(libratbox)
30
212380e3 31dnl Check for various compilers. -jmallett
32dnl But if $CC turns out to be gcc, sure as hell it's, well, gcc. -joshk
33
34if test "$ac_cv_c_compiler_gnu" != yes; then
35
36SGS=no
37AC_MSG_CHECKING($CC -version for TenDRA or MIPSpro)
38case `$CC -version 2>&1` in
39*TenDRA*)
40 AC_MSG_RESULT([yes, TenDRA])
41 IRC_CFLAGS=""
42 CPPFLAGS="$CPPFLAGS -Ylonglong -Yansi -I/usr/include"
43 SGS=yes
44 TenDRA=yes
45;;
46*MIPSpro*)
47 AC_MSG_RESULT([yes, MIPSpro])
48 MIPSpro=yes
49 SGS=yes
50;;
51*)
52 AC_MSG_RESULT(no)
53 TenDRA=no
54 MIPSpro=no
55;;
56esac
57
58AC_MSG_CHECKING([$CC -V for Sun Workshop, Forte, HPUX or Tru64 cc])
59case `$CC -V 2>&1` in
60*Sun*WorkShop* | *Forte*Developer*)
61 AC_MSG_RESULT(Sun Workshop/Forte)
62 IRC_CFLAGS="-fast -xinline=dlinkAdd,dlinkAddBefore,dlinkAddTail,dlinkDelete,dlink_list_length,dlink_node,dlinkMoveList,_MyMalloc,_MyRealloc,_MyFree,_DupString"
63 SunWorkShop=yes
64 SGS=yes
65;;
66*Tru64*)
67 AC_MSG_RESULT(Tru64 cc)
68 IRC_CFLAGS="-O2"
69 CPPFLAGS="-I/usr/local/include"
70 Tru=yes
71;;
72*HP*ANSI*)
73 AC_MSG_RESULT(HPUX cc)
74 HPUX=yes
75 IRC_CFLAGS="+e"
76;;
77*)
78 AC_MSG_RESULT(no)
79;;
80esac
81
82fi
83
84AC_MSG_CHECKING([uname -s for Cygwin, Solaris, AIX or HPUX])
85OSNAME=`uname -s`
86case "$OSNAME" in
87 HP-UX*)
88 dnl only do this if we haven't already detected the newer one
89 dnl and we're not already using gcc
90
91 if test "$HPUX" != yes -a "$ac_cv_c_compiler_gnu" = no; then
92 AC_MSG_RESULT(assuming old HPUX with its own cc)
93 IRC_CFLAGS="$IRC_CFLAGS +e"
94 HPUX=yes
95 else
96 AC_MSG_RESULT(already using newer HPUX)
97 fi
98 ;;
99 CYGWIN*)
100 AC_MSG_RESULT(Cygwin)
101 CYGWIN=yes
102 ;;
103 SunOS*)
104 AC_MSG_RESULT(SunOS or Solaris)
105 AC_DEFINE(__EXTENSIONS__, 1, [This is needed to use strtok_r on Solaris.])
106 SUN=yes
107 ;;
108 AIX*)
109 AC_MSG_RESULT(AIX - Sorry you poor bastard..really we are)
110 IRC_CFLAGS="$IRC_CFLAGS -Wl,-brtl -Wl,-G"
111 ;;
112 *)
113 AC_MSG_RESULT(no)
114 ;;
115esac
116
117if test "$ac_cv_c_compiler_gnu" = yes; then
118 AC_MSG_CHECKING(if $CC is Apple GCC)
119
120 case `$CC -v 2>&1 | tail -n 1` in
121 *Apple*)
122 AC_MSG_RESULT(yes)
123 AppleGCC=yes
124 ;;
125 *)
126 AC_MSG_RESULT(no)
127 AppleGCC=no
128 ;;
129 esac
130
35971c41 131 IRC_CFLAGS="$IRC_CFLAGS -O0 -Wall -std=gnu99"
212380e3 132fi
133
134dnl If we support -g, use it!
135if test "$ac_cv_prog_cc_g" = yes; then
136 dnl Tru64 needs -g3 for -O2
137 if test "$Tru" = yes; then
138 IRC_CFLAGS="$IRC_CFLAGS -g3"
139 else
140 IRC_CFLAGS="$IRC_CFLAGS -g"
141 fi
142fi
143
144dnl SVR4 SGS based on what we know about the compiler -jmallett
145AC_MSG_CHECKING(if $CC supports the SVR4 SGS interfaces)
146if test "$SGS" = "yes"; then
147 AC_MSG_RESULT(yes)
148else
149 AC_MSG_RESULT(no)
150fi
151
152dnl We prefer gcc -MM because it's a lot less bloated
153AC_PATH_PROG(MKDEP, mkdep)
154AC_PATH_PROG(MAKEDEPEND, makedepend)
155
156AC_MSG_CHECKING(how to generate dependency info)
157
158STDOUT="> .depend"
159
160if test "$ac_cv_c_compiler_gnu" = yes; then
161 AC_MSG_RESULT(gcc -MM)
162 MKDEP="$CC -MM"
163elif test ! -z "$MKDEP"; then
164 AC_MSG_RESULT(mkdep)
165
166 dnl Tru64's mkdep is very loud
167 if test -z "$Tru"; then
168 STDOUT=""
169 else
170 STDOUT=" 2> /dev/null"
171 fi
172elif test "$SunWorkShop" = yes; then
173 AC_MSG_RESULT($CC -xM)
174 MKDEP="$CC -xM"
175 STDOUT="> .depend 2> /dev/null"
176elif test ! -z "$MAKEDEPEND"; then
177 AC_MSG_RESULT(makedepend)
178 MKDEP="$MAKEDEPEND -f-"
179else
180 AC_MSG_RESULT([nothing suitable.. forget it!])
181 MKDEP=":"
182fi
183
184AC_SUBST(MKDEP)
185AC_SUBST(STDOUT)
186
187dnl check for /dev/null so we can use it to hold evil fd's
188AC_MSG_CHECKING([for /dev/null])
189if test -c /dev/null ; then
190 AC_DEFINE(PATH_DEVNULL, "/dev/null", [Path to /dev/null])
191 AC_MSG_RESULT(yes)
192else
193 AC_DEFINE(PATH_DEVNULL, "devnull.log", [Path to /dev/null])
194 AC_MSG_RESULT(no - using devnull.log)
195fi
196
197dnl jdc -- If CFLAGS is defined, best use it everywhere...
198dnl NOTE: jv says it must be added to the *END*, because things like
199dnl "gcc -O9 -O2" will result in -O2 getting preference. How stupid.
200if test ! -z "$CFLAGS"; then
201 IRC_CFLAGS="$IRC_CFLAGS $CFLAGS"
202fi
203
204AC_ISC_POSIX
205AC_C_INLINE
206AC_PROG_GCC_TRADITIONAL
207AC_PROG_MAKE_SET
208AC_PROG_INSTALL
209AC_PATH_PROG(RM, rm)
210AC_PATH_PROG(CP, cp)
211AC_PATH_PROG(MV, mv)
212AC_PATH_PROG(LN, ln)
213AC_PATH_PROG(SED, sed)
214AC_PATH_PROG(AR, ar)
215AC_PATH_PROG(LD, ld)
216AC_PATH_PROG(RANLIB, ranlib)
217AC_PATH_PROG(TOUCH, touch)
218
219AC_PROG_YACC
220
221dnl AC_PROG_YACC defaults to yacc unconditionally if nothing can be found
222if test "$YACC" = "yacc" -a -z "`which $YACC 2>/dev/null`"; then
223 AC_MSG_ERROR([could not locate a suitable parser generator; install bison, yacc, or byacc])
224fi
225
226AC_PROG_LEX
227
228if test "$LEX" = ":"; then
229 AC_MSG_ERROR([could not locate a suitable lexical generator, install flex or lex.])
230fi
231
232dnl use directory structure of cached as default (hack)
233if test "$libexecdir" = '${exec_prefix}/libexec' &&
234 test "$localstatedir" = '${prefix}/var'; then
235 libexecdir='${bindir}'
236 localstatedir='${prefix}'
237fi
238
239dnl Checks for header files.
240AC_HEADER_STDC
241
242AC_CHECK_HEADERS([crypt.h sys/resource.h sys/param.h errno.h sys/syslog.h stddef.h sys/wait.h wait.h sys/epoll.h sys/uio.h machine/endian.h])
243
244dnl Stuff that the memory manager (imalloc) depends on
245dnl ==================================================
246
247AC_C_CONST
248if test "$ac_cv_header_machine_endian_h" = "no" ; then
249 AC_C_BIGENDIAN
250fi
251AC_TYPE_PID_T
252AC_TYPE_SIZE_T
253AC_CHECK_SIZEOF(short)
254AC_CHECK_SIZEOF(int)
255AC_CHECK_SIZEOF(long)
256AC_CHECK_SIZEOF(long long)
257
212380e3 258dnl Networking Functions
259dnl ====================
260
261AC_SEARCH_LIBS(socket, socket, , [AC_MSG_ERROR([You have no socket()! Aborting.])])
262
263dnl SunOS/Solaris required libnsl for inet_ntoa()
264if test x"$SUN" = xyes; then
265 AC_SEARCH_LIBS(inet_ntoa, nsl,, [AC_MSG_ERROR([libnsl not found! Aborting.])])
266fi
267
212380e3 268AC_CHECK_TYPE(socklen_t, ,
269[AC_DEFINE([socklen_t], [unsigned int],
270[If we don't have a real socklen_t, unsigned int is good enough.])],
271[#include <sys/types.h>
272#include <sys/socket.h>])
273
274AC_ARG_ENABLE(ipv6,
275AC_HELP_STRING([--enable-ipv6],[Enable IPv6 support]),[ipv6=$enableval],[ipv6=no])
276
212380e3 277AC_SEARCH_LIBS(crypt, [crypt descrypt],,)
278
279CRYPT_LIB=$ac_cv_search_crypt
280
281if test "$CRYPT_LIB" = "none required"; then
282 unset CRYPT_LIB
283elif test "$CRYPT_LIB" = no; then
284 unset CRYPT_LIB
285fi
286
287AC_SUBST(CRYPT_LIB)
288
289if test "$ac_cv_header_sys_wait_h" = yes -o "$ac_cv_header_wait_h" = yes; then
290 VICONF=viconf
291 dnl We need one of the above to build viconf. Just a sanity check,
292 dnl we don't want to stop people from building the rest of ircd
293 dnl just because they can't build viconf.
294else
295 VICONF=""
296fi
297
298AC_SUBST(VICONF)
299
300dnl See whether we can include both string.h and strings.h.
301AC_CACHE_CHECK([whether string.h and strings.h may both be included],
302gcc_cv_header_string,
303[
304 AC_COMPILE_IFELSE(
305 [#include <string.h>
306 #include <strings.h>],
307 [gcc_cv_header_string=yes],
308 [gcc_cv_header_string=no])
309])
310
311if test "$gcc_cv_header_string" = "yes"; then
312 AC_DEFINE(STRING_WITH_STRINGS, 1, [Define to 1 if string.h may be included along with strings.h])
313fi
314
315AC_C_BIGENDIAN
316
317dnl Check for stdarg.h - if we can't find it, halt configure
318AC_CHECK_HEADER(stdarg.h, , [AC_MSG_ERROR([** stdarg.h could not be found - ircd-ratbox will not compile without it **])])
319
320dnl Checks for the existence of strlcat, strlcpy, basename...
321dnl This more reliable test only works with gcc though.
322
323if test "$ac_cv_c_compiler_gnu" = yes; then
324
325AC_MSG_CHECKING(for strlcpy)
326save_CFLAGS=$CFLAGS
327CFLAGS="$CFLAGS -Wimplicit -Werror"
328
329AC_LINK_IFELSE(
330 [AC_LANG_PROGRAM(
331 [[#include <string.h>
332 #include <stdlib.h>]],
333 [[char *a = malloc(6);
334 strlcpy(a, "hello", 6);]]
335 )],
336 [AC_MSG_RESULT(yes)
337 AC_DEFINE(HAVE_STRLCPY, 1, [Define if strlcpy is available (most BSDs.)])],
338 [AC_MSG_RESULT(no)]
339)
340
341AC_MSG_CHECKING(for strlcat)
342AC_LINK_IFELSE(
343 [AC_LANG_PROGRAM(
344 [[#include <string.h>
345 #include <stdlib.h>]],
346 [[char *a = malloc(6);
347 a[0] = '\0';
348 strlcat(a, "hello", 6);]]
349 )],
350 [AC_MSG_RESULT(yes)
351 AC_DEFINE(HAVE_STRLCAT, 1, [Define if strlcat is available (most BSDs.)])],
352 [AC_MSG_RESULT(no)]
353)
354
355CFLAGS=$save_CFLAGS
356
357else
358
359dnl Better than nothing. The more complicated test above probably fixes powerpc,
360dnl so who cares.
361
362AC_CHECK_FUNCS([strlcat strlcpy])
363
364fi
365
366AC_CHECK_TYPE([u_int32_t], [],
367[
368 AC_CHECK_TYPE([uint32_t],
369 [
370 AC_DEFINE(u_int32_t, [uint32_t], [If system does not define u_int32_t, define a reasonable substitute.])
371 ],
372 [
373 AC_MSG_WARN([system has no u_int32_t or uint32_t, default to unsigned long int])
374 AC_DEFINE(u_int32_t, [unsigned long int], [If system does not define u_int32_t, define to unsigned long int here.])
375 ])
376])
377
378AC_CHECK_TYPE([u_int16_t], [],
379[
380 AC_CHECK_TYPE([uint16_t],
381 [
382 AC_DEFINE(u_int16_t, [uint16_t], [If system does not define u_int16_t, define a usable substitute])
383 ],
384 [
385 AC_MSG_WARN([system has no u_int16_t or uint16_t, default to unsigned short int])
386 AC_DEFINE(u_int16_t, [unsigned short int], [If system does not define u_int16_t, define a usable substitute.])
387 ])
388])
389
390AC_CHECK_TYPE([in_port_t], [],
391[AC_DEFINE(in_port_t, [u_int16_t], [If system does not define in_port_t, define it to what it should be.])],
392[[#include <sys/types.h>
393#include <netinet/in.h>]])
394
395AC_CHECK_TYPE([sa_family_t], [],
396[AC_DEFINE(sa_family_t, [u_int16_t], [If system does not define sa_family_t, define it here.])],
397[[#include <sys/types.h>
398#include <sys/socket.h>]])
399
400AC_CHECK_TYPES([uintptr_t])
401
402dnl check for various functions...
403AC_CHECK_FUNCS([socketpair vsnprintf mmap gettimeofday strdup strndup ])
404
405AC_FUNC_ALLOCA
406
407dnl Specialized functions checks
408dnl ============================
409
410dnl check for nanosleep
411AC_CHECK_FUNC(nanosleep,,[AC_CHECK_LIB(rt,nanosleep,
412 LIBS="${LIBS} -lrt",
413 [AC_CHECK_LIB(posix4,nanosleep, LIBS="${LIBS} -lposix4"
414 )])])
415if test x$ac_cv_func_nanosleep = xno && test x$ac_cv_lib_posix4_nanosleep = xno && test x$ac_cv_lib_rt_nanosleep = xno
416then
417 AC_MSG_RESULT("nanosleep not found..using select for delay")
418else
419 AC_DEFINE([HAVE_NANOSLEEP], 1, [Define if nanosleep exists])
420fi
421
422dnl OpenSSL support
423AC_MSG_CHECKING(for OpenSSL)
424AC_ARG_ENABLE(openssl,
425[AC_HELP_STRING([--enable-openssl[=DIR]],[Enable OpenSSL support (DIR optional).])
426AC_HELP_STRING([--disable-openssl],[Disable OpenSSL support.])],
427[cf_enable_openssl=$enableval],
428[cf_enable_openssl="auto"])
429
430if test "$cf_enable_openssl" != "no" ; then
431 cf_openssl_basedir=""
432 if test "$cf_enable_openssl" != "auto" &&
433 test "$cf_enable_openssl" != "yes" ; then
434 dnl Support for --enable-openssl=/some/place
435 cf_openssl_basedir="`echo ${cf_enable_openssl} | sed 's/\/$//'`"
436 else
437 dnl Do the auto-probe here. Check some common directory paths.
438 for dirs in /usr/local/ssl /usr/pkg /usr/local \
439 /usr/local/openssl ; do
440 if test -f "${dirs}/include/openssl/opensslv.h" ; then
441 cf_openssl_basedir="${dirs}"
442 break
443 fi
444 done
445 unset dirs
446 fi
447 dnl Now check cf_openssl_found to see if we found anything.
448 if test ! -z "$cf_openssl_basedir"; then
449 if test -f "${cf_openssl_basedir}/include/openssl/opensslv.h" ; then
450 SSL_INCLUDES="-I${cf_openssl_basedir}/include"
451 SSL_LIBS="-L${cf_openssl_basedir}/lib"
452 else
453 dnl OpenSSL wasn't found in the directory specified. Naughty
454 dnl administrator...
455 cf_openssl_basedir=""
456 fi
457 else
458 dnl Check for stock FreeBSD 4.x and 5.x systems, since their files
459 dnl are in /usr/include and /usr/lib. In this case, we don't want to
460 dnl change INCLUDES or LIBS, but still want to enable OpenSSL.
461 dnl We can't do this check above, because some people want two versions
462 dnl of OpenSSL installed (stock FreeBSD 4.x/5.x and /usr/local/ssl)
463 dnl and they want /usr/local/ssl to have preference.
464 if test -f "/usr/include/openssl/opensslv.h" ; then
465 cf_openssl_basedir="/usr"
466 fi
467 fi
468
469 dnl If we have a basedir defined, then everything is okay. Otherwise,
470 dnl we have a problem.
471 if test ! -z "$cf_openssl_basedir"; then
472 AC_MSG_RESULT($cf_openssl_basedir)
473 cf_enable_openssl="yes"
474 else
475 AC_MSG_RESULT([not found. Specify a correct path?])
476 cf_enable_openssl="no"
477 fi
478 unset cf_openssl_basedir
479else
480 dnl If --disable-openssl was specified
481 AC_MSG_RESULT(disabled)
482fi
483
484save_CPPFLAGS="$CPPFLAGS"
485CPPFLAGS="$CPPFLAGS $SSL_INCLUDES"
486save_LIBS="$LIBS"
487LIBS="$LIBS $SSL_LIBS"
488if test "$cf_enable_openssl" != no; then
489 dnl Check OpenSSL version (must be 0.9.6 or above!)
490 AC_MSG_CHECKING(for OpenSSL 0.9.6 or above)
491 AC_RUN_IFELSE(
492 AC_LANG_PROGRAM(
493 [#include <openssl/opensslv.h>
494 #include <stdlib.h>],
495 [[if ( OPENSSL_VERSION_NUMBER >= 0x00906000)
496 exit(0); else exit(1);]]),
497 cf_openssl_version_ok=yes,
498 cf_openssl_version_ok=no,
499 cf_openssl_version_ok=no)
500
501 if test "$cf_openssl_version_ok" = yes; then
502 AC_MSG_RESULT(found)
503
504 dnl Work around pmake/gmake conditional incompatibilities
505 AC_SUBST(ENCSPEED, encspeed)
506
507 dnl Do all the HAVE_LIBCRYPTO magic -- and check for ciphers
508 CPPFLAGS="$CPPFLAGS $SSL_LIBS"
509 AC_CHECK_LIB(crypto, RSA_free)
510 SSL_LIBS="$SSL_LIBS -lcrypto"
511 SSL_SRCS_ENABLE='$(SSL_SRCS)'
512 else
513 AC_MSG_RESULT(no - OpenSSL support disabled)
514 fi
515fi
516
517CPPFLAGS="$save_CPPFLAGS"
518LIBS="$save_LIBS"
519
520dnl End OpenSSL detection
521
522
523dnl Specialized functions and libraries
524dnl ===================================
525
526AC_ARG_WITH(zlib-path,
527AC_HELP_STRING([--with-zlib-path=DIR],[Path to libz.so for ziplinks support.]),
528[LIBS="$LIBS -L$withval"],)
529
530AC_ARG_ENABLE(zlib,
531AC_HELP_STRING([--disable-zlib],[Disable ziplinks support]),
532[zlib=$enableval],[zlib=yes])
533
534if test "$zlib" = yes; then
535
536AC_CHECK_HEADER(zlib.h, [
537 AC_CHECK_LIB(z, zlibVersion,
538 [
539 AC_SUBST(ZLIB_LD, -lz)
540 AC_DEFINE(HAVE_LIBZ, 1, [Define to 1 if zlib (-lz) is available.])
541 ], zlib=no)
542], zlib=no)
543
544fi
545
546dnl IO Loop Selection
547dnl =================
548
1b4cfad8 549AC_ARG_ENABLE(ports, AC_HELP_STRING([--enable-ports],[Force solaris I/O ports subsystem usage.]),
550[ if test $enableval = yes; then
551 SELECT_TYPE_EXPLICIT="ports"
552 else
553 use_ports=no
554 fi
555],)
556
212380e3 557AC_ARG_ENABLE(poll, AC_HELP_STRING([--enable-poll],[Force poll() usage.]),
558[ if test $enableval = yes; then
559 SELECT_TYPE_EXPLICIT="poll"
560 else
561 use_poll=no
562 fi
563],)
564
565AC_ARG_ENABLE(select, AC_HELP_STRING([--enable-select],[Force select() usage.]),
566[ if test $enableval = yes; then
567 SELECT_TYPE_EXPLICIT="select"
568 else
569 use_select=no
570 fi
571],)
572
573AC_ARG_ENABLE(kqueue, AC_HELP_STRING([--enable-kqueue],[Force kqueue() usage.]),
574[ if test $enableval = yes; then
575 SELECT_TYPE_EXPLICIT="kqueue"
576 else
577 use_kqueue=no
578 fi
579],)
580
212380e3 581AC_ARG_ENABLE(epoll, AC_HELP_STRING([--enable-epoll],[Force sys_epoll usage (Linux only).]),
582[ if test $enableval = yes; then
583 SELECT_TYPE_EXPLICIT="epoll"
a34ec229 584 AC_CHECK_FUNCS(epoll_ctl, [haveepoll=yes], [haveepoll=no])
212380e3 585 else
586 use_epoll=no
587 fi
588],)
589
590dnl **********************************************************************
591dnl Check for --with-confdir
592dnl **********************************************************************
593
594AC_MSG_CHECKING([whether to modify confdir])
595AC_ARG_WITH(confdir,
596AC_HELP_STRING([--with-confdir=DIR],
597 [Directory to install config files.]),
598 [ confdir=`echo $withval | sed 's/\/$//'`
599 AC_MSG_RESULT(yes)
600 AC_DEFINE_DIR(ETC_DIR, confdir, [Prefix where config files are installed.])
601 AC_SUBST_DIR([confdir]) ],
602 [ confdir='${prefix}/etc'
603 AC_MSG_RESULT(no)
604 AC_DEFINE_DIR(ETC_DIR, confdir, [Prefix where config files are installed.])
605 AC_SUBST_DIR([confdir])]
606)
607
608dnl **********************************************************************
609dnl Check for --with-logdir
610dnl **********************************************************************
611
612AC_MSG_CHECKING([whether to modify logdir])
613AC_ARG_WITH(logdir,
614AC_HELP_STRING([--with-logdir=DIR],
615 [Directory where to write logfiles.]),
616 [ logdir=`echo $withval | sed 's/\/$//'`
617 AC_MSG_RESULT(yes)
618 AC_DEFINE_DIR(LOG_DIR, logdir, [Prefix where to write logfiles.])
619 AC_SUBST_DIR([logdir]) ],
620 [ logdir='${prefix}/logs'
621 AC_MSG_RESULT(no)
622 AC_DEFINE_DIR(LOG_DIR, logdir, [Prefix where to write logfiles.])
623 AC_SUBST_DIR([logdir])]
624)
625
626dnl **********************************************************************
627dnl Check for --with-helpdir
628dnl **********************************************************************
629
630AC_MSG_CHECKING([whether to modify helpdir])
631AC_ARG_WITH(helpdir,
632AC_HELP_STRING([--with-helpdir=DIR],
633 [Directory to install help files.]),
634 [ helpdir=`echo $withval | sed 's/\/$//'`
635 AC_MSG_RESULT(yes)
636 AC_DEFINE_DIR(HELP_DIR, helpdir, [Prefix where help files are installed.])
637 AC_SUBST_DIR([helpdir]) ],
638 [ helpdir='${prefix}/help'
639 AC_MSG_RESULT(no)
640 AC_DEFINE_DIR(HELP_DIR, helpdir, [Prefix where help file are installed.])
641 AC_SUBST_DIR([helpdir])]
642)
643
644dnl **********************************************************************
645dnl Check for --with-moduledir
646dnl **********************************************************************
647
648AC_MSG_CHECKING([whether to modify moduledir])
649AC_ARG_WITH(moduledir,
650AC_HELP_STRING([--with-moduledir=DIR],
651 [Directory to install modules.]),
652 [ moduledir=`echo $withval | sed 's/\/$//'`
653 AC_MSG_RESULT(yes)
654 AC_DEFINE_DIR(MODULE_DIR, moduledir, [Prefix where modules are installed.])
655 AC_SUBST_DIR([moduledir]) ],
656 [ moduledir='${prefix}/modules'
657 AC_MSG_RESULT(no)
658 AC_DEFINE_DIR(MODULE_DIR, moduledir, [Prefix where modules are installed.])
659 AC_SUBST_DIR([moduledir])]
660)
661
662if test ! -z "$SELECT_TYPE_EXPLICIT"; then
663 SELECT_TYPE="$SELECT_TYPE_EXPLICIT";
664 echo "Forcing $SELECT_TYPE to be enabled"
665else
666
1b4cfad8 667if test ! "x$use_ports" = "xno"; then
668 AC_CHECK_FUNCS(port_getn, [haveports=yes], [haveports=no])
669 if test "x$haveports" = "xyes" ; then
670 SELECT_TYPE="ports"
671 fi
672fi
673
212380e3 674if test ! "x$use_select" = "xno"; then
675 AC_CHECK_FUNCS(select, [haveselect=yes], [haveselect=no])
676 if test "x$haveselect" = "xyes" ; then
677 SELECT_TYPE="select"
678 fi
679fi
680
681if test ! "x$use_poll" = "xno"; then
682 AC_CHECK_FUNCS(poll, [havepoll=yes], [havepoll=no])
683 if test "x$havepoll" = "xyes" ; then
684 SELECT_TYPE="poll"
685 fi
686fi
687
212380e3 688if test ! "x$use_kqueue" = "xno"; then
689 AC_CHECK_FUNCS(kevent, [havekqueue=yes], [havekqueue=no])
690 if test "x$havekqueue" = "xyes" ; then
691 SELECT_TYPE="kqueue"
692 fi
693fi
694
695if test ! "x$use_epoll" = "xno"; then
696 AC_CHECK_FUNCS(epoll_ctl, [haveepoll=yes], [haveepoll=no])
697 if test "x$ac_cv_header_sys_epoll_h" = "xyes"; then
698 if test "x$haveepoll" = "xyes" ; then
699 AC_MSG_CHECKING(for epoll support in kernel)
700 AC_TRY_RUN(
701#include <stdint.h>
702#include <sys/param.h>
703#include <sys/types.h>
704#include <sys/epoll.h>
705#include <sys/syscall.h>
706#include <unistd.h>
707
708int
709main(int argc, char **argv)
710{
711 int epfd;
712
713 epfd = epoll_create(256);
33b310b3 714 return (epfd == -1 ? 1 : 0);
212380e3 715}, [AC_MSG_RESULT(yes)
716 AC_DEFINE(HAVE_EPOLL, 1,
717 [Define if your system supports the epoll system calls])
718 SELECT_TYPE="epoll"],
719 AC_MSG_RESULT(no), AC_MSG_RESULT(no))
720 fi
721 fi
722
723haveepollsyscall=no
724
725if test "x$ac_cv_header_sys_epoll_h" = "xyes"; then
726 if test "x$haveepoll" = "xno" ; then
727 AC_MSG_CHECKING(for epoll system call)
728 AC_TRY_RUN(
729#include <stdint.h>
730#include <sys/param.h>
731#include <sys/types.h>
732#include <sys/epoll.h>
733#include <sys/syscall.h>
734#include <unistd.h>
735
736int
737epoll_create(int size)
738{
739 return (syscall(__NR_epoll_create, size));
740}
741
742int
743main(int argc, char **argv)
744{
745 int epfd;
746
747 epfd = epoll_create(256);
748 exit (epfd == -1 ? 1 : 0);
749}, [AC_MSG_RESULT(yes)
750 AC_DEFINE(HAVE_EPOLL, 1,
751 [Define if your system supports the epoll system calls])
752 SELECT_TYPE="epoll"],
753 AC_MSG_RESULT(no), AC_MSG_RESULT(no))
754 fi
755fi
756
757fi
758
759fi
760
761if test -z "$SELECT_TYPE"; then
762 AC_MSG_ERROR([Unable to find a usable IO interface],)
763fi
764
765echo "Using $SELECT_TYPE for select loop."
766
767AC_DEFINE_UNQUOTED(SELECT_TYPE, "$SELECT_TYPE", [This is the type of IO loop we are using])
768AC_SUBST(SELECT_TYPE)
769
770
771dnl Debug-related options
772dnl =====================
773
774AC_ARG_ENABLE(assert,
775AC_HELP_STRING([--enable-assert],[Enable assert(). Choose between soft(warnings) and hard(aborts the daemon)]),
776[assert=$enableval], [assert=no])
777
778if test "$assert" = no; then
779 AC_DEFINE(NDEBUG, 1, [Define this to disable debugging support.])
780elif test "$assert" = soft; then
781 AC_DEFINE(SOFT_ASSERT, 1, [Define this to enable soft asserts.])
782 AC_DEFINE(NDEBUG, 1, [Define this to disable debugging support.])
783elif test "$assert" = yes; then
784 assert = "hard";
785fi
786
787AC_MSG_CHECKING(if you want IO Debugging hooks)
788AC_ARG_ENABLE(iodebug,
789AC_HELP_STRING([--enable-iodebug],[Enable IO Debugging hooks]),
790[iodebug=$enableval], [iodebug=no])
791
792if test "$iodebug" = yes; then
793 AC_DEFINE(USE_IODEBUG_HOOKS, 1, [Define this to enable IO Debug hooks.])
794 AC_MSG_RESULT(yes)
795else
796 AC_MSG_RESULT(no)
797fi
798
799
800AC_MSG_CHECKING(if you want to do a profile build)
801AC_ARG_ENABLE(profile,
802AC_HELP_STRING([--enable-profile],[Enable profiling]),
803[profile=$enableval], [profile=no])
804
805if test "$profile" = yes; then
806 if test "$ac_cv_c_compiler_gnu" = yes; then
807 IRC_CFLAGS="$IRC_CFLAGS -pg"
808 AC_MSG_RESULT([yes, adding -pg])
809 AC_DEFINE(CHARYBDIS_PROFILE, 1, [Define this if you are profiling.])
810 else
811 AC_MSG_RESULT([no, profile builds only work with gcc])
812 fi
813else
814 AC_MSG_RESULT(no)
815fi
816
817AC_ARG_ENABLE(balloc,
818AC_HELP_STRING([--disable-balloc],[Disable the block allocator.]),
819[balloc=$enableval], [balloc=yes])
820
821if test "$balloc" = no; then
822 AC_DEFINE([NOBALLOC], 1, [Define to 1 if you wish to disable the block allocator.])
823fi
824
212380e3 825AC_ARG_ENABLE(small-net,
826AC_HELP_STRING([--enable-small-net],[Enable small network support.]),
827[small_net=$enableval], [small_net=no])
828
829if test "$small_net" = yes; then
830dnl AC_DEFINE([HASHSIZE], 4096, [Max number of buckets in hash tables.])
831 AC_DEFINE([NICKNAMEHISTORYLENGTH], 1500, [Size of the WHOWAS array.])
832 AC_DEFINE([CHANNEL_HEAP_SIZE], 256, [Size of the channel heap.])
833 AC_DEFINE([BAN_HEAP_SIZE], 128, [Size of the ban heap.])
834 AC_DEFINE([CLIENT_HEAP_SIZE], 256, [Size of the client heap.])
835 AC_DEFINE([LCLIENT_HEAP_SIZE], 128, [Size of the local client heap.])
836 AC_DEFINE([PCLIENT_HEAP_SIZE], 32, [Size of the pre-client heap.])
837 AC_DEFINE([USER_HEAP_SIZE], 128, [Size of the user heap.])
838 AC_DEFINE([DNODE_HEAP_SIZE], 256, [Size of the dlink_node heap.])
839 AC_DEFINE([TOPIC_HEAP_SIZE], 256, [Size of the topic heap.])
840 AC_DEFINE([LINEBUF_HEAP_SIZE], 128, [Size of the linebuf heap.])
841 AC_DEFINE([MEMBER_HEAP_SIZE], 256, [Sizeof member heap.])
842 AC_DEFINE([ND_HEAP_SIZE], 128, [Size of the nick delay heap.])
843 AC_DEFINE([CONFITEM_HEAP_SIZE], 128, [Size of the confitem heap.])
844 AC_DEFINE([MONITOR_HEAP_SIZE], 128, [Size of the monitor heap.])
9a19c5ba 845 AC_DEFINE([FD_HEAP_SIZE], 128, [Size of fd heap.])
e5559a51 846 AC_DEFINE([AWAY_HEAP_SIZE], 128, [Size of away heap.])
212380e3 847else
848dnl These settings are for a large network like efnet..they will use lots of memory
849dnl so enable small net unless you really need this much support
850 AC_DEFINE([NICKNAMEHISTORYLENGTH], 15000, [Size of the WHOWAS array.])
851 AC_DEFINE([CHANNEL_HEAP_SIZE], 8192, [Size of the channel heap.])
852 AC_DEFINE([BAN_HEAP_SIZE], 4096, [Size of the ban heap.])
853 AC_DEFINE([CLIENT_HEAP_SIZE], 8192, [Size of the client heap.])
854 AC_DEFINE([LCLIENT_HEAP_SIZE], 1024, [Size of the local client heap.])
855 AC_DEFINE([PCLIENT_HEAP_SIZE], 256, [Size of the pre-client heap.])
856 AC_DEFINE([USER_HEAP_SIZE], 8192, [Size of the user heap.])
857 AC_DEFINE([DNODE_HEAP_SIZE], 8192, [Size of the dlink_node heap.])
858 AC_DEFINE([TOPIC_HEAP_SIZE], 4096, [Size of the topic heap.])
859 AC_DEFINE([LINEBUF_HEAP_SIZE], 2048, [Size of the linebuf heap.])
860 AC_DEFINE([MEMBER_HEAP_SIZE], 32768, [Sizeof member heap.])
861 AC_DEFINE([ND_HEAP_SIZE], 512, [Size of the nick delay heap.])
862 AC_DEFINE([CONFITEM_HEAP_SIZE], 256, [Size of the confitem heap.])
863 AC_DEFINE([MONITOR_HEAP_SIZE], 1024, [Size of the monitor heap.])
9a19c5ba 864 AC_DEFINE([FD_HEAP_SIZE], 1024, [Size of fd heap.])
e5559a51 865 AC_DEFINE([AWAY_HEAP_SIZE], 512, [Size of away heap.])
212380e3 866fi
867
868AC_ARG_WITH(nicklen,
869AC_HELP_STRING([--with-nicklen=LENGTH],[Set the nick length to LENGTH (default 15, max 50)]),
870[
871 if test $withval -ge 50; then
872 NICKLEN=50
873 AC_MSG_WARN([NICKLEN has a hard limit of 50. Setting NICKLEN=50])
874 else
875 NICKLEN="$withval"
876 fi
877], [NICKLEN=15])
878
879AC_ARG_WITH(topiclen,
880AC_HELP_STRING([--with-topiclen=NUMBER],[Set the max topic length to NUMBER (default 390, max 390)]),
881[
882 if test $withval -ge 390; then
883 TOPICLEN=390
884 AC_MSG_WARN([TOPICLEN has a hard limit of 390. Setting TOPICLEN=390])
885 else
886 TOPICLEN=$withval
887 fi
888], [TOPICLEN=390])
889
212380e3 890AC_DEFINE_UNQUOTED(TOPICLEN, ${TOPICLEN}, [Maximum topic length (<=390)])
891AC_DEFINE_UNQUOTED(NICKLEN, (${NICKLEN}+1), [Nickname length])
212380e3 892
f13494df 893shared_modules="yes"
212380e3 894dnl Some first-stage sanity checks.
895if test "$shared_modules" = yes; then
896
897 if test "$CYGWIN" = yes; then
898 AC_MSG_WARN([disabling shared modules; Cygwin is at present unable to build them.])
899 shared_modules="no"
900 fi
901
902 dnl TenDRA's cc is called tcc too.
903 if test "$CC" = tcc -a "$TenDRA" = "no"; then
904 AC_MSG_WARN([disabling shared modules: Tiny C Compiler can't create PIC])
905 shared_modules="no"
906 fi
907fi
908
909dnl Second stage: check for functions and headers.
910if test "$shared_modules" = yes; then
911 DYNLINK_C=dynlink.c
912 AC_CHECK_HEADERS(dlfcn.h)
913 AC_SEARCH_LIBS(shl_load, dld,
914 [
915 AC_DEFINE(HAVE_SHL_LOAD, 1, [Define if the shl_load function is available.])
916 SUFFIX=".sl"
917 MOD_TARGET=hpux_shared
918 SEDOBJ="s/\.o/.sl/g"
919 ],
920 dnl !shl_load:
921 [
922 dnl standard dlopen
923 AC_SEARCH_LIBS(dlopen, [dl c_r],
924 [
925 AC_DEFINE(HAVE_DLOPEN, 1, [Define if the dlopen function is available.])
926 SUFFIX=".so"
927 MOD_TARGET=shared_modules
928 SEDOBJ="s/\.o/.so/g"
929 if test "$AppleGCC" = yes; then
930 AC_CHECK_HEADERS([mach-o/dyld.h])
931 fi
932 AC_CHECK_FUNC(dlsym, ,
933 [
934 AC_MSG_WARN([dlsym is not available, shared modules disabled])
935 shared_modules=no
936 ])
937 AC_CHECK_FUNCS(dlfunc)
938 ],
939 [
940 shared_modules=no
941 ])
942 ])
943fi
944
945AC_DEFINE_UNQUOTED(SHARED_SUFFIX, "$SUFFIX", [Suffix for shared libraries on this platform.])
946
947dnl Third stage - wrangling the linker.
948if test "$shared_modules" = yes; then
949 # The GNU linker requires the -export-dynamic option to make
950 # all symbols visible in the dynamic symbol table.
951 hold_ldflags=$LDFLAGS
952 AC_MSG_CHECKING(for the ld -export-dynamic flag)
953 LDFLAGS="${LDFLAGS} -Wl,-export-dynamic -Werror"
954 AC_LINK_IFELSE(AC_LANG_PROGRAM([],[int i;]), found=yes, found=no)
955 LDFLAGS=$hold_ldflags
956
957 if expr "`uname -s`" : ^IRIX >/dev/null 2>&1; then
958 found="no, IRIX ld uses -B,dynamic"
959 LDFLAGS="${LDFLAGS} -Wl,-B,dynamic"
960 fi
961
962 if expr "`uname -s`" : ^AIX >/dev/null 2>&1; then
963 found="no, AIX ld uses -G -brtl"
964 LDFLAGS="${LDFLAGS} -Wl,-G,-brtl"
965 fi
966
967 AC_MSG_RESULT($found)
968
969 if test "$found" = yes; then
970 LDFLAGS="${LDFLAGS} -Wl,-export-dynamic"
971 fi
972
973 AC_MSG_CHECKING(for compiler option to produce PIC)
974 dnl The order should be here to check for groups of compilers,
975 dnl then for odd compilers, then if no PICFLAGS were set up,
976 dnl check for GCC and set defaults, or else error. -jmallett
977 if test "$SGS" = "yes"; then
978 AC_MSG_RESULT([SVR4 SGS interfaces: -KPIC -DPIC -G])
979 PICFLAGS="-KPIC -DPIC -G"
980 fi
981
982 if test "$AppleGCC" = "yes"; then
983 AC_MSG_RESULT([Darwin Mach-O bundles: -fno-common -bundle -flat_namespace -undefined suppress])
984 PICFLAGS="-fno-common -bundle -flat_namespace -undefined suppress"
985 fi
986 dnl Please note, that on HPUX two different stages of module compilation occurs, since
987 dnl while compiling modules, the compiler does not allow you to give arguments
988 dnl to the linker. (I did not design this)
989 dnl So we need -c in the first stage of module compilation.
990 dnl In the second stage, we link the modules via ld -b.
991 dnl Additionally, HPUX does not like -export-dynamic, it likes -E instead.
992 dnl -TimeMr14C
993 if test "$HPUX" = "yes" -a "$CC" != gcc; then
994 AC_MSG_RESULT(HP-UX cc: +z -r -q -n)
995 PICFLAGS="+z -r -q -n -c"
996 AC_MSG_CHECKING([if +ESfic is required on this platform])
997
998 if expr "`$CC +ESfic 2>&1`" : ".*neither supported.*" >/dev/null; then
999 AC_MSG_RESULT(no)
1000 else
1001 AC_MSG_RESULT(yes)
1002 PICFLAGS="$PICFLAGS +ESfic"
1003 fi
1004
1005 LDFLAGS="${LDFLAGS} -Wl,-E"
1006 fi
1007 if test "$Tru" = yes -a "$CC" != gcc; then
1008 AC_MSG_RESULT([Tru64: -shared -expect_unresolved '*'])
1009 PICFLAGS="-shared -expect_unresolved '*' "
1010 LDFLAGS="-call_shared"
1011 fi
1012 if test -z "$PICFLAGS"; then
1013 if test "$ac_cv_c_compiler_gnu" = "yes"; then
1014 AC_MSG_RESULT(gcc: -fPIC -DPIC -shared)
1015 PICFLAGS="-fPIC -DPIC -shared"
1016 else
1017 AC_MSG_RESULT(no)
1018 shared_modules=no
1019 fi
1020 fi
1021fi
1022
1023# This must be down here, or it will mess up checks like the ones
1024# for -Wl,-export-dynamic
1025# -- jilles
35971c41 1026CWARNS=""
212380e3 1027AC_ARG_ENABLE(warnings,
1028AC_HELP_STRING([--enable-warnings],[Enable all sorts of warnings for debugging.]),
1029[
1030IRC_CFLAGS="$IRC_CFLAGS -O0"
1031CFLAGS="$IRC_CFLAGS"
1032
1033CHARYBDIS_C_GCC_TRY_FLAGS([-Wall], charybdis_cv_c_gcc_w_all)
1034CHARYBDIS_C_GCC_TRY_FLAGS([-Wpointer-arith], charybdis_cv_c_gcc_w_pointer_arith)
1035CHARYBDIS_C_GCC_TRY_FLAGS([-Wimplicit -Wnested-externs], charybdis_cv_c_gcc_w_implicit)
1036CHARYBDIS_C_GCC_TRY_FLAGS([-Wcast-align], charybdis_cv_c_gcc_w_cast_align)
1037CHARYBDIS_C_GCC_TRY_FLAGS([-Wcast-qual], charybdis_cv_c_gcc_w_cast_qual)
35971c41 1038CHARYBDIS_C_GCC_TRY_FLAGS([-Wwrite-strings], charybdis_cv_c_gcc_w_float_equal)
212380e3 1039CHARYBDIS_C_GCC_TRY_FLAGS([-Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations], charybdis_cv_c_gcc_prototypes)
1040CHARYBDIS_C_GCC_TRY_FLAGS([-Wparenthesis], charybdis_cv_c_gcc_parenthesis)
1041CHARYBDIS_C_GCC_TRY_FLAGS([-W -Wno-unused], charybdis_cv_c_gcc_w)
1042CHARYBDIS_C_GCC_TRY_FLAGS([-Wextra], charybdis_cv_c_gcc_w_extra)
1043CHARYBDIS_C_GCC_TRY_FLAGS([-Wshadow], charybdis_cv_c_gcc_w_shadow)
1044CHARYBDIS_C_GCC_TRY_FLAGS([-Wmissing-noreturn], charybdis_cv_c_gcc_w_missing_noreturn)
1045CHARYBDIS_C_GCC_TRY_FLAGS([-Wundef], charybdis_cv_c_gcc_w_undef)
1046CHARYBDIS_C_GCC_TRY_FLAGS([-Wpacked], charybdis_cv_c_gcc_w_packed)
1047CHARYBDIS_C_GCC_TRY_FLAGS([-Wnested-externs], charybdis_cv_c_gcc_w_nested_externs)
1048CHARYBDIS_C_GCC_TRY_FLAGS([-Wbad-function-cast], charybdis_cv_c_gcc_w_bad_function_cast)
1049CHARYBDIS_C_GCC_TRY_FLAGS([-Wunused-function -Wunused-label -Wunused-value -Wunused-variable], charybdis_cv_c_gcc_w_unused)
1050CHARYBDIS_C_GCC_TRY_FLAGS([-Wredundant-decls], charybdis_cv_c_gcc_w_redundant_decls)
1051CHARYBDIS_C_GCC_TRY_FLAGS([-Wfloat-equal], charybdis_cv_c_gcc_w_float_equal)
35971c41 1052CHARYBDIS_C_GCC_TRY_FLAGS([-Wformat -Wformat-y2k -Wformat-security], charybdis_cv_c_gcc_w_format)
212380e3 1053CHARYBDIS_C_GCC_TRY_FLAGS([-pedantic], charybdis_cv_c_gcc_pedantic)
1054
1055IRC_CFLAGS="$CFLAGS"
1056],[])
1057
1058if test "$shared_modules" = no; then
1059 DYNLINK_C=""
1060 MOD_TARGET="libmodules.a"
1061 MODULES_LIBS="../modules/libmodules.a"
1062 SEDOBJ=""
1063 AC_DEFINE(STATIC_MODULES, 1, [Define to 1 if dynamic modules can't be used.])
1064 AC_MSG_WARN([shared module support has been disabled!])
1065fi
1066
1067dnl Stage 5 - underscores in front of symbol names.
1068if test "$shared_modules" = yes; then
1069
1070 AC_CHECK_FUNC(nlist,,
1071 AC_CHECK_LIB(dl, nlist, nlist_lib="-ldl",
1072 AC_CHECK_LIB(elf, nlist, nlist_lib="-lelf",)
1073 )
1074 )
1075
1076 dnl We need to find out whether underscores are appended to symbol
1077 dnl names in executable files. First, though, we need to see
1078 dnl where nlist.h is hiding.
1079 AC_CHECK_HEADER(libelf/nlist.h, [ nlist_h="libelf/nlist.h" ], )
1080 AC_CHECK_HEADER(elf/nlist.h, [ nlist_h="elf/nlist.h" ], )
1081 AC_CHECK_HEADER(nlist.h, [ nlist_h="nlist.h" ], )
1082 if test x"$nlist_h" = "x"; then
1083 AC_DEFINE_UNQUOTED(SYMBOL_PREFIX, "", [String containing extra underscores prepended to symbols loaded from modules.])
1084 else
1085 AC_MSG_CHECKING(for extra underscores prepended to symbol names)
1086 AC_CACHE_VAL(symbol_underscores,
1087 [
1088cat << EOF > conftest.c
1089#include <$nlist_h>
1090#include <stdio.h>
1091#include <stdlib.h>
1092void _modinit(void);
1093int main(int argc, char *argv[[]]) {
1094 int i;
1095 struct nlist nl[[5]];
1096
1097 /* fill the names in this way, so it'll work almost everywhere */
1098 nl[[0]].n_name = "_modinit";
1099 nl[[1]].n_name = "__modinit";
1100 nl[[2]].n_name = "___modinit";
1101 nl[[3]].n_name = "____modinit";
1102 nl[[0]].n_value = nl[[1]].n_value = nl[[2]].n_value = nl[[3]].n_value = nl[[4]].n_name = NULL;
1103
1104 if(argc < 2 || (nlist(argv[[1]], nl)) == -1) exit(-1);
1105 for(i = 0; i < 4; i++) {
1106 if(nl[[i]].n_value != NULL)
1107 {
1108 int j;
1109 for(j = 0; j < i; j++)
1110 printf("_");
1111 exit(i);
1112 }
1113 }
1114 exit(-1);
1115}
1116void _modinit(void) { return; }
1117EOF
1118 $CC $CPPFLAGS $IRC_CFLAGS -o conftest conftest.c $nlist_lib >/dev/null 2>&1
1119 symbol_underscores=`./conftest conftest`
1120 AC_MSG_RESULT($symbol_underscores)
1121 $RM -f conftest conftest.c
1122 ])
1123 AC_DEFINE_UNQUOTED(SYMBOL_PREFIX, "${symbol_underscores}", [String containing extra underscores prepended to symbols loaded from modules.])
1124 fi
1125fi
1126
35971c41
JT
1127IRC_CFLAGS="$IRC_CFLAGS $CWARNS"
1128
212380e3 1129AC_SUBST(MODULES_LIBS)
1130AC_SUBST(MOD_TARGET)
1131
1132AC_SUBST(SSL_SRCS_ENABLE)
1133AC_SUBST(SSL_INCLUDES)
1134AC_SUBST(SSL_LIBS)
1135
1136AC_SUBST(LDFLAGS)
1137AC_SUBST(PICFLAGS)
1138AC_SUBST(IRC_CFLAGS)
1139AC_SUBST(SEDOBJ)
1140
1141
1142if test "$prefix" = "NONE"; then
1143 AC_DEFINE_UNQUOTED(IRCD_PREFIX, "$ac_default_prefix", [Prefix where the ircd is installed.])
1144
1145else
1146
1147dnl Don't get bitten by Cygwin's stupidity if the user specified
1148dnl a custom prefix with a trailing slash
1149
1150 prefix=`echo $prefix | sed 's/\/$//'`
1151 AC_DEFINE_UNQUOTED(IRCD_PREFIX, "$prefix", [Prefix where the ircd is installed.])
1152
1153fi
1154
1155AC_CONFIG_FILES( \
1156 Makefile \
9b027314 1157 ssld/Makefile \
212380e3 1158 extensions/Makefile \
1159 unsupported/Makefile \
1160 src/Makefile \
1161 modules/Makefile \
1162 tools/Makefile \
1163 doc/Makefile \
1164 help/Makefile \
1165)
1166
1167AC_OUTPUT
1168
1169if test "$cf_openssl_version_ok" = yes; then
1170 openssl="yes"
1171else
1172 openssl="no"
1173fi
1174
1175if test "$shared_modules" = yes; then
1176 modules=shared
1177else
1178 modules=static
1179fi
1180
1181echo "
1182Configuration:
1183 Install directory : $prefix
1184
1185 Ziplinks : $zlib
1186 OpenSSL : $openssl
212380e3 1187 Socket Engine : $SELECT_TYPE
1188 Small network : $small_net
1189 Block allocator : $balloc
212380e3 1190
1191 Nickname length : $NICKLEN
1192 Topic length : $TOPICLEN
1193
f820576d 1194Use (g)make to compile Charybdis, then (g)make install to install it.
212380e3 1195"