dnl intro
AC_INIT(pdns/receiver.cc)
-AM_INIT_AUTOMAKE(pdns, 2.9.4)
+AM_INIT_AUTOMAKE(pdns, 2.9.22-snapshot)
AC_CANONICAL_HOST
AM_CONFIG_HEADER(config.h)
AC_C_BIGENDIAN
AM_PROG_LEX
AC_PROG_INSTALL
AC_PROG_MAKE_SET
-AM_PROG_LIBTOOL
+AC_PROG_LIBTOOL
AC_LANG_CPLUSPLUS
dnl Checks for header files.
AC_HEADER_STDC
-AC_CHECK_HEADERS(fcntl.h getopt.h limits.h strings.h sys/time.h syslog.h unistd.h)
+AC_CHECK_HEADERS(fcntl.h getopt.h limits.h strings.h sys/time.h syslog.h unistd.h)
+AC_CHECK_HEADERS(boost/shared_ptr.hpp, ,
+echo Missing boost - please install Boost packages or see http://doc.powerdns.com/compiling-powerdns.html; exit)
dnl Checks for typedefs, structures, and compiler characteristics.
AC_TYPE_SIZE_T
# Check for libdl
+LIBS="$LIBS -lz"
+
my_save_LIBS="$LIBS"
LIBS=""
AC_CHECK_LIB(dl,dlopen)
fi
LIBS=$ac_save_LIBS
-# pthread_create is in standard libraries (As in BSDI 3.0)
-AC_MSG_CHECKING([for pthread_create in -libc]);
-AC_TRY_LINK(
-[#include <pthread.h>],
-[ (void) pthread_create((pthread_t*) 0,(pthread_attr_t*) 0, 0, 0); ],
-with_posix_threads=yes, with_posix_threads=no)
-AC_MSG_RESULT("$with_posix_threads")
-if test "$with_posix_threads" = "no"
-then
- AC_MSG_CHECKING([for pthread_create in -lpthread]);
- ac_save_LIBS="$LIBS"
- LIBS="$LIBS -lpthread"
- AC_TRY_LINK(
- [#include <pthread.h>],
- [ (void) pthread_create((pthread_t*) 0,(pthread_attr_t*) 0, 0, 0); ],
- with_posix_threads=yes, with_posix_threads=no)
- AC_MSG_RESULT("$with_posix_threads")
- if test "$with_posix_threads" = "no"
- then
- LIBS=" $ac_save_LIBS -lpthreads"
- AC_MSG_CHECKING([for pthread_create in -lpthreads]);
- AC_TRY_LINK(
- [#include <pthread.h>],
- [ pthread_create((pthread_t*) 0,(pthread_attr_t*) 0, 0, 0); ],
- with_posix_threads=yes, with_posix_threads=no)
- AC_MSG_RESULT("$with_posix_threads")
- if test "$with_posix_threads" = "no"
- then
- # This is for FreeBSD
- LIBS="$ac_save_LIBS -pthread"
- AC_MSG_CHECKING([for pthread_create in -pthread]);
- AC_TRY_LINK(
- [#include <pthread.h>],
- [ pthread_create((pthread_t*) 0,(pthread_attr_t*) 0, 0, 0); ],
- with_posix_threads=yes, with_posix_threads=no)
- AC_MSG_RESULT("$with_posix_threads")
- if test "$with_posix_threads" = "no"
- then
- with_mit_threads="yes"
- LIBS="$ac_save_LIBS"
- fi
- fi
- fi
-fi
-
DYNLINKFLAGS=""
+THREADFLAGS=""
+
case "$host_os" in
+solaris2.10)
+ AC_DEFINE(HAVE_IPV6,1,[If the host operating system understands IPv6])
+ LIBS="-lposix4 -lresolv -lnsl -lsocket -lpthread -lrt $LIBS"
+ CXXFLAGS="-D_REENTRANT $CXXFLAGS"
+ ;;
+
solaris2.8 | solaris2.9 )
AC_DEFINE(NEED_POSIX_TYPEDEF,,[If POSIX typedefs need to be defined])
AC_DEFINE(NEED_INET_NTOP_PROTO,,[If your OS is so broken that it needs an additional prototype])
linux*)
AC_DEFINE(HAVE_IPV6,1,[If the host operating system understands IPv6])
DYNLINKFLAGS="-rdynamic"
- LDFLAGS="-pthread $LDFLAGS"
- CXXFLAGS="-pthread -D_GNU_SOURCE $CXXFLAGS"
+ LDFLAGS="$LDFLAGS"
+ THREADFLAGS="-pthread"
+ CXXFLAGS="-D_GNU_SOURCE $CXXFLAGS"
;;
openbsd*)
AC_DEFINE(HAVE_IPV6,1,[If the host operating system understands IPv6])
;;
esac
+AC_SUBST(THREADFLAGS)
+
AC_SUBST(DYNLINKFLAGS)
AC_MSG_CHECKING(whether we will be doing verbose logging)
-modules="gmysql"
-AC_ARG_WITH(modules, [ --with-modules Which userbases to compile with ],
+modules="gmysql geo"
+AC_ARG_WITH(modules, [ --with-modules Which backends to compile with ],
[
modules="$withval"
])
dynmodules="pipe"
-AC_ARG_WITH(dynmodules, [ --with-dynmodules Which userbases to build for dynamic loading ],
+AC_ARG_WITH(dynmodules, [ --with-dynmodules Which backends to build for dynamic loading ],
[
dynmodules="$withval"
])
AC_SUBST(programdescend)
+AC_ARG_ENABLE(gcc-skip-locking,
+ [ --enable-gcc-skip-locking If we should forcefully skip gcc locking],
+ AC_DEFINE(GCC_SKIP_LOCKING,,[Skip gcc locking]),
+ )
+
+AC_MSG_CHECKING(whether we will be building the recursor)
+AC_ARG_ENABLE(recursor,
+ [ --enable-recursor If we should build the recursor],
+ enable_recursor=$enableval,
+ enable_recursor=no )
+
+AC_MSG_RESULT($enable_recursor)
+
+AM_CONDITIONAL(RECURSOR,test x"$enable_recursor" = "xyes")
+
+
+AC_MSG_CHECKING(whether we should use nedmalloc allocator)
+AC_ARG_ENABLE(nedmalloc,
+ [ --enable-nedmalloc If we should use nedmalloc],
+ enable_nedmalloc=$enableval,
+ if echo $host_os | grep -i freebsd > /dev/null
+ then
+ enable_nedmalloc=yes
+ else
+ enable_nedmalloc=no
+ fi
+ )
+AC_MSG_RESULT($enable_nedmalloc)
+
+AM_CONDITIONAL(NEDMALLOC,test x"$enable_nedmalloc" = "xyes")
+
+
for a in $modules $dynmodules
do
case "$a" in
gpgsql )
needpgsql=yes
;;
+ gsqlite )
+ needsqlite=yes
+ ;;
+ gsqlite3 )
+ needsqlite3=yes
+ ;;
pdns )
needmysql=yes
;;
+ ldap)
+ AC_CHECK_HEADERS([ldap.h], , [AC_MSG_ERROR([ldap header (ldap.h) not found])])
+ AC_CHECK_HEADERS([lber.h], , [AC_MSG_ERROR([ldap header (lber.h) not found])])
+ AC_SUBST([LIBLDAP])
+ AC_CHECK_LIB(
+ [ldap_r], [ldap_set_option],
+ [AC_DEFINE([HAVE_LIBLDAP_R], 1, [Have -lldap_r]) LIBLDAP="ldap_r"],
+ [AC_CHECK_LIB(
+ [ldap], [ldap_set_option],
+ [AC_DEFINE([HAVE_LIBLDAP], 1, [Have -lldap]) LIBLDAP="ldap"],
+ [AC_MSG_ERROR([ldap library (libldap) not found])]
+ )]
+ )
+ AC_CHECK_LIB(
+ [$LIBLDAP], [ldap_initialize],
+ [AC_DEFINE([HAVE_LDAP_INITIALIZE], 1, [Define to 1 if you have ldap_initialize])]
+ )
+ AC_CHECK_LIB(
+ [$LIBLDAP], [ldap_sasl_bind],
+ [AC_DEFINE([HAVE_LDAP_SASL_BIND], 1, [Define to 1 if you have ldap_sasl_bind])]
+ )
+ ;;
+ opendbx)
+ AC_CHECK_HEADERS([odbx.h], , [AC_MSG_ERROR([opendbx header (odbx.h) not found])])
+ AC_SUBST([LIBOPENDBX])
+ AC_CHECK_LIB(
+ [opendbx], [odbx_init],
+ [AC_DEFINE([HAVE_LIBOPENDBX], 1, [Have -lopendbx]) LIBOPENDBX="opendbx"]
+ )
+ ;;
esac
done
[ --with-mysql=<path> root directory path of MySQL installation],
[MYSQL_lib_check="$withval/lib/mysql $with_mysql/lib"
MYSQL_inc_check="$withval/include/mysql"],
- [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"
- MYSQL_inc_check="/usr/local/mysql/include/mysql /usr/local/include/mysql /opt/mysql/include/mysql /opt/mysql/include /usr/include/mysql"])
+ [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 \
+ /usr/sfw/lib/"
+ MYSQL_inc_check="/usr/local/mysql/include/mysql /usr/local/include/mysql \
+ /opt/mysql/include/mysql /opt/mysql/include /usr/include/mysql /usr/sfw/include/mysql"])
AC_ARG_WITH(mysql-lib,
[ --with-mysql-lib=<path> directory path of MySQL library installation],
[MYSQL_lib_check="$withval/lib/mysql $withval/mysql $withval"])
[PGSQL_lib_check="$withval/lib/pgsql $with_pgsql/lib"
PGSQL_inc_check="$withval/include/pgsql"],
[PGSQL_lib_check="/usr/local/pgsql/lib/pgsql /usr/local/lib/pgsql /opt/pgsql/lib/pgsql /usr/lib/pgsql /usr/local/pgsql/lib /usr/local/lib /opt/pgsql/lib /usr/lib"
- PGSQL_inc_check="/usr/local/pgsql/include/pgsql /usr/local/include/postgresql/ /usr/local/include /opt/pgsql/include/pgsql /opt/pgsql/include /usr/include/pgsql/ /usr/include/postgresql"])
+ PGSQL_inc_check="/usr/local/pgsql/include/pgsql /usr/include /usr/local/include/postgresql/ /usr/local/include /opt/pgsql/include/pgsql /opt/pgsql/include /usr/include/pgsql/ /usr/include/postgresql"])
AC_ARG_WITH(pgsql-lib,
[ --with-pgsql-lib=<path> directory path of PgSQL library installation],
[PGSQL_lib_check="$withval/lib/pgsql $withval/pgsql $withval"])
PGSQL_libdir=
for m in $PGSQL_lib_check; do
if test -d "$m" && \
- (test -f "$m/libpq++.so" || test -f "$m/libpq++.a")
+ (test -f "$m/libpq.a" || test -f "$m/libpq++.a")
then
PGSQL_libdir=$m
break
AC_MSG_CHECKING([for PgSQL include directory])
PGSQL_incdir=
for m in $PGSQL_inc_check; do
- if test -d "$m" && test -f "$m/libpq++.h"
+ if test -d "$m" && test -f "$m/libpq-fe.h"
then
PGSQL_incdir=$m
break
fi
+if test "$needsqlite"
+then
+ AC_ARG_WITH(sqlite,
+ [ --with-sqlite=<path> root directory path of SQLite installation],
+ [SQLITE_lib_check="$withval/lib/sqlite $with_sqlite/lib"
+ SQLITE_inc_check="$withval/include/sqlite"],
+ [SQLITE_lib_check="/usr/local/sqlite/lib/sqlite /usr/local/lib/sqlite /opt/pgsql/lib/sqlite /usr/lib/sqlite /usr/local/sqlite/lib /usr/local/lib /opt/sqlite/lib /usr/lib"
+ SQLITE_inc_check="/usr/local/sqlite/include/sqlite /usr/local/include/sqlite/ /usr/local/include /opt/sqlite/include/sqlite /opt/sqlite/include /usr/include/ /usr/include/sqlite"])
+ AC_ARG_WITH(sqlite-lib,
+ [ --with-sqlite-lib=<path> directory path of SQLite library installation],
+ [SQLITE_lib_check="$withval/lib/sqlite $withval/sqlite $withval"])
+ AC_ARG_WITH(sqlite-includes,
+ [ --with-sqlite-includes=<path>
+ directory path of SQLite header installation],
+ [SQLITE_inc_check="$withval/include/sqlite $withval/sqlite $withval"])
+ AC_MSG_CHECKING([for SQLite library directory])
+ SQLITE_libdir=
+ for m in $SQLITE_lib_check; do
+ if test -d "$m" && \
+ (test -f "$m/libsqlite.so" || test -f "$m/libsqlite.a")
+ then
+ SQLITE_libdir=$m
+ break
+ fi
+ done
+ if test -z "$SQLITE_libdir"; then
+ AC_MSG_ERROR([Didn't find the sqlite library dir in '$SQLITE_lib_check'])
+ fi
+ case "$SQLITE_libdir" in
+ /usr/lib ) SQLITE_lib="" ;;
+ /* ) SQLITE_lib="-L$SQLITE_libdir -Wl,-rpath,$SQLITE_libdir"
+ LDFLAGS="$SQLITE_lib $LDFLAGS"
+ ;;
+ * ) AC_MSG_ERROR([The SQLite library directory ($SQLITE_libdir) must be an absolute path.]) ;;
+ esac
+
+ AC_SUBST(SQLITE_lib)
+ AC_MSG_RESULT([$SQLITE_libdir])
+ AC_MSG_CHECKING([for SQLite include directory])
+ SQLITE_incdir=
+ for m in $SQLITE_inc_check; do
+ if test -d "$m" && test -f "$m/sqlite.h"
+ then
+ SQLITE_incdir=$m
+ break
+ fi
+ done
+ if test -z "$SQLITE_incdir"; then
+ AC_MSG_ERROR([Didn't find the SQLite include dir in '$SQLITE_inc_check'])
+ fi
+ case "$SQLITE_incdir" in
+ /* ) ;;
+ * ) AC_MSG_ERROR([The SQLite include directory ($SQLITE_incdir) must be an absolute path.]) ;;
+ esac
+ AC_SUBST(SQLITE_incdir)
+ AC_MSG_RESULT([$SQLITE_incdir])
+
+# LIBS="$LIBS -lsqlite"
+fi
+
+if test "$needsqlite3"
+then
+ AC_ARG_WITH(sqlite3,
+ [ --with-sqlite3=<path> root directory path of SQLite3 installation],
+ [SQLITE3_lib_check="$withval/lib/sqlite3 $with_sqlite3/lib"
+ SQLITE3_inc_check="$withval/include/sqlite3"],
+ [SQLITE3_lib_check="/usr/local/sqlite3/lib/sqlite3 /usr/local/lib/sqlite3 /usr/lib/sqlite3 /usr/local/sqlite3/lib /usr/local/lib /opt/sqlite3/lib /usr/lib"
+ SQLITE3_inc_check="/usr/local/sqlite3/include/sqlite3 /usr/local/include/sqlite3/ /usr/local/include /opt/sqlite3/include/sqlite3 /opt/sqlite3/include /usr/include/ /usr/include/sqlite3"])
+ AC_ARG_WITH(sqlite3-lib,
+ [ --with-sqlite3-lib=<path> directory path of SQLite3 library installation],
+ [SQLITE3_lib_check="$withval/lib/sqlite3 $withval/sqlite3 $withval"])
+ AC_ARG_WITH(sqlite3-includes,
+ [ --with-sqlite3-includes=<path> directory path of SQLite3 header installation],
+ [SQLITE3_inc_check="$withval/include/sqlite3 $withval/sqlite3 $withval"])
+ AC_MSG_CHECKING([for SQLite3 library directory])
+ SQLITE3_libdir=
+ for m in $SQLITE3_lib_check; do
+ if test -d "$m" && \
+ (test -f "$m/libsqlite3.so" || test -f "$m/libsqlite3.a")
+ then
+ SQLITE3_libdir=$m
+ break
+ fi
+ done
+ if test -z "$SQLITE3_libdir"; then
+ AC_MSG_ERROR([Didn't find the sqlite3 library dir in '$SQLITE3_lib_check'])
+ fi
+ case "$SQLITE3_libdir" in
+ /usr/lib ) SQLITE3_lib="" ;;
+ /* ) SQLITE3_lib="-L$SQLITE3_libdir -Wl,-rpath,$SQLITE3_libdir"
+ LDFLAGS="$SQLITE3_lib $LDFLAGS"
+ ;;
+ * ) AC_MSG_ERROR([The SQLite3 library directory ($SQLITE3_libdir) must be an absolute path.]) ;;
+ esac
+
+ AC_SUBST(SQLITE3_lib)
+ AC_MSG_RESULT([$SQLITE3_libdir])
+ AC_MSG_CHECKING([for SQLite3 include directory])
+ SQLITE3_incdir=
+ for m in $SQLITE3_inc_check; do
+ if test -d "$m" && test -f "$m/sqlite3.h"
+ then
+ SQLITE3_incdir=$m
+ break
+ fi
+ done
+ if test -z "$SQLITE3_incdir"; then
+ AC_MSG_ERROR([Didn't find the SQLite3 include dir in '$SQLITE3_inc_check'])
+ fi
+ case "$SQLITE3_incdir" in
+ /* ) ;;
+ * ) AC_MSG_ERROR([The SQLite3 include directory ($SQLITE3_incdir) must be an absolute path.]) ;;
+ esac
+ AC_SUBST(SQLITE3_incdir)
+ AC_MSG_RESULT([$SQLITE3_incdir])
+
+# LIBS="$LIBS -lsqlite3"
+fi
+
+
for a in $modules
do
moduledirs="$moduledirs ${a}backend"
moduledirs="$moduledirs ${a}backend"
done
+AC_SUBST(LIBS)
+
export moduledirs moduleobjects modulelibs
-AC_OUTPUT(Makefile modules/Makefile pdns/Makefile pdns/codedocs/Makefile \
-pdns/backends/Makefile pdns/backends/bind/Makefile pdns/pdns \
+AC_OUTPUT(Makefile modules/Makefile pdns/Makefile codedocs/Makefile \
+pdns/backends/Makefile pdns/backends/bind/Makefile pdns/pdns pdns/precursor \
modules/mysqlbackend/Makefile modules/pdnsbackend/Makefile \
modules/gmysqlbackend/Makefile modules/db2backend/Makefile \
+modules/geobackend/Makefile modules/opendbxbackend/Makefile \
modules/pipebackend/Makefile modules/oraclebackend/Makefile \
modules/xdbbackend/Makefile modules/odbcbackend/Makefile \
-modules/gpgsqlbackend/Makefile )
+modules/gpgsqlbackend/Makefile modules/ldapbackend/Makefile
+modules/gsqlitebackend/Makefile modules/gsqlite3backend/Makefile
+modules/goraclebackend/Makefile )