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