1 # Process this file with autoconf to produce a configure script.
4 AC_INIT([NeonServ], [5.5], [bugs@pk910.de], [neonserv], [http://neonserv.krypton-bouncer.de])
5 AC_PREFIX_DEFAULT([~/neonserv])
7 AM_INIT_AUTOMAKE([foreign subdir-objects])
9 AC_CONFIG_HEADERS([config.h])
11 LT_INIT([disable-static])
13 # Checks for programs.
17 # Checks for libraries.
18 # Get MySQL library and include locations
20 [AS_HELP_STRING([--with-mysql=DIR],
21 [location of the MySQL headers, defaults to /usr/include/mysql])],
22 [MYSQL_CFLAGS="-I$withval"],
23 [MYSQL_CFLAGS='-I/usr/include/mysql'])
24 AC_SUBST([MYSQL_CFLAGS])
26 AC_ARG_WITH([mysql-lib],
27 [AS_HELP_STRING([--with-mysql-lib=DIR], [location of the MySQL libraries])],
28 [MYSQL_LIBS="-L$withval -lmysqlclient"],
29 [MYSQL_LIBS='-lmysqlclient'])
30 AC_SUBST([MYSQL_LIBS])
32 AC_ARG_WITH([winsock],
33 [AS_HELP_STRING([--with-winsock], [use winsock (WIN32 systems)])],
34 [SYSTEM_LIBS='-lws2_32'],
36 AC_SUBST([SYSTEM_LIBS])
39 AC_CHECK_LIB(ssl, SSL_read, [
40 AC_CHECK_LIB(crypto, X509_new, [
41 AC_CHECK_HEADERS(openssl/ssl.h openssl/err.h openssl/rand.h, [
47 if test x"$do_have_ssl" = xyes; then
48 LIBS="$LIBS -lssl -lcrypto"
49 AC_DEFINE([HAVE_SSL], 1, [Define if you are using SSL])
53 AC_CHECK_LIB(pthread, pthread_create, [
54 AC_CHECK_HEADERS(pthread.h, [
59 AC_ARG_ENABLE([threads],
60 [AS_HELP_STRING([--enable-threads], [use threads if possible])],
62 if test x"$do_have_threads" = xyes; then
63 LIBS="$LIBS -lpthread"
64 AC_DEFINE([HAVE_THREADS], 1, [Define if you have Threads])
69 AC_ARG_ENABLE([memory-debug],
70 [AS_HELP_STRING([--enable-memory-debug], [run memory debugger])],
72 AC_DEFINE([ENABLE_MEMORY_DEBUG], 1, [Define if you enable memoryDebug.c])
76 AC_ARG_ENABLE([debug],
77 [AS_HELP_STRING([--enable-debug], [debug mode (compile using -O0 -Wall -Wshadow -Werror)])],
78 [CFLAGS='-g -O0 -Wall -Wshadow -Werror'],
81 CFLAGS="$CFLAGS -D_GNU_SOURCE"
83 # Checks for header files.
84 AC_CHECK_HEADERS([arpa/inet.h netdb.h netinet/in.h stdlib.h string.h sys/socket.h unistd.h windows.h winsock2.h])
86 # Checks for typedefs, structures, and compiler characteristics.
88 # Checks for library functions.
90 AC_CHECK_FUNCS([gethostbyname memset select socket strchr strdup strstr])
92 AC_CONFIG_FILES(Makefile)