- Move configure.ac to the project's root.

- Separate m4 macros into *.m4 files (it is much easier to run aclocal now).
- Remove unused DOMAINNAME macro and --with-hostname= options as the DOMAINNAME macro isn't used anywheres and its use shouldn't be encouraged.
- autogen.sh to bootstrap the buildsystem. We now maintain setup.h with autoheader.
- --disable-blah now does the opposite of --enable-blah. The same for --with-blah and --without-blah. (This makes Gentoo users happier).
pull/2/head
binki 13 years ago
parent 5cf8ee21a0
commit 7dbf154d04

@ -2007,3 +2007,10 @@
- Replaced some coders@lists.unrealircd.org references with bugs.unrealircd.org
- Fixed desynchronized prototype.
- Fixed a few trivial compilation warnings.
- Move configure.ac to the project's root.
- Separate m4 macros into *.m4 files (it is much easier to run aclocal now).
- Remove unused DOMAINNAME macro and --with-hostname= options as the DOMAINNAME
macro isn't used anywheres and its use shouldn't be encouraged.
- autogen.sh to bootstrap the buildsystem. We now maintain setup.h with autoheader.
- --disable-blah now does the opposite of --enable-blah. The same for --with-blah
and --without-blah. (This makes Gentoo users happier).

@ -77,7 +77,6 @@ ARG="$ARG--with-spath=$SPATH "
ARG="$ARG--with-nick-history=$NICKNAMEHISTORYLENGTH "
ARG="$ARG--with-sendq=$MAXSENDQLENGTH "
ARG="$ARG--with-bufferpool=$BUFFERPOOL "
ARG="$ARG--with-hostname=$DOMAINNAME "
ARG="$ARG--with-permissions=$DEFPERM "
ARG="$ARG--with-fd-setsize=$MAXCONNECTIONS "
ARG="$ARG--enable-dynamic-linking "
@ -314,7 +313,6 @@ UNREALCWD="`pwd`"
NOSPOOF="1"
DPATH="`pwd`"
SPATH="`pwd`/src/ircd"
DOMAINNAME=`hostname`
DEFPERM="0600"
CRYPTOIRCD=""
SSLDIR=""
@ -479,17 +477,6 @@ while [ -z "$TEST" ] ; do
fi
done
TEST="$DOMAINNAME"
echo ""
echo "What is the hostname of the server running your IRCd?"
echo $n "[$TEST] -> $c"
read cc
if [ -z "$cc" ] ; then
DOMAINNAME=$TEST
else
DOMAINNAME=`eval echo $cc` # modified
fi
TEST=""
while [ -z "$TEST" ] ; do
TEST="$DEFPERM"
@ -916,7 +903,6 @@ MAXSENDQLENGTH="$MAXSENDQLENGTH"
BUFFERPOOL="$BUFFERPOOL"
MAXCONNECTIONS="$MAXCONNECTIONS"
NICKNAMEHISTORYLENGTH="$NICKNAMEHISTORYLENGTH"
DOMAINNAME="$DOMAINNAME"
DEFPERM="$DEFPERM"
CRYPTOIRCD="$CRYPTOIRCD"
SSLDIR="$SSLDIR"

402
autoconf/aclocal.m4 vendored

