1dnl Process this file with autoconf to produce a configure script. 2 3dnl When updating the version, remember to update the following files 4dnl appropriately: 5dnl 6dnl include/win32/setup.h 7dnl src/win32/unrealinst.iss 8dnl docs/unreal32docs*.html 9dnl Unreal.nfo 10dnl .CHANGES.NEW 11dnl src/version.c.SH 12 13AC_INIT([unrealircd], [3.2.10.7], [http://bugs.unrealircd.org/], [], [http://unrealircd.org/]) 14AC_CONFIG_SRCDIR([src/ircd.c]) 15AC_CONFIG_HEADER([include/setup.h]) 16AC_CONFIG_AUX_DIR([autoconf]) 17AC_CONFIG_MACRO_DIR([autoconf/m4]) 18 19if test "x$enable_dynamic_linking" = "x"; then 20 echo "Please use ./Config instead of ./configure" 21 exit 1 22fi 23 24dnl Calculate the versions. Perhaps the use of expr is a little too extravagant 25# Generation version number (e.g.: 3 for Unreal3*) 26UNREAL_VERSION_GENERATION=["`expr $PACKAGE_VERSION : '\([^.]*\)\.[^.]*\.[^.-_]*'`"] 27AC_DEFINE_UNQUOTED([UNREAL_VERSION_GENERATION], [$UNREAL_VERSION_GENERATION], [Generation version number (e.g.: 3 for Unreal3*)]) 28 29# Major version number (e.g.: 2 for Unreal3.2*) 30UNREAL_VERSION_MAJOR=["`expr $PACKAGE_VERSION : '[0-9]*\.\([0-9]*\)\.[0-9]*'`"] 31AC_DEFINE_UNQUOTED([UNREAL_VERSION_MAJOR], [$UNREAL_VERSION_MAJOR], [Major version number (e.g.: 2 for Unreal3.2*)]) 32 33# Minor version number (e.g.: 1 for Unreal3.2.1) 34UNREAL_VERSION_MINOR=["`expr $PACKAGE_VERSION : '[0-9]*\.[0-9]*\.\([0-9]*\)'`"] 35AC_DEFINE_UNQUOTED([UNREAL_VERSION_MINOR], [$UNREAL_VERSION_MINOR], [Minor version number (e.g.: 1 for Unreal3.2.1)]) 36 37# The version suffix such as a beta marker or release candidate 38# marker. (e.g.: -rc2 for unrealircd-3.2.9-rc2). This macro is a 39# string instead of an integer because it contains arbitrary data. 40UNREAL_VERSION_SUFFIX=["`expr $PACKAGE_VERSION : '[0-9]*\.[0-9]*\.[0-9]*\(.*\)'`"] 41AC_DEFINE_UNQUOTED([UNREAL_VERSION_SUFFIX], ["$UNREAL_VERSION_SUFFIX"], [Version suffix such as a beta marker or release candidate marker. (e.g.: -rc2 for unrealircd-3.2.9-rc2)]) 42 43AC_PROG_CC 44if test "$ac_cv_prog_gcc" = "yes"; then 45CFLAGS="$CFLAGS -funsigned-char" 46AC_CACHE_CHECK(if gcc has a working -pipe, ac_cv_pipe, [ 47 save_cflags="$CFLAGS" 48 CFLAGS="$CFLAGS -pipe" 49 AC_TRY_COMPILE(,, ac_cv_pipe="yes", ac_cv_pipe="no") 50 CFLAGS="$save_cflags" 51]) 52if test "$ac_cv_pipe" = "yes"; then 53CFLAGS="-pipe $CFLAGS" 54fi 55fi 56 57dnl (the gcc flag detection trick is taken from xemacs/Vin Shelton) 58 59dnl UnrealIRCd might not be strict-aliasing safe at this time 60case "`$CC -v --help 2>&1`" in 61 *-fstrict-aliasing* ) CFLAGS="$CFLAGS -fno-strict-aliasing" ;; 62esac 63 64dnl Pointer signedness warnings are really a pain and 99.9% of the time 65dnl they are of absolutely no use whatsoever. IMO the person who decided 66dnl to enable this without -Wall should be shot on sight. 67case "`$CC -v --help 2>&1`" in 68 *-Wpointer-sign* ) CFLAGS="$CFLAGS -Wno-pointer-sign" ;; 69esac 70 71AC_PATH_PROG(RM,rm) 72AC_PATH_PROG(CP,cp) 73AC_PATH_PROG(TOUCH,touch) 74AC_PATH_PROG(OPENSSLPATH,openssl) 75AC_PATH_PROG(INSTALL,install) 76AC_CHECK_PROG(MAKER, gmake, gmake, make) 77AC_PATH_PROG(GMAKE,gmake) 78AC_PATH_PROG(GUNZIP, gunzip) 79AC_PATH_PROG(PKGCONFIG, pkg-config) 80 81dnl Checks for libraries. 82AC_CHECK_LIB(descrypt, crypt, 83 [AC_DEFINE([HAVE_CRYPT], [], [Define if you have crypt]) 84 IRCDLIBS="$IRCDLIBS-ldescrypt " 85 MKPASSWDLIBS="-ldescrypt"], 86 [AC_CHECK_LIB(crypt, crypt, 87 [AC_DEFINE([HAVE_CRYPT], [], [Define if you have crypt]) 88 IRCDLIBS="$IRCDLIBS-lcrypt " 89 MKPASSWDLIBS="-lcrypt"])]) 90AC_CHECK_LIB(socket, socket, 91 [IRCDLIBS="$IRCDLIBS-lsocket " 92 SOCKLIB="-lsocket"]) 93AC_CHECK_LIB(nsl, inet_ntoa, 94 [IRCDLIBS="$IRCDLIBS-lnsl " 95 INETLIB="-lnsl"]) 96AC_CHECK_LIB(crypto, RAND_egd, 97 AC_DEFINE(HAVE_RAND_EGD, 1, [Define if the libcrypto has RAND_egd])) 98 99AC_SUBST(IRCDLIBS) 100AC_SUBST(MKPASSWDLIBS) 101 102dnl module checking based on Hyb7's module checking code 103AC_DEFUN([AC_ENABLE_DYN], 104[ 105AC_CHECK_FUNC(dlopen,, [AC_CHECK_LIB(dl, dlopen,IRCDLIBS="$IRCDLIBS -ldl", 106[ 107AC_MSG_WARN(Dynamic linking is not enabled because dlopen was not found) 108AC_DEFINE(STATIC_LINKING) 109])]) 110 111hold_cflags=$CFLAGS 112CFLAGS="$CFLAGS -Wl,-export-dynamic" 113AC_CACHE_CHECK(if we need the -export-dynamic flag, ac_cv_export_dynamic, [ 114AC_TRY_LINK(, [int i];, ac_cv_export_dynamic=yes, ac_cv_export_dynamic=no)]) 115if test "$ac_cv_export_dynamic" = "no"; then 116CFLAGS=$hold_cflags 117fi 118 119AC_CACHE_CHECK(for compiler option to produce PIC,ac_cv_pic,[ 120if test "$ac_cv_prog_gcc" = "yes"; then 121 ac_cv_pic="-fPIC -DPIC -shared" 122 case `uname -s` in 123 Darwin*[)] 124 ac_cv_pic="-std=gnu89 -bundle -flat_namespace -undefined suppress" 125 ;; 126 HP-UX*[)] 127 ac_cv_pic="-fPIC" 128 ;; 129 esac 130else 131case `uname -s` in 132 SunOS*[)] 133 ac_cv_pic="-KPIC -DPIC -G" 134 ;; 135esac 136fi 137]) 138AC_CACHE_CHECK(if your system prepends an underscore on symbols,ac_cv_underscore,[ 139cat >uscore.c << __EOF__ 140int main() { 141 return 0; 142} 143__EOF__ 144$CC -o uscore $CFLAGS uscore.c 1>&5 145if test -z "`strings -a uscore |grep '^_main$'`"; then 146ac_cv_underscore=no 147else 148ac_cv_underscore=yes 149fi 150rm -f uscore uscore.c 151]) 152dnl libtool has built-in tests that determine proper underscorage 153if test "$ac_cv_underscore" = "yes"; then 154 AC_DEFINE([UNDERSCORE], [], [Define if your system prepends an underscore to symbols]) 155fi 156 157MODULEFLAGS=$ac_cv_pic 158dnl DYNAMIC_LINKING is not meant to be defined in include/setup.h, it's 159dnl defined in the Makefiles using -D. Having it defined globally will 160dnl only cause braindamage and symbol collisions :-D. 161dnl AC_DEFINE([DYNAMIC_LINKING], [], [Link dynamically as opposed to statically. (Dynamic linking is the only supported method of linking atm)]) 162]) 163AC_DEFUN([AC_ENABLE_INET6],[ 164 AC_CACHE_CHECK([if your system has IPv6 support], [ac_cv_ip6], [ 165 save_libs="$LIBS" 166 LIBS="$LIBS $SOCKLIB" 167 AC_TRY_RUN([ 168#include <sys/types.h> 169#include <sys/socket.h> 170int main() { 171if (socket(AF_INET6, SOCK_STREAM, 0) < 0) 172exit(1); 173exit(0); 174} 175 ], 176 [ac_cv_ip6=yes], 177 [ac_cv_ip6=no]) 178 ]) 179 if test "$ac_cv_ip6" = "no"; then 180 AC_MSG_ERROR([Your system does not support IPv6 so it will not be enabled]) 181 else 182 AC_DEFINE([INET6], [], [Define if you want IPv6 enabled]) 183 dnl in6addr_any detection code taken from ratbox 184 AC_MSG_CHECKING([for struct in6addr_any]) 185 AC_COMPILE_IFELSE( 186 [AC_LANG_PROGRAM( 187 [[#define IN_AUTOCONF 188 #include <sys/types.h> 189 #include <sys/socket.h> 190 #include <netinet/in.h>]], 191 [[struct in6_addr a = in6addr_any;]] 192 )], 193 [AC_MSG_RESULT(yes)], 194 [ 195 AC_MSG_RESULT([no]) 196 AC_DEFINE([NO_IN6ADDR_ANY], [1], [Define to 1 if your system has no in6addr_any.]) 197 ] 198 ) 199 fi 200 LIBS="$save_libs" 201]) 202 203AC_CHECK_HEADER(sys/param.h, 204 AC_DEFINE([PARAMH], [], [Define if you have the <sys/param.h> header file.])) 205AC_CHECK_HEADER(stdlib.h, 206 AC_DEFINE([STDLIBH], [], [Define if you have the <stdlib.h> header file.])) 207AC_CHECK_HEADER(stddef.h, 208 AC_DEFINE([STDDEFH], [], [Define if you have the <stddef.h> header file.])) 209AC_CHECK_HEADER(sys/syslog.h, 210 AC_DEFINE([SYSSYSLOGH], [], [Define if you have the <sys/syslog.h> header file.])) 211AC_CHECK_HEADER(unistd.h, 212 AC_DEFINE([UNISTDH], [], [Define if you have the <unistd.h> header file.])) 213AC_CHECK_HEADER(string.h, 214 AC_DEFINE([STRINGH], [], [Define if you have the <string.h> header file.])) 215AC_CHECK_HEADER(strings.h, 216 AC_DEFINE([STRINGSH], [], [Define if you have the <strings.h> header file.])) 217AC_CHECK_HEADER(malloc.h, 218 AC_DEFINE([MALLOCH], [<malloc.h>], [Define to <malloc.h> you need malloc.h.])) 219AC_CHECK_HEADER(sys/rusage.h, 220 AC_DEFINE([RUSAGEH], [], [Define if you have the <sys/rusage.h> header file.])) 221AC_CHECK_HEADER(glob.h, 222 AC_DEFINE([GLOBH], [], [Define if you have the <glob.h> header file.])) 223AC_CHECK_HEADERS([stdint.h inttypes.h]) 224dnl Checks for typedefs, structures, and compiler characteristics. 225AC_C_CONST 226AC_C_INLINE 227 228AC_TYPE_MODE_T 229AC_TYPE_SIZE_T 230AC_TYPE_INTPTR_T 231 232AC_HEADER_TIME 233AC_STRUCT_TM 234AC_TYPE_UID_T 235unreal_CHECK_TYPE_SIZES 236 237dnl in the future, it would be nice to avoid AC_TRY_RUN to allow 238dnl better support for crosscompiling. 239AC_CACHE_CHECK([what kind of nonblocking sockets you have], [ac_cv_nonblocking],[ 240save_libs="$LIBS" 241LIBS="$LIBS $SOCKLIB" 242AC_TRY_RUN([ 243#include <sys/types.h> 244#include <sys/socket.h> 245#include <fcntl.h> 246#include <sys/ioctl.h> 247#include <sys/file.h> 248#include <signal.h> 249alarmed() { 250exit(1); 251} 252int main() { 253#ifdef O_NONBLOCK 254char b[12], x[32]; 255int f, l = sizeof(x); 256f = socket(AF_INET, SOCK_DGRAM, 0); 257if (f >= 0 && !(fcntl(f, F_SETFL, O_NONBLOCK))) { 258signal(SIGALRM, alarmed); 259alarm(3); 260recvfrom(f, b, 12, 0, (struct sockaddr *)x, &l); 261alarm(0); 262exit(0); 263} 264#endif 265exit(1); 266} 267],ac_cv_nonblocking=O_NONBLOCK,[ 268AC_TRY_RUN([ 269#include <sys/types.h> 270#include <sys/socket.h> 271#include <fcntl.h> 272#include <sys/ioctl.h> 273#include <sys/file.h> 274#include <signal.h> 275alarmed() { 276exit(0); 277} 278int main() { 279#ifdef O_NDELAY 280char b[12], x[32]; 281int f, l = sizeof(x); 282f = socket(AF_INET, SOCK_DGRAM, 0); 283if (f >= 0 && !(fcntl(f, F_SETFL, O_NDELAY))) { 284signal(SIGALRM, alarmed); 285alarm(3); 286recvfrom(f, b, 12, 0, (struct sockaddr *)x, &l); 287alarm(0); 288exit(0); 289} 290#endif 291exit(1); 292}],ac_cv_nonblocking=O_NDELAY,[ 293AC_TRY_RUN([ 294#include <sys/types.h> 295#include <sys/socket.h> 296#include <fcntl.h> 297#include <sys/ioctl.h> 298#include <sys/file.h> 299#include <signal.h> 300alarmed() { 301exit(1); 302} 303int main() { 304#ifdef FIONBIO 305char b[12], x[32]; 306int f, l = sizeof(x); 307f = socket(AF_INET, SOCK_DGRAM, 0); 308if (f >= 0 && !(fcntl(f, F_SETFL, FIONBIO))) { 309signal(SIGALRM, alarmed); 310alarm(3); 311recvfrom(f, b, 12, 0, (struct sockaddr *)x, &l); 312alarm(0); 313exit(0); 314} 315#endif 316exit(1); 317], ac_cv_nonblocking=FIONBIO,ac_cv_nonblocking=none)])])]) 318if test "$ac_cv_nonblocking" = "O_NONBLOCK"; then 319 AC_DEFINE([NBLOCK_POSIX], [], [Define if you have O_NONBLOCK]) 320elif test "$ac_cv_nonblocking" = "O_NDELAY"; then 321 AC_DEFINE([NBLOCK_BSD], [], [Define if you have O_NDELAY]) 322elif test "$ac_cv_nonblocking" = "FIONBIO"; then 323 AC_DEFINE([NBLOCK_SYSV], [], [Define if you have FIONBIO]) 324fi 325LIBS="$save_libs" 326dnl Checks for library functions. 327AC_PROG_GCC_TRADITIONAL 328AC_FUNC_SETPGRP 329AC_FUNC_SETVBUF_REVERSED 330AC_FUNC_ALLOCA 331AC_CHECK_FUNCS(snprintf, 332 AC_DEFINE([HAVE_SNPRINTF], [], [Define if you have snprintf])) 333AC_CHECK_FUNCS(vsnprintf, 334 AC_DEFINE([HAVE_VSNPRINTF], [], [Define if you have vsnprintf])) 335AC_CHECK_FUNCS(strlcpy, 336 AC_DEFINE([HAVE_STRLCPY], [], [Define if you have strlcpy. Otherwise, an internal implementation will be used!])) 337AC_CHECK_FUNCS(strlcat, 338 AC_DEFINE([HAVE_STRLCAT], [], [Define if you have strlcat])) 339AC_CHECK_FUNCS(strlncat, 340 AC_DEFINE([HAVE_STRLNCAT], [], [Define if you have strlncat])) 341AC_CHECK_FUNCS(inet_pton, 342 AC_DEFINE([HAVE_INET_PTON], [], [Define if you have inet_pton])) 343AC_CHECK_FUNCS(inet_ntop, 344 AC_DEFINE([HAVE_INET_NTOP], [], [Define if you have inet_ntop])) 345dnl Check if it supports C99 style variable length arrays 346AC_CACHE_CHECK([if C99 variable length arrays are supported], [ac_cv_varlen_arrays], [ 347AC_TRY_COMPILE(,[ 348int main() { 349int i = 5; 350int a[i]; 351a[0] = 1; 352return 0; 353}], ac_cv_varlen_arrays=yes, ac_cv_varlen_arrays=no) 354]) 355if test "$ac_cv_varlen_arrays" = "yes" ; then 356 AC_DEFINE([HAVE_C99_VARLEN_ARRAY], [], [Define if you have a compiler with C99 variable length array support]) 357fi 358 359dnl This check doesn't need to be in ./configure, we can 360dnl write the sourcecode to actually handle the return value 361dnl of setrlimit if necessary... -- ohnobinki 362AC_CACHE_CHECK([if we can set the core size to unlimited], [ac_cv_force_core], [ 363AC_TRY_RUN([ 364#include <sys/time.h> 365#include <sys/resource.h> 366#include <unistd.h> 367int main() { 368struct rlimit corelim; 369corelim.rlim_cur = corelim.rlim_max = RLIM_INFINITY; 370if (setrlimit(RLIMIT_CORE, &corelim)) 371exit(1); 372exit(0); 373} 374],ac_cv_force_core=yes,ac_cv_force_core=no) 375]) 376if test "$ac_cv_force_core" = "yes"; then 377 AC_DEFINE([FORCE_CORE], [], [Define if you can set the core size to unlimited]) 378fi 379AC_FUNC_VPRINTF 380AC_CHECK_FUNCS([gettimeofday], 381 [AC_DEFINE([GETTIMEOFDAY], [], [Define if you have gettimeofday])], 382 [AC_CHECK_FUNCS([lrand48], 383 [AC_DEFINE([LRADN48], [], [Define if you have lrand48])])]) 384AC_CHECK_FUNCS([getrusage], 385 [AC_DEFINE([GETRUSAGE_2], [], [Define if you have getrusage])], 386 [AC_CHECK_FUNCS([times], 387 [AC_DEFINE([TIMES_2], [], [Define if you have times])])]) 388AC_CHECK_FUNCS([setproctitle], 389 [AC_DEFINE([HAVE_SETPROCTITLE], [], [Define if you have setproctitle])], 390 [AC_CHECK_LIB([util], 391 [setproctitle], 392 [AC_DEFINE([HAVE_SETPROCTITLE], [], [Define if you have setproctitle]) 393 IRCDLIBS="$IRCDLIBS-lutil"], 394 [ 395 AC_EGREP_HEADER([#define.*PS_STRINGS.*],[sys/exec.h], 396 [AC_DEFINE([HAVE_PSSTRINGS],[], [Define if you have PS_STRINGS])], 397 [AC_CHECK_FUNCS([pstat], 398 [AC_DEFINE([HAVE_PSTAT], [], [Define if you have pstat])])]) 399 ]) 400 ] 401) 402 403 404AC_CACHE_CHECK([what type of signals you have], [ac_cv_sigtype], [ 405AC_TRY_RUN([ 406#include <signal.h> 407int main() { 408sigaction(SIGTERM, (struct sigaction *)0L, (struct sigaction *)0L); 409} 410], ac_cv_sigtype=POSIX, [ 411AC_TRY_RUN([ 412#include <signal.h> 413int calls = 0; 414void handler() 415{ 416if (calls) 417return; 418calls++; 419kill(getpid(), SIGTERM); 420sleep(1); 421} 422 423int main() { 424signal(SIGTERM, handler); 425kill(getpid(), SIGTERM); 426exit(0); 427} 428], ac_cv_sigtype=BSD,ac_cv_sigtype=SYSV)])]) 429 430if test "$ac_cv_sigtype" = "POSIX"; then 431 AC_DEFINE([POSIX_SIGNALS], [], [Define if you have POSIX signals]) 432elif test "$ac_cv_sigtype" = "BSD"; then 433 AC_DEFINE([BSD_RELIABLE_SIGNALS], [], [Define if you have BSD signals]) 434else 435 AC_DEFINE([SYSV_UNRELIABLE_SIGNALS], [], [Define if you have SYSV signals]) 436fi 437AC_CHECK_FUNCS(strtoken,,AC_DEFINE([NEED_STRTOKEN], [], [Define if you need the strtoken function.])) 438AC_CHECK_FUNCS(strtok,,AC_DEFINE([NEED_STRTOK], [], [Define if you need the strtok function.])) 439AC_CHECK_FUNCS(strerror,,AC_DEFINE([NEED_STRERROR], [], [Define if you need the strerror function.])) 440AC_CHECK_FUNCS(index,,AC_DEFINE([NOINDEX], [], [Define if you do not have the index function.])) 441AC_CHECK_FUNCS(strtoul,,STRTOUL="strtoul.o") 442AC_CHECK_FUNCS(bcopy,,AC_DEFINE([NEED_BCOPY], [], [Define if you don't have bcopy])) 443AC_CHECK_FUNCS(bcmp,,AC_DEFINE([NEED_BCMP], [], [Define if you don't have bcmp])) 444AC_CHECK_FUNCS(bzero,,AC_DEFINE([NEED_BZERO], [], [Define if you need bzero])) 445AC_CHECK_FUNCS(strcasecmp,AC_DEFINE([GOT_STRCASECMP], [], [Define if you have strcasecmp])) 446save_libs="$LIBS" 447LIBS="$LIBS $SOCKLIB $INETLIB" 448AC_CHECK_FUNCS(inet_addr,,AC_DEFINE([NEED_INET_ADDR], [], [Define if you need inet_addr])) 449AC_CHECK_FUNCS(inet_ntoa,,AC_DEFINE([NEED_INET_NTOA], [], [Define if you need inet_ntoa])) 450AC_CHECK_FUNCS(inet_netof,,AC_DEFINE([NEED_INET_NETOF], [], [Define if you need inet_netof])) 451LIBS="$save_libs" 452AC_CHECK_FUNCS(syslog,AC_DEFINE([HAVE_SYSLOG], [], [Define if you have syslog])) 453AC_SUBST(STRTOUL) 454AC_SUBST(CRYPTOLIB) 455AC_SUBST(MODULEFLAGS) 456AC_ARG_WITH(listen, [AS_HELP_STRING([--with-listen=backlog],[Specify the listen backlog value])], 457 [AC_DEFINE_UNQUOTED([LISTEN_SIZE], [$withval], [Set to the listen backlog size you want])], 458 [AC_DEFINE([LISTEN_SIZE], [5], [Set to the listen backlog size you want])]) 459AC_ARG_WITH(nick-history, [AS_HELP_STRING([--with-nick-history=length],[Specify the length of the nickname history])], 460 [AC_DEFINE_UNQUOTED([NICKNAMEHISTORYLENGTH], [$withval], [Set to the nickname history length you want])], 461 [AC_DEFINE([NICKNAMEHISTORYLENGTH], [2000], [Set to the nickname history length you want])]) 462AC_ARG_WITH([sendq], [AS_HELP_STRING([--with-sendq=maxsendq],[Specify the max sendq for the server])], 463 [AC_DEFINE_UNQUOTED([MAXSENDQLENGTH], [$withval], [Set to the max sendq you want])], 464 [AC_DEFINE([MAXSENDQLENGTH], [3000000], [Set to the max sendq you want])]) 465AC_ARG_WITH(bufferpool, [AS_HELP_STRING([--with-bufferpool=size],[Specify the size of the buffer pool])], 466 [AC_DEFINE_UNQUOTED([BUFFERPOOL],[($withval * MAXSENDQLENGTH)], [Set to the bufferpool size you want])], 467 [AC_DEFINE([BUFFERPOOL],[(18 * MAXSENDQLENGTH)], [Set to the bufferpool size you want])]) 468AC_ARG_WITH(permissions, [AS_HELP_STRING([--with-permissions=permissions], [Specify the default permissions for 469configuration files])], 470 dnl We have an apparently out-of-place 0 here because of a MacOSX bug and because 471 dnl we assume that a user thinks that `chmod 0600 blah' is the same as `chmod 600 blah' 472 dnl (#3189) 473 [AC_DEFINE_UNQUOTED([DEFAULT_PERMISSIONS], [0$withval], [The default permissions for configuration files. Set to 0 to prevent unrealircd from calling chmod() on the files.])], 474 [AC_DEFINE([DEFAULT_PERMISSIONS], [0600], [The default permissions for configuration files. Set to 0 to prevent unrealircd from calling chmod() on the files.])]) 475AC_ARG_WITH(dpath, [AS_HELP_STRING([--with-dpath=path],[Specify the path where configuration files are stored])], 476 [AC_DEFINE_UNQUOTED([DPATH], ["$withval"], [Define the location of the configuration files]) 477 IRCDDIR="$withval"], 478 [AC_DEFINE_UNQUOTED([DPATH], ["`pwd`"], [Define the location of the configuration files]) 479 IRCDDIR="`pwd`"]) 480 481AC_ARG_WITH(fd-setsize, [AS_HELP_STRING([--with-fd-setsize=size], [Specify the max file descriptors to use])], 482 [ac_fd=$withval], 483 [ac_fd=1024]) 484AC_DEFINE_UNQUOTED([MAXCONNECTIONS], [$ac_fd], [Set to the max connections you want]) 485 486dnl It would be nice if this could just respect --bindir like every other 487dnl program does someday... -- ohnobinki 488AC_ARG_WITH(spath, [AS_HELP_STRING([--with-spath],[Specify the location of the executable])], 489 [AC_DEFINE_UNQUOTED([SPATH], ["$withval"], [Define the location of the executable]) 490 BINDIR="$withval"], 491 [AC_DEFINE_UNQUOTED([SPATH], ["`pwd`/src/ircd"], [Define the location of the executable]) 492 BINDIR="`pwd`/src/ircd"]) 493 494AC_ARG_ENABLE([prefixaq], 495 [AS_HELP_STRING([--disable-prefixaq],[Enable chanadmin (+a) and chanowner (+q) prefixes])], 496 [], 497 [enable_prefixaq=yes]) 498AS_IF([test $enable_prefixaq = "yes"], 499 [AC_DEFINE([PREFIX_AQ], [], [Define if you want +a/+q prefixes])]) 500 501AC_ARG_WITH(showlistmodes, 502 [AS_HELP_STRING([--with-showlistmodes], [Specify whether modes are shown in /list])], 503 [AS_IF([test $withval = "yes"], 504 [AC_DEFINE([LIST_SHOW_MODES], [], [Define if you want modes shown in /list])])]) 505AC_ARG_WITH(topicisnuhost, [AS_HELP_STRING([--with-topicisnuhost], [Display nick!user@host as the topic setter])], 506 [AS_IF([test $withval = "yes"], 507 [AC_DEFINE([TOPIC_NICK_IS_NUHOST], [], [Define if you want nick!user@host shown for the topic setter])])]) 508AC_ARG_WITH(shunnotices, [AS_HELP_STRING([--with-shunnotices], [Notify a user when he/she is no longer shunned])], 509 [AS_IF([test $withval = "yes"], 510 [AC_DEFINE([SHUN_NOTICES], [], [Define if you want users to be notified when their shun is removed])])]) 511AC_ARG_WITH(no-operoverride, [AS_HELP_STRING([--with-no-operoverride], [Disable OperOverride])], 512 [AS_IF([test $withval = "yes"], 513 [AC_DEFINE([NO_OPEROVERRIDE], [], [Define if you want OperOverride disabled])])]) 514AC_ARG_WITH(disableusermod, [AS_HELP_STRING([--with-disableusermod], [Disable /set* and /chg*])], 515 [AS_IF([test $withval = "yes"], 516 [AC_DEFINE([DISABLE_USERMOD], [], [Define if you want to disable /set* and /chg*])])]) 517AC_ARG_WITH(operoverride-verify, [AS_HELP_STRING([--with-operoverride-verify], [Require opers to invite themselves to +s/+p channels])], 518 [AS_IF([test $withval = "yes"], 519 [AC_DEFINE([OPEROVERRIDE_VERIFY], [], [Define if you want opers to have to use /invite to join +s/+p channels])])]) 520AC_ARG_WITH(disable-extendedban-stacking, [AS_HELP_STRING([--with-disable-extendedban-stacking], [Disable extended ban stacking])], 521 [AS_IF([test $withval = "yes"], 522 [AC_DEFINE([DISABLE_STACKED_EXTBANS], [], [Define to disable extended ban stacking (~q:~c:\#chan, etc)])])]) 523AC_ARG_WITH(system-tre, [AS_HELP_STRING([--with-system-tre], [Use the system tre package instead of bundled, discovered using pkg-config])], [], [with_system_tre=no]) 524AC_ARG_WITH(system-cares, [AS_HELP_STRING([--with-system-cares], [Use the system c-ares (at least version 1.6.0) package instead of bundled c-ares, discovered using pkg-config])], [], [with_system_cares=no]) 525CHECK_SSL 526CHECK_ZLIB 527AC_ARG_ENABLE(dynamic-linking, [AS_HELP_STRING([--disable-dynamic-linking], [Make the IRCd statically link with shared objects rather than dynamically (noone knows if disabling dynamic linking actually does anything or not)])], 528 [enable_dynamic_linking=$enableval], [enable_dynamic_linking="yes"]) 529AS_IF([test $enable_dynamic_linking = "yes"], 530 [AC_ENABLE_DYN], 531 [AC_DEFINE([STATIC_LINKING], [], [Link... statically(?) (defining this macro will probably cause the build tofail)])]) 532 533AC_ARG_ENABLE([inet6], [AS_HELP_STRING([--enable-inet6], [Make the IRCd support IPv6])], 534 [AS_IF([test $enableval = "yes"], 535 [AC_ENABLE_INET6])]) 536AC_SUBST(IRCDDIR) 537AC_SUBST(BINDIR) 538AC_MSG_CHECKING([if FD_SETSIZE is large enough to allow $ac_fd file descriptors]) 539AC_COMPILE_IFELSE([ 540#include <sys/types.h> 541#include <sys/time.h> 542int main() { 543#if FD_SETSIZE < $ac_fd 544#error FD_SETSIZE is smaller than $ac_fd 545#endif 546exit(0); 547} 548], AC_MSG_RESULT([yes]), [ 549# must be passed on the commandline to avoid a ``warning, you redefined something'' 550FD_SETSIZE="-DFD_SETSIZE=$ac_fd" 551AC_MSG_RESULT(no) 552]) 553AC_SUBST([FD_SETSIZE]) 554 555case `uname -s` in 556 *SunOS*|*solaris*) 557 AC_DEFINE([_SOLARIS], [], [Define if you are compiling unrealircd on Sun's (or Oracle's?) Solaris]) 558 IRCDLIBS="$IRCDLIBS -lresolv " 559 ;; 560esac 561 562dnl c-ares needs PATH_SEPARATOR set or it will 563dnl fail on certain solaris boxes. We might as 564dnl well set it here. 565export PATH_SEPARATOR 566 567AS_IF([test "x$with_system_tre" = "xno"],[ 568dnl REMEMBER TO CHANGE WITH A NEW TRE RELEASE! 569tre_version="0.8.0" 570AC_MSG_RESULT(extracting TRE regex library) 571cur_dir=`pwd` 572cd extras 573dnl remove old tre directory to force a recompile... 574dnl and remove its installation prefix just to clean things up. 575rm -rf tre-$tre_version rege[]xp 576if test "x$ac_cv_path_GUNZIP" = "x" ; then 577 tar xfz tre.tar.gz 578else 579 cp tre.tar.gz tre.tar.gz.bak 580 gunzip -f tre.tar.gz 581 cp tre.tar.gz.bak tre.tar.gz 582 tar xf tre.tar 583fi 584AC_MSG_RESULT(configuring TRE regex library) 585cd tre-$tre_version 586./configure --disable-agrep --disable-shared --disable-system-abi --disable-wchar --disable-multibyte --prefix=$cur_dir/extras/regexp || exit 1 587AC_MSG_RESULT(compiling TRE regex library) 588$ac_cv_prog_MAKER || exit 1 589AC_MSG_RESULT(installing TRE regex library) 590$ac_cv_prog_MAKER install || exit 1 591TRE_CFLAGS="-I$cur_dir/extras/regexp/include" 592AC_SUBST(TRE_CFLAGS) 593 594TRE_LIBS= 595dnl See c-ares's compilation section for more info on this hack. 596dnl ensure that we're linking against the bundled version of tre 597dnl (we only reach this code if linking against the bundled version is desired). 598AS_IF([test -n "$ac_cv_path_PKGCONFIG"], 599 [TRE_LIBS="`$ac_cv_path_PKGCONFIG --static --libs tre.pc | sed -e ['s,-L\([^ ]*regex[^ ]*lib\)\( .*\)-ltre,\1/libtre.a \2,']`"]) 600dnl For when pkg-config isn't available -- or for when pkg-config 601dnl doesn't see the tre.pc file somehow... (#3982) 602AS_IF([test -z "$TRE_LIBS"], 603 [TRE_LIBS="../extras/regexp/lib/libtre.a"]) 604AC_SUBST(TRE_LIBS) 605cd $cur_dir 606],[ 607dnl use pkgconfig for tre: 608PKG_CHECK_MODULES([TRE], tre >= 0.7.5) 609]) 610 611AS_IF([test "x$with_system_cares" = "xno"],[ 612dnl REMEMBER TO CHANGE WITH A NEW C-ARES RELEASE! 613dnl NOTE: when changing this here, ALSO change it in ./curlinstall 614dnl and in the comment in this file around line 400! 615cares_version="1.10.0" 616AC_MSG_RESULT(extracting c-ares resolver library) 617cur_dir=`pwd` 618cd extras 619dnl remove old c-ares directory to force a recompile... 620rm -rf c-ares-$cares_version c-ares 621if test "x$ac_cv_path_GUNZIP" = "x" ; then 622 tar xfz c-ares.tar.gz 623else 624 cp c-ares.tar.gz c-ares.tar.gz.bak 625 gunzip -f c-ares.tar.gz 626 cp c-ares.tar.gz.bak c-ares.tar.gz 627 tar xf c-ares.tar 628fi 629AC_MSG_RESULT(configuring c-ares library) 630cd c-ares-$cares_version 631./configure --prefix=$cur_dir/extras/c-ares --disable-shared || exit 1 632AC_MSG_RESULT(compiling c-ares resolver library) 633$ac_cv_prog_MAKER || exit 1 634AC_MSG_RESULT(installing c-ares resolver library) 635$ac_cv_prog_MAKER install || exit 1 636CARES_CFLAGS="-I$cur_dir/extras/c-ares/include" 637AC_SUBST(CARES_CFLAGS) 638CARES_LIBS="-L../extras/c-ares/lib" 639 640dnl Set default library parameters for when pkg-config is not available 641dnl Ugly cd'ing out of extras/c-ares-xxx ;) 642dnl Note: must be a full path, not relative path. 643cd ../.. 644CARESLIBSALT="`pwd`/extras/c-ares/lib/libcares.a" 645cd - 646case `uname -s` in 647 *FreeBSD*) 648 CARESLIBSALT="$CARESLIBSALT" 649 ;; 650 *Linux*) 651 CARESLIBSALT="$CARESLIBSALT -lrt" 652 ;; 653 *SunOS*) 654 CARESLIBSALT="$CARESLIBSALT -lrt" 655 ;; 656esac 657 658dnl Use pkg-config for c-ares libraries, and if not available use defaults 659dnl from above. Also, if pkg-config returns an empty result (ex: on fbsd 660dnl or older versions it might be missing --static) then also use defaults. 661if test "x$ac_cv_path_PKGCONFIG" = "x" ; then 662 CARES_LIBS="$CARES_LIBS $CARESLIBSALT" 663else 664 CARES_LIBSPRE="$CARES_LIBS" 665 dnl the sed expression forces an absolute path to the .a file to be generated 666 dnl because this is what libtool would do. If this wasn't done and /usr/lib*/libcares.so 667 dnl exists, then unrealircd would still try to link against the system c-ares. 668 dnl The [] quotation is needed because the sed expression has [] in it. 669 [CARES_LIBS="$CARES_LIBS `$ac_cv_path_PKGCONFIG --static --libs libcares.pc | sed -e 's,-L\([^ ]\+lib\) -lcares,\1/libcares.a,'`"] 670 if test "$CARES_LIBS" = "$CARES_LIBSPRE " ; then 671 CARES_LIBS="$CARES_LIBS $CARESLIBSALT" 672 fi 673fi 674AC_SUBST(CARES_LIBS) 675cd $cur_dir 676],[ 677dnl use pkg-config for system c-ares: 678PKG_CHECK_MODULES([CARES], libcares >= 1.6.0) 679]) 680 681CHECK_LIBCURL 682 683AC_CONFIG_FILES([Makefile 684 src/modules/Makefile 685 unreal 686 ircdcron/ircdchk 687 ircdcron/ircd.cron]) 688AC_OUTPUT 689chmod 0700 unreal 690chmod 0700 ircdcron/ircdchk 691