| 1 |
< |
dnl $Id$ |
| 2 |
< |
dnl Process this file with autoconf to produce a configure script. |
| 1 |
> |
# Inspired by work Copyright (C) 2006 Luca Filipozzi |
| 2 |
> |
# vim: set fdm=marker ts=2 sw=2 et: |
| 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.57) |
| 9 |
< |
|
| 10 |
< |
dnl Sneaky way to get an Id tag into the configure script |
| 11 |
< |
AC_COPYRIGHT([$Id$]) |
| 12 |
< |
|
| 13 |
< |
AC_INIT([ircd-hybrid],[7.2]) |
| 14 |
< |
|
| 15 |
< |
AC_CONFIG_HEADER(include/setup.h) |
| 16 |
< |
|
| 17 |
< |
AC_PREFIX_DEFAULT(/usr/local/ircd) |
| 18 |
< |
|
| 19 |
< |
AC_GNU_SOURCE |
| 20 |
< |
|
| 21 |
< |
OLD_CFLAGS="$CFLAGS" |
| 22 |
< |
dnl Checks for programs. |
| 23 |
< |
AC_PROG_CC |
| 24 |
< |
AC_LANG(C) |
| 25 |
< |
|
| 26 |
< |
dnl Make sure autoconf doesn't interfere with cflags -jmallett |
| 27 |
< |
CFLAGS="$OLD_CFLAGS" |
| 28 |
< |
|
| 29 |
< |
dnl Check for various compilers. -jmallett |
| 30 |
< |
dnl But if $CC turns out to be gcc, sure as hell it's, well, gcc. -joshk |
| 31 |
< |
|
| 32 |
< |
if test "$ac_cv_c_compiler_gnu" != yes; then |
| 33 |
< |
|
| 34 |
< |
SGS=no |
| 35 |
< |
AC_MSG_CHECKING($CC -version for TenDRA or MIPSpro) |
| 36 |
< |
case `$CC -version 2>&1` in |
| 37 |
< |
*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 |
| 4 |
> |
AC_REVISION([$Id$]) |
| 5 |
|
|
| 6 |
< |
fi |
| 7 |
< |
|
| 8 |
< |
AC_MSG_CHECKING([uname -s for Cygwin, Solaris or HPUX]) |
| 9 |
< |
case `uname -s` in |
| 10 |
< |
HP-UX*) |
| 11 |
< |
dnl only do this if we haven't already detected the newer one |
| 12 |
< |
dnl and we're not already using gcc |
| 13 |
< |
|
| 14 |
< |
if test "$HPUX" != yes -a "$ac_cv_c_compiler_gnu" = no; then |
| 15 |
< |
AC_MSG_RESULT(assuming old HPUX with its own cc) |
| 16 |
< |
IRC_CFLAGS="$IRC_CFLAGS +e" |
| 17 |
< |
HPUX=yes |
| 18 |
< |
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" |
| 148 |
< |
|
| 149 |
< |
if test "$ac_cv_c_compiler_gnu" = yes; then |
| 150 |
< |
AC_MSG_RESULT(gcc -MM) |
| 151 |
< |
MKDEP="$CC -MM" |
| 152 |
< |
elif test ! -z "$MKDEP"; then |
| 153 |
< |
AC_MSG_RESULT(mkdep) |
| 154 |
< |
|
| 155 |
< |
dnl Tru64's mkdep is very loud |
| 156 |
< |
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 |
| 194 |
< |
AC_C_INLINE |
| 195 |
< |
AC_PROG_GCC_TRADITIONAL |
| 196 |
< |
AC_PROG_MAKE_SET |
| 6 |
> |
AC_PREREQ(2.68) |
| 7 |
> |
AC_INIT([ircd-hybrid], [7.3-rc1], [bugs@ircd-hybrid.org]) |
| 8 |
> |
AM_INIT_AUTOMAKE(1.11.1) |
| 9 |
> |
AM_MAINTAINER_MODE |
| 10 |
> |
AC_CONFIG_HEADER(config.h) |
| 11 |
> |
AC_CONFIG_SRCDIR(src/ircd.c) |
| 12 |
> |
|
| 13 |
> |
# Checks for programs. |
| 14 |
> |
AC_PROG_CC_C99 |
| 15 |
> |
AS_IF([test "$ac_cv_prog_cc_c99" = "no"], |
| 16 |
> |
[AC_MSG_ERROR([no C99 compiler found. Aborting.])]) |
| 17 |
> |
AC_PROG_YACC |
| 18 |
> |
AM_PROG_LEX |
| 19 |
|
AC_PROG_INSTALL |
| 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]) |
| 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 |
| 20 |
|
|
| 21 |
< |
AC_MSG_CHECKING([for core IPv6 support]) |
| 22 |
< |
|
| 23 |
< |
AC_COMPILE_IFELSE( |
| 24 |
< |
[AC_LANG_PROGRAM( |
| 25 |
< |
[[#define IN_AUTOCONF |
| 26 |
< |
#include "include/stdinc.h"]], |
| 27 |
< |
[[struct sockaddr_in6 s; |
| 28 |
< |
struct sockaddr_storage t; |
| 29 |
< |
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 |
| 21 |
> |
# Initializing libtool. |
| 22 |
> |
LT_CONFIG_LTDL_DIR([libltdl]) |
| 23 |
> |
LT_INIT([dlopen disable-static]) |
| 24 |
> |
LTDL_INIT([recursive convenience]) |
| 25 |
> |
LIBTOOL="$LIBTOOL --silent" |
| 26 |
> |
|
| 27 |
> |
# Checks for libraries. |
| 28 |
> |
AX_CHECK_LIB_IPV4 |
| 29 |
> |
AX_CHECK_LIB_IPV6 |
| 30 |
|
|
| 31 |
+ |
# Checks for typedefs, structures, and compiler characteristics. |
| 32 |
|
AC_C_BIGENDIAN |
| 33 |
|
|
| 34 |
< |
dnl Check for stdarg.h - if we can't find it, halt configure |
| 35 |
< |
AC_CHECK_HEADER(stdarg.h, , [AC_MSG_ERROR([** stdarg.h could not be found - ircd-hybrid will not compile without it **])]) |
| 36 |
< |
|
| 37 |
< |
dnl Checks for the existence of strlcat, strlcpy, basename... |
| 38 |
< |
dnl This more reliable test only works with gcc though. |
| 39 |
< |
|
| 40 |
< |
if test "$ac_cv_c_compiler_gnu" = yes; then |
| 41 |
< |
|
| 42 |
< |
AC_MSG_CHECKING(for strlcpy) |
| 43 |
< |
save_CFLAGS=$CFLAGS |
| 44 |
< |
CFLAGS="$CFLAGS -Wimplicit -Werror" |
| 45 |
< |
|
| 46 |
< |
AC_LINK_IFELSE( |
| 47 |
< |
[AC_LANG_PROGRAM( |
| 48 |
< |
[[#include <string.h> |
| 49 |
< |
#include <stdlib.h>]], |
| 50 |
< |
[[char *a = malloc(6), *b = strdup("hello"); |
| 51 |
< |
strlcpy(a, b, 6);]] |
| 52 |
< |
)], |
| 53 |
< |
[AC_MSG_RESULT(yes) |
| 54 |
< |
AC_DEFINE(HAVE_STRLCPY, 1, [Define if strlcpy is available (most BSDs.)])], |
| 357 |
< |
[AC_MSG_RESULT(no)] |
| 358 |
< |
) |
| 359 |
< |
|
| 360 |
< |
AC_MSG_CHECKING(for strlcat) |
| 361 |
< |
AC_LINK_IFELSE( |
| 362 |
< |
[AC_LANG_PROGRAM( |
| 363 |
< |
[[#include <string.h> |
| 364 |
< |
#include <stdlib.h>]], |
| 365 |
< |
[[char *a = malloc(6), *b = strdup("hello"); |
| 366 |
< |
strlcat(a, b, 6);]] |
| 367 |
< |
)], |
| 368 |
< |
[AC_MSG_RESULT(yes) |
| 369 |
< |
AC_DEFINE(HAVE_STRLCAT, 1, [Define if strlcat is available (most BSDs.)])], |
| 370 |
< |
[AC_MSG_RESULT(no)] |
| 371 |
< |
) |
| 372 |
< |
|
| 373 |
< |
CFLAGS=$save_CFLAGS |
| 374 |
< |
|
| 375 |
< |
else |
| 376 |
< |
|
| 377 |
< |
dnl Better than nothing. The more complicated test above probably fixes powerpc, |
| 378 |
< |
dnl so who cares. |
| 379 |
< |
|
| 380 |
< |
AC_CHECK_FUNCS([strlcat strlcpy]) |
| 381 |
< |
|
| 382 |
< |
fi |
| 383 |
< |
|
| 384 |
< |
AC_CHECK_SIZEOF(int64_t) |
| 385 |
< |
AC_CHECK_SIZEOF(long long) |
| 386 |
< |
|
| 387 |
< |
if test "$ac_cv_sizeof_int64_t" = 8; then |
| 388 |
< |
AC_CHECK_TYPE(uint64_t) |
| 389 |
< |
AC_CHECK_TYPE(int64_t) |
| 390 |
< |
elif test "$ac_cv_sizeof_long_long" = 8; then |
| 391 |
< |
AC_CHECK_TYPE(uint64_t, unsigned long long) |
| 392 |
< |
AC_CHECK_TYPE(int64_t, long long) |
| 393 |
< |
else |
| 394 |
< |
AC_MSG_ERROR([Your system doesn't appear to have 64 bit integers. Aborting.]) |
| 395 |
< |
fi |
| 396 |
< |
|
| 397 |
< |
AC_CHECK_TYPE([u_int32_t], [], |
| 398 |
< |
[ |
| 399 |
< |
AC_CHECK_TYPE([uint32_t], |
| 400 |
< |
[ |
| 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 |
< |
]) |
| 34 |
> |
# Checks for library functions. |
| 35 |
> |
AC_CHECK_FUNCS_ONCE(mmap \ |
| 36 |
> |
strtok_r \ |
| 37 |
> |
usleep \ |
| 38 |
> |
strlcat \ |
| 39 |
> |
strlcpy \ |
| 40 |
> |
socketpair) |
| 41 |
> |
|
| 42 |
> |
# Checks for header files. |
| 43 |
> |
AC_CHECK_HEADERS_ONCE(crypt.h \ |
| 44 |
> |
inttypes.h \ |
| 45 |
> |
stdint.h \ |
| 46 |
> |
sys/resource.h \ |
| 47 |
> |
sys/param.h \ |
| 48 |
> |
errno.h \ |
| 49 |
> |
sys/syslog.h \ |
| 50 |
> |
types.h \ |
| 51 |
> |
socket.h \ |
| 52 |
> |
sys/wait.h \ |
| 53 |
> |
wait.h \ |
| 54 |
> |
link.h) |
| 55 |
|
|
| 56 |
< |
AC_CHECK_TYPE([in_port_t], [], |
| 57 |
< |
[AC_DEFINE(in_port_t, [u_int16_t], [If system does not define in_port_t, define it to what it should be.])], |
| 58 |
< |
[[#include <sys/types.h> |
| 59 |
< |
#include <netinet/in.h>]]) |
| 60 |
< |
|
| 61 |
< |
AC_CHECK_TYPE([sa_family_t], [], |
| 62 |
< |
[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) == 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 |
| 56 |
> |
# check for /dev/null so we can use it to hold evil fd's |
| 57 |
> |
AC_MSG_CHECKING([for /dev/null]) |
| 58 |
> |
AS_IF([test -c /dev/null], [ |
| 59 |
> |
AC_DEFINE(PATH_DEVNULL, "/dev/null", [Path to /dev/null]) |
| 60 |
> |
AC_MSG_RESULT([yes])], [ |
| 61 |
> |
AC_DEFINE(PATH_DEVNULL, "devnull.log", [Path to /dev/null]) |
| 62 |
> |
AC_MSG_RESULT([no - using devnull.log])]) |
| 63 |
|
|
| 554 |
– |
CPPFLAGS="$save_CPPFLAGS" |
| 555 |
– |
LIBS="$save_LIBS" |
| 64 |
|
|
| 65 |
< |
dnl End OpenSSL detection |
| 65 |
> |
AC_SEARCH_LIBS(crypt, crypt) |
| 66 |
|
|
| 559 |
– |
dnl Specialized functions and libraries |
| 560 |
– |
dnl =================================== |
| 67 |
|
|
| 68 |
|
AC_ARG_WITH(zlib-path, |
| 69 |
< |
AC_HELP_STRING([--with-zlib-path=DIR],[Path to libz.so for ziplinks support.]), |
| 70 |
< |
[LIBS="$LIBS -L$withval"],) |
| 69 |
> |
AS_HELP_STRING([--with-zlib-path=DIR], [Path to libz.so for ziplinks support.]), |
| 70 |
> |
[LDFLAGS="-L$withval $LDFLAGS"],) |
| 71 |
|
|
| 72 |
< |
AC_ARG_ENABLE(zlib, |
| 567 |
< |
AC_HELP_STRING([--disable-zlib],[Disable ziplinks support]), |
| 72 |
> |
AC_ARG_ENABLE(zlib, AS_HELP_STRING([--disable-zlib],[Disable ziplinks support]), |
| 73 |
|
[zlib=$enableval],[zlib=yes]) |
| 74 |
|
|
| 75 |
< |
if test "$zlib" = yes; then |
| 76 |
< |
|
| 77 |
< |
AC_CHECK_HEADER(zlib.h, [ |
| 78 |
< |
AC_CHECK_LIB(z, zlibVersion, |
| 79 |
< |
[ |
| 80 |
< |
AC_SUBST(ZLIB_LD, -lz) |
| 81 |
< |
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 |
| 75 |
> |
AS_IF([test "$zlib" = "yes"], [ |
| 76 |
> |
AC_CHECK_HEADER(zlib.h, [AC_CHECK_LIB(z, zlibVersion, |
| 77 |
> |
[ |
| 78 |
> |
LIBS="-lz $LIBS" |
| 79 |
> |
AC_DEFINE(HAVE_LIBZ, 1, [Define to 1 if zlib (-lz) is available.]) |
| 80 |
> |
], zlib=no) |
| 81 |
> |
], zlib=no) |
| 82 |
|
]) |
| 83 |
|
|
| 84 |
< |
fi |
| 85 |
< |
|
| 86 |
< |
echo "Using $SELECT_TYPE for select loop." |
| 87 |
< |
|
| 88 |
< |
AC_DEFINE_UNQUOTED(SELECT_TYPE, "$SELECT_TYPE", [This is the type of IO loop we are using]) |
| 89 |
< |
AC_SUBST(SELECT_TYPE) |
| 90 |
< |
|
| 91 |
< |
|
| 92 |
< |
dnl Debug-related options |
| 93 |
< |
dnl ===================== |
| 94 |
< |
|
| 95 |
< |
AC_ARG_ENABLE(clobber, |
| 96 |
< |
AC_HELP_STRING([--enable-clobber], [Don't preserve old binaries on make install]), |
| 97 |
< |
[clobber=$enableval], [clobber=no]) |
| 98 |
< |
|
| 99 |
< |
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)]) |
| 84 |
> |
AC_ARG_WITH(libpcre-path, |
| 85 |
> |
AS_HELP_STRING([--with-libpcre-path=DIR], [Path to libpcre.so for PCRE support.]), |
| 86 |
> |
[LDFLAGS="-L$withval $LDFLAGS"],) |
| 87 |
> |
|
| 88 |
> |
AC_ARG_ENABLE(libpcre, AS_HELP_STRING([--disable-libpcre],[Disable PCRE support]), |
| 89 |
> |
[libpcre=$enableval],[libpcre=yes]) |
| 90 |
> |
|
| 91 |
> |
AS_IF([test "$libpcre" = "yes"], [ |
| 92 |
> |
AC_CHECK_HEADER(pcre.h, [AC_CHECK_LIB(pcre, pcre_study, |
| 93 |
> |
[ |
| 94 |
> |
LIBS="-lpcre $LIBS" |
| 95 |
> |
AC_DEFINE(HAVE_LIBPCRE, 1, [Define to 1 if libpcre (-lpcre) is available.]) |
| 96 |
> |
], libpcre=no) |
| 97 |
> |
], libpcre=no) |
| 98 |
> |
]) |
| 99 |
> |
AM_CONDITIONAL(ENABLE_PCRE, [test "$libpcre" = yes]) |
| 100 |
|
|
| 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 |
| 101 |
|
|
| 102 |
< |
AC_MSG_RESULT($balloc) |
| 102 |
> |
dnl Openssl checks |
| 103 |
> |
AC_ARG_ENABLE(openssl, |
| 104 |
> |
[ --enable-openssl[=DIR] Enable OpenSSL support (DIR optional). |
| 105 |
> |
--disable-openssl Disable OpenSSL support. ], |
| 106 |
> |
[ cf_enable_openssl=$enableval ], |
| 107 |
> |
[ cf_enable_openssl="auto" ]) |
| 108 |
> |
AC_MSG_CHECKING([for OpenSSL]) |
| 109 |
> |
if test "$cf_enable_openssl" != "no"; then |
| 110 |
> |
cf_openssl_basedir="" |
| 111 |
> |
if test "$cf_enable_openssl" != "auto" && |
| 112 |
> |
test "$cf_enable_openssl" != "yes"; then |
| 113 |
> |
dnl Support for --enable-openssl=/some/place |
| 114 |
> |
cf_openssl_basedir="${cf_enable_openssl}" |
| 115 |
> |
else |
| 116 |
> |
dnl Do the auto-probe here. Check some common directory paths. |
| 117 |
> |
for dirs in /usr/local/ssl /usr/pkg /usr/local /usr/lib /usr/lib/ssl\ |
| 118 |
> |
/opt /opt/openssl /usr/local/openssl; do |
| 119 |
> |
if test -f "${dirs}/include/openssl/opensslv.h"; then |
| 120 |
> |
cf_openssl_basedir="${dirs}" |
| 121 |
> |
break |
| 122 |
> |
fi |
| 123 |
> |
done |
| 124 |
> |
unset dirs |
| 125 |
> |
fi |
| 126 |
> |
|
| 127 |
> |
dnl Now check cf_openssl_found to see if we found anything. |
| 128 |
> |
if test ! -z "$cf_openssl_basedir"; then |
| 129 |
> |
if test -f "${cf_openssl_basedir}/include/openssl/opensslv.h"; then |
| 130 |
> |
CPPFLAGS="-I${cf_openssl_basedir}/include $CPPFLAGS" |
| 131 |
> |
LDFLAGS="-L${cf_openssl_basedir}/lib $LDFLAGS" |
| 132 |
> |
else |
| 133 |
> |
dnl OpenSSL wasn't found in the directory specified. Naughty |
| 134 |
> |
dnl administrator... |
| 135 |
> |
cf_openssl_basedir="" |
| 136 |
> |
fi |
| 137 |
> |
else |
| 138 |
> |
dnl Check for stock FreeBSD 4.x and 5.x systems, since their files |
| 139 |
> |
dnl are in /usr/include and /usr/lib. In this case, we don't want to |
| 140 |
> |
dnl change INCLUDES or LIBS, but still want to enable OpenSSL. |
| 141 |
> |
dnl We can't do this check above, because some people want two versions |
| 142 |
> |
dnl of OpenSSL installed (stock FreeBSD 4.x/5.x and /usr/local/ssl) |
| 143 |
> |
dnl and they want /usr/local/ssl to have preference. |
| 144 |
> |
if test -f "/usr/include/openssl/opensslv.h"; then |
| 145 |
> |
cf_openssl_basedir="/usr" |
| 146 |
> |
fi |
| 147 |
> |
fi |
| 148 |
> |
|
| 149 |
> |
dnl If we have a basedir defined, then everything is okay. Otherwise, |
| 150 |
> |
dnl we have a problem. |
| 151 |
> |
if test ! -z "$cf_openssl_basedir"; then |
| 152 |
> |
LIBS="-lcrypto -lssl $LIBS" |
| 153 |
> |
AC_MSG_RESULT([$cf_openssl_basedir]) |
| 154 |
> |
cf_enable_openssl="yes" |
| 155 |
> |
AC_DEFINE(HAVE_LIBCRYPTO, 1, [If we support ssl]) |
| 156 |
> |
else |
| 157 |
> |
AC_MSG_RESULT([not found. Please check your path.]) |
| 158 |
> |
cf_enable_openssl="no" |
| 159 |
> |
fi |
| 160 |
> |
unset cf_openssl_basedir |
| 161 |
> |
else |
| 162 |
> |
dnl If --disable-openssl was specified |
| 163 |
> |
AC_MSG_RESULT([disabled]) |
| 164 |
> |
fi |
| 165 |
> |
|
| 166 |
> |
AS_IF([test "$cf_enable_openssl" != "no"], |
| 167 |
> |
[AC_MSG_CHECKING(for OpenSSL 0.9.7 or above) |
| 168 |
> |
AC_RUN_IFELSE([ |
| 169 |
> |
AC_LANG_PROGRAM([ |
| 170 |
> |
#include <openssl/opensslv.h> |
| 171 |
> |
#include <stdlib.h>], |
| 172 |
> |
[[ exit(!(OPENSSL_VERSION_NUMBER >= 0x00907000)); ]])], |
| 173 |
> |
[cf_openssl_version_ok=yes], |
| 174 |
> |
[cf_openssl_version_ok=no], |
| 175 |
> |
[cf_openssl_version_ok=no]) |
| 176 |
> |
|
| 177 |
> |
AS_IF([test "$cf_openssl_version_ok" = "yes"], |
| 178 |
> |
[AC_MSG_RESULT(found) |
| 179 |
> |
|
| 180 |
> |
AC_CHECK_LIB(crypto, RSA_free) |
| 181 |
> |
AS_IF([test "$ac_cv_lib_crypto_RSA_free" = "yes"], |
| 182 |
> |
[AC_CHECK_FUNCS(EVP_bf_cfb \ |
| 183 |
> |
EVP_cast5_cfb \ |
| 184 |
> |
EVP_idea_cfb \ |
| 185 |
> |
EVP_rc5_32_12_16_cfb \ |
| 186 |
> |
EVP_des_ede3_cfb \ |
| 187 |
> |
EVP_des_cfb)]) |
| 188 |
> |
],[AC_MSG_RESULT(no - OpenSSL support disabled) |
| 189 |
> |
cf_enable_openssl="no"])]) |
| 190 |
> |
|
| 191 |
> |
AM_CONDITIONAL(ENABLE_SSL, [test "$cf_enable_openssl" = yes]) |
| 192 |
> |
|
| 193 |
> |
|
| 194 |
> |
AC_ARG_ENABLE(assert, AS_HELP_STRING([--enable-assert], |
| 195 |
> |
[Enable assert() statements]), |
| 196 |
> |
[assert=$enableval], [assert=no]) |
| 197 |
|
|
| 198 |
< |
AC_ARG_ENABLE(warnings, |
| 199 |
< |
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 -Wno-unused"],[]) |
| 198 |
> |
AS_IF([test "$assert" = "no"], |
| 199 |
> |
[AC_DEFINE(NDEBUG, 1, [Define to disable assert() statements.])]) |
| 200 |
|
|
| 780 |
– |
dnl Server Tweaks |
| 781 |
– |
dnl ============= |
| 201 |
|
|
| 202 |
< |
AC_ARG_ENABLE(small-net, |
| 203 |
< |
AC_HELP_STRING([--enable-small-net],[Enable small network support.]), |
| 202 |
> |
AC_ARG_ENABLE(small-net, AS_HELP_STRING([--enable-small-net], |
| 203 |
> |
[Enable small network support.]), |
| 204 |
|
[small_net=$enableval], [small_net=no]) |
| 205 |
|
|
| 206 |
< |
if test "$small_net" = yes; then |
| 207 |
< |
AC_DEFINE([NICKNAMEHISTORYLENGTH], 1500, [Size of the WHOWAS array.]) |
| 208 |
< |
AC_DEFINE([CHANNEL_HEAP_SIZE], 256, [Size of the channel heap.]) |
| 209 |
< |
AC_DEFINE([BAN_HEAP_SIZE], 128, [Size of the ban heap.]) |
| 210 |
< |
AC_DEFINE([CLIENT_HEAP_SIZE], 256, [Size of the client heap.]) |
| 211 |
< |
AC_DEFINE([LCLIENT_HEAP_SIZE], 128, [Size of the local client heap.]) |
| 212 |
< |
AC_DEFINE([DNODE_HEAP_SIZE], 256, [Size of the dlink_node heap.]) |
| 213 |
< |
AC_DEFINE([TOPIC_HEAP_SIZE], 256, [Size of the topic heap.]) |
| 214 |
< |
AC_DEFINE([DBUF_HEAP_SIZE], 64, [Size of the dbuf heap.]) |
| 215 |
< |
else |
| 216 |
< |
AC_DEFINE([NICKNAMEHISTORYLENGTH], 15000, [Size of the WHOWAS array.]) |
| 217 |
< |
AC_DEFINE([CHANNEL_HEAP_SIZE], 1024, [Size of the channel heap.]) |
| 218 |
< |
AC_DEFINE([BAN_HEAP_SIZE], 1024, [Size of the ban heap.]) |
| 219 |
< |
AC_DEFINE([CLIENT_HEAP_SIZE], 1024, [Size of the client heap.]) |
| 220 |
< |
AC_DEFINE([LCLIENT_HEAP_SIZE], 512, [Size of the local client heap.]) |
| 221 |
< |
AC_DEFINE([DNODE_HEAP_SIZE], 2048, [Size of the dlink_node heap.]) |
| 222 |
< |
AC_DEFINE([TOPIC_HEAP_SIZE], 1024, [Size of the topic heap.]) |
| 223 |
< |
AC_DEFINE([DBUF_HEAP_SIZE], 512, [Size of the dbuf heap.]) |
| 224 |
< |
fi |
| 225 |
< |
|
| 226 |
< |
AC_ARG_ENABLE(efnet, |
| 227 |
< |
AC_HELP_STRING([--enable-efnet],[For IRCDs running on EFnet.]), |
| 228 |
< |
[efnet=$enableval], [efnet=no]) |
| 229 |
< |
|
| 230 |
< |
if test "$efnet" = yes; then |
| 231 |
< |
AC_DEFINE(EFNET, 1, [Define if this ircd will be an EFnet server.]) |
| 232 |
< |
AC_DEFINE(TS5_ONLY, 1, [If enabled, server links to your network must have a minimum of TS5.]) |
| 233 |
< |
echo "Building ircd for use with EFnet" |
| 234 |
< |
EXAMPLE_CONF=example.efnet.conf |
| 235 |
< |
else |
| 236 |
< |
AC_DEFINE(INVARIANTS, 1, [Miscellaneous sanity checks for the ircd. Makes it slightly slower]) |
| 237 |
< |
EXAMPLE_CONF=example.conf |
| 238 |
< |
fi |
| 239 |
< |
|
| 240 |
< |
AC_ARG_ENABLE(gline-voting, |
| 241 |
< |
AC_HELP_STRING([--disable-gline-voting],[Disable G-line voting.]), |
| 242 |
< |
[gline_voting=$enableval], [gline_voting=yes]) |
| 243 |
< |
|
| 244 |
< |
if test "$gline_voting" = yes; then |
| 245 |
< |
AC_DEFINE(GLINE_VOTING, 1, [Define this if you want to enable gline voting.]) |
| 246 |
< |
echo "Building ircd with G-Line voting support" |
| 247 |
< |
fi |
| 248 |
< |
|
| 249 |
< |
AC_ARG_ENABLE(halfops, |
| 250 |
< |
AC_HELP_STRING([--enable-halfops],[Enable halfops support.]), |
| 251 |
< |
[halfops=$enableval], [halfops=no]) |
| 252 |
< |
|
| 253 |
< |
if test "$halfops" = yes; then |
| 254 |
< |
AC_DEFINE(HALFOPS, 1, [Define if you want halfops support.]) |
| 255 |
< |
fi |
| 256 |
< |
|
| 257 |
< |
AC_SUBST(EXAMPLE_CONF) |
| 258 |
< |
|
| 259 |
< |
AC_MSG_CHECKING(for syslog options) |
| 260 |
< |
|
| 261 |
< |
AC_ARG_ENABLE(syslog, |
| 262 |
< |
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) |
| 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 |
< |
AC_CONFIG_FILES( \ |
| 1096 |
< |
Makefile \ |
| 1097 |
< |
etc/Makefile \ |
| 1098 |
< |
servlink/Makefile \ |
| 1099 |
< |
contrib/Makefile \ |
| 1100 |
< |
contrib/help/Makefile \ |
| 1101 |
< |
src/Makefile \ |
| 1102 |
< |
messages/Makefile \ |
| 1103 |
< |
modules/Makefile \ |
| 1104 |
< |
tools/Makefile \ |
| 1105 |
< |
doc/Makefile \ |
| 1106 |
< |
help/Makefile \ |
| 1107 |
< |
lib/Makefile \ |
| 1108 |
< |
lib/pcre/Makefile |
| 1109 |
< |
) |
| 206 |
> |
AS_IF([test "$small_net" = "yes"], [ |
| 207 |
> |
AC_DEFINE([NICKNAMEHISTORYLENGTH], 1500, [Size of the WHOWAS array.]) |
| 208 |
> |
AC_DEFINE([CHANNEL_HEAP_SIZE], 256, [Size of the channel heap.]) |
| 209 |
> |
AC_DEFINE([BAN_HEAP_SIZE], 128, [Size of the ban heap.]) |
| 210 |
> |
AC_DEFINE([CLIENT_HEAP_SIZE], 256, [Size of the client heap.]) |
| 211 |
> |
AC_DEFINE([LCLIENT_HEAP_SIZE], 128, [Size of the local client heap.]) |
| 212 |
> |
AC_DEFINE([DNODE_HEAP_SIZE], 256, [Size of the dlink_node heap.]) |
| 213 |
> |
AC_DEFINE([TOPIC_HEAP_SIZE], 256, [Size of the topic heap.]) |
| 214 |
> |
AC_DEFINE([DBUF_HEAP_SIZE], 64, [Size of the dbuf heap.]) |
| 215 |
> |
AC_DEFINE([AUTH_HEAP_SIZE], 128, [Size of the auth heap.]) |
| 216 |
> |
AC_DEFINE([DNS_HEAP_SIZE], 128, [Size of the dns heap.])], [ |
| 217 |
> |
|
| 218 |
> |
AC_DEFINE([NICKNAMEHISTORYLENGTH], 15000, [Size of the WHOWAS array.]) |
| 219 |
> |
AC_DEFINE([CHANNEL_HEAP_SIZE], 1024, [Size of the channel heap.]) |
| 220 |
> |
AC_DEFINE([BAN_HEAP_SIZE], 1024, [Size of the ban heap.]) |
| 221 |
> |
AC_DEFINE([CLIENT_HEAP_SIZE], 1024, [Size of the client heap.]) |
| 222 |
> |
AC_DEFINE([LCLIENT_HEAP_SIZE], 512, [Size of the local client heap.]) |
| 223 |
> |
AC_DEFINE([DNODE_HEAP_SIZE], 1024, [Size of the dlink_node heap.]) |
| 224 |
> |
AC_DEFINE([TOPIC_HEAP_SIZE], 1024, [Size of the topic heap.]) |
| 225 |
> |
AC_DEFINE([DBUF_HEAP_SIZE], 512, [Size of the dbuf heap.]) |
| 226 |
> |
AC_DEFINE([AUTH_HEAP_SIZE], 512, [Size of the auth heap.]) |
| 227 |
> |
AC_DEFINE([DNS_HEAP_SIZE], 512, [Size of the dns heap.])]) |
| 228 |
> |
|
| 229 |
> |
|
| 230 |
> |
# Argument processing. |
| 231 |
> |
AX_ARG_ENABLE_IOLOOP_MECHANISM |
| 232 |
> |
AX_ARG_WITH_NICKLEN |
| 233 |
> |
AX_ARG_WITH_TOPICLEN |
| 234 |
> |
AX_ARG_WITH_SYSLOG |
| 235 |
> |
AX_ARG_ENABLE_EFNET |
| 236 |
> |
AX_ARG_ENABLE_HALFOPS |
| 237 |
> |
AX_ARG_ENABLE_DEBUGGING |
| 238 |
> |
AX_ARG_ENABLE_WARNINGS |
| 239 |
> |
AX_ARG_ENABLE_SYSLOG |
| 240 |
> |
|
| 241 |
> |
AC_DEFINE_DIR([PREFIX],[prefix],[Set to prefix.]) |
| 242 |
> |
AC_DEFINE_DIR([SYSCONFDIR],[sysconfdir],[Set to sysconfdir.]) |
| 243 |
> |
AC_DEFINE_DIR([LIBDIR],[libdir],[Set to libdir.]) |
| 244 |
> |
AC_DEFINE_DIR([DATADIR],[datadir],[Set to datadir.]) |
| 245 |
> |
AC_DEFINE_DIR([LOCALSTATEDIR],[localstatedir],[Set to localstatedir.]) |
| 246 |
> |
|
| 247 |
> |
AC_CONFIG_FILES( \ |
| 248 |
> |
Makefile \ |
| 249 |
> |
etc/Makefile \ |
| 250 |
> |
servlink/Makefile \ |
| 251 |
> |
contrib/Makefile \ |
| 252 |
> |
contrib/help/Makefile \ |
| 253 |
> |
src/Makefile \ |
| 254 |
> |
libltdl/Makefile \ |
| 255 |
> |
messages/Makefile \ |
| 256 |
> |
modules/Makefile \ |
| 257 |
> |
modules/core/Makefile \ |
| 258 |
> |
doc/Makefile \ |
| 259 |
> |
help/Makefile \ |
| 260 |
> |
help/opers/Makefile \ |
| 261 |
> |
help/users/Makefile \ |
| 262 |
> |
tools/Makefile) |
| 263 |
|
|
| 264 |
|
AC_OUTPUT |
| 1112 |
– |
|
| 1113 |
– |
dnl Configure options probably changed |
| 1114 |
– |
rm -f src/.depend modules/.depend servlink/.depend contrib/.depend lib/pcre/.depend |
| 1115 |
– |
|
| 1116 |
– |
dnl Make it look sexay! |
| 1117 |
– |
|
| 1118 |
– |
echo |
| 1119 |
– |
echo "Compiling $PACKAGE_NAME $PACKAGE_VERSION" |
| 1120 |
– |
echo |
| 1121 |
– |
|
| 1122 |
– |
echo "Installing into: $prefix" |
| 1123 |
– |
|
| 1124 |
– |
echo "Ziplinks ................ $zlib" |
| 1125 |
– |
|
| 1126 |
– |
if test ! -z "$cf_openssl_ciphers"; then |
| 1127 |
– |
tmpresult="yes - ${cf_openssl_ciphers}" |
| 1128 |
– |
else |
| 1129 |
– |
tmpresult=no |
| 1130 |
– |
fi |
| 1131 |
– |
|
| 1132 |
– |
echo "OpenSSL ................. $tmpresult" |
| 1133 |
– |
|
| 1134 |
– |
if test "$shared_modules" = yes; then |
| 1135 |
– |
tmpresult=shared |
| 1136 |
– |
else |
| 1137 |
– |
tmpresult=static |
| 1138 |
– |
fi |
| 1139 |
– |
|
| 1140 |
– |
echo "Modules ................. $tmpresult" |
| 1141 |
– |
echo "IPv6 support ............ $have_v6" |
| 1142 |
– |
echo "Net I/O implementation .. $SELECT_TYPE" |
| 1143 |
– |
|
| 1144 |
– |
if test "$efnet" = "yes"; then |
| 1145 |
– |
tmpresult="yes (use example.efnet.conf)" |
| 1146 |
– |
else |
| 1147 |
– |
tmpresult="no (use example.conf)" |
| 1148 |
– |
fi |
| 1149 |
– |
|
| 1150 |
– |
echo "EFnet server ............ $tmpresult" |
| 1151 |
– |
echo "Halfops support ......... $halfops" |
| 1152 |
– |
echo "Small network ........... $small_net" |
| 1153 |
– |
echo "G-Line voting ........... $gline_voting" |
| 1154 |
– |
echo |
| 1155 |
– |
echo "Configured limits:" |
| 1156 |
– |
echo "NICKLEN ................. $NICKLEN" |
| 1157 |
– |
echo "TOPICLEN ................ $TOPICLEN" |
| 1158 |
– |
echo |