X-Git-Url: http://git.pk910.de/?p=TransparentIRC.git;a=blobdiff_plain;f=configure.ac;fp=configure.ac;h=61224dea9996dca6b602aa3c2e00f9fc4b50c8eb;hp=0000000000000000000000000000000000000000;hb=1f2baa2e7b90ea83c5a0c93598e22e5063fc6d95;hpb=0e2ac9360b71a7d054d7e945be575c0d21fa880c diff --git a/configure.ac b/configure.ac new file mode 100644 index 0000000..61224de --- /dev/null +++ b/configure.ac @@ -0,0 +1,69 @@ +# Process this file with autoconf to produce a configure script. + +AC_PREREQ([2.67]) +AC_INIT([TransparentIRC], [0.1], [bugs@pk910.de], [transirc], [http://no.url]) +AC_PREFIX_DEFAULT([~/transirc]) +AC_CANONICAL_TARGET +AM_INIT_AUTOMAKE([foreign subdir-objects]) +AM_SILENT_RULES([yes]) +AC_CONFIG_HEADERS([config.h]) + +LT_INIT([disable-static]) + +# Checks for programs. +AC_PROG_CC +AC_PROG_AWK + +# Checks for libraries. +# Get MySQL library and include locations +AC_ARG_WITH([mysql], + [AS_HELP_STRING([--with-mysql=DIR], + [location of the MySQL headers, defaults to /usr/include/mysql])], + [MYSQL_CFLAGS="-I$withval"], + [MYSQL_CFLAGS='-I/usr/include/mysql']) +AC_SUBST([MYSQL_CFLAGS]) + +AC_ARG_WITH([mysql-lib], + [AS_HELP_STRING([--with-mysql-lib=DIR], [location of the MySQL libraries])], + [MYSQL_LIBS="-L$withval -lmysqlclient"], + [MYSQL_LIBS='-lmysqlclient']) +AC_SUBST([MYSQL_LIBS]) + +AC_ARG_WITH([winsock], + [AS_HELP_STRING([--with-winsock], [use winsock (WIN32 systems)])], + [SYSTEM_LIBS='-lws2_32'], + [SYSTEM_LIBS='-ldl']) +AC_SUBST([SYSTEM_LIBS]) + +do_have_ssl="no"; +AC_CHECK_LIB(ssl, SSL_read, [ + AC_CHECK_LIB(crypto, X509_new, [ + AC_CHECK_HEADERS(openssl/ssl.h openssl/err.h openssl/rand.h, [ + do_have_ssl="yes"; + ]) + ]) +]) + +if test x"$do_have_ssl" = xyes; then + LIBS="$LIBS -lssl -lcrypto" + AC_DEFINE([HAVE_SSL], 1, [Define if you are using SSL]) +fi + +AC_ARG_ENABLE([debug], + [AS_HELP_STRING([--enable-debug], [debug mode (compile using -O0 -Wall -Wshadow -Werror)])], + [CFLAGS='-g -O0 -Wall -Wshadow -Werror'], + [CFLAGS='-g -O2']) + +CFLAGS="$CFLAGS -D_GNU_SOURCE" + +# Checks for header files. +AC_CHECK_HEADERS([arpa/inet.h netdb.h netinet/in.h stdlib.h string.h sys/socket.h unistd.h windows.h winsock2.h]) + +# Checks for typedefs, structures, and compiler characteristics. + +# Checks for library functions. +AC_FUNC_MALLOC +AC_CHECK_FUNCS([gethostbyname memset select socket strchr strdup strstr]) + +AC_CONFIG_FILES(Makefile) +AC_OUTPUT \ No newline at end of file