dnl Process this file with autoconf to produce a configure script. AC_INIT([GNU Thales], [1.1], [klaus.weiss@nanet.at]) AC_CONFIG_HEADERS(src/config.h) AM_INIT_AUTOMAKE() 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 netdb.h netinet/in.h sys/socket.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 gethostbyname memmove memset strcasecmp strchr strpbrk strtoul) AC_FUNC_ERROR_AT_LINE AC_FUNC_FORK AC_FUNC_MALLOC AC_FUNC_REALLOC AC_FUNC_SELECT_ARGTYPES 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)]) 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) mysqlhead=0 mysqllib=0 AC_CHECK_LIB(mysqlclient,mysql_real_connect, [LIBS="-lmysqlclient $LIBS"; mysqllib=1]) if test "x$with_mysql_includes" != "x"; then AC_CHECK_HEADER($with_mysql_includes/mysql.h, [CFLAGS="$CFLAGS -I$with_mysql_includes" ; mysqlinc=1]) fi if test "x$with_mysql_libraries" != "x"; then if test $mysqllib -eq 0; then AC_CHECK_LIB_LOC($with_mysql_libraries,mysqlclient,mysql_real_connect, [LIBS="-L$with_mysql_libraries -lmysqlclient $LIBS"; mysqllib=1]) fi fi if test "x$with_mysql" != "x"; then if test "x$with_mysql_libraries" = "x"; then if test $mysqllib -eq 0; then AC_CHECK_LIB_LOC($with_mysql/lib/mysql,mysqlclient,mysql_real_connect, [LIBS="-L$with_mysql_libraries -lmysqlclient $LIBS"; mysqllib=1]) fi 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" ; mysqlhead=1]) fi else if test "x$with_mysql_libraries" = "x"; then if test $mysqllib -eq 0; then AC_CHECK_LIB_LOC(/opt/lib/mysql,mysqlclient,mysql_real_connect,[LIBS="-L/opt/lib/mysql -lmysqlclient $LIBS"; mysqllib=1]) fi if test $mysqllib -eq 0; then AC_CHECK_LIB_LOC(/usr/local/lib/mysql,mysqlclient,mysql_real_connect,[LIBS="-L/usr/local/lib/mysql -lmysqlclient $LIBS"; mysqllib=1]) fi if test $mysqllib -eq 0; then AC_CHECK_LIB_LOC(/usr/lib/mysql,mysqlclient,mysql_real_connect,[LIBS="-L/usr/lib/mysql -lmysqlclient $LIBS"; mysqllib=1]) fi if test $mysqllib -eq 0; then AC_CHECK_LIB_LOC(/usr/local/lib,mysqlclient,mysql_real_connect,[LIBS="-L/usr/local/lib -lmysqlclient $LIBS"; mysqllib=1]) fi if test $mysqllib -eq 0; then AC_CHECK_LIB_LOC(/opt/lib,mysqlclient,mysql_real_connect,[LIBS="-L/opt/lib -lmysqlclient $LIBS"; mysqllib=1]) fi if test $mysqllib -eq 0; then AC_CHECK_LIB_LOC(/usr/lib,mysqlclient,mysql_real_connect,[LIBS="-L/usr/lib -lmysqlclient $LIBS"; mysqllib=1]) fi fi if test "x$with_mysql_includes" = "x"; then AC_CHECK_HEADER(/opt/include/mysql/mysql.h, [CFLAGS="$CFLAGS -I/opt/include/mysql" ; mysqlhead=1]) AC_CHECK_HEADER(/usr/local/include/mysql/mysql.h, [CFLAGS="$CFLAGS -I/usr/local/include/mysql" ; mysqlhead=1]) AC_CHECK_HEADER(/usr/include/mysql/mysql.h, [CFLAGS="$CFLAGS -I/usr/include/mysql"; mysqlhead=1]) fi fi if test $mysqlhead -eq 0; then AC_MSG_ERROR(Need MySQL includes! You have to install the libmysqlclient-dev package.) fi if test $mysqllib -eq 0; then AC_MSG_ERROR(Need MySQL library! You have to install the libmysqlclient package.) 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 if test "x$with_ircd" == "x"; then with_ircd=bahamut fi case $with_ircd in [[Bb][Aa][Hh][Aa][Mm][Uu][Tt]]) AC_DEFINE_UNQUOTED(IRCD_BAHAMUT, 1, 'ircd type') echo "Using Bahamut IRCD" ;; [[Hh][Yy][Bb][Rr][Ii][Dd]]) AC_DEFINE_UNQUOTED(IRCD_HYBRID, 1, 'ircd type') echo "Using Hybrid IRCD" ;; [[Ii][Rr][Cc][Dd][Rr][Uu]]) AC_DEFINE_UNQUOTED(IRCD_IRCDRU, 1, 'ircd type') echo "Using IRCD-RU IRCD" ;; [[Uu][Nn][Rr][Ee][Aa][Ll]]) AC_DEFINE_UNQUOTED(IRCD_UNREAL, 1, 'ircd type') echo "Using Unreal IRCD" ;; [[Uu][Ll][Tt][Ii][Mm][Aa][Tt][Ee]28]) AC_DEFINE_UNQUOTED(IRCD_ULTI28, 1, 'ircd type') echo "Using Ultimate IRCD 2.8" ;; [[Uu][Ll][Tt][Ii][Mm][Aa][Tt][Ee]30]) AC_DEFINE_UNQUOTED(IRCD_ULTIMATE, 1, 'ircd type') echo "Using Ultimate IRCD 3.0" ;; *) AC_MSG_ERROR([IRCD type unrecognized]) esac 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) 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