dnl Process this file with autoconf to produce a configure script. AC_INIT(src/main.c) AM_CONFIG_HEADER(src/config.h) AM_INIT_AUTOMAKE(thales, 0.9.5) AC_PREFIX_DEFAULT([\${HOME}/thales]) dnl Checks for programs. AC_PROG_AWK AC_PROG_CC AC_PROG_INSTALL AC_PROG_LN_S dnl Checks for libraries. AC_CHECK_LIB(socket, connect, gethostbyname) AC_CHECK_LIB(z, compress) AC_CHECK_LIB(m, floor) dnl Checks for header files. AC_HEADER_STDC AC_CHECK_HEADERS(limits.h sys/time.h unistd.h) dnl Checks for typedefs, structures, and compiler characteristics. AC_C_CONST AC_TYPE_SIZE_T AC_HEADER_TIME AC_STRUCT_TM dnl Checks for library functions. AC_FUNC_STRFTIME AC_FUNC_VPRINTF AC_CHECK_FUNCS(gettimeofday select socket strcspn strdup strerror strspn strtol) AC_ARG_WITH(ircd, [ --with-ircd=ircdtype type of the ircd used with thales (bahamut, hybrid, ircdru, unreal, ultimate28 or ultimate30)]) AC_ARG_WITH(tableprefix, [ --tableprefix=string prefix to add to all SQL tables names. database creation scripts need to be modified accordingly.)]) AC_ARG_WITH(hashlist, [ --with-hashlist=YES/NO Use an internal hashlist to store some data ? (that makes Thales run faster)]) AC_ARG_WITH(mysql, [ --with-mysql=PFX Prefix where MySQL is installed (usually /usr/local)]) AC_ARG_WITH(mysql-includes, [ --with-mysql-includes=PFX Prefix where MySQL includes are found (usually /usr/local/include/mysql)]) AC_ARG_WITH(mysql-libraries, [ --with-mysql-libraries=PFX Prefix where MySQL libraries are found (usually /usr/local/lib/mysql)]) AC_ARG_ENABLE(noreportusage, [ --enable-noreportusage Forget about the Usage Survey],[REPORT=0],[REPORT=1]) dnl Check usr/local first, in case sys admin has installed a later version dnl than was included with the OS (in which case the older will be in /usr) if test "x$with_mysql_includes" != "x"; then AC_CHECK_HEADER($with_mysql_includes/mysql.h, [CFLAGS="$CFLAGS -I$with_mysql_includes"], AC_MSG_ERROR(Need MySQL includes!)) fi if test "x$with_mysql_libraries" != "x"; then AC_CHECK_LIB_LOC($with_mysql_libraries,mysqlclient,mysql_real_connect,, AC_MSG_ERROR(Need MySQL client library!)) fi if test "x$with_mysql" != "x"; then if test "x$with_mysql_libraries" = "x"; then AC_CHECK_LIB_LOC($with_mysql/lib/mysql,mysqlclient,mysql_real_connect,, AC_MSG_ERROR(Need MySQL client library!)) fi if test "x$with_mysql_includes" = "x"; then AC_CHECK_HEADER($with_mysql/include/mysql/mysql.h, [CFLAGS="$CFLAGS -I$with_mysql/include/mysql"], AC_MSG_ERROR(Need MySQL includes!)) fi else if test "x$with_mysql_libraries" = "x"; then AC_CHECK_LIB_LOC(/opt/lib/mysql,mysqlclient,mysql_real_connect,, AC_CHECK_LIB_LOC(/usr/local/lib/mysql,mysqlclient,mysql_real_connect,, AC_CHECK_LIB_LOC(/usr/lib/mysql,mysqlclient,mysql_real_connect,, AC_CHECK_LIB_LOC(/usr/local/lib,mysqlclient,mysql_real_connect,, AC_CHECK_LIB_LOC(/opt/lib,mysqlclient,mysql_real_connect,, AC_CHECK_LIB_LOC(/usr/lib,mysqlclient,mysql_real_connect,, AC_MSG_ERROR(Need MySQL client library!))))))) fi if test "x$with_mysql_includes" = "x"; then AC_CHECK_HEADER(/opt/include/mysql/mysql.h, CFLAGS="$CFLAGS -I/opt/include/mysql", AC_CHECK_HEADER(/usr/local/include/mysql/mysql.h, CFLAGS="$CFLAGS -I/usr/local/include/mysql", AC_CHECK_HEADER(/usr/include/mysql/mysql.h, CFLAGS="$CFLAGS -I/usr/include/mysql", AC_MSG_ERROR(Need MySQL includes!)))) fi fi CFLAGS="$CFLAGS -Wall" AC_ARG_ENABLE(static, [ --enable-static links statically], [LDFLAGS="$LDFLAGS -static"]) dnl Table prefix ok=0 if test "x$with_tableprefix" != "x"; then AC_DEFINE_UNQUOTED(TBL_PREFIX, "$with_tableprefix", 'table prefix to use') fi dnl Hashlist ? ok=0 if test "x$with_hashlist" != "x"; then case $with_hashlist in [[Nn][Oo]]) echo "Hashlist support disabled : Thales will run slower." ok=1 ;; esac fi if test $ok -eq 0; then AC_DEFINE_UNQUOTED(HASHLISTSUPPORT, 1, 'use internal hashlist') fi dnl IRCD type ok=0 reportusage=1 if test "x$with_ircd" != "x"; then case $with_ircd in [[Bb][Aa][Hh][Aa][Mm][Uu][Tt]]) AC_DEFINE_UNQUOTED(IRCD_BAHAMUT, 1, 'ircd type') echo "Using Bahamut IRCD" ok=1 ;; [[Hh][Yy][Bb][Rr][Ii][Dd]]) AC_DEFINE_UNQUOTED(IRCD_HYBRID, 1, 'ircd type') echo "Using Hybrid IRCD" ok=1 ;; [[Ii][Rr][Cc][Dd][Rr][Uu]]) AC_DEFINE_UNQUOTED(IRCD_IRCDRU, 1, 'ircd type') echo "Using IRCD-RU IRCD" ok=1 ;; [[Uu][Nn][Rr][Ee][Aa][Ll]]) AC_DEFINE_UNQUOTED(IRCD_UNREAL, 1, 'ircd type') echo "Using Unreal IRCD" reportusage=0 ok=1 ;; [[Uu][Ll][Tt][Ii][Mm][Aa][Tt][Ee]28]) AC_DEFINE_UNQUOTED(IRCD_ULTI28, 1, 'ircd type') echo "Using Ultimate IRCD 2.8" ok=1 ;; [[Uu][Ll][Tt][Ii][Mm][Aa][Tt][Ee]30]) AC_DEFINE_UNQUOTED(IRCD_ULTIMATE, 1, 'ircd type') echo "Using Ultimate IRCD 3.0" ok=1 ;; *) echo "IRCD type unrecognized" ;; esac fi if test $ok -eq 0; then echo echo "---------------------------------------------------------------" echo echo "Which of the following is closest to the type of server used on" echo "your IRC network ?" echo " 1) UnrealIRCd 3.1.1 or later" echo "Support for these servers is still available but might not be" echo "complete. See the NeedMaintainers file for more info." echo " 2) Bahamut 1.4.27 or later" echo " 3) Hybrid 7 or later" echo " 4) ircd-RU! 1.4.0 or later" echo " 5) UltimateIRCD 2.8 or later (2.8 branch)" echo " 6) UltimateIRCD 3.0.0 or later" while `test $ok -eq 0` ; do echo -n '> ' read KBDINPUT case $KBDINPUT in 1) AC_DEFINE_UNQUOTED(IRCD_UNREAL, 1, 'ircd type') reportusage=0 ok=1 ;; 2) AC_DEFINE_UNQUOTED(IRCD_BAHAMUT, 1, 'ircd type') ok=1 ;; 3) AC_DEFINE_UNQUOTED(IRCD_HYBRID, 1, 'ircd type') ok=1 ;; 4) AC_DEFINE_UNQUOTED(IRCD_IRCDRU, 1, 'ircd type') ok=1 ;; 5) AC_DEFINE_UNQUOTED(IRCD_ULTI28, 1, 'ircd type') ok=1 ;; 6) AC_DEFINE_UNQUOTED(IRCD_ULTIMATE, 1, 'ircd type') ok=1 ;; *) echo "Please enter a valid option number." ;; esac done fi AC_ARG_ENABLE(no-modes, [ --enable-no-modes Disables modes in the database (modes are enabled by default)], [AC_DEFINE_UNQUOTED(NOMODES, 1, 'dont store modes in the database ?')]) AC_OUTPUT(src/Makefile data/Makefile Makefile) if test $REPORT -eq 1 -a $reportusage -eq 1; then ./ReportUsage.sh fi echo echo "Thales will be installed in ${prefix}. To change this, run :" echo " ./configure --prefix=DIRECTORY" echo "To compile Thales, run make (or gmake on non-GNU systems)" echo "To install Thales, run make install (or gmake install on non-GNU systems)" echo echo "Don't forget to read the README and INSTALL files for more detailed instructions" echo