This repository has been archived on 2025-02-12. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.
NeoStats/configure.in
2004-03-17 21:06:48 +00:00

542 lines
No EOL
14 KiB
Text

dnl Process this file with autoconf to produce a configure script.
AC_INIT(src/main.c)
AC_CONFIG_HEADER(src/config.h)
PACKAGE=NeoStats
MAJOR=3
MINOR=0
REV=genesis
AC_DEFINE_UNQUOTED(MAJOR, $MAJOR)
AC_DEFINE_UNQUOTED(MINOR, $MINOR)
AC_DEFINE_UNQUOTED(REV, $REV)
VERSION=$MAJOR.$MINOR.$REV
AC_PREFIX_DEFAULT(~/NeoStats)
MODLDFLAGS="-shared"
AC_DEFINE_UNQUOTED(NEOSTATS_PACKAGE_VERSION, "$VERSION")
dnl Get system type
AC_CANONICAL_HOST
MYHOST=$host_os
case "$host_os" in
*cygwin)
CFLAGS="$CFLAGS -O2 -g"
LDFLAGS="$LDFLAGS -export-dynamic";;
*mingw32)
CFLAGS="$CFLAGS -O2 -g -mno-cygwin"
LDFLAGS="$LDFLAGS -export-dynamic";;
*openbsd)
CFLAGS="$CFLAGS -O2 -g -fPIC -DPIC"
LDFLAGS="-export-dynamic";;
*)
CFLAGS="$CFLAGS -O2 -g -fPIC -DPIC"
LDFLAGS="-rdynamic";;
esac
case "$host_os" in
*openbsd*)
MAKEDEPENDENCIES="";;
*freebsd*)
MAKEDEPENDENCIES="";;
*)
MAKEDEPENDENCIES="-include \$(OBJS:.o=.d)";;
esac
dnl Checks for programs.
AC_PROG_CC
AC_PROG_INSTALL
AC_PROG_LEX
AC_PROG_YACC
AC_PROG_RANLIB
AC_CACHE_SAVE
dnl Checks for libraries.
dnl Replace `main' with a function in -ldl:
AC_CHECK_LIB(dl, dlopen)
ADNS_C_GETFUNC(socket,socket)
ADNS_C_GETFUNC(inet_ntoa,nsl)
AC_CHECK_FUNC(backtrace,
[AC_DEFINE(HAVE_BACKTRACE, 1, 'backtrace function available')
LIBS="-g $LIBS"]
)
AC_CACHE_SAVE
dnl Checks for header files.
AC_HEADER_STDC
AC_HEADER_SYS_WAIT
AC_CHECK_HEADERS(sys/time.h unistd.h limits.h)
AC_CACHE_SAVE
dnl Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_TYPE_SIZE_T
AC_HEADER_TIME
AC_STRUCT_TM
AC_CACHE_SAVE
dnl Checks for library functions.
AC_FUNC_FNMATCH
AC_TYPE_SIGNAL
AC_FUNC_STRFTIME
AC_CHECK_FUNCS(strlcpy strlcat strnlen)
AC_CHECK_FUNCS(socket strdup)
AC_CHECK_FUNCS(strndup)
AC_CHECK_FUNCS(bcopy memmove strerror)
ADNS_C_GETFUNC(inet_aton,resolv,[
LIBS="-lresolv $LIBS";
AC_MSG_WARN([inet_aton is in libresolv, urgh. Must use -lresolv.])
])
DPKG_CACHED_TRY_COMPILE(inlines,dpkg_cv_c_inline,,
[} inline int foo (int x) {],
AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_INLINE),
AC_MSG_RESULT(no))
ADNS_C_GCCATTRIB
AC_CHECK_HEADERS(sys/select.h)
AC_MSG_CHECKING(for INADDR_LOOPBACK)
AC_CACHE_VAL(adns_cv_decl_inaddrloopback,[
AC_TRY_COMPILE([
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
],[
INADDR_LOOPBACK;
],
adns_cv_decl_inaddrloopback=yes,
adns_cv_decl_inaddrloopback=no)])
if test "$adns_cv_decl_inaddrloopback" = yes; then
AC_MSG_RESULT(found)
else
AC_MSG_RESULT([not in standard headers, urgh...])
AC_CHECK_HEADER(rpc/types.h,[
AC_DEFINE(HAVEUSE_RPCTYPES_H)
],[
AC_MSG_ERROR([cannot find INADDR_LOOPBACK or rpc/types.h])
])
fi
dnl **** Check for underscore on external symbols ****
AC_CACHE_CHECK(whether external symbols need an underscore prefix,
ac_cv_c_extern_prefix,
[saved_libs=$LIBS
LIBS="conftest_asm.s $LIBS"
cat > conftest_asm.s <<EOF
.globl _ac_test
_ac_test:
.long 0
EOF
AC_TRY_LINK([extern int ac_test;],[if (ac_test) return 1],
ac_cv_c_extern_prefix="yes",ac_cv_c_extern_prefix="no")
LIBS=$saved_libs])
if test "$ac_cv_c_extern_prefix" = "yes"
then
AC_DEFINE(NEED_UNDERSCORE_PREFIX)
fi
dnl check for berkeley db support
AC_CHECK_HEADER(db.h, AC_DEFINE(HAVE_DB_H, 1, [Define to 1 if you have the <db.h> header file.])
AC_CHECK_LIB(db, db_create, LIBDB="-ldb"))
PCRE_MAJOR=4
PCRE_MINOR=3
PCRE_DATE=21-May-2003
PCRE_VERSION=${PCRE_MAJOR}.${PCRE_MINOR}
dnl Default values for miscellaneous macros
AC_DEFINE(POSIX_MALLOC_THRESHOLD,10)
dnl check if we are running with Debug....
AC_MSG_CHECKING(Whether to Enable Debuging...)
AC_ARG_ENABLE(debug,
[ --enable-debug - Enable Debuging],
[ case "$enableval" in
yes)
AC_DEFINE(DEBUG, 1, 'Enable Debugging')
CFLAGS="$CFLAGS -ggdb -Wall"
AC_MSG_RESULT(yes - Watch your Log Files)
;;
*)
CFLAGS="$CFLAGS -DNDEBUG"
AC_MSG_RESULT(no)
;;
esac],
CFLAGS="$CFLAGS -DNDEBUG"
AC_MSG_RESULT(no)
)
AC_CACHE_SAVE
do_serviceroots=no
PROTOCOL=no
dnl check to see if we should enable Unreal IRCD Support
AC_MSG_CHECKING(Whether to Enable Unreal 3.1.x IRCD Support...)
AC_ARG_ENABLE(unreal31, [ --enable-unreal31 - enable Unreal 3.1.x IRCD Support],
[ case "$enableval" in
yes)
AC_DEFINE(UNREAL, 1, 'Enable Unreal 3.1.x Support')
PROTOCOL="unreal"
AC_MSG_RESULT(yes)
;;
*)
AC_MSG_RESULT(no)
;;
esac],
AC_MSG_RESULT(no))
AC_MSG_CHECKING(Whether to Enable Unreal 3.2.x IRCD Support...)
AC_ARG_ENABLE(unreal32, [ --enable-unreal32 - enable Unreal 3.2.x IRCD Support],
[ case "$enableval" in
yes)
AC_DEFINE(UNREAL, 1, 'Enable Unreal 3.1.x Support')
AC_DEFINE(UNREAL32, 1, 'Enable Unreal 3.2.x Support')
PROTOCOL="unreal"
AC_MSG_RESULT(yes)
;;
*)
AC_MSG_RESULT(no)
;;
esac],
AC_MSG_RESULT(no))
dnl check to see if we should enable Ultimate IRCD Support
AC_MSG_CHECKING(Whether to Enable Ultimate 2.x.x IRCD Support...)
AC_ARG_ENABLE(ultimate2, [ --enable-ultimate2 - enable Ultimate 2.x.x IRCD Support],
[ case "$enableval" in
yes)
AC_DEFINE(ULTIMATE, 1, 'Enable Ultimate Support')
PROTOCOL="ultimate"
AC_MSG_RESULT(yes)
;;
*)
AC_MSG_RESULT(no)
;;
esac],
AC_MSG_RESULT(no)
)
AC_MSG_CHECKING(Whether to Enable Ultimate 3.x.x IRCD Support...)
AC_ARG_ENABLE(ultimate3, [ --enable-ultimate3 - enable Ultimate 3.x.x IRCD Support],
[ case "$enableval" in
yes)
AC_DEFINE(ULTIMATE, 1, 'Enable Ultimate 2.x.x Support')
AC_DEFINE(ULTIMATE3, 1, "Enable Ultimate 3.x.x Support')
PROTOCOL="ultimate"
AC_MSG_RESULT(yes)
;;
*)
AC_MSG_RESULT(no)
;;
esac],
AC_MSG_RESULT(no)
)
AC_MSG_CHECKING(Whether to Enable Hybrid 7.x.x IRCD Support...)
AC_ARG_ENABLE(hybrid7, [ --enable-hybrid7 - enable Hybrid7 IRCD Support],
[ case "$enableval" in
yes)
AC_DEFINE(HYBRID7, 1, 'Enable hybrid7 IRCD support')
PROTOCOL="hybrid7"
AC_MSG_CHECKING(Auto-Enabling ServiceRoots Authentication Module)
do_serviceroots=yes
AC_DEFINE(EXTAUTH, 1, 'Use IRCD Authentication')
EXTAUTH_SRC="$EXTAUTH_SRC serviceroots.c"
EXTAUTH_OBJS="$EXTAUTH_OBJS serviceroots.o"
MODULES="$MODULES extauth"
AC_MSG_RESULT(yes)
;;
*)
AC_MSG_RESULT(no)
;;
esac],
AC_MSG_RESULT(no)
)
AC_MSG_CHECKING(Whether to Enable NeoIRCd IRCD Support...)
AC_ARG_ENABLE(neoircd, [ --enable-neoircd - enable NeoIRCd IRCD Support],
[ case "$enableval" in
yes)
AC_DEFINE(NEOIRCD, 1, 'Enable NeoIRCd IRCD support')
PROTOCOL="neoircd"
AC_MSG_RESULT(yes)
;;
*)
AC_MSG_RESULT(no)
;;
esac],
AC_MSG_RESULT(no)
)
dnl check to see if we should enable Quantum IRCD Support
AC_MSG_CHECKING(Whether to Enable Quantum IRCD Support...)
AC_ARG_ENABLE(quantum, [ --enable-quantum - enable Quantum IRCD Support],
[ case "$enableval" in
yes)
AC_DEFINE(QUANTUM, 1, 'Enable Quantum Support')
PROTOCOL="quantum"
AC_MSG_RESULT(yes)
;;
*)
AC_MSG_RESULT(no)
;;
esac],
AC_MSG_RESULT(no))
dnl check to see if we should enable Mystic IRCD Support
AC_MSG_CHECKING(Whether to Enable Mystic IRCD Support...)
AC_ARG_ENABLE(mystic, [ --enable-mystic - enable Mystic IRCD Support],
[ case "$enableval" in
yes)
AC_DEFINE(MYSTIC, 1, 'Enable Mystic Support')
PROTOCOL="mystic"
AC_MSG_RESULT(yes)
;;
*)
AC_MSG_RESULT(no)
;;
esac],
AC_MSG_RESULT(no))
dnl check to see if we should enable Bahamut IRCD Support
AC_MSG_CHECKING(Whether to Enable Bahamut IRCD Support...)
AC_ARG_ENABLE(bahamut, [ --enable-bahamut - enable Bahamut IRCD Support],
[ case "$enableval" in
yes)
AC_DEFINE(BAHAMUT, 1, 'Enable Bahamut Support')
PROTOCOL="bahamut"
AC_MSG_RESULT(yes)
;;
*)
AC_MSG_RESULT(no)
;;
esac],
AC_MSG_RESULT(no))
dnl check to see if we should enable IRCu IRCD Support
AC_MSG_CHECKING(Whether to Enable IRCu IRCD Support...)
AC_ARG_ENABLE(ircu, [ --enable-ircu - enable IRCu IRCD Support],
[ case "$enableval" in
yes)
dnl AC_MSG_ERROR('Sorry IRCu support isnt complete yet')
AC_DEFINE(IRCU, 1, 'Enable IRCu Support')
PROTOCOL="ircu"
AC_MSG_RESULT(yes)
;;
*)
AC_MSG_RESULT(no)
;;
esac],
AC_MSG_RESULT(no))
dnl check to see if we should enable liquid IRCD Support
AC_MSG_CHECKING(Whether to Enable Liquid IRCD Support...)
AC_ARG_ENABLE(liquid, [ --enable-liquid - enable Liquid IRCD Support],
[ case "$enableval" in
yes)
AC_DEFINE(LIQUID, 1, 'Enable Liquid IRCd Support')
PROTOCOL="liquid"
AC_MSG_RESULT(yes)
;;
*)
AC_MSG_RESULT(no)
;;
esac],
AC_MSG_RESULT(no)
)
dnl check to see if we should enable Viagra IRCD Support
AC_MSG_CHECKING(Whether to Enable Viagra IRCD Support...)
AC_ARG_ENABLE(viagra, [ --enable-viagra - enable Viagra IRCD Support],
[ case "$enableval" in
yes)
AC_DEFINE(VIAGRA, 1, 'Enable Viagra IRCd Support')
PROTOCOL="viagra"
AC_MSG_RESULT(yes)
;;
*)
AC_MSG_RESULT(no)
;;
esac],
AC_MSG_RESULT(no)
)
AC_MSG_CHECKING(A compatible IRCD is specified)
if test "$PROTOCOL" = no; then
AC_MSG_RESULT(no)
AC_MSG_ERROR('You must define a IRCD to use. See ./configure --help for more information')
else
AC_MSG_RESULT(yes)
fi
if test "$do_serviceroots" = no; then
dnl check to see what type of authentication to use
AC_MSG_CHECKING(What type of Authentication to use...)
AC_ARG_ENABLE(auth, [ --enable-auth=TYPE - what type of Authentication to use. See Readme File],
[ case "$enableval" in
sr)
AC_DEFINE(EXTAUTH, 1, 'Use IRCD Authentication')
EXTAUTH_SRC="$EXTAUTH_SRC serviceroots.c"
EXTAUTH_OBJS="$EXTAUTH_OBJS serviceroots.o"
AC_MSG_RESULT(External)
MODULES="$MODULES extauth"
;;
*)
AC_MSG_RESULT(IRCD)
;;
esac],
AC_MSG_RESULT(IRCD)
)
fi
AC_MSG_CHECKING(To Enable Raw command?)
AC_ARG_ENABLE(raw, [ --enable-raw - Enable Raw command],
[ case "$enableval" in
yes)
AC_DEFINE(USE_RAW, 1, 'Use Raw command')
AC_MSG_RESULT(yes)
;;
*)
AC_MSG_RESULT(no)
;;
esac],
AC_MSG_RESULT(no)
)
AC_MSG_CHECKING(To Enable Sql Server Emulation?)
AC_ARG_ENABLE(sqlsrv, [ --enable-sqlsrv - Enable Sql Server Emulation],
[ case "$enableval" in
yes)
AC_DEFINE(SQLSRV, 1, 'Use Sql Server Emulation')
AC_MSG_RESULT(yes)
sqlsrvbuild=sqlsrv/librtadb.a
AC_SUBST(sqlsrvbuild)
buildsqlsrv=sqlsrvlib
AC_SUBST(buildsqlsrv)
;;
*)
AC_MSG_RESULT(no)
;;
esac],
AC_MSG_RESULT(no)
)
dnl Lets see what Modules to Compile
AC_MSG_CHECKING(Any other modules to compile?)
AC_ARG_ENABLE(modules, [ --enable-modules="MODULES" - space seperated list of modules to compile],
AC_MSG_RESULT($enableval)
MODULES="$MODULES $enableval",
AC_MSG_RESULT(none)
)
configtool=no
AC_MSG_CHECKING(Enable Building of ConfigTool?)
AC_ARG_ENABLE(configtool,
[ --enable-configtool - Enable building of the configtool program (Needs X windows)],
[if test "$enableval" = yes; then configtool=yes; else configtool=no; fi])
if test "$configtool" = yes; then
AC_MSG_RESULT(Yes.... Testing for Dependancies!)
AC_PATH_PROG(GTK_CONFIG, gtk-config, no)
if test "$GTK_CONFIG" = no; then
AC_MSG_WARN([Cannot find GTK+, configtool will not be built])
else
AC_MSG_CHECKING([GTK version (need at least 1.2.0)])
gtk_version=`$GTK_CONFIG --version`
gtk_maj_ver=`echo $gtk_version | cut -f 1 -d .`
gtk_min_ver=`echo $gtk_version | cut -f 2 -d .`
gtk_sub_ver=`echo $gtk_version | cut -f 3 -d .`
AC_MSG_RESULT(${gtk_maj_ver}.${gtk_min_ver}.${gtk_sub_ver})
if test $gtk_maj_ver -lt 1 -o $gtk_min_ver -lt 2; then
configtool=no
AC_MSG_WARN([GTK+ version is too old, configtool will not be built])
fi
fi
else
AC_MSG_RESULT(no)
fi
if test "$configtool" = yes; then
build_configtool=configtool
else
build_configtool=
fi
AC_SUBST(build_configtool)
AC_MSG_CHECKING(The Modules that will be compiled)
AC_MSG_RESULT($MODULES)
dnl Set NEO_PREFIX in config.h.
if test "x${prefix}" = "xNONE"; then
AC_DEFINE_UNQUOTED(NEO_PREFIX, "${ac_default_prefix}")
else
AC_DEFINE_UNQUOTED(NEO_PREFIX, "${prefix}")
fi
AC_SUBST(LIBDB)
AC_SUBST(MAKEDEPENDENCIES)
AC_SUBST(DIRINST)
AC_SUBST(CFLAGS)
AC_SUBST(LDFLAGS)
AC_SUBST(MODLDFLAGS)
AC_SUBST(LINK_SIZE)
AC_SUBST(MATCH_LIMIT)
AC_SUBST(NEWLINE)
AC_SUBST(PCRE_MAJOR)
AC_SUBST(PCRE_MINOR)
AC_SUBST(PCRE_DATE)
AC_SUBST(PCRE_VERSION)
AC_SUBST(PCRE_LIB_VERSION)
AC_SUBST(PCRE_POSIXLIB_VERSION)
AC_DEFINE(POSIX_MALLOC_THRESHOLD,10)
AC_SUBST(POSIX_MALLOC_THRESHOLD)
AC_SUBST(UTF8)
AC_SUBST(PROTOCOL)
AC_SUBST(MODULES)
AC_SUBST(LIBS)
AC_SUBST(EXTAUTH_SRC)
AC_SUBST(EXTAUTH_OBJS)
AC_SUBST(PACKAGE)
AC_SUBST(VERSION)
AC_CONFIG_HEADER(src/adns/config.h)
AC_CONFIG_HEADER(src/pcre/config.h)
AC_OUTPUT(src/Makefile.inc src/Makefile src/protocol/Makefile src/modules/Makefile.inc src/sqlsrv/Makefile src/tools/Makefile src/pcre/Makefile src/pcre.h:src/pcre/pcre.in)
NEO_SUBDIR_CONFIG(src/curl, [--disable-thread --disable-ipv6 --enable-nonblocking --without-ssl])
echo "(*----------------------------------------------------------*)"
echo "(| Important Instructions |)"
echo "(*----------------------------------------------------------*)"
echo "(| if you just typed ./configure and didnt read the README |)"
echo "(| NeoStats may not be configured correctly. |)"
echo "(| We suggest you at least type ./configure --help to see |)"
echo "(| available options and read the README file for further |)"
echo "(| information on that option. |)"
echo "(*----------------------------------------------------------*)"
echo "(| For Support please visit: |)"
echo "(| IRC: /server irc.irc-chat.net |)"
echo "(| #neostats channel |)"
echo "(| WWW: http://www.neostats.net/boards/ |)"
echo "(*----------------------------------------------------------*)"
echo "(| Now that configure is complete, type 'make' to compile |)"
echo "(| the program. When the compile has completed, type |)"
echo "(| 'make install' to install the program. |)"
echo "(| For BSD you might need to use 'gmake' and 'gmake install'|)"
echo "(*----------------------------------------------------------*)"
if test "$shush" != yes; then
read -p "Press Enter Key to Read the Release Notes"
clear
more ./RELNOTES
fi