Merge branch 'master' of git://mikachu.ath.cx/vhostgen
[vhostgen.git] / configure.in
blob88ecc97c1cd473ee9a1e206a6296e6a89da6961f
1 #                                               -*- Autoconf -*-
2 # Process this file with autoconf to produce a configure script.
4 AC_PREREQ(2.59)
5 AC_INIT(vhostgen, 1.0, sjk@ankeborg.nu)
6 AC_CONFIG_SRCDIR([vhostgen.c])
7 AC_CONFIG_HEADER([config.h])
9 # Checks for programs.
10 AC_PROG_CC
12 # We use the following function to check for mysql libs
13 # I believe this function was written by Michiel van Baak.
14 AC_DEFUN([AC_CHECK_MYSQLR],[
15     AC_SUBST(MYSQL_CFLAGS)
16     AC_SUBST(MYSQL_LIBS)
17     AC_PATH_PROG(mysqlconfig,mysql_config)
18     if test [ -z "$mysqlconfig" ]
19     then
20         AC_MSG_ERROR([mysql_config executable not found])
21     else
22         AC_MSG_CHECKING(mysql libraries)
23         MYSQL_LIBS=`${mysqlconfig} --libs`
24         AC_MSG_RESULT($MYSQL_LIBS)
25         AC_MSG_CHECKING(mysql includes)
26         MYSQL_CFLAGS=`${mysqlconfig} --cflags`
27         AC_MSG_RESULT($MYSQL_CFLAGS)
28     fi
31 # Checks for libraries.
32 AC_CHECK_MYSQLR
33 # FIXME: Replace `main' with a function in `-lcrypto':
34 AC_CHECK_LIB([crypto], [main])
35 # FIXME: Replace `main' with a function in `-lm':
36 AC_CHECK_LIB([m], [main])
37 # FIXME: Replace `main' with a function in `-lmysqlclient':
38 AC_CHECK_LIB([mysqlclient], [main])
39 # FIXME: Replace `main' with a function in `-lssl':
40 AC_CHECK_LIB([ssl], [main])
41 # FIXME: Replace `main' with a function in `-lz':
42 AC_CHECK_LIB([z], [main])
44 # Checks for header files.
45 AC_HEADER_STDC
46 AC_CHECK_HEADERS([stdlib.h])
48 # Checks for typedefs, structures, and compiler characteristics.
49 AC_C_CONST
50 AC_STRUCT_TM
52 # Checks for library functions.
53 AC_FUNC_MALLOC
54 AC_FUNC_STRFTIME
55 AC_CHECK_FUNCS([strchr])
57 AC_CONFIG_FILES([Makefile])
58 AC_OUTPUT