1 # Process this file with autoconf to produce a configure script.
4 AC_INIT([NeonServ], [5.6], [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_CHECK_LIB([ws2_32], [_head_libws2_32_a], [LIBS="$LIBS -lws2_32"])
33 AC_CHECK_LIB([dl], [dlopen], [LIBS="$LIBS -ldl"])
34 AC_CHECK_LIB([pthread], [pthread_create], [LIBS="$LIBS -lpthread"])
35 AC_CHECK_LIB([ssl], [SSL_read], [LIBS="$LIBS -lssl"])
36 AC_CHECK_LIB([crypto], [X509_new], [LIBS="$LIBS -lcrypto"])
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, [
42 AC_DEFINE([HAVE_SSL], 1, [Define if you are using SSL])
48 AC_CHECK_LIB(pthread, pthread_create, [
49 AC_CHECK_HEADERS(pthread.h, [
54 AC_ARG_ENABLE([threads],
55 [AS_HELP_STRING([--enable-threads], [use threads if possible])],
57 if test x"$do_have_threads" = xyes; then
58 LIBS="$LIBS -lpthread"
59 AC_DEFINE([HAVE_THREADS], 1, [Define if you have Threads])
64 AC_ARG_ENABLE([memory-debug],
65 [AS_HELP_STRING([--enable-memory-debug], [run memory debugger])],
67 AC_DEFINE([ENABLE_MEMORY_DEBUG], 1, [Define if you enable memoryDebug.c])
71 AC_ARG_ENABLE([mutex-debug],
72 [AS_HELP_STRING([--enable-mutex-debug], [run mutex debugger])],
74 AC_DEFINE([ENABLE_MUTEX_DEBUG], 1, [Define if you enable mutexDebug.c])
78 AC_ARG_ENABLE([debug],
79 [AS_HELP_STRING([--enable-debug], [debug mode (compile using -O0 -Wall -Wshadow -Werror)])],
80 [CFLAGS='-g -O0 -Wall -Wshadow -Werror'],
83 CFLAGS="$CFLAGS -D_GNU_SOURCE"
85 # Checks for header files.
86 AC_CHECK_HEADERS([stdio.h stdlib.h string.h ctype.h windows.h winsock2.h malloc.h features.h sys/types.h sys/socket.h netinet/in.h netinet/tcp.h arpa/inet.h netdb.h sys/wait.h errno.h unistd.h getopt.h stdarg.h sys/time.h time.h signal.h sys/epoll.h sys/event.h ws2tcpip.h mysql.h mysql/errmsg.h errmsg.h])
88 # Checks for typedefs, structures, and compiler characteristics.
90 # Checks for library functions.
92 AC_CHECK_FUNCS([gethostbyname memset select socket strchr strdup strstr])
94 AC_CONFIG_FILES(Makefile)