2 AC_INIT(pdns/receiver.cc)
3 AM_INIT_AUTOMAKE(pdns, 2.9.21)
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 AC_DEFINE(HAVE_IPV6,1,[If the host operating system understands IPv6])
66 LIBS="-lposix4 -lresolv -lnsl -lsocket -lpthread -lrt $LIBS"
67 CXXFLAGS="-D_REENTRANT $CXXFLAGS"
70 solaris2.8 | solaris2.9 )
71 AC_DEFINE(NEED_POSIX_TYPEDEF,,[If POSIX typedefs need to be defined])
72 AC_DEFINE(NEED_INET_NTOP_PROTO,,[If your OS is so broken that it needs an additional prototype])
73 AC_DEFINE(HAVE_IPV6,1,[If the host operating system understands IPv6])
74 LIBS="-lposix4 -lresolv -lnsl -lsocket -lpthread $LIBS"
75 CXXFLAGS="-D_REENTRANT $CXXFLAGS"
77 solaris2.6 | solaris2.7)
78 AC_DEFINE(NEED_POSIX_TYPEDEF,,[If POSIX typedefs need to be defined])
79 AC_DEFINE(NEED_INET_NTOP_PROTO,,[If your OS is so broken that it needs an additional prototype])
80 LIBS="-lposix4 -lresolv -lnsl -lsocket -lpthread $LIBS"
81 CXXFLAGS="-D_REENTRANT $CXXFLAGS"
84 AC_DEFINE(HAVE_IPV6,1,[If the host operating system understands IPv6])
85 DYNLINKFLAGS="-rdynamic"
87 THREADFLAGS="-pthread"
88 CXXFLAGS="-D_GNU_SOURCE $CXXFLAGS"
91 AC_DEFINE(HAVE_IPV6,1,[If the host operating system understands IPv6])
92 DYNLINKFLAGS="-rdynamic"
93 LDFLAGS="-lc_r $LDFLAGS"
94 CXXFLAGS="-pthread $CXXFLAGS"
97 AC_DEFINE(HAVE_IPV6,1,[If the host operating system understands IPv6])
98 DYNLINKFLAGS="-rdynamic"
99 LDFLAGS="-pthread $LDFLAGS"
100 CXXFLAGS="-pthread $CXXFLAGS"
104 AC_SUBST(THREADFLAGS)
106 AC_SUBST(DYNLINKFLAGS)
108 AC_MSG_CHECKING(whether we will be doing verbose logging)
109 AC_ARG_ENABLE(verbose-logging,
110 [ --enable-verbose-logging Do verbose logging],enable_verbose_logging=yes ,enable_verbose_logging=no)
112 if test $enable_verbose_logging = yes; then AC_DEFINE(VERBOSELOG, 1, [If verbose logging should be enabled])
114 AC_MSG_RESULT($enable_verbose_logging)
116 AC_MSG_CHECKING(whether we should build static binaries)
118 AC_ARG_ENABLE(static-binaries,
119 [ --enable-static-binaries Build static binaries],
120 [case "${enableval}" in
123 *) AC_MSG_ERROR(bad value ${enableval} for --enable-static-binaries) ;;
125 AC_MSG_RESULT($static)
127 AM_CONDITIONAL(ALLSTATIC, test x$static = xtrue)
129 if test x$static = xtrue;
131 LDFLAGS="-all-static $LDFLAGS"
137 AC_ARG_WITH(modules, [ --with-modules Which backends to compile with ],
143 AC_ARG_WITH(dynmodules, [ --with-dynmodules Which backends to build for dynamic loading ],
145 dynmodules="$withval"
152 AC_ARG_WITH(socketdir, [ --with-socketdir Where the controlsocket lives ],
158 AC_SUBST(moduleobjects)
161 AC_MSG_CHECKING(whether we will be building the server)
162 AC_ARG_ENABLE(pdns-server,
163 [ --enable-pdns_server If we should build the server],
164 enable_pdns_server=$enableval,
165 enable_pdns_server=yes)
167 AC_MSG_RESULT($enable_pdns_server)
169 if test x"$enable_pdns_server" = "xyes"
174 AC_SUBST(programdescend)
176 AC_ARG_ENABLE(gcc-skip-locking,
177 [ --enable-gcc-skip-locking If we should forcefully skip gcc locking],
178 AC_DEFINE(GCC_SKIP_LOCKING,,[Skip gcc locking]),
181 AC_MSG_CHECKING(whether we will be building the recursor)
182 AC_ARG_ENABLE(recursor,
183 [ --enable-recursor If we should build the server],
184 enable_recursor=$enableval,
187 AC_MSG_RESULT($enable_recursor)
189 AM_CONDITIONAL(RECURSOR,test x"$enable_recursor" = "xyes")
192 AC_MSG_CHECKING(whether we should use nedmalloc allocator)
193 AC_ARG_ENABLE(nedmalloc,
194 [ --enable-nedmalloc If we should use nedmalloc],
195 enable_nedmalloc=$enableval,
196 if echo $host_os | grep -i freebsd > /dev/null
203 AC_MSG_RESULT($enable_nedmalloc)
205 AM_CONDITIONAL(NEDMALLOC,test x"$enable_nedmalloc" = "xyes")
208 for a in $modules $dynmodules
236 [ --with-mysql=<path> root directory path of MySQL installation],
237 [MYSQL_lib_check="$withval/lib/mysql $with_mysql/lib"
238 MYSQL_inc_check="$withval/include/mysql"],
239 [MYSQL_lib_check="/usr/local/mysql/lib/mysql /usr/local/lib/mysql /opt/mysql/lib/mysql \
240 /usr/lib/mysql /usr/local/mysql/lib /usr/local/lib /opt/mysql/lib /usr/lib \
242 MYSQL_inc_check="/usr/local/mysql/include/mysql /usr/local/include/mysql \
243 /opt/mysql/include/mysql /opt/mysql/include /usr/include/mysql /usr/sfw/include/mysql"])
244 AC_ARG_WITH(mysql-lib,
245 [ --with-mysql-lib=<path> directory path of MySQL library installation],
246 [MYSQL_lib_check="$withval/lib/mysql $withval/mysql $withval"])
247 AC_ARG_WITH(mysql-includes,
248 [ --with-mysql-includes=<path>
249 directory path of MySQL header installation],
250 [MYSQL_inc_check="$withval/include/mysql $withval/mysql $withval"])
251 AC_MSG_CHECKING([for MySQL library directory])
253 for m in $MYSQL_lib_check; do
255 (test -f "$m/libmysqlclient.so" || test -f "$m/libmysqlclient.a")
261 if test -z "$MYSQL_libdir"; then
262 AC_MSG_ERROR([Didn't find the mysql library dir in '$MYSQL_lib_check'])
264 case "$MYSQL_libdir" in
265 /usr/lib ) MYSQL_lib="" ;;
266 /* ) MYSQL_lib=-L$MYSQL_libdir; LDFLAGS="$MYSQL_lib $LDFLAGS";;
267 * ) AC_MSG_ERROR([The MySQL library directory ($MYSQL_libdir) must be an absolute path.]) ;;
272 AC_MSG_RESULT([$MYSQL_libdir])
273 AC_MSG_CHECKING([for MySQL include directory])
275 for m in $MYSQL_inc_check; do
276 if test -d "$m" && test -f "$m/mysql.h"
282 if test -z "$MYSQL_incdir"; then
283 AC_MSG_ERROR([Didn't find the mysql include dir in '$MYSQL_inc_check'])
286 case "$MYSQL_incdir" in
288 * ) AC_MSG_ERROR([The MySQL include directory ($MYSQL_incdir) must be an absolute path.]) ;;
291 AC_SUBST(MYSQL_incdir)
292 AC_MSG_RESULT([$MYSQL_incdir])
293 # LIBS="$LIBS -lmysqlclient"
301 [ --with-pgsql=<path> root directory path of PgSQL installation],
302 [PGSQL_lib_check="$withval/lib/pgsql $with_pgsql/lib"
303 PGSQL_inc_check="$withval/include/pgsql"],
304 [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"
305 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"])
306 AC_ARG_WITH(pgsql-lib,
307 [ --with-pgsql-lib=<path> directory path of PgSQL library installation],
308 [PGSQL_lib_check="$withval/lib/pgsql $withval/pgsql $withval"])
309 AC_ARG_WITH(pgsql-includes,
310 [ --with-pgsql-includes=<path>
311 directory path of PgSQL header installation],
312 [PGSQL_inc_check="$withval/include/pgsql $withval/pgsql $withval"])
313 AC_MSG_CHECKING([for PgSQL library directory])
315 for m in $PGSQL_lib_check; do
317 (test -f "$m/libpq.a" || test -f "$m/libpq++.a")
323 if test -z "$PGSQL_libdir"; then
324 AC_MSG_ERROR([Didn't find the pgsql library dir in '$PGSQL_lib_check'])
326 case "$PGSQL_libdir" in
327 /usr/lib ) PGSQL_lib="" ;;
328 /* ) PGSQL_lib="-L$PGSQL_libdir -Wl,-rpath,$PGSQL_libdir"
329 LDFLAGS="$PGSQL_lib $LDFLAGS"
331 * ) AC_MSG_ERROR([The PgSQL library directory ($PGSQL_libdir) must be an absolute path.]) ;;
335 AC_MSG_RESULT([$PGSQL_libdir])
336 AC_MSG_CHECKING([for PgSQL include directory])
338 for m in $PGSQL_inc_check; do
339 if test -d "$m" && test -f "$m/libpq-fe.h"
345 if test -z "$PGSQL_incdir"; then
346 AC_MSG_ERROR([Didn't find the PgSQL include dir in '$PGSQL_inc_check'])
348 case "$PGSQL_incdir" in
350 * ) AC_MSG_ERROR([The PgSQL include directory ($PGSQL_incdir) must be an absolute path.]) ;;
352 AC_SUBST(PGSQL_incdir)
353 AC_MSG_RESULT([$PGSQL_incdir])
355 # LIBS="$LIBS -lpq++ -lpq -lssl -lcrypt -lcrypto"
359 if test "$needsqlite"
362 [ --with-sqlite=<path> root directory path of SQLite installation],
363 [SQLITE_lib_check="$withval/lib/sqlite $with_sqlite/lib"
364 SQLITE_inc_check="$withval/include/sqlite"],
365 [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"
366 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"])
367 AC_ARG_WITH(sqlite-lib,
368 [ --with-sqlite-lib=<path> directory path of SQLite library installation],
369 [SQLITE_lib_check="$withval/lib/sqlite $withval/sqlite $withval"])
370 AC_ARG_WITH(sqlite-includes,
371 [ --with-sqlite-includes=<path>
372 directory path of SQLite header installation],
373 [SQLITE_inc_check="$withval/include/sqlite $withval/sqlite $withval"])
374 AC_MSG_CHECKING([for SQLite library directory])
376 for m in $SQLITE_lib_check; do
378 (test -f "$m/libsqlite.so" || test -f "$m/libsqlite.a")
384 if test -z "$SQLITE_libdir"; then
385 AC_MSG_ERROR([Didn't find the sqlite library dir in '$SQLITE_lib_check'])
387 case "$SQLITE_libdir" in
388 /usr/lib ) SQLITE_lib="" ;;
389 /* ) SQLITE_lib="-L$SQLITE_libdir -Wl,-rpath,$SQLITE_libdir"
390 LDFLAGS="$SQLITE_lib $LDFLAGS"
392 * ) AC_MSG_ERROR([The SQLite library directory ($SQLITE_libdir) must be an absolute path.]) ;;
396 AC_MSG_RESULT([$SQLITE_libdir])
397 AC_MSG_CHECKING([for SQLite include directory])
399 for m in $SQLITE_inc_check; do
400 if test -d "$m" && test -f "$m/sqlite.h"
406 if test -z "$SQLITE_incdir"; then
407 AC_MSG_ERROR([Didn't find the SQLite include dir in '$SQLITE_inc_check'])
409 case "$SQLITE_incdir" in
411 * ) AC_MSG_ERROR([The SQLite include directory ($SQLITE_incdir) must be an absolute path.]) ;;
413 AC_SUBST(SQLITE_incdir)
414 AC_MSG_RESULT([$SQLITE_incdir])
416 # LIBS="$LIBS -lsqlite"
419 if test "$needsqlite3"
422 [ --with-sqlite3=<path> root directory path of SQLite3 installation],
423 [SQLITE3_lib_check="$withval/lib/sqlite3 $with_sqlite3/lib"
424 SQLITE3_inc_check="$withval/include/sqlite3"],
425 [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"
426 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"])
427 AC_ARG_WITH(sqlite3-lib,
428 [ --with-sqlite3-lib=<path> directory path of SQLite3 library installation],
429 [SQLITE3_lib_check="$withval/lib/sqlite3 $withval/sqlite3 $withval"])
430 AC_ARG_WITH(sqlite3-includes,
431 [ --with-sqlite3-includes=<path> directory path of SQLite3 header installation],
432 [SQLITE3_inc_check="$withval/include/sqlite3 $withval/sqlite3 $withval"])
433 AC_MSG_CHECKING([for SQLite3 library directory])
435 for m in $SQLITE3_lib_check; do
437 (test -f "$m/libsqlite3.so" || test -f "$m/libsqlite3.a")
443 if test -z "$SQLITE3_libdir"; then
444 AC_MSG_ERROR([Didn't find the sqlite3 library dir in '$SQLITE3_lib_check'])
446 case "$SQLITE3_libdir" in
447 /usr/lib ) SQLITE3_lib="" ;;
448 /* ) SQLITE3_lib="-L$SQLITE3_libdir -Wl,-rpath,$SQLITE3_libdir"
449 LDFLAGS="$SQLITE3_lib $LDFLAGS"
451 * ) AC_MSG_ERROR([The SQLite3 library directory ($SQLITE3_libdir) must be an absolute path.]) ;;
454 AC_SUBST(SQLITE3_lib)
455 AC_MSG_RESULT([$SQLITE3_libdir])
456 AC_MSG_CHECKING([for SQLite3 include directory])
458 for m in $SQLITE3_inc_check; do
459 if test -d "$m" && test -f "$m/sqlite3.h"
465 if test -z "$SQLITE3_incdir"; then
466 AC_MSG_ERROR([Didn't find the SQLite3 include dir in '$SQLITE3_inc_check'])
468 case "$SQLITE3_incdir" in
470 * ) AC_MSG_ERROR([The SQLite3 include directory ($SQLITE3_incdir) must be an absolute path.]) ;;
472 AC_SUBST(SQLITE3_incdir)
473 AC_MSG_RESULT([$SQLITE3_incdir])
475 # LIBS="$LIBS -lsqlite3"
481 moduledirs="$moduledirs ${a}backend"
483 for b in `cat $srcdir/modules/${a}backend/OBJECTFILES`
485 moduleobjects="$moduleobjects ../modules/${a}backend/$b"
487 modulelibs="$modulelibs `cat $srcdir/modules/${a}backend/OBJECTLIBS`"
492 moduledirs="$moduledirs ${a}backend"
497 export moduledirs moduleobjects modulelibs
499 AC_OUTPUT(Makefile modules/Makefile pdns/Makefile codedocs/Makefile \
500 pdns/backends/Makefile pdns/backends/bind/Makefile pdns/pdns pdns/precursor \
501 modules/mysqlbackend/Makefile modules/pdnsbackend/Makefile \
502 modules/gmysqlbackend/Makefile modules/db2backend/Makefile \
503 modules/geobackend/Makefile modules/opendbxbackend/Makefile \
504 modules/pipebackend/Makefile modules/oraclebackend/Makefile \
505 modules/xdbbackend/Makefile modules/odbcbackend/Makefile \
506 modules/gpgsqlbackend/Makefile modules/ldapbackend/Makefile
507 modules/gsqlitebackend/Makefile modules/gsqlite3backend/Makefile
508 modules/goraclebackend/Makefile )