@ -1,402 +0,0 @@
dnl aclocal.m4 generated automatically by aclocal 1.4-p4
dnl Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
dnl This program is distributed in the hope that it will be useful,
dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without
dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A
dnl PARTICULAR PURPOSE.
dnl Macro: unet_CHECK_TYPE_SIZES
dnl
dnl Check the size of several types and define a valid int16_t and int32_t.
dnl
AC_DEFUN(unreal_CHECK_TYPE_SIZES,
[dnl Check type sizes
AC_CHECK_SIZEOF(short)
AC_CHECK_SIZEOF(int)
AC_CHECK_SIZEOF(long)
if test "$ac_cv_sizeof_int" = 2 ; then
AC_CHECK_TYPE(int16_t, int)
AC_CHECK_TYPE(u_int16_t, unsigned int)
elif test "$ac_cv_sizeof_short" = 2 ; then
AC_CHECK_TYPE(int16_t, short)
AC_CHECK_TYPE(u_int16_t, unsigned short)
else
AC_MSG_ERROR([Cannot find a type with size of 16 bits])
fi
if test "$ac_cv_sizeof_int" = 4 ; then
AC_CHECK_TYPE(int32_t, int)
AC_CHECK_TYPE(u_int32_t, unsigned int)
elif test "$ac_cv_sizeof_short" = 4 ; then
AC_CHECK_TYPE(int32_t, short)
AC_CHECK_TYPE(u_int32_t, unsigned short)
elif test "$ac_cv_sizeof_long" = 4 ; then
AC_CHECK_TYPE(int32_t, long)
AC_CHECK_TYPE(u_int32_t, unsigned long)
else
AC_MSG_ERROR([Cannot find a type with size of 32 bits])
fi
AC_CHECK_SIZEOF(rlim_t)
if test "$ac_cv_sizeof_rlim_t" = 8 ; then
AC_DEFINE(LONG_LONG_RLIM_T)
fi
])
AC_DEFUN(CHECK_LIBCURL,
[
AC_ARG_ENABLE(libcurl,
[AC_HELP_STRING([--enable-libcurl=DIR],[enable libcurl (remote include) support])],
[enable_curl=$enableval],
[enable_curl=no])
AS_IF([test "x$enable_curl" != "xno"],
[
dnl sane, default directory for Operating System-managed libcURL
dnl (when --enable-libcurl is passed without any arguments). On
dnl systems with stuff in /usr/local, /usr/local/bin should already
dnl be in PATH. On sane systems, this will invoke the curl-config
dnl installed by the package manager.
CURLCONFIG="curl-config"
AS_IF([test "x$enable_curl" != "xyes"],
[CURLCONFIG="$enable_curl/bin/curl-config"])
AC_MSG_CHECKING([$CURLCONFIG])
AS_IF([$CURLCONFIG --version 2>/dev/null >/dev/null],
[AC_MSG_RESULT([yes])],
[AC_MSG_RESULT([no])
AC_MSG_FAILURE([Could not find curl-config, try editing --enable-libcurl])])
CURLCFLAG="`$CURLCONFIG --cflags`"
CURLLIBS="`$CURLCONFIG --libs`"
CURLUSESCARES="`echo $CURLLIBS|grep c-ares|wc -l`"
AS_IF([test "$CURLUSESCARES" = "0"],
[AC_MSG_WARN([cURL is compiled without c-ares support. Your IRCd will possibly stall when REHASHing!])])
dnl sanity warnings
AS_IF([test -z "${CURLLIBS}"],
[AC_MSG_WARN([CURLLIBS is empty, that probably means that I could not find $enableval/bin/curl-config])])
dnl Ok this is ugly, basically we need to strip the version of c-ares that curl uses
dnl because we want to use our own version (which is hopefully fully binary
dnl compatible with the curl one as well).
dnl Therefore we need to strip the cares libs in a weird way...
dnl If anyone can come up with something better and still portable (no awk!?)
dnl then let us know. -- Syzop
dnl
dnl It is dangerous to mix and match cURL with potentially ABI-incompatible versions of
dnl c-ares, just use --with-system-cares.
dnl Thus, make sure to use --with-system-cares when using system-cURL. If the user
dnl wants bundled c-ares + system libcURL, then we should filter out c-ares
dnl flags. _Only_ in that case should we mess with the flags. -- ohnobinki
AS_IF([test "x$with_system_cares" = "xno" && test "x$HOME/curl" != "x$enable_curl" && test "x/usr/share/unreal-curl" != "x$enable_curl" && test "$CURLUSESCARES" != "0" ],
[
AC_MSG_ERROR([[
You have decided to build unrealIRCd with libcURL (remote includes) support.
However, you have disabled system-installed c-ares support (--with-system-cares).
Because UnrealIRCd will use a bundled copy of c-ares which may be incompatible
with the system-installed libcURL, this is a bad idea which may result in error
messages looking like:
\`\`[error] unrealircd.conf:9: include: error downloading '(http://example.net/ex.conf)': Could not resolve host: example.net (Successful completion)''
Or UnrealIRCd might even crash.
Please build UnrealIRCd with --with-system-cares when enabling --enable-libcurl
]])
])
AS_IF([test "x`echo $CURLLIBS |grep ares`" != x && test "x$with_system_cares" = "xno"],
[
dnl Attempt one: Linux sed
XCURLLIBS="`echo "$CURLLIBS"|sed -r 's/(@<:@^ @:>@+ @<:@^ @:>@+ )(@<:@^ @:>@+ @<:@^ @:>@+ )(.+)/\1\3/g' 2>/dev/null`"
AS_IF([test x"$XCURLLIBS" = x],
[
dnl Attempt two: FreeBSD (and others?) sed
XCURLLIBS="`echo "$CURLLIBS"|sed -E 's/(@<:@^ @:>@+ @<:@^ @:>@+ )(@<:@^ @:>@+ @<:@^ @:>@+ )(.+)/\1\3/g' 2>/dev/null`"
AS_IF([test x"$XCURLLIBS" = x],
[
AC_MSG_ERROR([sed appears to be broken. It is needed for a remote includes compile hack.])
])
])
CURLLIBS="$XCURLLIBS"
])
dnl Make sure that linking against cURL works rather than letting the user
dnl find out after compiling most of his program. ~ohnobinki
IRCDLIBS="$IRCDLIBS $CURLLIBS"
CFLAGS="$CFLAGS $CURLCFLAG -DUSE_LIBCURL"
AC_MSG_CHECKING([curl_easy_init() in $CURLLIBS])
LIBS_SAVEDA="$LIBS"
LIBS="$IRCDLIBS"
AC_LINK_IFELSE(
[
AC_LANG_PROGRAM(
[[#include <curl/curl.h>]],
[[CURL *curl = curl_easy_init();]])
],
[AC_MSG_RESULT([yes])],
[AC_MSG_RESULT([no])
AC_MSG_FAILURE([You asked for libcURL (remote includes) support, but it can't be found at $enable_curl])
])
LIBS="$LIBS_SAVEDA"
URL="url.o"
AC_SUBST(URL)
]) dnl AS_IF(enable_curl)
])
dnl the following 2 macros are based on CHECK_SSL by Mark Ethan Trostler <trostler@juniper.net>
AC_DEFUN([CHECK_SSL],
[
AC_ARG_ENABLE(ssl,
[AC_HELP_STRING([--enable-ssl=],[enable ssl will check /usr/local/ssl /usr/lib/ssl /usr/ssl /usr/pkg /usr/sfw /usr/local /usr])],
[
AC_MSG_CHECKING(for openssl)
for dir in $enableval /usr/local/ssl /usr/lib/ssl /usr/ssl /usr/pkg /usr/sfw /usr/local /usr; do
ssldir="$dir"
if test -f "$dir/include/openssl/ssl.h"; then
AC_MSG_RESULT(found in $ssldir/include/openssl)
found_ssl="yes";
if test ! "$ssldir" = "/usr" ; then
CFLAGS="$CFLAGS -I$ssldir/include";
fi
break;
fi
if test -f "$dir/include/ssl.h"; then
AC_MSG_RESULT(found in $ssldir/include)
found_ssl="yes";
if test ! "$ssldir" = "/usr" ; then
CFLAGS="$CFLAGS -I$ssldir/include";
fi
break
fi
done
if test x_$found_ssl != x_yes; then
AC_MSG_RESULT(not found)
echo ""
echo "Apparently you do not have both the openssl binary and openssl development libraries installed."
echo "You have two options:"
echo "a) Install the needed binaries and libraries"
echo " and run ./Config"
echo "OR"
echo "b) If you don't need SSL..."
echo " Run ./Config and say 'no' when asked about SSL"
echo ""
exit 1
else
CRYPTOLIB="-lssl -lcrypto";
if test ! "$ssldir" = "/usr" ; then
LDFLAGS="$LDFLAGS -L$ssldir/lib";
fi
AC_DEFINE(USE_SSL)
fi
],
)
])
AC_DEFUN([CHECK_ZLIB],
[
AC_ARG_ENABLE(ziplinks,
[AC_HELP_STRING([--enable-ziplinks],[enable ziplinks will check /usr/local /usr /usr/pkg])],
[
AC_MSG_CHECKING(for zlib)
for dir in $enableval /usr/local /usr /usr/pkg; do
zlibdir="$dir"
if test -f "$dir/include/zlib.h"; then
AC_MSG_RESULT(found in $zlibdir)
found_zlib="yes";
if test "$zlibdir" = "/usr" ; then
CFLAGS="$CFLAGS -DZIP_LINKS";
else
CFLAGS="$CFLAGS -I$zlibdir/include -DZIP_LINKS";
fi
break;
fi
done
if test x_$found_zlib != x_yes; then
AC_MSG_RESULT(not found)
echo ""
echo "Apparently you do not have the zlib development library installed."
echo "You have two options:"
echo "a) Install the zlib development library"
echo " and run ./Config"
echo "OR"
echo "b) If you don't need compressed links..."
echo " Run ./Config and say 'no' when asked about ziplinks support"
echo ""
exit 1
else
IRCDLIBS="$IRCDLIBS -lz";
if test "$zlibdir" != "/usr" ; then
LDFLAGS="$LDFLAGS -L$zlibdir/lib";
fi
HAVE_ZLIB=yes
fi
AC_SUBST(HAVE_ZLIB)
],
)
])
# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*-
#
# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that program.
# PKG_PROG_PKG_CONFIG([MIN-VERSION])
# ----------------------------------
AC_DEFUN([PKG_PROG_PKG_CONFIG],
[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
m4_pattern_allow([^PKG_CONFIG(_PATH)?$])
AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl
if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
fi
if test -n "$PKG_CONFIG"; then
_pkg_min_version=m4_default([$1], [0.9.0])
AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
AC_MSG_RESULT([yes])
else
AC_MSG_RESULT([no])
PKG_CONFIG=""
fi
fi[]dnl
])# PKG_PROG_PKG_CONFIG
# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
#
# Check to see whether a particular set of modules exists. Similar
# to PKG_CHECK_MODULES(), but does not set variables or print errors.
#
#
# Similar to PKG_CHECK_MODULES, make sure that the first instance of
# this or PKG_CHECK_MODULES is called, or make sure to call
# PKG_CHECK_EXISTS manually
# --------------------------------------------------------------
AC_DEFUN([PKG_CHECK_EXISTS],
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
if test -n "$PKG_CONFIG" && \
AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
m4_ifval([$2], [$2], [:])
m4_ifvaln([$3], [else
$3])dnl
fi])
# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
# ---------------------------------------------
m4_define([_PKG_CONFIG],
[if test -n "$$1"; then
pkg_cv_[]$1="$$1"
elif test -n "$PKG_CONFIG"; then
PKG_CHECK_EXISTS([$3],
[pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
[pkg_failed=yes])
else
pkg_failed=untried
fi[]dnl
])# _PKG_CONFIG
# _PKG_SHORT_ERRORS_SUPPORTED
# -----------------------------
AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
_pkg_short_errors_supported=yes
else
_pkg_short_errors_supported=no
fi[]dnl
])# _PKG_SHORT_ERRORS_SUPPORTED
# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
# [ACTION-IF-NOT-FOUND])
#
#
# Note that if there is a possibility the first call to
# PKG_CHECK_MODULES might not happen, you should be sure to include an
# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
#
#
# --------------------------------------------------------------
AC_DEFUN([PKG_CHECK_MODULES],
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
pkg_failed=no
AC_MSG_CHECKING([for $1])
_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
_PKG_CONFIG([$1][_LIBS], [libs], [$2])
m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
and $1[]_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.])
if test $pkg_failed = yes; then
_PKG_SHORT_ERRORS_SUPPORTED
if test $_pkg_short_errors_supported = yes; then
$1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "$2" 2>&1`
else
$1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors "$2" 2>&1`
fi
# Put the nasty error message in config.log where it belongs
echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
ifelse([$4], , [AC_MSG_ERROR(dnl
[Package requirements ($2) were not met:
$$1_PKG_ERRORS
Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.
_PKG_TEXT
])],
[AC_MSG_RESULT([no])
$4])
elif test $pkg_failed = untried; then
ifelse([$4], , [AC_MSG_FAILURE(dnl
[The pkg-config script could not be found or is too old. Make sure it
is in your PATH or set the PKG_CONFIG environment variable to the full
path to pkg-config.
_PKG_TEXT
To get pkg-config, see <http://pkg-config.freedesktop.org/>.])],
[$4])
else
$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
AC_MSG_RESULT([yes])
ifelse([$3], , :, [$3])
fi[]dnl
])# PKG_CHECK_MODULES

@ -1,539 +0,0 @@
dnl Process this file with autoconf to produce a configure script.
AC_INIT([unrealircd], [3.2.8.1], [http://bugs.unrealircd.org/], [], [http://unrealircd.org/])
AC_CONFIG_SRCDIR([src/ircd.c])
AC_CONFIG_HEADER([include/setup.h])
if test "x$enable_dynamic_linking" = "x"; then
echo "Please use ./Config instead of ./configure"
exit 1
fi
AC_PROG_CC
if test "$ac_cv_prog_gcc" = "yes"; then
CFLAGS="$CFLAGS -funsigned-char"
AC_CACHE_CHECK(if gcc has a working -pipe, ac_cv_pipe, [
save_cflags="$CFLAGS"
CFLAGS="$CFLAGS -pipe"
AC_TRY_COMPILE(,, ac_cv_pipe="yes", ac_cv_pipe="no")
CFLAGS="$save_cflags"
])
if test "$ac_cv_pipe" = "yes"; then
CFLAGS="-pipe $CFLAGS"
fi
fi
dnl (the gcc flag detection trick is taken from xemacs/Vin Shelton)
dnl UnrealIRCd might not be strict-aliasing safe at this time
case "`$CC -v --help 2>&1`" in
*-fstrict-aliasing* ) CFLAGS="$CFLAGS -fno-strict-aliasing" ;;
esac
dnl Pointer signedness warnings are really a pain and 99.9% of the time
dnl they are of absolutely no use whatsoever. IMO the person who decided
dnl to enable this without -Wall should be shot on sight.
case "`$CC -v --help 2>&1`" in
*-Wpointer-sign* ) CFLAGS="$CFLAGS -Wno-pointer-sign" ;;
esac
AC_PATH_PROG(RM,rm)
AC_PATH_PROG(CP,cp)
AC_PATH_PROG(TOUCH,touch)
AC_PATH_PROG(OPENSSLPATH,openssl)
AC_PATH_PROG(INSTALL,install)
AC_CHECK_PROG(MAKER, gmake, gmake, make)
AC_PATH_PROG(GMAKE,gmake)
AC_PATH_PROG(GUNZIP, gunzip)
AC_PATH_PROG(PKGCONFIG, pkg-config)
dnl Checks for libraries.
AC_CHECK_LIB(descrypt, crypt, [AC_DEFINE(HAVE_CRYPT) IRCDLIBS="$IRCDLIBS-ldescrypt " MKPASSWDLIBS="-ldescrypt"],
AC_CHECK_LIB(crypt, crypt,[ AC_DEFINE(HAVE_CRYPT) IRCDLIBS="$IRCDLIBS-lcrypt " MKPASSWDLIBS="-lcrypt"]))
AC_CHECK_LIB(socket, socket,IRCDLIBS="$IRCDLIBS-lsocket " SOCKLIB="-lsocket")
AC_CHECK_LIB(nsl, inet_ntoa,IRCDLIBS="$IRCDLIBS-lnsl " INETLIB="-lnsl")
AC_SUBST(IRCDLIBS)
AC_SUBST(MKPASSWDLIBS)
dnl module checking based on Hyb7's module checking code
AC_DEFUN([AC_ENABLE_DYN],
[
AC_CHECK_FUNC(dlopen,, [AC_CHECK_LIB(dl, dlopen,IRCDLIBS="$IRCDLIBS -ldl",
[
AC_MSG_WARN(Dynamic linking is not enabled because dlopen was not found)
AC_DEFINE(STATIC_LINKING)
])])
hold_cflags=$CFLAGS
CFLAGS="$CFLAGS -export-dynamic"
AC_CACHE_CHECK(if we need the -export-dynamic flag, ac_cv_export_dynamic, [
AC_TRY_LINK(, [int i];, ac_cv_export_dynamic=yes, ac_cv_export_dynamic=no)])
if test "$ac_cv_export_dynamic" = "no"; then
CFLAGS=$hold_cflags
fi
AC_CACHE_CHECK(for compiler option to produce PIC,ac_cv_pic,[
if test "$ac_cv_prog_gcc" = "yes"; then
ac_cv_pic="-fPIC -DPIC -shared"
case `uname -s` in
Darwin*[)]
ac_cv_pic="-bundle -flat_namespace -undefined suppress"
;;
HP-UX*[)]
ac_cv_pic="-fPIC"
;;
esac
else
case `uname -s` in
SunOS*[)]
ac_cv_pic="-KPIC -DPIC -G"
;;
esac
fi
])
AC_CACHE_CHECK(if your system prepends an underscore on symbols,ac_cv_underscore,[
cat >uscore.c << __EOF__
int main() {
return 0;
}
__EOF__
$CC -o uscore $CFLAGS uscore.c 1>&5
if test -z "`strings -a uscore |grep '^_main$'`"; then
ac_cv_underscore=no
else
ac_cv_underscore=yes
fi
rm -f uscore uscore.c
])
if test "$ac_cv_underscore" = "yes"; then
AC_DEFINE(UNDERSCORE)
fi
MODULEFLAGS=$ac_cv_pic
AC_DEFINE(DYNAMIC_LINKING)
])
AC_DEFUN([AC_ENABLE_INET6],[
AC_CACHE_CHECK(if your system has IPv6 support, ac_cv_ip6, [
save_libs="$LIBS"
LIBS="$LIBS $SOCKLIB"
AC_TRY_RUN([
#include <sys/types.h>
#include <sys/socket.h>
int main() {
if (socket(AF_INET6, SOCK_STREAM, 0) < 0)
exit(1);
exit(0);
}
], ac_cv_ip6=yes, ac_cv_ip6=no)
])
if test "$ac_cv_ip6" = "no"; then
AC_MSG_WARN(Your system does not support IPv6 so it will not be enabled)
else
AC_DEFINE(INET6)
dnl in6addr_any detection code taken from ratbox
AC_MSG_CHECKING([for struct in6addr_any])
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM(
[[#define IN_AUTOCONF
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>]],
[[struct in6_addr a = in6addr_any;]]
)],
[AC_MSG_RESULT(yes)],
[
AC_MSG_RESULT(no)
AC_DEFINE(NO_IN6ADDR_ANY)
]
)
fi
LIBS="$save_libs"
])
AC_CHECK_HEADER(sys/param.h,AC_DEFINE(PARAMH))
AC_CHECK_HEADER(stdlib.h,AC_DEFINE(STDLIBH))
AC_CHECK_HEADER(stddef.h,AC_DEFINE(STDDEFH))
AC_CHECK_HEADER(sys/syslog.h,AC_DEFINE(SYSSYSLOGH))
AC_CHECK_HEADER(unistd.h,AC_DEFINE(UNISTDH))
AC_CHECK_HEADER(string.h,AC_DEFINE(STRINGH))
AC_CHECK_HEADER(strings.h,AC_DEFINE(STRINGSH))
AC_CHECK_HEADER(malloc.h,AC_DEFINE(MALLOCH,<malloc.h>))
AC_CHECK_HEADER(sys/rusage.h,AC_DEFINE(RUSAGEH))
AC_CHECK_HEADER(glob.h,AC_DEFINE(GLOBH))
dnl Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_C_INLINE
AC_TYPE_SIZE_T
AC_HEADER_TIME
AC_STRUCT_TM
AC_TYPE_UID_T
unreal_CHECK_TYPE_SIZES
AC_CACHE_CHECK(what kind of nonblocking sockets you have, ac_cv_nonblocking,[
save_libs="$LIBS"
LIBS="$LIBS $SOCKLIB"
AC_TRY_RUN([
#include <sys/types.h>
#include <sys/socket.h>
#include <fcntl.h>
#include <sys/ioctl.h>
#include <sys/file.h>
#include <signal.h>
alarmed() {
exit(1);
}
int main() {
#ifdef O_NONBLOCK
char b[12], x[32];
int f, l = sizeof(x);
f = socket(AF_INET, SOCK_DGRAM, 0);
if (f >= 0 && !(fcntl(f, F_SETFL, O_NONBLOCK))) {
signal(SIGALRM, alarmed);
alarm(3);
recvfrom(f, b, 12, 0, (struct sockaddr *)x, &l);
alarm(0);
exit(0);
}
#endif
exit(1);
}
],ac_cv_nonblocking=O_NONBLOCK,[
AC_TRY_RUN([
#include <sys/types.h>
#include <sys/socket.h>
#include <fcntl.h>
#include <sys/ioctl.h>
#include <sys/file.h>
#include <signal.h>
alarmed() {
exit(0);
}
int main() {
#ifdef O_NDELAY
char b[12], x[32];
int f, l = sizeof(x);
f = socket(AF_INET, SOCK_DGRAM, 0);
if (f >= 0 && !(fcntl(f, F_SETFL, O_NDELAY))) {
signal(SIGALRM, alarmed);
alarm(3);
recvfrom(f, b, 12, 0, (struct sockaddr *)x, &l);
alarm(0);
exit(0);
}
#endif
exit(1);
}],ac_cv_nonblocking=O_NDELAY,[
AC_TRY_RUN([
#include <sys/types.h>
#include <sys/socket.h>
#include <fcntl.h>
#include <sys/ioctl.h>
#include <sys/file.h>
#include <signal.h>
alarmed() {
exit(1);
}
int main() {
#ifdef FIONBIO
char b[12], x[32];
int f, l = sizeof(x);
f = socket(AF_INET, SOCK_DGRAM, 0);
if (f >= 0 && !(fcntl(f, F_SETFL, FIONBIO))) {
signal(SIGALRM, alarmed);
alarm(3);
recvfrom(f, b, 12, 0, (struct sockaddr *)x, &l);
alarm(0);
exit(0);
}
#endif
exit(1);
], ac_cv_nonblocking=FIONBIO,ac_cv_nonblocking=none)])])])
if test "$ac_cv_nonblocking" = "O_NONBLOCK"; then
AC_DEFINE(NBLOCK_POSIX)
elif test "$ac_cv_nonblocking" = "O_NDELAY"; then
AC_DEFINE(NBLOCK_BSD)
elif test "$ac_cv_nonblocking" = "FIONBIO"; then
AC_DEFINE(NBLOCK_SYSV)
fi
LIBS="$save_libs"
dnl Checks for library functions.
AC_PROG_GCC_TRADITIONAL
AC_FUNC_SETPGRP
AC_FUNC_SETVBUF_REVERSED
AC_FUNC_ALLOCA
AC_CHECK_FUNCS(snprintf,AC_DEFINE(HAVE_SNPRINTF))
AC_CHECK_FUNCS(vsnprintf,AC_DEFINE(HAVE_VSNPRINTF))
AC_CHECK_FUNCS(strlcpy, AC_DEFINE(HAVE_STRLCPY))
AC_CHECK_FUNCS(strlcat, AC_DEFINE(HAVE_STRLCAT))
AC_CHECK_FUNCS(strlncat, AC_DEFINE(HAVE_STRLNCAT))
AC_CHECK_FUNCS(inet_pton, AC_DEFINE(HAVE_INET_PTON))
AC_CHECK_FUNCS(inet_ntop, AC_DEFINE(HAVE_INET_NTOP))
dnl Check if it supports C99 style variable length arrays
AC_CACHE_CHECK(if C99 variable length arrays are supported, ac_cv_varlen_arrays, [
AC_TRY_COMPILE(,[
int main() {
int i = 5;
int a[i];
a[0] = 1;
return 0;
}], ac_cv_varlen_arrays=yes, ac_cv_varlen_arrays=no)
])
if test "$ac_cv_varlen_arrays" = "yes" ; then
AC_DEFINE(HAVE_C99_VARLEN_ARRAY)
fi
AC_CACHE_CHECK(if we can set the core size to unlimited, ac_cv_force_core,[
AC_TRY_RUN([
#include <sys/time.h>
#include <sys/resource.h>
#include <unistd.h>
int main() {
struct rlimit corelim;
corelim.rlim_cur = corelim.rlim_max = RLIM_INFINITY;
if (setrlimit(RLIMIT_CORE, &corelim))
exit(1);
exit(0);
}
],ac_cv_force_core=yes,ac_cv_force_core=no)
])
if test "$ac_cv_force_core" = "yes"; then
AC_DEFINE(FORCE_CORE)
fi
AC_FUNC_VPRINTF
AC_CHECK_FUNCS(gettimeofday,AC_DEFINE(GETTIMEOFDAY),[AC_CHECK_FUNCS(lrand48,AC_DEFINE(LRADN48))])
AC_CHECK_FUNCS(getrusage,AC_DEFINE(GETRUSAGE_2),[AC_CHECK_FUNCS(times,AC_DEFINE(TIMES_2))])
AC_CHECK_FUNCS(setproctitle,AC_DEFINE(HAVE_SETPROCTITLE),[
AC_CHECK_LIB(util,setproctitle,AC_DEFINE(HAVE_SETPROCTITLE) IRCDLIBS="$IRCDLIBS-lutil",[
AC_EGREP_HEADER([#define.*PS_STRINGS.*],sys/exec.h,AC_DEFINE(HAVE_PSSTRINGS),[
AC_CHECK_FUNCS(pstat,AC_DEFINE(HAVE_PSTAT))
])
])
])
AC_CACHE_CHECK(what type of signals you have, ac_cv_sigtype, [
AC_TRY_RUN([
#include <signal.h>
int main() {
sigaction(SIGTERM, (struct sigaction *)0L, (struct sigaction *)0L);
}
], ac_cv_sigtype=POSIX, [
AC_TRY_RUN([
#include <signal.h>
int calls = 0;
void handler()
{
if (calls)
return;
calls++;
kill(getpid(), SIGTERM);
sleep(1);
}
int main() {
signal(SIGTERM, handler);
kill(getpid(), SIGTERM);
exit(0);
}
], ac_cv_sigtype=BSD,ac_cv_sigtype=SYSV)])])
if test "$ac_cv_sigtype" = "POSIX"; then
AC_DEFINE(POSIX_SIGNALS)
elif test "$ac_cv_sigtype" = "BSD"; then
AC_DEFINE(BSD_RELIABLE_SIGNALS)
else
AC_DEFINE(SYSV_UNRELIABLE_SIGNALS)
fi
AC_CHECK_FUNCS(strtoken,,AC_DEFINE(NEED_STRTOKEN))
AC_CHECK_FUNCS(strtok,,AC_DEFINE(NEED_STRTOK))
AC_CHECK_FUNCS(strerror,,AC_DEFINE(NEED_STRERROR))
AC_CHECK_FUNCS(index,,AC_DEFINE(NOINDEX))
AC_CHECK_FUNCS(strtoul,,STRTOUL="strtoul.o")
AC_CHECK_FUNCS(bcopy,,AC_DEFINE(NEED_BCOPY))
AC_CHECK_FUNCS(bcmp,,AC_DEFINE(NEED_BCMP))
AC_CHECK_FUNCS(bzero,,AC_DEFINE(NEED_BZERO))
AC_CHECK_FUNCS(strcasecmp,AC_DEFINE(GOT_STRCASECMP))
save_libs="$LIBS"
LIBS="$LIBS $SOCKLIB $INETLIB"
AC_CHECK_FUNCS(inet_addr,,AC_DEFINE(NEED_INET_ADDR))
AC_CHECK_FUNCS(inet_ntoa,,AC_DEFINE(NEED_INET_NTOA))
AC_CHECK_FUNCS(inet_netof,,AC_DEFINE(NEED_INET_NETOF))
LIBS="$save_libs"
AC_CHECK_FUNCS(syslog,AC_DEFINE(HAVE_SYSLOG))
AC_CHECK_FUNCS(vsyslog,AC_DEFINE(HAVE_VSYSLOG))
AC_SUBST(STRTOUL)
AC_SUBST(CRYPTOLIB)
AC_SUBST(MODULEFLAGS)
AC_ARG_WITH(listen, [AC_HELP_STRING([--with-listen=backlog],[Specify the listen backlog value])],
AC_DEFINE_UNQUOTED(LISTEN_SIZE,$withval),AC_DEFINE(LISTEN_SIZE,5))
AC_ARG_WITH(nick-history, [AC_HELP_STRING([--with-nick-history=length],[Specify the length of the nickname history])],
AC_DEFINE_UNQUOTED(NICKNAMEHISTORYLENGTH,$withval), AC_DEFINE(NICKNAMEHISTORYLENGTH,2000))
AC_ARG_WITH(sendq, [AC_HELP_STRING([--with-sendq=maxsendq],[Specify the max sendq for the server])],
AC_DEFINE_UNQUOTED(MAXSENDQLENGTH,$withval),AC_DEFINE(MAXSENDQLENGTH,3000000))
AC_ARG_WITH(bufferpool, [AC_HELP_STRING([--with-bufferpool=size],[Specify the size of the buffer pool])],
AC_DEFINE_UNQUOTED(BUFFERPOOL,[($withval * MAXSENDQLENGTH)]),AC_DEFINE(BUFFERPOOL,[(18 * MAXSENDQLENGTH)]))
AC_ARG_WITH(hostname, [AC_HELP_STRING([--with-hostname=host],[Specify the local hostname of the server])], AC_DEFINE_UNQUOTED(DOMAINNAME,"$withval"),AC_DEFINE_UNQUOTED(DOMAINNAME,"`hostname`"))
AC_ARG_WITH(permissions, [AC_HELP_STRING([--with-permissions=permissions],[Specify the default permissions for
configuration files])], AC_DEFINE_UNQUOTED(DEFAULT_PERMISSIONS,$withval), AC_DEFINE(DEFAULT_PERMISSIONS, 0600))
AC_ARG_WITH(dpath, [AC_HELP_STRING([--with-dpath=path],[Specify the path where configuration files are stored])],
AC_DEFINE_UNQUOTED(DPATH, "$withval") IRCDDIR="$withval", AC_DEFINE_UNQUOTED(DPATH,"`pwd`") IRCDDIR="`pwd`")
AC_ARG_WITH(fd-setsize, [AC_HELP_STRING([--with-fd-setsize=size],[Specify the max file descriptors to use])],
ac_fd=$withval, ac_fd=1024)
AC_DEFINE_UNQUOTED(MAXCONNECTIONS, $ac_fd)
AC_ARG_WITH(spath, [AC_HELP_STRING([--with-spath],[Specify the location of the executable])],
AC_DEFINE_UNQUOTED(SPATH,"$withval") BINDIR="$withval",AC_DEFINE_UNQUOTED(SPATH,"`pwd`/src/ircd") BINDIR="`pwd`/src/ircd")
AC_ARG_ENABLE(nospoof, [AC_HELP_STRING([--enable-nospoof],[Enable spoofing protection])], AC_DEFINE(NOSPOOF))
AC_ARG_ENABLE(prefixaq, [AC_HELP_STRING([--enable-prefixaq],[Enable chanadmin and chanowner prefixes])], AC_DEFINE(PREFIX_AQ))
AC_ARG_WITH(showlistmodes, [AC_HELP_STRING([--with-showlistmodes], [Specify whether modes are shown in /list])],
AC_DEFINE(LIST_SHOW_MODES))
AC_ARG_WITH(topicisnuhost, [AC_HELP_STRING([--with-topicisnuhost], [Display nick!user@host as the topic setter])],
AC_DEFINE(TOPIC_NICK_IS_NUHOST))
AC_ARG_WITH(shunnotices, [AC_HELP_STRING([--with-shunnotices], [Notify a user when he/she is no longer shunned])],
AC_DEFINE(SHUN_NOTICES))
AC_ARG_WITH(no-operoverride, [AC_HELP_STRING([--with-no-operoverride], [Disable OperOverride])],
AC_DEFINE(NO_OPEROVERRIDE))
AC_ARG_WITH(disableusermod, [AC_HELP_STRING([--with-disableusermod], [Disable /set* and /chg*])],
AC_DEFINE(DISABLE_USERMOD))
AC_ARG_WITH(operoverride-verify, [AC_HELP_STRING([--with-operoverride-verify], [Require opers to invite themselves to +s/+p channels])],
AC_DEFINE(OPEROVERRIDE_VERIFY))
AC_ARG_WITH(disable-extendedban-stacking, [AC_HELP_STRING([--with-disable-extendedban-stacking], [Disable extended ban stacking])],
AC_DEFINE(DISABLE_STACKED_EXTBANS))
AC_ARG_WITH(system-tre, [AC_HELP_STRING([--with-system-tre], [Use the system tre package instead of bundled, discovered using pkg-config])], [], [with_system_tre=no ])
AC_ARG_WITH(system-cares, [AC_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 ])
CHECK_SSL
CHECK_ZLIB
CHECK_LIBCURL
AC_ARG_ENABLE(dynamic-linking, [AC_HELP_STRING([--enable-dynamic-linking],[Make the IRCd dynamically link shared objects rather than statically])], [AC_ENABLE_DYN], [AC_DEFINE(STATIC_LINKING)])
AC_ARG_ENABLE(inet6, [AC_HELP_STRING([--enable-inet6],[Make the IRCd support IPv6])], [AC_ENABLE_INET6])
AC_SUBST(IRCDDIR)
AC_SUBST(BINDIR)
AC_MSG_CHECKING(if FD_SETSIZE is large enough to allow $ac_fd file descriptors)
AC_TRY_RUN([
#include <sys/types.h>
#include <sys/time.h>
int main() {
if (FD_SETSIZE >= $ac_fd)
exit(0);
exit(1);
}
], AC_MSG_RESULT(yes), [
FD_SETSIZE="-DFD_SETSIZE=$ac_fd"
AC_MSG_RESULT(no)
])
AC_SUBST(FD_SETSIZE)
case `uname -s` in
*SunOS*)
CFLAGS="$CFLAGS -D_SOLARIS"
IRCDLIBS="$IRCDLIBS -lresolv "
;;
*solaris*)
CFLAGS="$CFLAGS -D_SOLARIS"
IRCDLIBS="$IRCDLIBS -lresolv "
;;
esac
dnl c-ares needs PATH_SEPARATOR set or it will
dnl fail on certain solaris boxes. We might as
dnl well set it here.
export PATH_SEPARATOR
AS_IF([test "x$with_system_tre" = "xno"],[
dnl REMEMBER TO CHANGE WITH A NEW TRE RELEASE!
tre_version="0.7.5"
AC_MSG_RESULT(extracting TRE regex library)
cur_dir=`pwd`
cd extras
dnl remove old tre directory to force a recompile...
rm -rf tre-$tre_version
if test "x$ac_cv_path_GUNZIP" = "x" ; then
tar xfz tre.tar.gz
else
cp tre.tar.gz tre.tar.gz.bak
gunzip -f tre.tar.gz
cp tre.tar.gz.bak tre.tar.gz
tar xf tre.tar
fi
AC_MSG_RESULT(configuring TRE regex library)
cd tre-$tre_version
./configure --disable-agrep --disable-shared --disable-system-abi --disable-wchar --disable-multibyte --prefix=$cur_dir/extras/regexp || exit 1
AC_MSG_RESULT(compiling TRE regex library)
$ac_cv_prog_MAKER || exit 1
AC_MSG_RESULT(installing TRE regex library)
$ac_cv_prog_MAKER install || exit 1
TRE_CFLAGS="-I$cur_dir/extras/regexp/include"
AC_SUBST(TRE_CFLAGS)
if test "x$ac_cv_path_PKGCONFIG" = "x" ; then
TRE_LIBS="-L../extras/regexp/lib -ltre"
else
TRE_LIBS=`$ac_cv_path_PKGCONFIG --libs tre.pc`
fi
AC_SUBST(TRE_LIBS)
cd $cur_dir
],[
dnl use pkgconfig for tre:
PKG_CHECK_MODULES([TRE], tre >= 0.7.5)
])
AS_IF([test "x$with_system_cares" = "xno"],[
dnl REMEMBER TO CHANGE WITH A NEW C-ARES RELEASE!
dnl NOTE: when changing this here, ALSO change it in ./curlinstall
dnl and in the comment in this file around line 400!
cares_version="1.6.0"
AC_MSG_RESULT(extracting c-ares resolver library)
cur_dir=`pwd`
cd extras
dnl remove old c-ares directory to force a recompile...
rm -rf c-ares-$cares_version
if test "x$ac_cv_path_GUNZIP" = "x" ; then
tar xfz c-ares.tar.gz
else
cp c-ares.tar.gz c-ares.tar.gz.bak
gunzip -f c-ares.tar.gz
cp c-ares.tar.gz.bak c-ares.tar.gz
tar xf c-ares.tar
fi
AC_MSG_RESULT(configuring c-ares library)
cd c-ares-$cares_version
./configure --prefix=$cur_dir/extras/c-ares || exit 1
AC_MSG_RESULT(compiling c-ares resolver library)
$ac_cv_prog_MAKER || exit 1
AC_MSG_RESULT(installing c-ares resolver library)
$ac_cv_prog_MAKER install || exit 1
CARES_CFLAGS="-I$cur_dir/extras/c-ares/include"
AC_SUBST(CARES_CFLAGS)
CARES_LIBS="-L../extras/c-ares/lib"
dnl Set default library parameters for when pkg-config is not available
CARESLIBSALT="-lcares"
case `uname -s` in
*FreeBSD*)
CARESLIBSALT="-lcares"
;;
*Linux*)
CARESLIBSALT="-lcares -lrt"
;;
*SunOS*)
CARESLIBSALT="-lcares -lrt"
;;
esac
dnl Use pkg-config for c-ares libraries, and if not available use defaults
dnl from above. Also, if pkg-config returns an empty result (ex: on fbsd
dnl or older versions it might be missing --static) then also use defaults.
if test "x$ac_cv_path_PKGCONFIG" = "x" ; then
CARES_LIBS="$CARES_LIBS $CARESLIBSALT"
else
CARES_LIBSPRE="$CARES_LIBS"
CARES_LIBS="$CARES_LIBS `$ac_cv_path_PKGCONFIG --static --libs libcares.pc`"
if test "$CARES_LIBS" = "$CARES_LIBSPRE " ; then
CARES_LIBS="$CARES_LIBS $CARESLIBSALT"
fi
fi
AC_SUBST(CARES_LIBS)
cd $cur_dir
],[
dnl use pkg-config for system c-ares:
PKG_CHECK_MODULES([CARES], libcares >= 1.6.0)
])
AC_OUTPUT(Makefile src/modules/Makefile unreal ircdcron/ircdchk)
chmod 0700 unreal
chmod 0700 ircdcron/ircdchk

@ -0,0 +1,243 @@
#serial 1
dnl Macro: unreal_CHECK_TYPE_SIZES
dnl originally called unet_CHECK_TYPE_SIZES
dnl
dnl Check the size of several types and define a valid int16_t and int32_t.
dnl
AC_DEFUN([unreal_CHECK_TYPE_SIZES],
[dnl Check type sizes
AC_CHECK_SIZEOF(short)
AC_CHECK_SIZEOF(int)
AC_CHECK_SIZEOF(long)
if test "$ac_cv_sizeof_int" = 2 ; then
AC_CHECK_TYPE(int16_t, int)
AC_CHECK_TYPE(u_int16_t, unsigned int)
elif test "$ac_cv_sizeof_short" = 2 ; then
AC_CHECK_TYPE(int16_t, short)
AC_CHECK_TYPE(u_int16_t, unsigned short)
else
AC_MSG_ERROR([Cannot find a type with size of 16 bits])
fi
if test "$ac_cv_sizeof_int" = 4 ; then
AC_CHECK_TYPE(int32_t, int)
AC_CHECK_TYPE(u_int32_t, unsigned int)
elif test "$ac_cv_sizeof_short" = 4 ; then
AC_CHECK_TYPE(int32_t, short)
AC_CHECK_TYPE(u_int32_t, unsigned short)
elif test "$ac_cv_sizeof_long" = 4 ; then
AC_CHECK_TYPE(int32_t, long)
AC_CHECK_TYPE(u_int32_t, unsigned long)
else
AC_MSG_ERROR([Cannot find a type with size of 32 bits])
fi
AC_CHECK_SIZEOF(rlim_t)
if test "$ac_cv_sizeof_rlim_t" = 8 ; then
AC_DEFINE([LONG_LONG_RLIM_T], [], [Define if rlim_t is long long])
fi
])
AC_DEFUN([CHECK_LIBCURL],
[
AC_ARG_ENABLE(libcurl,
[AC_HELP_STRING([--enable-libcurl=DIR],[enable libcurl (remote include) support])],
[enable_curl=$enableval],
[enable_curl=no])
AS_IF([test "x$enable_curl" != "xno"],
[
dnl sane, default directory for Operating System-managed libcURL
dnl (when --enable-libcurl is passed without any arguments). On
dnl systems with stuff in /usr/local, /usr/local/bin should already
dnl be in PATH. On sane systems, this will invoke the curl-config
dnl installed by the package manager.
CURLCONFIG="curl-config"
AS_IF([test "x$enable_curl" != "xyes"],
[CURLCONFIG="$enable_curl/bin/curl-config"])
AC_MSG_CHECKING([$CURLCONFIG])
AS_IF([$CURLCONFIG --version 2>/dev/null >/dev/null],
[AC_MSG_RESULT([yes])],
[AC_MSG_RESULT([no])
AC_MSG_FAILURE([Could not find curl-config, try editing --enable-libcurl])])
CURLCFLAG="`$CURLCONFIG --cflags`"
CURLLIBS="`$CURLCONFIG --libs`"
CURLUSESCARES="`echo $CURLLIBS|grep c-ares|wc -l`"
AS_IF([test "$CURLUSESCARES" = "0"],
[AC_MSG_WARN([cURL is compiled without c-ares support. Your IRCd will possibly stall when REHASHing!])])
dnl sanity warnings
AS_IF([test -z "${CURLLIBS}"],
[AC_MSG_WARN([CURLLIBS is empty, that probably means that I could not find $enable_curl/bin/curl-config])])
dnl Ok this is ugly, basically we need to strip the version of c-ares that curl uses
dnl because we want to use our own version (which is hopefully fully binary
dnl compatible with the curl one as well).
dnl Therefore we need to strip the cares libs in a weird way...
dnl If anyone can come up with something better and still portable (no awk!?)
dnl then let us know. -- Syzop
dnl
dnl It is dangerous to mix and match cURL with potentially ABI-incompatible versions of
dnl c-ares, just use --with-system-cares.
dnl Thus, make sure to use --with-system-cares when using system-cURL. If the user
dnl wants bundled c-ares + system libcURL, then we should filter out c-ares
dnl flags. _Only_ in that case should we mess with the flags. -- ohnobinki
AS_IF([test "x$with_system_cares" = "xno" && test "x$HOME/curl" != "x$enable_curl" && test "x/usr/share/unreal-curl" != "x$enable_curl" && test "$CURLUSESCARES" != "0" ],
[
AC_MSG_ERROR([[
You have decided to build unrealIRCd with libcURL (remote includes) support.
However, you have disabled system-installed c-ares support (--with-system-cares).
Because UnrealIRCd will use a bundled copy of c-ares which may be incompatible
with the system-installed libcURL, this is a bad idea which may result in error
messages looking like:
\`\`[error] unrealircd.conf:9: include: error downloading '(http://example.net/ex.conf)': Could not resolve host: example.net (Successful completion)''
Or UnrealIRCd might even crash.
Please build UnrealIRCd with --with-system-cares when enabling --enable-libcurl
]])
])
AS_IF([test "x`echo $CURLLIBS |grep ares`" != x && test "x$with_system_cares" = "xno"],
[
dnl Attempt one: Linux sed
XCURLLIBS="`echo "$CURLLIBS"|sed -r 's/(@<:@^ @:>@+ @<:@^ @:>@+ )(@<:@^ @:>@+ @<:@^ @:>@+ )(.+)/\1\3/g' 2>/dev/null`"
AS_IF([test x"$XCURLLIBS" = x],
[
dnl Attempt two: FreeBSD (and others?) sed
XCURLLIBS="`echo "$CURLLIBS"|sed -E 's/(@<:@^ @:>@+ @<:@^ @:>@+ )(@<:@^ @:>@+ @<:@^ @:>@+ )(.+)/\1\3/g' 2>/dev/null`"
AS_IF([test x"$XCURLLIBS" = x],
[
AC_MSG_ERROR([sed appears to be broken. It is needed for a remote includes compile hack.])
])
])
CURLLIBS="$XCURLLIBS"
])
dnl Make sure that linking against cURL works rather than letting the user
dnl find out after compiling most of his program. ~ohnobinki
IRCDLIBS="$IRCDLIBS $CURLLIBS"
CFLAGS="$CFLAGS $CURLCFLAG -DUSE_LIBCURL"
AC_MSG_CHECKING([curl_easy_init() in $CURLLIBS])
LIBS_SAVEDA="$LIBS"
LIBS="$IRCDLIBS"
AC_LINK_IFELSE(
[
AC_LANG_PROGRAM(
[[#include <curl/curl.h>]],
[[CURL *curl = curl_easy_init();]])
],
[AC_MSG_RESULT([yes])],
[AC_MSG_RESULT([no])
AC_MSG_FAILURE([You asked for libcURL (remote includes) support, but it can't be found at $enable_curl])
])
LIBS="$LIBS_SAVEDA"
URL="url.o"
AC_SUBST(URL)
]) dnl AS_IF(enable_curl)
])
dnl the following 2 macros are based on CHECK_SSL by Mark Ethan Trostler <trostler@juniper.net>
AC_DEFUN([CHECK_SSL],
[
AC_ARG_ENABLE(ssl,
[AC_HELP_STRING([--enable-ssl=],[enable ssl will check /usr/local/ssl /usr/lib/ssl /usr/ssl /usr/pkg /usr/sfw /usr/local /usr])],
[],
[enable_ssl=no])
AS_IF([test $enable_ssl != "no"],
[
AC_MSG_CHECKING([for openssl])
for dir in $enable_ssl /usr/local/ssl /usr/lib/ssl /usr/ssl /usr/pkg /usr/sfw /usr/local /usr; do
ssldir="$dir"
if test -f "$dir/include/openssl/ssl.h"; then
AC_MSG_RESULT([found in $ssldir/include/openssl])
found_ssl="yes";
if test ! "$ssldir" = "/usr" ; then
CFLAGS="$CFLAGS -I$ssldir/include";
fi
break
fi
if test -f "$dir/include/ssl.h"; then
AC_MSG_RESULT([found in $ssldir/include])
found_ssl="yes";
if test ! "$ssldir" = "/usr" ; then
CFLAGS="$CFLAGS -I$ssldir/include";
fi
break
fi
done
if test x_$found_ssl != x_yes; then
AC_MSG_RESULT(not found)
echo ""
echo "Apparently you do not have both the openssl binary and openssl development libraries installed."
echo "You have two options:"
echo "a) Install the needed binaries and libraries"
echo " and run ./Config"
echo "OR"
echo "b) If you don't need SSL..."
echo " Run ./Config and say 'no' when asked about SSL"
echo " (or pass --disable-ssl to ./configure)"
echo ""
exit 1
else
CRYPTOLIB="-lssl -lcrypto";
if test ! "$ssldir" = "/usr" ; then
LDFLAGS="$LDFLAGS -L$ssldir/lib";
fi
AC_DEFINE([USE_SSL], [], [Define if you want to allow SSL connections])
fi
])
])
AC_DEFUN([CHECK_ZLIB],
[
AC_ARG_ENABLE([ziplinks],
[AC_HELP_STRING([--enable-ziplinks=DIR],[enable ziplinks. will check /usr/local /usr /usr/pkg. Note that SSL does its own compression, so you won't need this for SSL links.])],
[],
[enable_ziplinks=no])
AS_IF([test $enable_ziplinks != "no"],
[
AC_MSG_CHECKING([for zlib])
for dir in $enable_ziplinks /usr/local /usr /usr/pkg; do
zlibdir="$dir"
if test -f "$dir/include/zlib.h"; then
AC_MSG_RESULT(found in $zlibdir)
found_zlib="yes";
if test "$zlibdir" = "/usr" ; then
CFLAGS="$CFLAGS -DZIP_LINKS";
else
CFLAGS="$CFLAGS -I$zlibdir/include -DZIP_LINKS";
fi
break
fi
done
if test x_$found_zlib != x_yes; then
AC_MSG_RESULT([not found])
echo ""
echo "Apparently you do not have the zlib development library installed."
echo "You have two options:"
echo "a) Install the zlib development library"
echo " and run ./Config"
echo "OR"
echo "b) If you don't need compressed links..."
echo " Run ./Config and say 'no' when asked about ziplinks support"
echo ""
exit 1
else
IRCDLIBS="$IRCDLIBS -lz"
if test "$zlibdir" != "/usr" ; then
LDFLAGS="$LDFLAGS -L$zlibdir/lib"
fi
HAVE_ZLIB=yes
fi
AC_SUBST([HAVE_ZLIB])
])
])

@ -0,0 +1,9 @@
#!/bin/bash
cd "$(dirname "${0}")"
ACLOCAL_AMFLAGS=(-I autoconf/m4)
aclocal "${ACLOCAL_AMFLAGS[@]}"
autoconf
autoheader

16148
configure vendored

File diff suppressed because it is too large Load Diff

@ -0,0 +1,643 @@
dnl Process this file with autoconf to produce a configure script.
AC_INIT([unrealircd], [3.2.8.1], [http://bugs.unrealircd.org/], [], [http://unrealircd.org/])
AC_CONFIG_SRCDIR([src/ircd.c])
AC_CONFIG_HEADER([include/setup.h])
AC_CONFIG_AUX_DIR([autoconf])
AC_CONFIG_MACRO_DIR([autoconf/m4])
if test "x$enable_dynamic_linking" = "x"; then
echo "Please use ./Config instead of ./configure"
exit 1
fi
AC_PROG_CC
if test "$ac_cv_prog_gcc" = "yes"; then
CFLAGS="$CFLAGS -funsigned-char"
AC_CACHE_CHECK(if gcc has a working -pipe, ac_cv_pipe, [
save_cflags="$CFLAGS"
CFLAGS="$CFLAGS -pipe"
AC_TRY_COMPILE(,, ac_cv_pipe="yes", ac_cv_pipe="no")
CFLAGS="$save_cflags"
])
if test "$ac_cv_pipe" = "yes"; then
CFLAGS="-pipe $CFLAGS"
fi
fi
dnl (the gcc flag detection trick is taken from xemacs/Vin Shelton)
dnl UnrealIRCd might not be strict-aliasing safe at this time
case "`$CC -v --help 2>&1`" in
*-fstrict-aliasing* ) CFLAGS="$CFLAGS -fno-strict-aliasing" ;;
esac
dnl Pointer signedness warnings are really a pain and 99.9% of the time
dnl they are of absolutely no use whatsoever. IMO the person who decided
dnl to enable this without -Wall should be shot on sight.
case "`$CC -v --help 2>&1`" in
*-Wpointer-sign* ) CFLAGS="$CFLAGS -Wno-pointer-sign" ;;
esac
AC_PATH_PROG(RM,rm)
AC_PATH_PROG(CP,cp)
AC_PATH_PROG(TOUCH,touch)
AC_PATH_PROG(OPENSSLPATH,openssl)
AC_PATH_PROG(INSTALL,install)
AC_CHECK_PROG(MAKER, gmake, gmake, make)
AC_PATH_PROG(GMAKE,gmake)
AC_PATH_PROG(GUNZIP, gunzip)
AC_PATH_PROG(PKGCONFIG, pkg-config)
dnl Checks for libraries.
AC_CHECK_LIB(descrypt, crypt,
[AC_DEFINE([HAVE_CRYPT], [], [Define if you have crypt])
IRCDLIBS="$IRCDLIBS-ldescrypt "
MKPASSWDLIBS="-ldescrypt"],
[AC_CHECK_LIB(crypt, crypt,
[AC_DEFINE([HAVE_CRYPT], [], [Define if you have crypt])
IRCDLIBS="$IRCDLIBS-lcrypt "
MKPASSWDLIBS="-lcrypt"])])
AC_CHECK_LIB(socket, socket,
[IRCDLIBS="$IRCDLIBS-lsocket "
SOCKLIB="-lsocket"])
AC_CHECK_LIB(nsl, inet_ntoa,
[IRCDLIBS="$IRCDLIBS-lnsl "
INETLIB="-lnsl"])
AC_SUBST(IRCDLIBS)
AC_SUBST(MKPASSWDLIBS)
dnl module checking based on Hyb7's module checking code
AC_DEFUN([AC_ENABLE_DYN],
[
AC_CHECK_FUNC(dlopen,, [AC_CHECK_LIB(dl, dlopen,IRCDLIBS="$IRCDLIBS -ldl",
[
AC_MSG_WARN(Dynamic linking is not enabled because dlopen was not found)
AC_DEFINE(STATIC_LINKING)
])])
hold_cflags=$CFLAGS
CFLAGS="$CFLAGS -export-dynamic"
AC_CACHE_CHECK(if we need the -export-dynamic flag, ac_cv_export_dynamic, [
AC_TRY_LINK(, [int i];, ac_cv_export_dynamic=yes, ac_cv_export_dynamic=no)])
if test "$ac_cv_export_dynamic" = "no"; then
CFLAGS=$hold_cflags
fi
AC_CACHE_CHECK(for compiler option to produce PIC,ac_cv_pic,[
if test "$ac_cv_prog_gcc" = "yes"; then
ac_cv_pic="-fPIC -DPIC -shared"
case `uname -s` in
Darwin*[)]
ac_cv_pic="-bundle -flat_namespace -undefined suppress"
;;
HP-UX*[)]
ac_cv_pic="-fPIC"
;;
esac
else
case `uname -s` in
SunOS*[)]
ac_cv_pic="-KPIC -DPIC -G"
;;
esac
fi
])
AC_CACHE_CHECK(if your system prepends an underscore on symbols,ac_cv_underscore,[
cat >uscore.c << __EOF__
int main() {
return 0;
}
__EOF__
$CC -o uscore $CFLAGS uscore.c 1>&5
if test -z "`strings -a uscore |grep '^_main$'`"; then
ac_cv_underscore=no
else
ac_cv_underscore=yes
fi
rm -f uscore uscore.c
])
dnl libtool has built-in tests that determine proper underscorage
if test "$ac_cv_underscore" = "yes"; then
AC_DEFINE([UNDERSCORE], [], [Define if your system prepends an underscore to symbols])
fi
MODULEFLAGS=$ac_cv_pic
dnl DYNAMIC_LINKING is not meant to be defined in include/setup.h, it's
dnl defined in the Makefiles using -D. Having it defined globally will
dnl only cause braindamage and symbol collisions :-D.
dnl AC_DEFINE([DYNAMIC_LINKING], [], [Link dynamically as opposed to statically. (Dynamic linking is the only supported method of linking atm)])
])
AC_DEFUN([AC_ENABLE_INET6],[
AC_CACHE_CHECK([if your system has IPv6 support], [ac_cv_ip6], [
save_libs="$LIBS"
LIBS="$LIBS $SOCKLIB"
AC_TRY_RUN([
#include <sys/types.h>
#include <sys/socket.h>
int main() {
if (socket(AF_INET6, SOCK_STREAM, 0) < 0)
exit(1);
exit(0);
}
],
[ac_cv_ip6=yes],
[ac_cv_ip6=no])
])
if test "$ac_cv_ip6" = "no"; then
AC_MSG_ERROR([Your system does not support IPv6 so it will not be enabled])
else
AC_DEFINE([INET6], [], [Define if you want IPv6 enabled])
dnl in6addr_any detection code taken from ratbox
AC_MSG_CHECKING([for struct in6addr_any])
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM(
[[#define IN_AUTOCONF
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>]],
[[struct in6_addr a = in6addr_any;]]
)],
[AC_MSG_RESULT(yes)],
[
AC_MSG_RESULT([no])
AC_DEFINE([NO_IN6ADDR_ANY], [1], [Define to 1 if your system has no in6addr_any.])
]
)
fi
LIBS="$save_libs"
])
AC_CHECK_HEADER(sys/param.h,
AC_DEFINE([PARAMH], [], [Define if you have the <sys/param.h> header file.]))
AC_CHECK_HEADER(stdlib.h,
AC_DEFINE([STDLIBH], [], [Define if you have the <stdlib.h> header file.]))
AC_CHECK_HEADER(stddef.h,
AC_DEFINE([STDDEFH], [], [Define if you have the <stddef.h> header file.]))
AC_CHECK_HEADER(sys/syslog.h,
AC_DEFINE([SYSSYSLOGH], [], [Define if you have the <sys/syslog.h> header file.]))
AC_CHECK_HEADER(unistd.h,
AC_DEFINE([UNISTDH], [], [Define if you have the <unistd.h> header file.]))
AC_CHECK_HEADER(string.h,
AC_DEFINE([STRINGH], [], [Define if you have the <string.h> header file.]))
AC_CHECK_HEADER(strings.h,
AC_DEFINE([STRINGSH], [], [Define if you have the <strings.h> header file.]))
AC_CHECK_HEADER(malloc.h,
AC_DEFINE([MALLOCH], [<malloc.h>], [Define to <malloc.h> you need malloc.h.]))
AC_CHECK_HEADER(sys/rusage.h,
AC_DEFINE([RUSAGEH], [], [Define if you have the <sys/rusage.h> header file.]))
AC_CHECK_HEADER(glob.h,
AC_DEFINE([GLOBH], [], [Define if you have the <glob.h> header file.]))
dnl Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_C_INLINE
AC_TYPE_SIZE_T
AC_HEADER_TIME
AC_STRUCT_TM
AC_TYPE_UID_T
unreal_CHECK_TYPE_SIZES
dnl in the future, it would be nice to avoid AC_TRY_RUN to allow
dnl better support for crosscompiling.
AC_CACHE_CHECK([what kind of nonblocking sockets you have], [ac_cv_nonblocking],[
save_libs="$LIBS"
LIBS="$LIBS $SOCKLIB"
AC_TRY_RUN([
#include <sys/types.h>
#include <sys/socket.h>
#include <fcntl.h>
#include <sys/ioctl.h>
#include <sys/file.h>
#include <signal.h>
alarmed() {
exit(1);
}
int main() {
#ifdef O_NONBLOCK
char b[12], x[32];
int f, l = sizeof(x);
f = socket(AF_INET, SOCK_DGRAM, 0);
if (f >= 0 && !(fcntl(f, F_SETFL, O_NONBLOCK))) {
signal(SIGALRM, alarmed);
alarm(3);
recvfrom(f, b, 12, 0, (struct sockaddr *)x, &l);
alarm(0);
exit(0);
}
#endif
exit(1);
}
],ac_cv_nonblocking=O_NONBLOCK,[
AC_TRY_RUN([
#include <sys/types.h>
#include <sys/socket.h>
#include <fcntl.h>
#include <sys/ioctl.h>
#include <sys/file.h>
#include <signal.h>
alarmed() {
exit(0);
}
int main() {
#ifdef O_NDELAY
char b[12], x[32];
int f, l = sizeof(x);
f = socket(AF_INET, SOCK_DGRAM, 0);
if (f >= 0 && !(fcntl(f, F_SETFL, O_NDELAY))) {
signal(SIGALRM, alarmed);
alarm(3);
recvfrom(f, b, 12, 0, (struct sockaddr *)x, &l);
alarm(0);
exit(0);
}
#endif
exit(1);
}],ac_cv_nonblocking=O_NDELAY,[
AC_TRY_RUN([
#include <sys/types.h>
#include <sys/socket.h>
#include <fcntl.h>
#include <sys/ioctl.h>
#include <sys/file.h>
#include <signal.h>
alarmed() {
exit(1);
}
int main() {
#ifdef FIONBIO
char b[12], x[32];
int f, l = sizeof(x);
f = socket(AF_INET, SOCK_DGRAM, 0);
if (f >= 0 && !(fcntl(f, F_SETFL, FIONBIO))) {
signal(SIGALRM, alarmed);
alarm(3);
recvfrom(f, b, 12, 0, (struct sockaddr *)x, &l);
alarm(0);
exit(0);
}
#endif
exit(1);
], ac_cv_nonblocking=FIONBIO,ac_cv_nonblocking=none)])])])
if test "$ac_cv_nonblocking" = "O_NONBLOCK"; then
AC_DEFINE([NBLOCK_POSIX], [], [Define if you have O_NONBLOCK])
elif test "$ac_cv_nonblocking" = "O_NDELAY"; then
AC_DEFINE([NBLOCK_BSD], [], [Define if you have O_NDELAY])
elif test "$ac_cv_nonblocking" = "FIONBIO"; then
AC_DEFINE([NBLOCK_SYSV], [], [Define if you have FIONBIO])
fi
LIBS="$save_libs"
dnl Checks for library functions.
AC_PROG_GCC_TRADITIONAL
AC_FUNC_SETPGRP
AC_FUNC_SETVBUF_REVERSED
AC_FUNC_ALLOCA
AC_CHECK_FUNCS(snprintf,
AC_DEFINE([HAVE_SNPRINTF], [], [Define if you have snprintf]))
AC_CHECK_FUNCS(vsnprintf,
AC_DEFINE([HAVE_VSNPRINTF], [], [Define if you have vsnprintf]))
AC_CHECK_FUNCS(strlcpy,
AC_DEFINE([HAVE_STRLCPY], [], [Define if you have strlcpy. Otherwise, an internal implementation will be used!]))
AC_CHECK_FUNCS(strlcat,
AC_DEFINE([HAVE_STRLCAT], [], [Define if you have strlcat]))
AC_CHECK_FUNCS(strlncat,
AC_DEFINE([HAVE_STRLNCAT], [], [Define if you have strlncat]))
AC_CHECK_FUNCS(inet_pton,
AC_DEFINE([HAVE_INET_PTON], [], [Define if you have inet_pton]))
AC_CHECK_FUNCS(inet_ntop,
AC_DEFINE([HAVE_INET_NTOP], [], [Define if you have inet_ntop]))
dnl Check if it supports C99 style variable length arrays
AC_CACHE_CHECK([if C99 variable length arrays are supported], [ac_cv_varlen_arrays], [
AC_TRY_COMPILE(,[
int main() {
int i = 5;
int a[i];
a[0] = 1;
return 0;
}], ac_cv_varlen_arrays=yes, ac_cv_varlen_arrays=no)
])
if test "$ac_cv_varlen_arrays" = "yes" ; then
AC_DEFINE([HAVE_C99_VARLEN_ARRAY], [], [Define if you have a compiler with C99 variable length array support])
fi
dnl This check doesn't need to be in ./configure, we can
dnl write the sourcecode to actually handle the return value
dnl of setrlimit if necessary...
AC_CACHE_CHECK([if we can set the core size to unlimited], [ac_cv_force_core], [
AC_TRY_RUN([
#include <sys/time.h>
#include <sys/resource.h>
#include <unistd.h>
int main() {
struct rlimit corelim;
corelim.rlim_cur = corelim.rlim_max = RLIM_INFINITY;
if (setrlimit(RLIMIT_CORE, &corelim))
exit(1);
exit(0);
}
],ac_cv_force_core=yes,ac_cv_force_core=no)
])
if test "$ac_cv_force_core" = "yes"; then
AC_DEFINE([FORCE_CORE], [], [Define if you can set the core size to unlimited])
fi
AC_FUNC_VPRINTF
AC_CHECK_FUNCS([gettimeofday],
[AC_DEFINE([GETTIMEOFDAY], [], [Define if you have gettimeofday])],
[AC_CHECK_FUNCS([lrand48],
[AC_DEFINE([LRADN48], [], [Define if you have lrand48])])])
AC_CHECK_FUNCS([getrusage],
[AC_DEFINE([GETRUSAGE_2], [], [Define if you have getrusage])],
[AC_CHECK_FUNCS([times],
[AC_DEFINE([TIMES_2], [], [Define if you have times])])])
AC_CHECK_FUNCS([setproctitle],
[AC_DEFINE([HAVE_SETPROCTITLE], [], [Define if you have setproctitle])],
[AC_CHECK_LIB([util],
[setproctitle],
[AC_DEFINE([HAVE_SETPROCTITLE], [], [Define if you have setproctitle])
IRCDLIBS="$IRCDLIBS-lutil"],
[
AC_EGREP_HEADER([#define.*PS_STRINGS.*],[sys/exec.h],
[AC_DEFINE([HAVE_PSSTRINGS],[], [Define if you have PS_STRINGS])],
[AC_CHECK_FUNCS([pstat],
[AC_DEFINE([HAVE_PSTAT], [], [Define if you have pstat])])])
])
]
)
AC_CACHE_CHECK([what type of signals you have], [ac_cv_sigtype], [
AC_TRY_RUN([
#include <signal.h>
int main() {
sigaction(SIGTERM, (struct sigaction *)0L, (struct sigaction *)0L);
}
], ac_cv_sigtype=POSIX, [
AC_TRY_RUN([
#include <signal.h>
int calls = 0;
void handler()
{
if (calls)
return;
calls++;
kill(getpid(), SIGTERM);
sleep(1);
}
int main() {
signal(SIGTERM, handler);
kill(getpid(), SIGTERM);
exit(0);
}
], ac_cv_sigtype=BSD,ac_cv_sigtype=SYSV)])])
if test "$ac_cv_sigtype" = "POSIX"; then
AC_DEFINE([POSIX_SIGNALS], [], [Define if you have POSIX signals])
elif test "$ac_cv_sigtype" = "BSD"; then
AC_DEFINE([BSD_RELIABLE_SIGNALS], [], [Define if you have BSD signals])
else
AC_DEFINE([SYSV_UNRELIABLE_SIGNALS], [], [Define if you have SYSV signals])
fi
AC_CHECK_FUNCS(strtoken,,AC_DEFINE([NEED_STRTOKEN], [], [Define if you need the strtoken function.]))
AC_CHECK_FUNCS(strtok,,AC_DEFINE([NEED_STRTOK], [], [Define if you need the strtok function.]))
AC_CHECK_FUNCS(strerror,,AC_DEFINE([NEED_STRERROR], [], [Define if you need the strerror function.]))
AC_CHECK_FUNCS(index,,AC_DEFINE([NOINDEX], [], [Define if you do not have the index function.]))
AC_CHECK_FUNCS(strtoul,,STRTOUL="strtoul.o")
AC_CHECK_FUNCS(bcopy,,AC_DEFINE([NEED_BCOPY], [], [Define if you don't have bcopy]))
AC_CHECK_FUNCS(bcmp,,AC_DEFINE([NEED_BCMP], [], [Define if you don't have bcmp]))
AC_CHECK_FUNCS(bzero,,AC_DEFINE([NEED_BZERO], [], [Define if you need bzero]))
AC_CHECK_FUNCS(strcasecmp,AC_DEFINE([GOT_STRCASECMP], [], [Define if you have strcasecmp]))
save_libs="$LIBS"
LIBS="$LIBS $SOCKLIB $INETLIB"
AC_CHECK_FUNCS(inet_addr,,AC_DEFINE([NEED_INET_ADDR], [], [Define if you need inet_addr]))
AC_CHECK_FUNCS(inet_ntoa,,AC_DEFINE([NEED_INET_NTOA], [], [Define if you need inet_ntoa]))
AC_CHECK_FUNCS(inet_netof,,AC_DEFINE([NEED_INET_NETOF], [], [Define if you need inet_netof]))
LIBS="$save_libs"
AC_CHECK_FUNCS(syslog,AC_DEFINE([HAVE_SYSLOG], [], [Define if you have syslog]))
AC_CHECK_FUNCS(vsyslog,AC_DEFINE([HAVE_VSYSLOG], [], [Define if you have vsyslog]))
AC_SUBST(STRTOUL)
AC_SUBST(CRYPTOLIB)
AC_SUBST(MODULEFLAGS)
AC_ARG_WITH(listen, [AS_HELP_STRING([--with-listen=backlog],[Specify the listen backlog value])],
[AC_DEFINE_UNQUOTED([LISTEN_SIZE], [$withval], [Set to the listen backlog size you want])],
[AC_DEFINE([LISTEN_SIZE], [5], [Set to the listen backlog size you want])])
AC_ARG_WITH(nick-history, [AS_HELP_STRING([--with-nick-history=length],[Specify the length of the nickname history])],
[AC_DEFINE_UNQUOTED([NICKNAMEHISTORYLENGTH], [$withval], [Set to the nickname history length you want])],
[AC_DEFINE([NICKNAMEHISTORYLENGTH], [2000], [Set to the nickname history length you want])])
AC_ARG_WITH([sendq], [AS_HELP_STRING([--with-sendq=maxsendq],[Specify the max sendq for the server])],
[AC_DEFINE_UNQUOTED([MAXSENDQLENGTH], [$withval], [Set to the max sendq you want])],
[AC_DEFINE([MAXSENDQLENGTH], [3000000], [Set to the max sendq you want])])
AC_ARG_WITH(bufferpool, [AS_HELP_STRING([--with-bufferpool=size],[Specify the size of the buffer pool])],
[AC_DEFINE_UNQUOTED([BUFFERPOOL],[($withval * MAXSENDQLENGTH)], [Set to the bufferpool size you want])],
[AC_DEFINE([BUFFERPOOL],[(18 * MAXSENDQLENGTH)], [Set to the bufferpool size you want])])
AC_ARG_WITH(permissions, [AS_HELP_STRING([--with-permissions=permissions], [Specify the default permissions for
configuration files])],
[AC_DEFINE_UNQUOTED([DEFAULT_PERMISSIONS], [$withval], [The default permissions for configuration files. Set to 0 to prevent unrealircd from calling chmod() on the files.])],
[AC_DEFINE([DEFAULT_PERMISSIONS], [0600], [The default permissions for configuration files. Set to 0 to prevent unrealircd from calling chmod() on the files.])])
AC_ARG_WITH(dpath, [AS_HELP_STRING([--with-dpath=path],[Specify the path where configuration files are stored])],
[AC_DEFINE_UNQUOTED([DPATH], ["$withval"], [Define the location of the configuration files])
I IRCDDIR="$withval"],
[AC_DEFINE_UNQUOTED([DPATH], ["`pwd`"], [Define the location of the configuration files])
IRCDDIR="`pwd`"])
AC_ARG_WITH(fd-setsize, [AS_HELP_STRING([--with-fd-setsize=size], [Specify the max file descriptors to use])],
[ac_fd=$withval],
[ac_fd=1024])
AC_DEFINE_UNQUOTED([MAXCONNECTIONS], [$ac_fd], [Set to the max connections you want])
dnl It would be nice if this could just respect --bindir like every other
dnl program does someday...
dnl Also, there's no reason to call unrealircd ``ircd'' when there are so many other
dnl IRCds out there ;-)
AC_ARG_WITH(spath, [AS_HELP_STRING([--with-spath],[Specify the location of the executable])],
[AC_DEFINE_UNQUOTED([SPATH], ["$withval"], [Define the location of the executable])
BINDIR="$withval"],
[AC_DEFINE_UNQUOTED([SPATH], ["`pwd`/src/ircd"], [Define the location of the executable])
BINDIR="`pwd`/src/ircd"])
# enable nospoof by default; protects against javascript POST attacks and much more ;-)
AC_ARG_ENABLE([nospoof],
[AS_HELP_STRING([--disable-nospoof], [Disable spoofing protection (requires clients to respond to a randomly generated PING packet after USER and NICK but before using other commands)])],
[],
[enable_nospoof=yes])
AS_IF([test $enable_nospoof = "yes"],
[AC_DEFINE([NOSPOOF], [], [Define if you want spoof protection])])
AC_ARG_ENABLE([prefixaq],
[AS_HELP_STRING([--disable-prefixaq],[Enable chanadmin (+a) and chanowner (+q) prefixes])],
[],
[enable_prefixaq=yes])
AS_IF([test $enable_prefixaq = "yes"],
[AC_DEFINE([PREFIX_AQ], [], [Define if you want +a/+q prefixes])])
AC_ARG_WITH(showlistmodes,
[AS_HELP_STRING([--with-showlistmodes], [Specify whether modes are shown in /list])],
[AS_IF([test $withval = "yes"],
[AC_DEFINE([LIST_SHOW_MODES], [], [Define if you want modes shown in /list])])])
AC_ARG_WITH(topicisnuhost, [AS_HELP_STRING([--with-topicisnuhost], [Display nick!user@host as the topic setter])],
[AS_IF([test $withval = "yes"],
[AC_DEFINE([TOPIC_NICK_IS_NUHOST], [], [Define if you want nick!user@host shown for the topic setter])])])
AC_ARG_WITH(shunnotices, [AS_HELP_STRING([--with-shunnotices], [Notify a user when he/she is no longer shunned])],
[AS_IF([test $withval = "yes"],
[AC_DEFINE([SHUN_NOTICES], [], [Define if you want users to be notified when their shun is removed])])])
AC_ARG_WITH(no-operoverride, [AS_HELP_STRING([--with-no-operoverride], [Disable OperOverride])],
[AS_IF([test $withval = "yes"],
[AC_DEFINE([NO_OPEROVERRIDE], [], [Define if you want OperOverride disabled])])])
AC_ARG_WITH(disableusermod, [AS_HELP_STRING([--with-disableusermod], [Disable /set* and /chg*])],
[AS_IF([test $withval = "yes"],
[AC_DEFINE([DISABLE_USERMOD], [], [Define if you want to disable /set* and /chg*])])])
AC_ARG_WITH(operoverride-verify, [AS_HELP_STRING([--with-operoverride-verify], [Require opers to invite themselves to +s/+p channels])],
[AS_IF([test $withval = "yes"],
[AC_DEFINE([OPEROVERRIDE_VERIFY], [], [Define if you want opers to have to use /invite to join +s/+p channels])])])
AC_ARG_WITH(disable-extendedban-stacking, [AS_HELP_STRING([--with-disable-extendedban-stacking], [Disable extended ban stacking])],
[AS_IF([test $withval = "yes"],
[AC_DEFINE([DISABLE_STACKED_EXTBANS], [], [Define to disable extended ban stacking (~q:~c:\#chan, etc)])])])
AC_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])
AC_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])
CHECK_SSL
CHECK_ZLIB
CHECK_LIBCURL
AC_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)])],
[enable_dynamic_linking=$enableval], [enable_dynamic_linking="yes"])
AS_IF([test $enable_dynamic_linking = "yes"],
[AC_ENABLE_DYN],
[AC_DEFINE([STATIC_LINKING], [], [Link... statically(?) (defining this macro will probably cause the build tofail)])])
AC_ARG_ENABLE([inet6], [AS_HELP_STRING([--enable-inet6], [Make the IRCd support IPv6])],
[AS_IF([test $enableval = "yes"],
[AC_ENABLE_INET6])])
AC_SUBST(IRCDDIR)
AC_SUBST(BINDIR)
AC_MSG_CHECKING([if FD_SETSIZE is large enough to allow $ac_fd file descriptors])
AC_COMPILE_IFELSE([
#include <sys/types.h>
#include <sys/time.h>
int main() {
#if FD_SETSIZE < $ac_fd
#error FD_SETSIZE is smaller than $ac_fd
#endif
exit(0);
}
], AC_MSG_RESULT([yes]), [
FD_SETSIZE="-DFD_SETSIZE=$ac_fd"
AC_MSG_RESULT(no)
])
AC_SUBST([FD_SETSIZE])
case `uname -s` in
*SunOS*)
CFLAGS="$CFLAGS -D_SOLARIS"
IRCDLIBS="$IRCDLIBS -lresolv "
;;
*solaris*)
CFLAGS="$CFLAGS -D_SOLARIS"
IRCDLIBS="$IRCDLIBS -lresolv "
;;
esac
dnl c-ares needs PATH_SEPARATOR set or it will
dnl fail on certain solaris boxes. We might as
dnl well set it here.
export PATH_SEPARATOR
AS_IF([test "x$with_system_tre" = "xno"],[
dnl REMEMBER TO CHANGE WITH A NEW TRE RELEASE!
tre_version="0.7.5"
AC_MSG_RESULT(extracting TRE regex library)
cur_dir=`pwd`
cd extras
dnl remove old tre directory to force a recompile...
rm -rf tre-$tre_version
if test "x$ac_cv_path_GUNZIP" = "x" ; then
tar xfz tre.tar.gz
else
cp tre.tar.gz tre.tar.gz.bak
gunzip -f tre.tar.gz
cp tre.tar.gz.bak tre.tar.gz
tar xf tre.tar
fi
AC_MSG_RESULT(configuring TRE regex library)
cd tre-$tre_version
./configure --disable-agrep --disable-shared --disable-system-abi --disable-wchar --disable-multibyte --prefix=$cur_dir/extras/regexp || exit 1
AC_MSG_RESULT(compiling TRE regex library)
$ac_cv_prog_MAKER || exit 1
AC_MSG_RESULT(installing TRE regex library)
$ac_cv_prog_MAKER install || exit 1
TRE_CFLAGS="-I$cur_dir/extras/regexp/include"
AC_SUBST(TRE_CFLAGS)
if