ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/svn/ircd-hybrid-7.3/configure.ac
(Generate patch)

Comparing ircd-hybrid-7.2/configure.ac (file contents):
Revision 902 by michael, Sun Nov 4 14:00:06 2007 UTC vs.
Revision 908 by stu, Sun Nov 4 23:21:51 2007 UTC

# Line 1 | Line 1
1 < dnl $Id$
2 < dnl Process this file with autoconf to produce a configure script.
3 <
4 < dnl TODO: clean up all the OpenSSL and shared module checking stuff;
5 < dnl the most major changes have already been made and it looks like
6 < dnl said functions need to be just about as complex as they already are.
7 <
8 < AC_PREREQ(2.61)
9 <
10 < dnl Sneaky way to get an Id tag into the configure script
11 < AC_COPYRIGHT([$Id$])
1 > # Inspired by work Copyright (C) 2006 Luca Filipozzi
2 > # vim: set fdm=marker ts=2 sw=2 et:
3  
4 + AC_PREREQ(2.59)
5   AC_INIT([ircd-hybrid],[7.2.4])
6 + AM_INIT_AUTOMAKE([ircd-hybrid],[7.2.4])
7 + AC_CONFIG_HEADERS([include/setup.h])
8 + AM_MAINTAINER_MODE
9 +
10 + #ltdl stuff
11 + AC_LIBTOOL_DLOPEN
12 + AC_LIBLTDL_CONVENIENCE
13 + AC_SUBST(INCLTDL)
14 + AC_SUBST(LIBLTDL)
15  
16 < AC_CONFIG_HEADER(include/setup.h)
17 <
17 < AC_PREFIX_DEFAULT(/usr/local/ircd)
18 <
16 > # Checks for programs.
17 > AC_PROG_INSTALL
18   AC_GNU_SOURCE
20
21 OLD_CFLAGS="$CFLAGS"
22 dnl Checks for programs.
19   AC_PROG_CC
20 < AC_LANG(C)
21 <
22 < dnl Make sure autoconf doesn't interfere with cflags -jmallett
23 < CFLAGS="$OLD_CFLAGS"
24 <
25 < dnl Check for various compilers. -jmallett
26 < dnl But if $CC turns out to be gcc, sure as hell it's, well, gcc. -joshk
27 <
28 < if test "$ac_cv_c_compiler_gnu" != yes; then
29 <
30 < SGS=no
31 < AC_MSG_CHECKING($CC -version for TenDRA or MIPSpro)
32 < case `$CC -version 2>&1` in
33 < *TenDRA*)
38 <        AC_MSG_RESULT([yes, TenDRA])
39 <        IRC_CFLAGS=""
40 <        CPPFLAGS="$CPPFLAGS -Ylonglong -Yansi -Ysystem"
41 <        SGS=yes
42 <        TenDRA=yes
43 < ;;
44 < *MIPSpro*)
45 <        AC_MSG_RESULT([yes, MIPSpro])
46 <        MIPSpro=yes
47 <        SGS=yes
48 < ;;
49 < *)
50 <        AC_MSG_RESULT(no)
51 <        TenDRA=no
52 <        MIPSpro=no
53 < ;;
54 < esac
55 <
56 < AC_MSG_CHECKING([$CC -V for Sun Workshop, Forte, HPUX or Tru64 cc])
57 < case `$CC -V 2>&1` in
58 < *Sun*WorkShop* | *Forte*Developer* | *Sun*C*)
59 <        AC_MSG_RESULT(Sun Workshop/Forte)
60 <        IRC_CFLAGS="-xO3 -xdepend -xinline=dlinkAdd,dlinkAddBefore,dlinkAddTail,dlinkDelete,dlink_list_length,dlink_node,dlinkMoveList,_MyMalloc,_MyRealloc,_MyFree,_DupString"
61 <        SunWorkShop=yes
62 <        SGS=yes
63 < ;;
64 < *Tru64*)
65 <        AC_MSG_RESULT(Tru64 cc)
66 <        IRC_CFLAGS=""
67 <        CPPFLAGS="-I/usr/local/include"
68 <        Tru=yes
69 < ;;
70 < *HP*ANSI*)
71 <        AC_MSG_RESULT(HPUX cc)
72 <        HPUX=yes
73 <        IRC_CFLAGS="+e"
74 < ;;
75 < *)
76 <        AC_MSG_RESULT(no)
77 < ;;
78 < esac
79 <
80 < fi
81 <
82 < AC_MSG_CHECKING([uname -s for Cygwin, Solaris or HPUX])
83 < case `uname -s` in
84 <        HP-UX*)
85 <        dnl only do this if we haven't already detected the newer one
86 <        dnl and we're not already using gcc
87 <        
88 <                if test "$HPUX" != yes -a "$ac_cv_c_compiler_gnu" = no; then
89 <                        AC_MSG_RESULT(assuming old HPUX with its own cc)  
90 <                        IRC_CFLAGS="$IRC_CFLAGS +e"
91 <                        HPUX=yes
92 <                else
93 <                        AC_MSG_RESULT(already using newer HPUX)
94 <                fi
95 <        ;;
96 <        CYGWIN*)
97 <                AC_MSG_RESULT(Cygwin)
98 <                CYGWIN=yes
99 <        ;;
100 <        SunOS*)
101 <                AC_MSG_RESULT(SunOS or Solaris)
102 <                AC_DEFINE(__EXTENSIONS__, 1, [This is needed to use strtok_r on Solaris.])
103 <        ;;
104 <        *)
105 <                AC_MSG_RESULT(no)
106 <        ;;
107 < esac
108 <
109 < if test "$ac_cv_c_compiler_gnu" = yes; then
110 <        AC_MSG_CHECKING(if $CC is Apple GCC)
111 <        
112 <        if expr "`$CC -v 2>&1 | tail -1`" : ".*Apple" >/dev/null; then
113 <                AppleGCC=yes
114 <        else
115 <                AppleGCC=no
116 <        fi
117 <
118 <        AC_MSG_RESULT($AppleGCC)
119 <
120 <        IRC_CFLAGS="$IRC_CFLAGS -Wall -O2"
121 < fi
122 <
123 < dnl If we support -g, use it!
124 < if test "$ac_cv_prog_cc_g" = yes; then
125 <        dnl Tru64 needs -g3 for -O2
126 <        if test "$Tru" = yes; then
127 <                IRC_CFLAGS="$IRC_CFLAGS -g3"
128 <        else
129 <                IRC_CFLAGS="$IRC_CFLAGS -g"
130 <        fi
131 < fi
132 <
133 < dnl SVR4 SGS based on what we know about the compiler -jmallett
134 < AC_MSG_CHECKING(if $CC supports the SVR4 SGS interfaces)
135 < if test "$SGS" = "yes"; then
136 <        AC_MSG_RESULT(yes)
137 < else
138 <        AC_MSG_RESULT(no)
139 < fi
140 <
141 < dnl We prefer gcc -MM because it's a lot less bloated
142 < AC_PATH_PROG(MKDEP, mkdep)
143 < AC_PATH_PROG(MAKEDEPEND, makedepend)
144 <
145 < AC_MSG_CHECKING(how to generate dependency info)
146 <
147 < STDOUT="> .depend"
20 > AC_PROG_RANLIB
21 > AC_PROG_LIBTOOL
22 > LIBTOOL="$LIBTOOL --silent"
23 > AM_PROG_LEX
24 > AC_PROG_YACC
25 > AC_PROG_AWK
26 > AC_PROG_EGREP
27 > AC_PATH_PROG([TAIL],[tail])
28 >
29 > # Checks for libraries.
30 > AX_CHECK_LIB_OPENSSL
31 > AX_CHECK_LIB_IPV4
32 > AX_CHECK_LIB_IPV6
33 > AX_CHECK_LIB_CRYPT
34  
35 < if test "$ac_cv_c_compiler_gnu" = yes; then
36 <        AC_MSG_RESULT(gcc -MM)
151 <        MKDEP="$CC -MM"
152 < elif test ! -z "$MKDEP"; then
153 <        AC_MSG_RESULT(mkdep)
35 > # Checks for header files.
36 > AC_CHECK_HEADERS([sys/resource.h]) # ick
37  
38 <        dnl Tru64's mkdep is very loud
39 <        if test -z "$Tru"; then
157 <                STDOUT=""
158 <        else
159 <                STDOUT=" 2> /dev/null"
160 <        fi
161 < elif test "$SunWorkShop" = yes; then
162 <        AC_MSG_RESULT($CC -xM)
163 <        MKDEP="$CC -xM"
164 <        STDOUT="> .depend 2> /dev/null"
165 < elif test ! -z "$MAKEDEPEND"; then
166 <        AC_MSG_RESULT(makedepend)
167 <        MKDEP="$MAKEDEPEND -f-"
168 < else
169 <        AC_MSG_RESULT([nothing suitable.. forget it!])
170 <        MKDEP=":"
171 < fi
172 <
173 < AC_SUBST(MKDEP)
174 < AC_SUBST(STDOUT)
175 <
176 < dnl check for /dev/null so we can use it to hold evil fd's
177 < AC_MSG_CHECKING([for /dev/null])
178 < if test -c /dev/null ; then
179 <        AC_DEFINE(PATH_DEVNULL, "/dev/null", [Path to /dev/null])
180 <        AC_MSG_RESULT(yes)
181 < else
182 <        AC_DEFINE(PATH_DEVNULL, "devnull.log", [Path to /dev/null])
183 <        AC_MSG_RESULT(no - using devnull.log)
184 < fi
185 <
186 < dnl jdc -- If CFLAGS is defined, best use it everywhere...
187 < dnl NOTE: jv says it must be added to the *END*, because things like
188 < dnl "gcc -O9 -O2" will result in -O2 getting preference.  How stupid.
189 < if test ! -z "$CFLAGS"; then
190 <        IRC_CFLAGS="$IRC_CFLAGS $CFLAGS"
191 < fi
192 <
193 < AC_ISC_POSIX
38 > # Checks for typedefs, structures, and compiler characteristics.
39 > AC_C_CONST
40   AC_C_INLINE
41 < AC_PROG_GCC_TRADITIONAL
196 < AC_PROG_MAKE_SET
197 < AC_PROG_INSTALL
198 < AC_PATH_PROG(RM, rm)
199 < AC_PATH_PROG(CP, cp)
200 < AC_PATH_PROG(MV, mv)
201 < AC_PATH_PROG(LN, ln)
202 < AC_PATH_PROG(SED, sed)
203 < AC_PATH_PROG(AR, ar)
204 < AC_PATH_PROG(LD, ld)
205 < AC_PATH_PROG(TEST, [test], [test])
206 <
207 < dnl use directory structure of cached as default (hack)
208 < if test "$libexecdir" = '${exec_prefix}/libexec' &&
209 <   test "$localstatedir" = '${prefix}/var'; then
210 <        libexecdir='${bindir}'
211 <        localstatedir='${prefix}'
212 < fi
213 <
214 < dnl Checks for header files.
215 < AC_HEADER_STDC
216 <
217 < AC_CHECK_HEADERS([crypt.h inttypes.h stdint.h sys/resource.h sys/param.h errno.h sys/syslog.h stddef.h libgen.h sys/wait.h wait.h link.h])
218 <
219 < dnl Networking Functions
220 < dnl ====================
221 <
222 < AC_SEARCH_LIBS(socket, socket, , [AC_MSG_ERROR([You have no socket()! Aborting.])])
223 <
224 < dnl Don't use them if they're available natively... else, they're available in inet_misc
225 < AC_SEARCH_LIBS(inet_aton, resolv, , [inet_misc=1; AC_DEFINE(NO_INET_ATON, 1, [Define if you have no native inet_aton() function.])])
226 < AC_SEARCH_LIBS(inet_pton, resolv nsl, , [inet_misc=1; AC_DEFINE(NO_INET_PTON, 1, [Define if you have no native inet_pton() function.])])
227 < AC_SEARCH_LIBS(inet_ntop, resolv nsl, , [inet_misc=1; AC_DEFINE(NO_INET_NTOP, 1, [Define if you have no native inet_ntop() function.])])
228 <
229 < if test "$inet_misc" = 1; then
230 <        AC_SUBST(INET_MISC, inet_misc.c)
231 < fi
232 <
233 < AC_CHECK_TYPES([struct sockaddr_storage], , ,
234 < [[#include <sys/types.h>
235 < #include <sys/socket.h>
236 < ]])
237 <
238 < if test "$ac_cv_type_struct_sockaddr_storage" = no; then
239 <        AC_CHECK_MEMBER([struct sockaddr_in.sin_len],
240 <        [AC_DEFINE(SOCKADDR_IN_HAS_LEN, 1, [Define to 1 if sockaddr_in has a 'sin_len' member.])])
241 < fi
242 <
243 < AC_CHECK_TYPES([struct addrinfo], , , [[#include <netdb.h>]])
244 <
245 < AC_CHECK_TYPE(socklen_t, ,
246 < [AC_DEFINE([socklen_t], [unsigned int],
247 < [If we don't have a real socklen_t, unsigned int is good enough.])],
248 < [#include <sys/types.h>
249 < #include <sys/socket.h>])
250 <
251 < dnl Tru64 accepts *both*
252 < if test -z "$Tru"; then
253 <
254 < AC_MSG_CHECKING(for broken glibc with __ss_family)
255 < AC_COMPILE_IFELSE(
256 < [AC_LANG_PROGRAM(
257 < [#include <sys/types.h>
258 < #include <sys/socket.h>],
259 < [struct sockaddr_storage s; s.__ss_family = AF_INET;])],
260 < [
261 <        AC_MSG_RESULT(yes)
262 <        AC_DEFINE(ss_family, __ss_family, [Broken glibc implementations use __ss_family instead of ss_family. Define to __ss_family if true.])
263 < ],
264 < [AC_MSG_RESULT(no)])
265 <
266 < fi
267 <
268 < AC_MSG_CHECKING([for core IPv6 support])
269 <
270 < AC_COMPILE_IFELSE(
271 < [AC_LANG_PROGRAM(
272 <        [[#define IN_AUTOCONF
273 <        #include "include/stdinc.h"]],
274 <        [[struct sockaddr_in6 s;
275 <          struct sockaddr_storage t;
276 <          s.sin6_family = 0;]]
277 <        )],
278 < [
279 <        if test "$CYGWIN" = "yes"; then
280 <                AC_MSG_RESULT([no, Cygwin's IPv6 is incomplete])
281 <                have_v6=no
282 <        else
283 <                have_v6=yes
284 <                AC_DEFINE(IPV6, 1, [Define if IPv6 support is present and available.])
285 <                AC_MSG_RESULT(yes)
286 <                AC_MSG_CHECKING([for struct in6addr_any])
287 <                AC_COMPILE_IFELSE(
288 <                        [AC_LANG_PROGRAM(
289 <                                [[#define IN_AUTOCONF
290 <                                #include "include/stdinc.h"]],
291 <                                [[struct in6_addr a = in6addr_any;]]
292 <                        )],
293 <                        [AC_MSG_RESULT(yes)],
294 <                        [
295 <                                AC_MSG_RESULT(no)
296 <                                AC_DEFINE(NO_IN6ADDR_ANY, 1, [Define to 1 if your system has no in6addr_any.])
297 <                                inet_misc=1
298 <                        ]
299 <                )
300 <        fi
301 < ],
302 < [AC_MSG_RESULT(no)
303 < have_v6="no"])
304 <
305 < AC_SEARCH_LIBS(crypt, [crypt descrypt],,)
306 <
307 < CRYPT_LIB=$ac_cv_search_crypt
308 <
309 < if test "$CRYPT_LIB" = "none required"; then
310 <        unset CRYPT_LIB
311 < elif test "$CRYPT_LIB" = no; then
312 <        CRYPT_C=crypt.c
313 <        unset CRYPT_LIB
314 < fi
315 <
316 < AC_SUBST(CRYPT_C)
317 < AC_SUBST(CRYPT_LIB)
318 <
319 < dnl See whether we can include both string.h and strings.h.
320 < AC_CACHE_CHECK([whether string.h and strings.h may both be included],
321 < gcc_cv_header_string,
322 < [
323 <        AC_COMPILE_IFELSE(
324 <        [#include <string.h>
325 <        #include <strings.h>],
326 <        [gcc_cv_header_string=yes],
327 <        [gcc_cv_header_string=no])
328 < ])
329 <
330 < if test "$gcc_cv_header_string" = "yes"; then
331 <        AC_DEFINE(STRING_WITH_STRINGS, 1, [Define to 1 if string.h may be included along with strings.h])
332 < fi
333 <
41 > AC_C_VOLATILE
42   AC_C_BIGENDIAN
43  
44 < dnl Check for stdarg.h - if we can't find it, halt configure
45 < AC_CHECK_HEADER(stdarg.h, , [AC_MSG_ERROR([** stdarg.h could not be found - ircd-hybrid will not compile without it **])])
46 <
47 < dnl Checks for the existence of strlcat, strlcpy, basename...
48 < dnl This more reliable test only works with gcc though.
49 <
50 < if test "$ac_cv_c_compiler_gnu" = yes; then
51 <
52 < AC_MSG_CHECKING(for strlcpy)
53 < save_CFLAGS=$CFLAGS
54 < CFLAGS="$CFLAGS -Wimplicit -Werror"
55 <
56 < AC_LINK_IFELSE(
57 <        [AC_LANG_PROGRAM(
58 <                [[#include <string.h>
59 <                #include <stdlib.h>]],
60 <                [[char *a = malloc(6), *b = strdup("hello");
61 <                strlcpy(a, b, 6);]]
62 <        )],
63 <        [AC_MSG_RESULT(yes)
64 <        AC_DEFINE(HAVE_STRLCPY, 1, [Define if strlcpy is available (most BSDs.)])],
65 <        [AC_MSG_RESULT(no)]
66 < )
67 <
68 < AC_MSG_CHECKING(for strlcat)
69 < AC_LINK_IFELSE(
70 <        [AC_LANG_PROGRAM(
71 <                [[#include <string.h>
72 <                #include <stdlib.h>]],
73 <                [[char *a = malloc(6), *b = strdup("hello");
74 <                strlcat(a, b, 6);]]
75 <        )],
76 <        [AC_MSG_RESULT(yes)
77 <        AC_DEFINE(HAVE_STRLCAT, 1, [Define if strlcat is available (most BSDs.)])],
78 <        [AC_MSG_RESULT(no)]
79 < )
80 <
81 < CFLAGS=$save_CFLAGS
82 <
83 < else
84 <
85 < dnl Better than nothing. The more complicated test above probably fixes powerpc,
86 < dnl so who cares.
87 <
88 < AC_CHECK_FUNCS([strlcat strlcpy])
89 <
90 < fi
91 <
92 < AC_CHECK_SIZEOF(int64_t)
93 < AC_CHECK_SIZEOF(long long)
94 <
95 < if test "$ac_cv_sizeof_int64_t" = 8; then
96 <  AC_CHECK_TYPE(uint64_t)
97 <  AC_CHECK_TYPE(int64_t)
98 < elif test "$ac_cv_sizeof_long_long" = 8; then
99 <  AC_CHECK_TYPE(uint64_t, unsigned long long)
100 <  AC_CHECK_TYPE(int64_t, long long)
101 < else
102 <  AC_MSG_ERROR([Your system doesn't appear to have 64 bit integers.  Aborting.])
103 < fi
104 <
105 < AC_CHECK_TYPE([u_int32_t], [],
106 < [
107 <        AC_CHECK_TYPE([uint32_t],
108 <        [
401 <                AC_DEFINE(u_int32_t, [uint32_t], [If system does not define u_int32_t, define a reasonable substitute.])
402 <        ],
403 <        [
404 <                AC_MSG_WARN([system has no u_int32_t or uint32_t, default to unsigned long int])
405 <                AC_DEFINE(u_int32_t, [unsigned long int], [If system does not define u_int32_t, define to unsigned long int here.])
406 <        ])
407 < ])
408 <
409 < AC_CHECK_TYPE([u_int16_t], [],
410 < [
411 <        AC_CHECK_TYPE([uint16_t],
412 <        [
413 <                AC_DEFINE(u_int16_t, [uint16_t], [If system does not define u_int16_t, define a usable substitute])
414 <        ],
415 <        [
416 <                AC_MSG_WARN([system has no u_int16_t or uint16_t, default to unsigned short int])
417 <                AC_DEFINE(u_int16_t, [unsigned short int], [If system does not define u_int16_t, define a usable substitute.])
418 <        ])
419 < ])
420 <
421 < AC_CHECK_TYPE([in_port_t], [],
422 < [AC_DEFINE(in_port_t, [u_int16_t], [If system does not define in_port_t, define it to what it should be.])],
423 < [[#include <sys/types.h>
424 < #include <netinet/in.h>]])
425 <
426 < AC_CHECK_TYPE([sa_family_t], [],
427 < [AC_DEFINE(sa_family_t, [u_int16_t], [If system does not define sa_family_t, define it here.])],
428 < [[#include <sys/types.h>
429 < #include <sys/socket.h>]])
430 <
431 < dnl check for various functions...
432 < AC_CHECK_FUNCS([socketpair basename mmap snprintf vsnprintf lrand48 srand48 strtok_r usleep])
433 <
434 < if test "$ac_cv_func_snprintf" = no -o "$ac_cv_func_vsnprintf" = no; then
435 <        SNPRINTF_C="snprintf.c"
436 < fi
437 <
438 < AC_SUBST(SNPRINTF_C)
439 <
440 < dnl Specialized functions checks
441 < dnl ============================
442 <
443 < dnl OpenSSL support
444 < AC_MSG_CHECKING(for OpenSSL)
445 < AC_ARG_ENABLE(openssl,
446 < [AC_HELP_STRING([--enable-openssl[=DIR]],[Enable OpenSSL support (DIR optional).])
447 < AC_HELP_STRING([--disable-openssl],[Disable OpenSSL support.])],
448 < [cf_enable_openssl=$enableval],
449 < [cf_enable_openssl="auto"])
450 <
451 < if test "$cf_enable_openssl" != "no" ; then
452 <        cf_openssl_basedir=""
453 <        if test "$cf_enable_openssl" != "auto" &&
454 <        test "$cf_enable_openssl" != "yes" ; then
455 <                dnl Support for --enable-openssl=/some/place
456 <                cf_openssl_basedir="`echo ${cf_enable_openssl} | sed 's/\/$//'`"
457 <        else
458 <        dnl Do the auto-probe here.  Check some common directory paths.
459 <                for dirs in /usr/local/ssl /usr/pkg /usr/local \
460 <                /usr/local/openssl /usr/sfw; do
461 <                        if test -f "${dirs}/include/openssl/opensslv.h" ; then
462 <                                cf_openssl_basedir="${dirs}"
463 <                        break
464 <                        fi
465 <                done
466 <                unset dirs
467 <        fi
468 <        dnl Now check cf_openssl_found to see if we found anything.
469 <        if test ! -z "$cf_openssl_basedir"; then
470 <                if test -f "${cf_openssl_basedir}/include/openssl/opensslv.h" ; then
471 <                        SSL_INCLUDES="-I${cf_openssl_basedir}/include"
472 <                        SSL_LIBS="-L${cf_openssl_basedir}/lib"
473 <                else
474 <                dnl OpenSSL wasn't found in the directory specified.  Naughty
475 <                dnl administrator...
476 <                cf_openssl_basedir=""
477 <                fi
478 <        else
479 <        dnl Check for stock FreeBSD 4.x and 5.x systems, since their files
480 <        dnl are in /usr/include and /usr/lib.  In this case, we don't want to
481 <        dnl change INCLUDES or LIBS, but still want to enable OpenSSL.
482 <        dnl We can't do this check above, because some people want two versions
483 <        dnl of OpenSSL installed (stock FreeBSD 4.x/5.x and /usr/local/ssl)
484 <        dnl and they want /usr/local/ssl to have preference.
485 <                if test -f "/usr/include/openssl/opensslv.h" ; then
486 <                        cf_openssl_basedir="/usr"
487 <                fi
488 <        fi
489 <
490 <        dnl If we have a basedir defined, then everything is okay.  Otherwise,
491 <        dnl we have a problem.
492 <        if test ! -z "$cf_openssl_basedir"; then
493 <                AC_MSG_RESULT($cf_openssl_basedir)
494 <                cf_enable_openssl="yes"
495 <        else
496 <                AC_MSG_RESULT([not found. Specify a correct path?])
497 <                cf_enable_openssl="no"
498 <        fi
499 <        unset cf_openssl_basedir
500 < else
501 <        dnl If --disable-openssl was specified
502 <        AC_MSG_RESULT(disabled)
503 < fi
504 <
505 < save_CPPFLAGS="$CPPFLAGS"
506 < CPPFLAGS="$CPPFLAGS $SSL_INCLUDES"
507 < save_LIBS="$LIBS"
508 < LIBS="$LIBS $SSL_LIBS"
509 < if test "$cf_enable_openssl" != no; then
510 <        dnl Check OpenSSL version (must be 0.9.6 or above!)
511 <        AC_MSG_CHECKING(for OpenSSL 0.9.6 or above)
512 <        AC_RUN_IFELSE(
513 <                AC_LANG_PROGRAM(
514 <                [#include <openssl/opensslv.h>
515 <                #include <stdlib.h>],
516 <                [[if (OPENSSL_VERSION_NUMBER >= 0x00906000)
517 <                exit(0); else exit(1);]]),
518 <        cf_openssl_version_ok=yes,
519 <        cf_openssl_version_ok=no,
520 <        cf_openssl_version_ok=no)
521 <
522 <        if test "$cf_openssl_version_ok" = yes; then
523 <                AC_MSG_RESULT(found)
524 <
525 <                dnl Work around pmake/gmake conditional incompatibilities
526 <                AC_SUBST(ENCSPEED, encspeed)
527 <                
528 <                dnl Do all the HAVE_LIBCRYPTO magic -- and check for ciphers
529 <                CPPFLAGS="$CPPFLAGS $SSL_LIBS"
530 <                AC_CHECK_LIB(crypto, RSA_free)
531 <                if test "$ac_cv_lib_crypto_RSA_free" = yes; then
532 <                        LIBS="$LIBS -lcrypto"
533 <                        cf_openssl_ciphers=''
534 <                        AC_CHECK_FUNCS(EVP_bf_cfb,
535 <                        cf_openssl_ciphers="${cf_openssl_ciphers}BF/168 BF/128 ")
536 <                        AC_CHECK_FUNCS(EVP_cast5_cfb,
537 <                        cf_openssl_ciphers="${cf_openssl_ciphers}CAST/128 ")
538 <                        AC_CHECK_FUNCS(EVP_idea_cfb,
539 <                        cf_openssl_ciphers="${cf_openssl_ciphers}IDEA/128 ")
540 <                        AC_CHECK_FUNCS(EVP_rc5_32_12_16_cfb,
541 <                        cf_openssl_ciphers="${cf_openssl_ciphers}RC5.16/128 RC5.12/128 RC5.8/128 ")
542 <                        AC_CHECK_FUNCS(EVP_des_ede3_cfb,
543 <                        cf_openssl_ciphers="${cf_openssl_ciphers}3DES/168 ")
544 <                        AC_CHECK_FUNCS(EVP_des_cfb,
545 <                        cf_openssl_ciphers="${cf_openssl_ciphers}DES/56 ")
546 <                fi
547 <                SSL_LIBS="$SSL_LIBS -lssl -lcrypto"
548 <                SSL_SRCS_ENABLE='$(SSL_SRCS)'
549 <        else
550 <                AC_MSG_RESULT(no - OpenSSL support disabled)
551 <        fi
552 < fi
553 <
554 < CPPFLAGS="$save_CPPFLAGS"
555 < LIBS="$save_LIBS"
556 <
557 < dnl End OpenSSL detection
558 <
559 < dnl Specialized functions and libraries
560 < dnl ===================================
561 <
562 < AC_ARG_WITH(zlib-path,
563 < AC_HELP_STRING([--with-zlib-path=DIR],[Path to libz.so for ziplinks support.]),
564 < [LIBS="$LIBS -L$withval"],)
565 <
566 < AC_ARG_ENABLE(zlib,
567 < AC_HELP_STRING([--disable-zlib],[Disable ziplinks support]),
568 < [zlib=$enableval],[zlib=yes])
569 <
570 < if test "$zlib" = yes; then
571 <
572 < AC_CHECK_HEADER(zlib.h, [
573 <        AC_CHECK_LIB(z, zlibVersion,
574 <        [
575 <                AC_SUBST(ZLIB_LD, -lz)
576 <                AC_DEFINE(HAVE_LIBZ, 1, [Define to 1 if zlib (-lz) is available.])
577 <        ], zlib=no)
578 < ], zlib=no)
579 <
580 < fi
581 <
582 < dnl IO Loop Selection
583 < dnl =================
584 <
585 < AC_ARG_ENABLE(poll,
586 < AC_HELP_STRING([--enable-poll],[Force poll() usage.]),
587 < [SELECT_TYPE_EXPLICIT="poll"; echo "Forcing poll() to be enabled"],)
588 <
589 < AC_ARG_ENABLE(select,
590 < AC_HELP_STRING([--enable-select],[Force select() usage.]),
591 < [SELECT_TYPE_EXPLICIT="select"; echo "Forcing select() to be enabled"],)
592 <    
593 < AC_ARG_ENABLE(kqueue,
594 < AC_HELP_STRING([--enable-kqueue],[Force kqueue() usage.]),
595 < [SELECT_TYPE_EXPLICIT="kqueue"; echo "Forcing kqueue() to be enabled"],)
596 <
597 < AC_ARG_ENABLE(devpoll,
598 < AC_HELP_STRING([--enable-devpoll],[Force usage of /dev/poll.]),
599 < [SELECT_TYPE_EXPLICIT="devpoll"
600 < echo "Forcing /dev/poll to be enabled"
601 < dnl These need to be defined or not defined
602 < AC_CHECK_HEADERS([sys/devpoll.h devpoll.h])],)
603 <
604 < AC_ARG_ENABLE(rtsigio,
605 < AC_HELP_STRING([--enable-rtsigio],[Enable SIGIO with RT Signals (Linux only)]),
606 < [SELECT_TYPE_EXPLICIT="sigio"; echo "Forcing Linux RT Sigio to be enabled"],)
607 <
608 < AC_ARG_ENABLE(epoll,
609 < AC_HELP_STRING([--enable-epoll], [Enable Linux epoll support.]),
610 < [SELECT_TYPE_EXPLICIT="epoll"; echo "Forcing Linux epoll to be enabled"],)
611 <
612 < if test ! -z "$SELECT_TYPE_EXPLICIT"; then
613 <        SELECT_TYPE="$SELECT_TYPE_EXPLICIT"
614 < else
615 <
616 < AC_CHECK_FUNC([kevent],
617 < [
618 <        SELECT_TYPE="kqueue"
619 < ],
620 < [
621 <        AC_CHECK_HEADER(sys/epoll.h, [HAS_EPOLL=1], [HAS_EPOLL=0])
622 <        if test $HAS_EPOLL -eq 1; then
623 <                AC_MSG_CHECKING(for epoll support in kernel)
624 <                AC_TRY_RUN(
625 < #include <sys/epoll.h>
626 < #include <sys/syscall.h>
627 < #if defined(__stub_epoll_create) || defined(__stub___epoll_create) || defined(EPOLL_NEED_BODY)
628 < #if !defined(__NR_epoll_create)
629 < #if defined(__ia64__)
630 < #define __NR_epoll_create 1243
631 < #elif defined(__x86_64__)
632 < #define __NR_epoll_create 214
633 < #elif defined(__sparc64__) || defined(__sparc__)
634 < #define __NR_epoll_create 193
635 < #elif defined(__s390__) || defined(__m68k__)
636 < #define __NR_epoll_create 249
637 < #elif defined(__ppc64__) || defined(__ppc__)
638 < #define __NR_epoll_create 236
639 < #elif defined(__parisc__) || defined(__arm26__) || defined(__arm__)
640 < #define __NR_epoll_create 224
641 < #elif defined(__alpha__)
642 < #define __NR_epoll_create 407
643 < #elif defined(__sh64__)
644 < #define __NR_epoll_create 282
645 < #elif defined(__i386__) || defined(__sh__) || defined(__m32r__) || defined(__h8300__) || defined(__frv__)
646 < #define __NR_epoll_create 254
647 < #else
648 < #error No system call numbers defined for epoll family.
649 < #endif
650 < #endif
651 < _syscall1(int, epoll_create, int, size)
652 < #endif
653 < main() { return epoll_create(256) == -1 ? 1 : 0; },
654 <                [AC_MSG_RESULT(yes)
655 <                SELECT_TYPE="epoll"],
656 <                [AC_MSG_RESULT(no)
657 <                HAS_EPOLL=0],
658 <                [AC_MSG_RESULT(no)
659 <                HAS_EPOLL=0])
660 <        fi
661 <        if test $HAS_EPOLL -eq 0; then
662 <                AC_MSG_CHECKING(for /dev/poll)
663 <                if test -c "/dev/poll"; then
664 <                        AC_MSG_RESULT(yes)
665 <                        AC_CHECK_HEADERS([devpoll.h sys/devpoll.h])
666 <                        SELECT_TYPE="devpoll"
667 <                else
668 <                        AC_MSG_RESULT(no)
669 <                        AC_MSG_CHECKING(for RT Signal IO)
670 <
671 <                        dnl check for rtsig readiness notification under Linux
672 <                        dnl (but don't use it unless kernel 2.4 or higher)
673 <                        AC_EGREP_CPP(YUP_HAVE_F_SETSIG,
674 <                        [#define _GNU_SOURCE
675 <                        #include <fcntl.h>
676 <                        #ifdef F_SETSIG
677 <                         YUP_HAVE_F_SETSIG
678 <                        #endif
679 <                        ],
680 <                        [
681 <                                SELECT_TYPE="sigio"
682 <                                AC_MSG_RESULT(yes)
683 <                        ],
684 <                        [
685 <                                AC_MSG_RESULT(no)
686 <                                AC_CHECK_FUNC(poll, [SELECT_TYPE="poll"],
687 <                                [
688 <                                        AC_CHECK_FUNC(select, [SELECT_TYPE="select"],
689 <                                        [AC_MSG_ERROR([Couldn't find anything to use for IO loop. Is your C environment POSIXly sane?])
690 <                                        ])
691 <                                ])
692 <                        ])
693 <                fi
694 <        fi
695 < ])
696 <
697 < fi
698 <
699 < echo "Using $SELECT_TYPE for select loop."
700 <
701 < AC_DEFINE_UNQUOTED(SELECT_TYPE, "$SELECT_TYPE", [This is the type of IO loop we are using])
702 < AC_SUBST(SELECT_TYPE)
703 <
704 <
705 < dnl Debug-related options
706 < dnl =====================
707 <
708 < AC_ARG_ENABLE(clobber,
709 < AC_HELP_STRING([--enable-clobber], [Don't preserve old binaries on make install]),
710 < [clobber=$enableval], [clobber=no])
711 <
712 < if test "$clobber" = yes; then
713 <        AC_SUBST(CLOBBER, yes)
714 < fi
715 <
716 < AC_ARG_ENABLE(assert,
717 < AC_HELP_STRING([--enable-assert],[Enable assert().]),
718 < [assert=$enableval], [assert=no])
719 <
720 < if test "$assert" = no; then
721 <        AC_DEFINE(NDEBUG, 1, [Define this to disable debugging support.])
722 < fi
723 <
724 < AC_MSG_CHECKING(if you want to do a profile build)
725 < AC_ARG_ENABLE(profile,
726 < AC_HELP_STRING([--enable-profile],[Enable profiling]),
727 < [profile=$enableval], [profile=no])
728 <
729 < if test "$profile" = yes; then
730 <        if test "$ac_cv_c_compiler_gnu" = yes; then
731 <                IRC_CFLAGS="$IRC_CFLAGS -pg -static"
732 <                AC_MSG_RESULT([yes, adding -pg -static])
733 <        else
734 <                AC_MSG_RESULT([no, profile builds only work with gcc])
735 <        fi
736 < else
737 <        AC_MSG_RESULT(no)
738 < fi
739 <
740 < dnl Check if we want to use efence
741 < AC_MSG_CHECKING(if you want ElectricFence)
742 < AC_ARG_ENABLE(efence,
743 < AC_HELP_STRING([--enable-efence],[Enable ElectricFence (memory debugger).]),
744 < [
745 < if test "$enableval" != no; then
746 <        if test ! -z "$enableval" -a "$enableval" != yes; then
747 <                LIBS="$LIBS -L$enableval"
748 <        fi
749 <
750 <        AC_CHECK_LIB(efence, malloc,
751 <        [
752 <                LIBS="$LIBS -lefence"
753 <                AC_MSG_RESULT(yes)
754 <        ],
755 <        [AC_MSG_RESULT(not found, disabling)])
756 < else
757 <        AC_MSG_RESULT(no)
758 < fi
759 < ],[AC_MSG_RESULT(no)])
760 <
761 < dnl Check if we want to enable the block allocator
762 < AC_MSG_CHECKING(if you want the block allocator)
763 < AC_ARG_ENABLE(block-alloc,
764 < AC_HELP_STRING([--disable-block-alloc],[Disable the block allocator (Only useful with ElectricFence)]),
765 < [balloc=$enableval], [balloc=yes])
766 <
767 < if test "$balloc" = no; then
768 <        AC_SUBST(BALLOC_C, [])
769 <        AC_DEFINE(NOBALLOC, 1, [Disable the block allocator.])
770 < else
771 <        AC_SUBST(BALLOC_C, balloc.c)
772 < fi
773 <
774 < AC_MSG_RESULT($balloc)
775 <
776 < AC_ARG_ENABLE(warnings,
777 < AC_HELP_STRING([--enable-warnings],[Enable all sorts of warnings for debugging.]),
778 < [IRC_CFLAGS="$IRC_CFLAGS -Wcast-qual -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wredundant-decls -Wshadow -Wwrite-strings -W -Wextra"],[])
779 <
780 < dnl Server Tweaks
781 < dnl =============
782 <
783 < AC_ARG_ENABLE(small-net,
784 < AC_HELP_STRING([--enable-small-net],[Enable small network support.]),
785 < [small_net=$enableval], [small_net=no])
786 <
787 < if test "$small_net" = yes; then
788 <        AC_DEFINE([NICKNAMEHISTORYLENGTH], 1500, [Size of the WHOWAS array.])
789 <        AC_DEFINE([CHANNEL_HEAP_SIZE], 256, [Size of the channel heap.])
790 <        AC_DEFINE([BAN_HEAP_SIZE], 128, [Size of the ban heap.])
791 <        AC_DEFINE([CLIENT_HEAP_SIZE], 256, [Size of the client heap.])
792 <        AC_DEFINE([LCLIENT_HEAP_SIZE], 128, [Size of the local client heap.])
793 <        AC_DEFINE([DNODE_HEAP_SIZE], 256, [Size of the dlink_node heap.])
794 <        AC_DEFINE([TOPIC_HEAP_SIZE], 256, [Size of the topic heap.])
795 <        AC_DEFINE([DBUF_HEAP_SIZE], 64, [Size of the dbuf heap.])
796 < else
797 <        AC_DEFINE([NICKNAMEHISTORYLENGTH], 15000, [Size of the WHOWAS array.])
798 <        AC_DEFINE([CHANNEL_HEAP_SIZE], 1024, [Size of the channel heap.])
799 <        AC_DEFINE([BAN_HEAP_SIZE], 1024, [Size of the ban heap.])
800 <        AC_DEFINE([CLIENT_HEAP_SIZE], 1024, [Size of the client heap.])
801 <        AC_DEFINE([LCLIENT_HEAP_SIZE], 512, [Size of the local client heap.])
802 <        AC_DEFINE([DNODE_HEAP_SIZE], 2048, [Size of the dlink_node heap.])
803 <        AC_DEFINE([TOPIC_HEAP_SIZE], 1024, [Size of the topic heap.])
804 <        AC_DEFINE([DBUF_HEAP_SIZE], 512, [Size of the dbuf heap.])
805 < fi
806 <
807 < AC_ARG_ENABLE(efnet,
808 < AC_HELP_STRING([--enable-efnet],[For IRCDs running on EFnet.]),
809 < [efnet=$enableval], [efnet=no])
810 <
811 < if test "$efnet" = yes; then
812 <        AC_DEFINE(EFNET, 1, [Define if this ircd will be an EFnet server.])
813 <        AC_DEFINE(TS5_ONLY, 1, [If enabled, server links to your network must have a minimum of TS5.])
814 <        echo "Building ircd for use with EFnet"
815 <        EXAMPLE_CONF=example.efnet.conf
816 < else
817 <        AC_DEFINE(INVARIANTS, 1, [Miscellaneous sanity checks for the ircd. Makes it slightly slower])
818 <        EXAMPLE_CONF=example.conf
819 < fi
820 <
821 < AC_ARG_ENABLE(gline-voting,
822 < AC_HELP_STRING([--disable-gline-voting],[Disable G-line voting.]),
823 < [gline_voting=$enableval], [gline_voting=yes])
824 <
825 < if test "$gline_voting" = yes; then
826 <        AC_DEFINE(GLINE_VOTING, 1, [Define this if you want to enable gline voting.])
827 <        echo "Building ircd with G-Line voting support"
828 < fi
829 <
830 < AC_ARG_ENABLE(halfops,
831 < AC_HELP_STRING([--enable-halfops],[Enable halfops support.]),
832 < [halfops=$enableval], [halfops=no])
833 <
834 < if test "$halfops" = yes; then
835 <        AC_DEFINE(HALFOPS, 1, [Define if you want halfops support.])
836 < fi
837 <
838 < AC_SUBST(EXAMPLE_CONF)
839 <
840 < AC_MSG_CHECKING(for syslog options)
841 <
842 < AC_ARG_ENABLE(syslog,
843 < AC_HELP_STRING([--enable-syslog="EVENTS"], [Enable syslog for events: kill, squit, connect, users, oper, space separated in quotes (default: disabled)]),
844 < [
845 < dnl Hopelessly swiped from the mozilla source (kind of)
846 <
847 < dnl We must have these headers for it to work..
848 < if test "$ac_cv_header_sys_syslog_h" = yes -o "$ac_cv_header_syslog_h" = yes; then
849 <
850 < if test "$enableval" != no; then
851 <        syslogstuff=core
852 <
853 < for option in $enableval; do
854 < case "$option" in
855 <        kill)
856 <                syslogstuff="$syslogstuff kill"
857 <                AC_DEFINE(SYSLOG_KILL, 1, [Send oper kills to syslog])
858 <        ;;
859 <        squit)
860 <                syslogstuff="$syslogstuff squit"
861 <                AC_DEFINE(SYSLOG_SQUIT, 1, [Send remote squits for all servers to syslog])
862 <        ;;
863 <        connect)
864 <                syslogstuff="$syslogstuff connect"
865 <                AC_DEFINE(SYSLOG_CONNECT, 1, [Send connect notices for other servers to syslog])
866 <        ;;
867 <        users)
868 <                syslogstuff="$syslogstuff users"
869 <                AC_DEFINE(SYSLOG_USERS, 1, [Send user log stuff to syslog])
870 <        ;;
871 <        oper)
872 <                syslogstuff="$syslogstuff oper"
873 <                AC_DEFINE(SYSLOG_OPER, 1, [Send /OPER successes to syslog])
874 <        ;;
875 < dnl yes is okay, shut up you
876 <        yes)
877 <        ;;
878 <        *)
879 <                AC_MSG_WARN(unknown event $option)
880 <        ;;
881 < esac
882 < done
883 <        
884 <        if test ! -z "$syslogstuff" -o "$enableval" = yes; then
885 <                AC_DEFINE(USE_SYSLOG, 1, [Send vital ircd messages to syslog])
886 <        fi
887 < else dnl $enableval is no
888 <        syslogstuff=none
889 < fi
890 <
891 < else dnl checking for syslog.h's
892 <        AC_MSG_WARN([both syslog.h and sys/syslog.h unavailable, not enabling syslog])
893 <        syslogstuff=none
894 < fi
895 < ],[syslogstuff=none])
896 <
897 < AC_MSG_RESULT($syslogstuff)
898 <
899 < AC_ARG_WITH(syslog-facility,
900 < AC_HELP_STRING([--with-syslog-facility=LOG], [Define the log facility to use with ircd's syslog output (default LOG_LOCAL4)]),
901 < [facility=$withval],[facility="LOG_LOCAL4"])
902 <
903 < if test "$syslogstuff" != none; then
904 < AC_DEFINE_UNQUOTED(LOG_FACILITY, $facility, [Log facility to use for syslog()])
905 < fi
906 <
907 < AC_ARG_WITH(nicklen,
908 < AC_HELP_STRING([--with-nicklen=LENGTH],[Set the nick length to LENGTH (default 9)]),
909 <        NICKLEN="$withval", NICKLEN="9")
910 <
911 < AC_ARG_WITH(topiclen,          
912 < AC_HELP_STRING([--with-topiclen=NUMBER],[Set the max topic length to NUMBER (default 160, max 390)]),
913 < [
914 < if test $withval -ge 390; then
915 <        TOPICLEN=390
916 <        AC_MSG_WARN([TOPICLEN has a hard limit of 390. Setting TOPICLEN=390])
917 < else
918 <        TOPICLEN=$withval
919 < fi
920 < ], [TOPICLEN=160])
921 <
922 < AC_DEFINE_UNQUOTED(TOPICLEN, ${TOPICLEN}, [Maximum topic length (<=390)])
923 < AC_DEFINE_UNQUOTED(NICKLEN, (${NICKLEN}+1), [Nickname length])
924 <
925 < AC_ARG_ENABLE(shared-modules,
926 < AC_HELP_STRING([--disable-shared-modules],[ Disable shared modules.]),
927 < [shared_modules=$enableval], [shared_modules="yes"])
928 <
929 < dnl Some first-stage sanity checks.
930 < if test "$shared_modules" = yes; then
931 <        
932 <        if test "$profile" = "no"; then
933 <                shared_modules="yes"
934 <        else
935 <                AC_MSG_WARN([disabling shared modules; cannot coexist with profile builds])
936 <                shared_modules="no"
937 <        fi
938 <
939 <        if test "$CYGWIN" = yes; then
940 <                AC_MSG_WARN([disabling shared modules; Cygwin is at present unable to build them.])
941 <                shared_modules="no"
942 <        fi
943 <
944 <        dnl TenDRA's cc is called tcc too.
945 <        if test "$CC" = tcc -a "$TenDRA" = "no"; then
946 <                AC_MSG_WARN([disabling shared modules: Tiny C Compiler can't create PIC])
947 <                shared_modules="no"
948 <        fi
949 < fi
950 <
951 < dnl Second stage: check for functions and headers.
952 < if test "$shared_modules" = yes; then
953 <        DYNLINK_C=dynlink.c
954 <        AC_CHECK_HEADERS(dlfcn.h)
955 <        AC_SEARCH_LIBS(shl_load, dld,
956 <        [
957 <          AC_DEFINE(HAVE_SHL_LOAD, 1, [Define if the shl_load function is available.])
958 <          SUFFIX=".sl"
959 <          MOD_TARGET=hpux_shared
960 <          SEDOBJ="s/\.o/.sl/g"  
961 <        ],
962 <        dnl !shl_load:
963 <        [
964 <          dnl standard dlopen
965 <          AC_SEARCH_LIBS(dlopen, [dl c_r],
966 <          [
967 <            AC_DEFINE(HAVE_DLOPEN, 1, [Define if the dlopen function is available.])
968 <            SUFFIX=".so"
969 <            MOD_TARGET=shared_modules
970 <            SEDOBJ="s/\.o/.so/g"
971 <            if test "$AppleGCC" = yes; then
972 <              AC_CHECK_HEADERS([mach-o/dyld.h])
973 <            fi
974 <            AC_CHECK_FUNC(dlsym, ,
975 <            [
976 <              AC_MSG_WARN([dlsym is not available, shared modules disabled])
977 <              shared_modules=no
978 <            ])
979 <            AC_CHECK_FUNCS(dlfunc dlinfo)
980 <          ],
981 <          [
982 <            shared_modules=no
983 <          ])
984 <        ])
985 < fi
986 <
987 < AC_DEFINE_UNQUOTED(SHARED_SUFFIX, "$SUFFIX", [Suffix for shared libraries on this platform.])
988 <
989 < dnl Third stage - wrangling the linker.
990 < if test "$shared_modules" = yes; then
991 <        # The GNU linker requires the -export-dynamic option to make
992 <        # all symbols visible in the dynamic symbol table.
993 <        hold_ldflags=$LDFLAGS
994 <        AC_MSG_CHECKING(for the ld -export-dynamic flag)
995 <        LDFLAGS="${LDFLAGS} -Wl,-export-dynamic"
996 <        AC_LINK_IFELSE(AC_LANG_PROGRAM([],[int i;]), found=yes, found=no)
997 <        LDFLAGS=$hold_ldflags
998 <
999 <        if expr "`uname -s`" : ^IRIX >/dev/null 2>&1; then
1000 <                found="no, IRIX ld uses -B,dynamic"
1001 <                LDFLAGS="${LDFLAGS} -Wl,-B,dynamic"
1002 <        fi
1003 <
1004 <        AC_MSG_RESULT($found)
1005 <
1006 <        if test "$found" = yes; then
1007 <                LDFLAGS="${LDFLAGS} -Wl,-export-dynamic"
1008 <        fi
1009 <
1010 <        AC_MSG_CHECKING(for compiler option to produce PIC)
1011 <        dnl The order should be here to check for groups of compilers,
1012 <        dnl then for odd compilers, then if no PICFLAGS were set up,
1013 <        dnl check for GCC and set defaults, or else error. -jmallett
1014 <        if test "$SGS" = "yes"; then
1015 <                AC_MSG_RESULT([SVR4 SGS interfaces: -KPIC -DPIC -G])
1016 <                PICFLAGS="-KPIC -DPIC -G"
1017 <        fi
1018 <        
1019 <        if test "$AppleGCC" = "yes"; then
1020 <                AC_MSG_RESULT([Darwin Mach-O bundles: -fno-common -bundle -flat_namespace -undefined suppress])
1021 <                PICFLAGS="-fno-common -bundle -flat_namespace -undefined suppress"
1022 <        fi
1023 <        dnl Please note, that on HPUX two different stages of module compilation occurs, since
1024 <        dnl while compiling modules, the compiler does not allow you to give arguments
1025 <        dnl to the linker. (I did not design this)
1026 <        dnl So we need -c in the first stage of module compilation.
1027 <        dnl In the second stage, we link the modules via ld -b.
1028 <        dnl Additionally, HPUX does not like -export-dynamic, it likes -E instead.
1029 <        dnl -TimeMr14C
1030 <        if test "$HPUX" = "yes" -a "$ac_cv_c_compiler_gnu" = no; then
1031 <                AC_MSG_RESULT(HP-UX cc: +z -r -q -n)
1032 <                PICFLAGS="+z -r -q -n -c"
1033 <                AC_MSG_CHECKING([if +ESfic is required on this platform])
1034 <                
1035 <                if expr "`$CC +ESfic 2>&1`" : ".*neither supported.*" >/dev/null; then
1036 <                        AC_MSG_RESULT(no)
1037 <                else
1038 <                        AC_MSG_RESULT(yes)
1039 <                        PICFLAGS="$PICFLAGS +ESfic"
1040 <                fi
1041 <
1042 <                LDFLAGS="${LDFLAGS} -Wl,-E"
1043 <        fi
1044 <        if test "$Tru" = yes -a "$ac_cv_c_compiler_gnu" = no; then
1045 <                AC_MSG_RESULT([Tru64: -shared -expect_unresolved '*'])
1046 <                PICFLAGS="-shared -expect_unresolved '*' "
1047 <                LDFLAGS="-call_shared"
1048 <        fi
1049 <        if test -z "$PICFLAGS"; then
1050 <                if test "$ac_cv_c_compiler_gnu" = "yes"; then
1051 <                        AC_MSG_RESULT(gcc: -fPIC -DPIC -shared)
1052 <                        PICFLAGS="-fPIC -DPIC -shared"
1053 <                else
1054 <                        AC_MSG_RESULT(no)
1055 <                        shared_modules=no
1056 <                fi
1057 <        fi
1058 < fi
1059 <
1060 < if test "$shared_modules" = no; then
1061 <        DYNLINK_C=""
1062 <        MOD_TARGET="libmodules.a"
1063 <        MODULES_LIBS="../modules/libmodules.a"
1064 <        SEDOBJ=""
1065 <        AC_DEFINE(STATIC_MODULES, 1, [Define to 1 if dynamic modules can't be used.])
1066 <        AC_MSG_WARN([shared module support has been disabled!])
1067 < fi
1068 <
1069 < AC_SUBST(MODULES_LIBS)
1070 < AC_SUBST(MOD_TARGET)
1071 <
1072 < AC_SUBST(SSL_SRCS_ENABLE)
1073 < AC_SUBST(SSL_INCLUDES)
1074 < AC_SUBST(SSL_LIBS)
1075 <
1076 < AC_SUBST(PICFLAGS)
1077 < AC_SUBST(IRC_CFLAGS)
1078 < AC_SUBST(SEDOBJ)
1079 <
1080 < AC_SUBST(DYNLINK_C)
1081 <
1082 < if test "$prefix" = "NONE"; then
1083 <        AC_DEFINE_UNQUOTED(IRCD_PREFIX, "$ac_default_prefix", [Prefix where the ircd is installed.])
1084 <
1085 < else
1086 <
1087 < dnl Don't get bitten by Cygwin's stupidity if the user specified
1088 < dnl a custom prefix with a trailing slash
1089 <
1090 <        prefix=`echo $prefix | sed 's/\/$//'`
1091 <        AC_DEFINE_UNQUOTED(IRCD_PREFIX, "$prefix", [Prefix where the ircd is installed.])
1092 <
1093 < fi
1094 <
1095 < if test "$datadir" != "NONE"; then
1096 <        AC_DEFINE_UNQUOTED(IRCD_DATADIR, "$datadir", [Prefix where the help files and modules go.])
1097 <        AC_SUBST(MODULEDIR, "${datadir}/modules")
1098 <        AC_SUBST(AUTOMODULEDIR, "${datadir}/modules/autoload")
1099 < else
1100 <        AC_SUBST(MODULEDIR, "${prefix}/modules")
1101 <        AC_SUBST(AUTOMODULEDIR, "${prefix}/modules/autoload")
1102 < fi
1103 <
1104 <        AC_DEFINE_UNQUOTED(IRCD_LOCALSTATEDIR, "$localstatedir", [Prefix where logs and pidfile go.])
1105 <
1106 < if test "$sysconfdir" != "NONE"; then
1107 <        AC_DEFINE_UNQUOTED(IRCD_SYSCONFDIR, "$sysconfdir", [Prefix where etc files go i.e. ircd.conf.])
1108 < fi
1109 <
1110 < AC_CONFIG_FILES(                \
1111 <        Makefile                \
1112 <        etc/Makefile            \
1113 <        etc/example.conf        \
1114 <        etc/example.conf.quick  \
1115 <        etc/example.efnet.conf  \
1116 <        servlink/Makefile       \
1117 <        contrib/Makefile        \
1118 <        contrib/help/Makefile   \
1119 <        src/Makefile            \
1120 <        messages/Makefile       \
1121 <        modules/Makefile        \
1122 <        tools/Makefile          \
1123 <        doc/Makefile            \
1124 <        help/Makefile           \
1125 <        lib/Makefile            \
1126 <        lib/pcre/Makefile
44 > # Checks for library functions.
45 > AC_CHECK_FUNC([snprintf],[AC_DEFINE([HAVE_SNPRINTF],[1],[Define to 1 if you have the snprintf() function.])])
46 > AC_CHECK_FUNC([vsnprintf],[AC_DEFINE([HAVE_VSNPRINTF],[1],[Define to 1 if you have the vsnprintf() function.])])
47 > AC_CHECK_FUNC([lrand48],[AC_DEFINE([HAVE_LRAND48],[1],[Define to 1 if you have the lrand48() function.])])
48 > AC_CHECK_FUNC([srand48],[AC_DEFINE([HAVE_LRAND48],[1],[Define to 1 if you have the srand48() function.])])
49 > AC_CHECK_FUNC([mmap],[AC_DEFINE([HAVE_MMAP],[1],[Define to 1 if you have the mmap() function.])])
50 > AC_CHECK_FUNC([strtok_r],[AC_DEFINE([HAVE_STRTOK_R],[1],[Define to 1 if you have the strtok_r() function.])])
51 > AC_CHECK_FUNC([usleep],[AC_DEFINE([HAVE_USLEEP],[1],[Define to 1 if you have the usleep() function.])])
52 > AC_CHECK_FUNC([strlcat],[AC_DEFINE([HAVE_STRLCAT],[1],[Define to 1 if you have the strlcat() function.])])
53 > AC_CHECK_FUNC([strlcpy],[AC_DEFINE([HAVE_STRLCPY],[1],[Define to 1 if you have the strlcpy() function.])])
54 > AC_CHECK_FUNC([basename],[AC_DEFINE([HAVE_BASENAME],[1],[Define to 1 if you have the basename() function.])])
55 >
56 > # Argument processing.
57 > AX_ARG_ENABLE_IOLOOP_MECHANISM
58 > AX_ARG_DISABLE_BLOCK_ALLOC
59 > AX_ARG_DISABLE_SHARED_MODULES
60 > AX_ARG_WITH_NICKLEN
61 > AX_ARG_WITH_USERLEN
62 > AX_ARG_WITH_HOSTLEN
63 > AX_ARG_WITH_TOPICLEN
64 > AX_ARG_WITH_LCLIENT_HEAP_SIZE
65 > AX_ARG_WITH_CLIENT_HEAP_SIZE
66 > AX_ARG_WITH_CHANNEL_HEAP_SIZE
67 > AX_ARG_WITH_DBUF_HEAP_SIZE
68 > AX_ARG_WITH_DNODE_HEAP_SIZE
69 > AX_ARG_WITH_BAN_HEAP_SIZE
70 > AX_ARG_WITH_TOPIC_HEAP_SIZE
71 > AX_ARG_WITH_IRCD_HEAP_SIZE
72 > AX_ARG_WITH_MQUEUE_HEAP_SIZE
73 > AX_ARG_WITH_FMSG_HEAP_SIZE
74 > AX_ARG_WITH_NICKNAME_HISTORY_LENGTH
75 > AX_ARG_WITH_SYSLOG
76 > AX_ARG_ENABLE_EFNET
77 > AX_ARG_ENABLE_HALFOPS
78 > AX_ARG_ENABLE_DEBUGGING
79 > AX_ARG_ENABLE_WARNINGS
80 > AX_ARG_ENABLE_EFENCE
81 > AX_ARG_ENABLE_SYSLOG
82 >
83 > AC_DEFINE_DIR([PREFIX],[prefix],[Set to prefix.])
84 > AC_DEFINE_DIR([SYSCONFDIR],[sysconfdir],[Set to sysconfdir.])
85 > AC_DEFINE_DIR([LIBDIR],[libdir],[Set to libdir.])
86 > AC_DEFINE_DIR([DATADIR],[datadir],[Set to datadir.])
87 > AC_DEFINE_DIR([LOCALSTATEDIR],[localstatedir],[Set to localstatedir.])
88 > AC_CONFIG_SUBDIRS(libltdl)
89 >
90 > AC_CONFIG_FILES(               \
91 >       Makefile                \
92 >       etc/Makefile            \
93 >       etc/example.conf        \
94 >       etc/example.conf.quick  \
95 >       servlink/Makefile       \
96 >       contrib/Makefile        \
97 >       contrib/help/Makefile   \
98 >       src/Makefile            \
99 >       messages/Makefile       \
100 >       modules/Makefile        \
101 >                         modules/core/Makefile   \
102 >       doc/Makefile            \
103 >       help/Makefile           \
104 >                         help/opers/Makefile             \
105 >                         help/users/Makefile     \
106 >                         include/Makefile        \
107 >       lib/Makefile            \
108 >       lib/pcre/Makefile
109   )
110  
111   AC_OUTPUT
1130
1131 dnl Configure options probably changed
1132 rm -f src/.depend modules/.depend servlink/.depend contrib/.depend lib/pcre/.depend
1133
1134 dnl Make it look sexay!
1135
1136 echo
1137 echo "Compiling $PACKAGE_NAME $PACKAGE_VERSION"
1138 echo
1139
1140 echo "Installing into: $prefix"
1141
1142 echo "Ziplinks ................ $zlib"
1143
1144 if test ! -z "$cf_openssl_ciphers"; then
1145        tmpresult="yes - ${cf_openssl_ciphers}"
1146 else
1147        tmpresult=no
1148 fi
1149
1150 echo "OpenSSL ................. $tmpresult"
1151
1152 if test "$shared_modules" = yes; then
1153        tmpresult=shared
1154 else
1155        tmpresult=static
1156 fi
1157
1158 echo  "Modules ................. $tmpresult"
1159 echo  "IPv6 support ............ $have_v6"
1160 echo  "Net I/O implementation .. $SELECT_TYPE"
1161
1162 if test "$efnet" = "yes"; then
1163        tmpresult="yes (use example.efnet.conf)"
1164 else
1165        tmpresult="no (use example.conf)"
1166 fi
1167
1168 echo "EFnet server ............ $tmpresult"
1169 echo "Halfops support ......... $halfops"
1170 echo "Small network ........... $small_net"
1171 echo "G-Line voting ........... $gline_voting"
1172 echo
1173 echo "Configured limits:"
1174 echo "NICKLEN ................. $NICKLEN"
1175 echo "TOPICLEN ................ $TOPICLEN"
1176 echo

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines