1
dnl Process this file with autoconf to produce a configure script.
2
AC_INIT(pdnsbackend.cc)
3
AM_INIT_AUTOMAKE(ahudns-pdnsbackend, 2.0rc2)
5
AC_PREFIX_DEFAULT(/opt/pdns)
15
# Location of MySQL installation
18
[ --with-mysql=<path> root directory path of MySQL installation],
19
[MYSQL_lib_check="$withval/lib/mysql $with_mysql/lib"
20
MYSQL_inc_check="$withval/include/mysql"],
21
[MYSQL_lib_check="/usr/local/mysql/lib/mysql /usr/local/lib/mysql /opt/mysql/lib/mysql /usr/lib/mysql /usr/local/mysql/lib /usr/local/lib /opt/mysql/lib /usr/lib"
22
MYSQL_inc_check="/usr/local/mysql/include/mysql /usr/local/include/mysql /opt/mysql/include/mysql /opt/mysql/include /usr/include/mysql"])
24
AC_ARG_WITH(mysql-lib,
25
[ --with-mysql-lib=<path> directory path of MySQL library installation],
26
[MYSQL_lib_check="$withval/lib/mysql $withval/mysql $withval"])
28
AC_ARG_WITH(mysql-includes,
29
[ --with-mysql-includes=<path>
30
directory path of MySQL header installation],
31
[MYSQL_inc_check="$withval/include/mysql $withval/mysql $withval"])
33
AC_MSG_CHECKING([for MySQL library directory])
35
for m in $MYSQL_lib_check; do
37
(test -f "$m/libmysqlclient.so" || test -f "$m/libmysqlclient.a")
44
if test -z "$MYSQL_libdir"; then
45
AC_MSG_ERROR([Didn't find the mysql library dir in '$MYSQL_lib_check'])
48
case "$MYSQL_libdir" in
50
* ) AC_MSG_ERROR([The MySQL library directory ($MYSQL_libdir) must be an absolute path.]) ;;
53
AC_MSG_RESULT([$MYSQL_libdir])
55
case "$MYSQL_libdir" in
57
*) LDFLAGS="$LDFLAGS -L${MYSQL_libdir}" ;;
60
AC_MSG_CHECKING([for MySQL include directory])
62
for m in $MYSQL_inc_check; do
63
if test -d "$m" && test -f "$m/mysql.h"
70
if test -z "$MYSQL_incdir"; then
71
AC_MSG_ERROR([Didn't find the mysql include dir in '$MYSQL_inc_check'])
74
case "$MYSQL_incdir" in
76
* ) AC_MSG_ERROR([The MySQL include directory ($MYSQL_incdir) must be an absolute path.]) ;;
79
AC_MSG_RESULT([$MYSQL_incdir])
81
CPPFLAGS="$CPPFLAGS -I${MYSQL_incdir}"
83
dnl Checks for programs.
85
dnl Checks for libraries.
86
dnl Replace `main' with a function in -ldl:
87
AC_CHECK_LIB(dl, main)
89
AC_CHECK_LIB(mysqlclient, mysql_store_result)
90
dnl Replace `main' with a function in -lpthread:
91
AC_CHECK_LIB(pthread, main)
93
dnl Checks for header files.
95
AC_CHECK_HEADERS(unistd.h)
97
dnl Checks for typedefs, structures, and compiler characteristics.
99
dnl Checks for ahudns functions
104
AC_ARG_WITH(ahudns-includes, [ --with-ahudns-includes=PATH Specify location of ahudns headers],
105
[ if test x"$withval" = x"no"; then
108
#if test x"$withval" != x"yes"; then
109
if test -d "$withval"; then
110
AHUDNS_INCLUDES="-I$withval"
118
AC_DEFUN(AC_CHECK_AHUDNS,
119
[ if test x"$search_ahudns" != x"0"; then
120
if test -f "$1/$2"; then
130
AC_DEFUN(AC_SEARCH_AHUDNS,
131
[ AC_MSG_CHECKING("location of ahudns logger.hh include")
132
AC_CHECK_AHUDNS($HOME/programming/ahudns, logger.hh,,-I$HOME/programming/ahudns, "found in $HOME/programming/ahudns")
133
AC_CHECK_AHUDNS(../ahudns, logger.hh,,-I../ahudns, "found in ../ahudns")
134
AC_CHECK_AHUDNS(../ahudns-1.2, logger.hh,,-I../ahudns-1.2, "found in ../ahudns-1.2")
137
if test x"$search_ahudns" != x"0"; then
141
if test x"$has_ahudns" = x"1"; then
142
echo Found ahudns include file, assuming working and compliant ahudns
145
echo Did not find ahudns include file
150
CPPFLAGS="$CPPFLAGS $AHUDNS_INCLUDES"
153
dnl Checks for library functions.
156
AC_CHECK_HEADER(sstream,dontneedstl=1)
158
if test "$dontneedstl" != "1"
162
AC_ARG_WITH(stl-includes, [ --with-stl-includes=PATH Specify location of STL headers],
163
[ if test x"$withval" = x"no"; then
166
#if test x"$withval" != x"yes"; then
167
if test -d "$withval"; then
168
STL_INCLUDES="-I$withval"
177
AC_ARG_WITH(stl-libs, [ --with-stl-libs=PATH Specify location of STL libs],
178
[ if test x"$withval" = x"no"; then
181
#if test x"$withval" != x"yes"; then
182
if test -d "$withval"; then
183
STL_LIBS="$LIBS -L$withval -lstlport_gcc"
190
AC_DEFUN(AC_CHECK_STL,
191
[ if test x"$search_stl" != x"0"; then
192
if test -f "$1/$2"; then
202
AC_DEFUN(AC_SEARCH_STL,
203
[ AC_MSG_CHECKING("location of sstream")
204
AC_CHECK_STL(/usr/include, sstream, -lstlport_gcc,, "found in /usr/include")
205
AC_CHECK_STL(/usr/include/stlport, sstream, -lstlport_gcc, -I/usr/include/stlport, "found in /usr/include/stlport")
206
AC_CHECK_STL(/usr/include, sstream, -lstlport_gcc,, "found in /usr/include")
207
AC_CHECK_STL(/usr/local/include, sstream, -L/usr/local/lib -lstlport_gcc, -I/usr/local/include, "found in /usr/local")
208
AC_CHECK_STL(/usr/local/include/stl, sstream, -L/usr/local/lib -L/usr/local/lib/stl -lstlport_gcc, -I/usr/local/include/stl, "found in /usr/local/include/stl")
209
AC_CHECK_STL(/home/ahu/download/STLport-4.0/stlport, sstream,-L/home/ahu/download/STLport-4.0/lib/ -lstlport_gcc, -I/home/ahu/download/STLport-4.0/stlport/, "found in /home/ahu/download/STLport-4.0/stlport")
210
AC_CHECK_STL($HOME/STLport-4.0/stlport, sstream,-L$HOME/STLport-4.0/lib/ -lstlport_gcc, -I$HOME/STLport-4.0/stlport/, "found in $HOME/STLport-4.0/stlport")
213
if test x"$search_stl" != x"0"; then
217
if test x"$has_stl" = x"1"; then
218
echo Found sstream include file, assuming working and compliant STL
221
echo Did not find sstream include file, this probably means that your STL is not
222
echo compliant - the default gcc libstdc++ isn\'t. Download STLport-4.0 from
223
echo http://www.stlport.org, or use --with-stl-includes and --with-stl-libs
224
echo to specify the location of your STL.
229
CPPFLAGS="$CPPFLAGS $STL_INCLUDES $MYSQLPP_INCLUDES"
230
LIBS="$LIBS $STL_LIBS"
233
AM_CONFIG_HEADER(config.h)