2 AC_INIT(pdns/receiver.cc)
3 AM_INIT_AUTOMAKE(pdns, 2.9.21-svn)
5 AM_CONFIG_HEADER(config.h)
8 CXXFLAGS="$CXXFLAGS -Wall -O2"
10 AC_PREFIX_DEFAULT(/usr/local)
20 dnl Checks for header files.
22 AC_CHECK_HEADERS(fcntl.h getopt.h limits.h strings.h sys/time.h syslog.h unistd.h)
23 AC_CHECK_HEADERS(boost/shared_ptr.hpp, ,
24 echo Missing boost - please install Boost packages or see http://doc.powerdns.com/compiling-powerdns.html; exit)
26 dnl Checks for typedefs, structures, and compiler characteristics.
31 dnl Checks for library functions.
33 AC_CHECK_FUNCS(gethostname gettimeofday mkdir mktime select socket strerror)
41 AC_CHECK_LIB(dl,dlopen)
46 AC_MSG_CHECKING([for RTLD_NOW]);
51 [ (void) dlopen("",RTLD_NOW); ],
52 has_RTLD_NOW=yes, has_RTLD_NOW=no)
53 AC_MSG_RESULT([$has_RTLD_NOW])
54 if test "$has_RTLD_NOW" = "no"
56 AC_DEFINE(NEED_RTLD_NOW,,[If host OS misses RTLD_NOW])
65 solaris2.8 | solaris2.9 )
66 AC_DEFINE(NEED_POSIX_TYPEDEF,,[If POSIX typedefs need to be defined])
67 AC_DEFINE(NEED_INET_NTOP_PROTO,,[If your OS is so broken that it needs an additional prototype])
68 AC_DEFINE(HAVE_IPV6,1,[If the host operating system understands IPv6])
69 LIBS="-lposix4 -lresolv -lnsl -lsocket -lpthread $LIBS"
70 CXXFLAGS="-D_REENTRANT $CXXFLAGS"
72 solaris2.6 | solaris2.7)
73 AC_DEFINE(NEED_POSIX_TYPEDEF,,[If POSIX typedefs need to be defined])
74 AC_DEFINE(NEED_INET_NTOP_PROTO,,[If your OS is so broken that it needs an additional prototype])
75 LIBS="-lposix4 -lresolv -lnsl -lsocket -lpthread $LIBS"
76 CXXFLAGS="-D_REENTRANT $CXXFLAGS"
79 AC_DEFINE(HAVE_IPV6,1,[If the host operating system understands IPv6])
80 DYNLINKFLAGS="-rdynamic"
82 THREADFLAGS="-pthread"
83 CXXFLAGS="-D_GNU_SOURCE $CXXFLAGS"
86 AC_DEFINE(HAVE_IPV6,1,[If the host operating system understands IPv6])
87 DYNLINKFLAGS="-rdynamic"
88 LDFLAGS="-lc_r $LDFLAGS"
89 CXXFLAGS="-pthread $CXXFLAGS"
92 AM_CONDITIONAL(NEDMALLOC, true)
93 enable_nedmalloc="yes"
96 AC_DEFINE(HAVE_IPV6,1,[If the host operating system understands IPv6])
97 DYNLINKFLAGS="-rdynamic"
98 LDFLAGS="-pthread $LDFLAGS"
99 CXXFLAGS="-pthread $CXXFLAGS"
103 AC_SUBST(THREADFLAGS)
105 AC_SUBST(DYNLINKFLAGS)
107 AC_MSG_CHECKING(whether we will be doing verbose logging)
108 AC_ARG_ENABLE(verbose-logging,
109 [ --enable-verbose-logging Do verbose logging],enable_verbose_logging=yes ,enable_verbose_logging=no)
111 if test $enable_verbose_logging = yes; then AC_DEFINE(VERBOSELOG, 1, [If verbose logging should be enabled])
113 AC_MSG_RESULT($enable_verbose_logging)
115 AC_MSG_CHECKING(whether we should build static binaries)
117 AC_ARG_ENABLE(static-binaries,
118 [ --enable-static-binaries Build static binaries],
119 [case "${enableval}" in
122 *) AC_MSG_ERROR(bad value ${enableval} for --enable-static-binaries) ;;
124 AC_MSG_RESULT($static)
126 AM_CONDITIONAL(ALLSTATIC, test x$static = xtrue)
128 if test x$static = xtrue;
130 LDFLAGS="-all-static $LDFLAGS"
136 AC_ARG_WITH(modules, [ --with-modules Which backends to compile with ],
142 AC_ARG_WITH(dynmodules, [ --with-dynmodules Which backends to build for dynamic loading ],
144 dynmodules="$withval"
151 AC_ARG_WITH(socketdir, [ --with-socketdir Where the controlsocket lives ],
157 AC_SUBST(moduleobjects)
160 AC_MSG_CHECKING(whether we will be building the server)
161 AC_ARG_ENABLE(pdns-server,
162 [ --enable-pdns_server If we should build the server],
163 enable_pdns_server=$enableval,
164 enable_pdns_server=yes)
166 AC_MSG_RESULT($enable_pdns_server)
168 if test x"$enable_pdns_server" = "xyes"
173 AC_SUBST(programdescend)
175 AC_ARG_ENABLE(gcc-skip-locking,
176 [ --enable-gcc-skip-locking If we should forcefully skip gcc locking],
177 AC_DEFINE(GCC_SKIP_LOCKING,,[Skip gcc locking]),
180 AC_MSG_CHECKING(whether we will be building the recursor)
181 AC_ARG_ENABLE(recursor,
182 [ --enable-recursor If we should build the server],
183 enable_recursor=$enableval,
186 AC_MSG_RESULT($enable_recursor)
188 AM_CONDITIONAL(RECURSOR,test x"$enable_recursor" = "xyes")
191 AC_MSG_CHECKING(whether we should use nedmalloc allocator)
192 AC_ARG_ENABLE(nedmalloc,
193 [ --enable-nedmalloc If we should use nedmalloc],
194 enable_nedmalloc=$enableval,
198 AC_MSG_RESULT($enable_nedmalloc)
200 AM_CONDITIONAL(NEDMALLOC,test x"$enable_nedmalloc" = "xyes")
203 for a in $modules $dynmodules
228 [ --with-mysql=<path> root directory path of MySQL installation],
229 [MYSQL_lib_check="$withval/lib/mysql $with_mysql/lib"
230 MYSQL_inc_check="$withval/include/mysql"],
231 [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"
232 MYSQL_inc_check="/usr/local/mysql/include/mysql /usr/local/include/mysql /opt/mysql/include/mysql /opt/mysql/include /usr/include/mysql"])
233 AC_ARG_WITH(mysql-lib,
234 [ --with-mysql-lib=<path> directory path of MySQL library installation],
235 [MYSQL_lib_check="$withval/lib/mysql $withval/mysql $withval"])
236 AC_ARG_WITH(mysql-includes,
237 [ --with-mysql-includes=<path>
238 directory path of MySQL header installation],
239 [MYSQL_inc_check="$withval/include/mysql $withval/mysql $withval"])
240 AC_MSG_CHECKING([for MySQL library directory])
242 for m in $MYSQL_lib_check; do
244 (test -f "$m/libmysqlclient.so" || test -f "$m/libmysqlclient.a")
250 if test -z "$MYSQL_libdir"; then
251 AC_MSG_ERROR([Didn't find the mysql library dir in '$MYSQL_lib_check'])
253 case "$MYSQL_libdir" in
254 /usr/lib ) MYSQL_lib="" ;;
255 /* ) MYSQL_lib=-L$MYSQL_libdir; LDFLAGS="$MYSQL_lib $LDFLAGS";;
256 * ) AC_MSG_ERROR([The MySQL library directory ($MYSQL_libdir) must be an absolute path.]) ;;
261 AC_MSG_RESULT([$MYSQL_libdir])
262 AC_MSG_CHECKING([for MySQL include directory])
264 for m in $MYSQL_inc_check; do
265 if test -d "$m" && test -f "$m/mysql.h"
271 if test -z "$MYSQL_incdir"; then
272 AC_MSG_ERROR([Didn't find the mysql include dir in '$MYSQL_inc_check'])
275 case "$MYSQL_incdir" in
277 * ) AC_MSG_ERROR([The MySQL include directory ($MYSQL_incdir) must be an absolute path.]) ;;
280 AC_SUBST(MYSQL_incdir)
281 AC_MSG_RESULT([$MYSQL_incdir])
282 # LIBS="$LIBS -lmysqlclient"
290 [ --with-pgsql=<path> root directory path of PgSQL installation],
291 [PGSQL_lib_check="$withval/lib/pgsql $with_pgsql/lib"
292 PGSQL_inc_check="$withval/include/pgsql"],
293 [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"
294 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"])
295 AC_ARG_WITH(pgsql-lib,
296 [ --with-pgsql-lib=<path> directory path of PgSQL library installation],
297 [PGSQL_lib_check="$withval/lib/pgsql $withval/pgsql $withval"])
298 AC_ARG_WITH(pgsql-includes,
299 [ --with-pgsql-includes=<path>
300 directory path of PgSQL header installation],
301 [PGSQL_inc_check="$withval/include/pgsql $withval/pgsql $withval"])
302 AC_MSG_CHECKING([for PgSQL library directory])
304 for m in $PGSQL_lib_check; do
306 (test -f "$m/libpq.a" || test -f "$m/libpq++.a")
312 if test -z "$PGSQL_libdir"; then
313 AC_MSG_ERROR([Didn't find the pgsql library dir in '$PGSQL_lib_check'])
315 case "$PGSQL_libdir" in
316 /usr/lib ) PGSQL_lib="" ;;
317 /* ) PGSQL_lib="-L$PGSQL_libdir -Wl,-rpath,$PGSQL_libdir"
318 LDFLAGS="$PGSQL_lib $LDFLAGS"
320 * ) AC_MSG_ERROR([The PgSQL library directory ($PGSQL_libdir) must be an absolute path.]) ;;
324 AC_MSG_RESULT([$PGSQL_libdir])
325 AC_MSG_CHECKING([for PgSQL include directory])
327 for m in $PGSQL_inc_check; do
328 if test -d "$m" && test -f "$m/libpq-fe.h"
334 if test -z "$PGSQL_incdir"; then
335 AC_MSG_ERROR([Didn't find the PgSQL include dir in '$PGSQL_inc_check'])
337 case "$PGSQL_incdir" in
339 * ) AC_MSG_ERROR([The PgSQL include directory ($PGSQL_incdir) must be an absolute path.]) ;;
341 AC_SUBST(PGSQL_incdir)
342 AC_MSG_RESULT([$PGSQL_incdir])
344 # LIBS="$LIBS -lpq++ -lpq -lssl -lcrypt -lcrypto"
348 if test "$needsqlite"
351 [ --with-sqlite=<path> root directory path of SQLite installation],
352 [SQLITE_lib_check="$withval/lib/sqlite $with_sqlite/lib"
353 SQLITE_inc_check="$withval/include/sqlite"],
354 [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"
355 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"])
356 AC_ARG_WITH(sqlite-lib,
357 [ --with-sqlite-lib=<path> directory path of SQLite library installation],
358 [SQLITE_lib_check="$withval/lib/sqlite $withval/sqlite $withval"])
359 AC_ARG_WITH(sqlite-includes,
360 [ --with-sqlite-includes=<path>
361 directory path of SQLite header installation],
362 [SQLITE_inc_check="$withval/include/sqlite $withval/sqlite $withval"])
363 AC_MSG_CHECKING([for SQLite library directory])
365 for m in $SQLITE_lib_check; do
367 (test -f "$m/libsqlite.so" || test -f "$m/libsqlite.a")
373 if test -z "$SQLITE_libdir"; then
374 AC_MSG_ERROR([Didn't find the sqlite library dir in '$SQLITE_lib_check'])
376 case "$SQLITE_libdir" in
377 /usr/lib ) SQLITE_lib="" ;;
378 /* ) SQLITE_lib="-L$SQLITE_libdir -Wl,-rpath,$SQLITE_libdir"
379 LDFLAGS="$SQLITE_lib $LDFLAGS"
381 * ) AC_MSG_ERROR([The SQLite library directory ($SQLITE_libdir) must be an absolute path.]) ;;
385 AC_MSG_RESULT([$SQLITE_libdir])
386 AC_MSG_CHECKING([for SQLite include directory])
388 for m in $SQLITE_inc_check; do
389 if test -d "$m" && test -f "$m/sqlite.h"
395 if test -z "$SQLITE_incdir"; then
396 AC_MSG_ERROR([Didn't find the SQLite include dir in '$SQLITE_inc_check'])
398 case "$SQLITE_incdir" in
400 * ) AC_MSG_ERROR([The SQLite include directory ($SQLITE_incdir) must be an absolute path.]) ;;
402 AC_SUBST(SQLITE_incdir)
403 AC_MSG_RESULT([$SQLITE_incdir])
405 # LIBS="$LIBS -lsqlite"
411 moduledirs="$moduledirs ${a}backend"
413 for b in `cat $srcdir/modules/${a}backend/OBJECTFILES`
415 moduleobjects="$moduleobjects ../modules/${a}backend/$b"
417 modulelibs="$modulelibs `cat $srcdir/modules/${a}backend/OBJECTLIBS`"
422 moduledirs="$moduledirs ${a}backend"
427 export moduledirs moduleobjects modulelibs
429 AC_OUTPUT(Makefile modules/Makefile pdns/Makefile codedocs/Makefile \
430 pdns/backends/Makefile pdns/backends/bind/Makefile pdns/pdns pdns/precursor \
431 modules/mysqlbackend/Makefile modules/pdnsbackend/Makefile \
432 modules/gmysqlbackend/Makefile modules/db2backend/Makefile \
433 modules/geobackend/Makefile modules/opendbxbackend/Makefile \
434 modules/pipebackend/Makefile modules/oraclebackend/Makefile \
435 modules/xdbbackend/Makefile modules/odbcbackend/Makefile \
436 modules/gpgsqlbackend/Makefile modules/ldapbackend/Makefile
437 modules/gsqlitebackend/Makefile modules/goraclebackend/Makefile )