2
AC_INIT(pdns/receiver.cc)
3
AM_INIT_AUTOMAKE(pdns, 3.1)
5
AM_CONFIG_HEADER(config.h)
8
: ${CXXFLAGS="-Wall -O2"}
9
AC_PREFIX_DEFAULT(/usr/local)
21
#BOOST_FILESYSTEM([mt])
22
BOOST_PROGRAM_OPTIONS([mt])
23
BOOST_SERIALIZATION([mt])
27
AC_MSG_CHECKING(if with lua)
28
AC_ARG_WITH(lua, AC_HELP_STRING([--with-lua],[lua]), [WITH_LUA=$withval],[WITH_LUA=yes])
30
AC_MSG_RESULT($WITH_LUA)
31
if test "$WITH_LUA" != "no"; then
33
if test "$WITH_LUA" = "yes"; then
38
PKG_CHECK_MODULES(LUA, $LUAPC >= 5.1, [
39
AC_DEFINE([HAVE_LUA], [1], [liblua])
40
AC_DEFINE([HAVE_LUA_H], [1], [lua.h])
42
PKG_CHECK_MODULES(LUA, lua5.1 >= 5.1, [
43
AC_DEFINE([HAVE_LUA], [1], [liblua])
44
AC_DEFINE([HAVE_LUA_H], [1], [lua.h])
46
PKG_CHECK_MODULES(LUA, lua-5.1 >= 5.1, [
47
AC_DEFINE([HAVE_LUA], [1], [liblua])
48
AC_DEFINE([HAVE_LUA_H], [1], [lua.h])
56
dnl Allow user to require SQLite3
57
AC_MSG_CHECKING(whether user requires sqlite3)
58
AC_ARG_WITH(sqlite3, AC_HELP_STRING([--with-sqlite3],[include sqlite3 driver]), [WITH_SQLITE3=$withval],[WITH_SQLITE3=no])
59
AC_MSG_RESULT($WITH_SQLITE3)
61
if test "$WITH_SQLITE3" != "no"; then
63
if test "$WITH_SQLITE3" != "yes"; then
64
SQLITE3PC=$WITH_SQLITE3
68
dnl Checks for header files.
70
AC_CHECK_HEADERS(fcntl.h getopt.h limits.h strings.h sys/time.h syslog.h unistd.h)
72
dnl Checks for typedefs, structures, and compiler characteristics.
77
dnl Checks for library functions.
79
AC_CHECK_FUNCS(gethostname gettimeofday mkdir mktime select socket strerror)
87
AC_CHECK_LIB(dl,dlopen)
92
AC_MSG_CHECKING([for RTLD_NOW]);
97
[ (void) dlopen("",RTLD_NOW); ],
98
has_RTLD_NOW=yes, has_RTLD_NOW=no)
99
AC_MSG_RESULT([$has_RTLD_NOW])
100
if test "$has_RTLD_NOW" = "no"
102
AC_DEFINE(NEED_RTLD_NOW,,[If host OS misses RTLD_NOW])
110
AC_CHECK_LIB(crypt, crypt)
120
AC_DEFINE(HAVE_IPV6,1,[If the host operating system understands IPv6])
121
LIBS="-lposix4 -lresolv -lnsl -lsocket -lpthread -lrt $LIBS"
122
CXXFLAGS="-D_REENTRANT $CXXFLAGS"
125
solaris2.8 | solaris2.9 )
126
AC_DEFINE(NEED_POSIX_TYPEDEF,,[If POSIX typedefs need to be defined])
127
AC_DEFINE(NEED_INET_NTOP_PROTO,,[If your OS is so broken that it needs an additional prototype])
128
AC_DEFINE(HAVE_IPV6,1,[If the host operating system understands IPv6])
129
LIBS="-lposix4 -lresolv -lnsl -lsocket -lpthread $LIBS"
130
CXXFLAGS="-D_REENTRANT $CXXFLAGS"
132
solaris2.6 | solaris2.7)
133
AC_DEFINE(NEED_POSIX_TYPEDEF,,[If POSIX typedefs need to be defined])
134
AC_DEFINE(NEED_INET_NTOP_PROTO,,[If your OS is so broken that it needs an additional prototype])
135
LIBS="-lposix4 -lresolv -lnsl -lsocket -lpthread $LIBS"
136
CXXFLAGS="-D_REENTRANT $CXXFLAGS"
139
AC_DEFINE(HAVE_IPV6,1,[If the host operating system understands IPv6])
140
DYNLINKFLAGS="-rdynamic"
142
THREADFLAGS="-pthread"
143
CXXFLAGS="-D_GNU_SOURCE $CXXFLAGS"
146
AC_DEFINE(HAVE_IPV6,1,[If the host operating system understands IPv6])
147
DYNLINKFLAGS="-rdynamic"
148
LDFLAGS="-pthread $LDFLAGS"
149
CXXFLAGS="-pthread $CXXFLAGS"
153
AC_SUBST(THREADFLAGS)
155
AC_SUBST(DYNLINKFLAGS)
157
AC_MSG_CHECKING(whether we will be doing verbose logging)
158
AC_ARG_ENABLE(verbose-logging,
159
[ --enable-verbose-logging Do verbose logging],enable_verbose_logging=yes ,enable_verbose_logging=no)
161
if test $enable_verbose_logging = yes; then AC_DEFINE(VERBOSELOG, 1, [If verbose logging should be enabled])
163
AC_MSG_RESULT($enable_verbose_logging)
165
AC_MSG_CHECKING(whether we will be linking in Botan 1.10)
166
AC_ARG_ENABLE(botan1.10,
167
[ --enable-botan1.10 Use Botan 1.10],enable_botan110=yes, enable_botan110=no)
168
AC_MSG_RESULT($enable_botan110)
169
AM_CONDITIONAL(BOTAN110,test x"$enable_botan110" = "xyes")
171
AC_MSG_CHECKING(whether we will be linking in Botan 1.8)
172
AC_ARG_ENABLE(botan1.8,
173
[ --enable-botan1.8 Use Botan 1.8],enable_botan18=yes, enable_botan18=no)
174
AC_MSG_RESULT($enable_botan18)
175
AM_CONDITIONAL(BOTAN18,test x"$enable_botan18" = "xyes")
177
AC_MSG_CHECKING(whether we will be linking in Crypto++)
178
AC_ARG_ENABLE(cryptopp,
179
[ --enable-cryptopp Use Crypto++],enable_cryptopp=yes, enable_cryptopp=no)
180
AC_MSG_RESULT($enable_cryptopp)
181
AM_CONDITIONAL(CRYPTOPP,test x"$enable_cryptopp" = "xyes")
184
AC_MSG_CHECKING(whether we should build static binaries)
186
AC_ARG_ENABLE(static-binaries,
187
[ --enable-static-binaries Build static binaries],
188
[case "${enableval}" in
191
*) AC_MSG_ERROR(bad value ${enableval} for --enable-static-binaries) ;;
193
AC_MSG_RESULT($static)
195
AM_CONDITIONAL(ALLSTATIC, test x$static = xtrue)
197
if test x$static = xtrue;
199
LDFLAGS="-all-static $LDFLAGS"
205
AC_ARG_WITH(modules, [ --with-modules Which backends to compile with ],
211
AC_ARG_WITH(dynmodules, [ --with-dynmodules Which backends to build for dynamic loading ],
213
dynmodules="$withval"
220
AC_ARG_WITH(socketdir, [ --with-socketdir Where the controlsocket lives ],
226
AC_SUBST(moduleobjects)
229
AC_MSG_CHECKING(whether we will be building the server)
230
AC_ARG_ENABLE(pdns-server,
231
[ --enable-pdns_server If we should build the server],
232
enable_pdns_server=$enableval,
233
enable_pdns_server=yes)
235
AC_MSG_RESULT($enable_pdns_server)
237
if test x"$enable_pdns_server" = "xyes"
242
AC_SUBST(programdescend)
244
AC_ARG_ENABLE(gcc-skip-locking,
245
[ --enable-gcc-skip-locking If we should forcefully skip gcc locking],
246
AC_DEFINE(GCC_SKIP_LOCKING,,[Skip gcc locking]),
249
AC_MSG_CHECKING(whether we will be building the recursor)
250
AC_ARG_ENABLE(recursor,
251
[ --enable-recursor If we should build the recursor],
252
enable_recursor=$enableval,
255
AC_MSG_RESULT($enable_recursor)
256
AM_CONDITIONAL(RECURSOR,test x"$enable_recursor" = "xyes")
258
for a in $modules $dynmodules
280
AC_CHECK_HEADERS([ldap.h], , [AC_MSG_ERROR([ldap header (ldap.h) not found])])
281
AC_CHECK_HEADERS([lber.h], , [AC_MSG_ERROR([ldap header (lber.h) not found])])
284
[ldap_r], [ldap_set_option],
285
[AC_DEFINE([HAVE_LIBLDAP_R], 1, [Have -lldap_r]) LIBLDAP="ldap_r"],
287
[ldap], [ldap_set_option],
288
[AC_DEFINE([HAVE_LIBLDAP], 1, [Have -lldap]) LIBLDAP="ldap"],
289
[AC_MSG_ERROR([ldap library (libldap) not found])]
293
[$LIBLDAP], [ldap_initialize],
294
[AC_DEFINE([HAVE_LDAP_INITIALIZE], 1, [Define to 1 if you have ldap_initialize])]
297
[$LIBLDAP], [ldap_sasl_bind],
298
[AC_DEFINE([HAVE_LDAP_SASL_BIND], 1, [Define to 1 if you have ldap_sasl_bind])]
305
AC_CHECK_HEADERS([odbx.h], , [AC_MSG_ERROR([opendbx header (odbx.h) not found])])
306
AC_SUBST([LIBOPENDBX])
308
[opendbx], [odbx_init],
309
[AC_DEFINE([HAVE_LIBOPENDBX], 1, [Have -lopendbx]) LIBOPENDBX="opendbx"]
322
[ --with-mysql=<path> root directory path of MySQL installation],
323
[MYSQL_lib_check="$withval/lib/mysql $with_mysql/lib"
324
MYSQL_inc_check="$withval/include/mysql"],
325
[MYSQL_lib_check="/usr/local/mysql/lib/mysql /usr/local/lib/mysql /opt/mysql/lib/mysql \
326
/usr/lib/mysql /usr/lib64/mysql /usr/local/mysql/lib /usr/local/lib /opt/mysql/lib /usr/lib \
328
MYSQL_inc_check="/usr/local/mysql/include/mysql /usr/local/include/mysql \
329
/opt/mysql/include/mysql /opt/mysql/include /usr/include/mysql /usr/sfw/include/mysql"])
330
AC_ARG_WITH(mysql-lib,
331
[ --with-mysql-lib=<path> directory path of MySQL library installation],
332
[MYSQL_lib_check="$withval/lib/mysql $withval/mysql $withval"])
333
AC_ARG_WITH(mysql-includes,
334
[ --with-mysql-includes=<path>
335
directory path of MySQL header installation],
336
[MYSQL_inc_check="$withval/include/mysql $withval/mysql $withval"])
337
AC_MSG_CHECKING([for MySQL library directory])
339
for m in $MYSQL_lib_check; do
341
(test -f "$m/libmysqlclient.so" || test -f "$m/libmysqlclient.a")
347
if test -z "$MYSQL_libdir"; then
348
AC_MSG_ERROR([Didn't find the mysql library dir in '$MYSQL_lib_check'])
350
case "$MYSQL_libdir" in
351
/usr/lib ) MYSQL_lib="" ;;
352
/* ) MYSQL_lib=-L$MYSQL_libdir; LDFLAGS="$MYSQL_lib $LDFLAGS";;
353
* ) AC_MSG_ERROR([The MySQL library directory ($MYSQL_libdir) must be an absolute path.]) ;;
358
AC_MSG_RESULT([$MYSQL_libdir])
359
AC_MSG_CHECKING([for MySQL include directory])
361
for m in $MYSQL_inc_check; do
362
if test -d "$m" && test -f "$m/mysql.h"
368
if test -z "$MYSQL_incdir"; then
369
AC_MSG_ERROR([Didn't find the mysql include dir in '$MYSQL_inc_check'])
372
case "$MYSQL_incdir" in
374
* ) AC_MSG_ERROR([The MySQL include directory ($MYSQL_incdir) must be an absolute path.]) ;;
377
AC_SUBST(MYSQL_incdir)
378
AC_MSG_RESULT([$MYSQL_incdir])
379
# LIBS="$LIBS -lmysqlclient"
387
[ --with-pgsql=<path> root directory path of PgSQL installation],
388
[PGSQL_lib_check="$withval/lib/pgsql $with_pgsql/lib"
389
PGSQL_inc_check="$withval/include/pgsql"],
390
[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 /usr/lib64"
391
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"])
392
AC_ARG_WITH(pgsql-lib,
393
[ --with-pgsql-lib=<path> directory path of PgSQL library installation],
394
[PGSQL_lib_check="$withval/lib/pgsql $withval/pgsql $withval"])
395
AC_ARG_WITH(pgsql-includes,
396
[ --with-pgsql-includes=<path>
397
directory path of PgSQL header installation],
398
[PGSQL_inc_check="$withval/include/pgsql $withval/pgsql $withval"])
399
AC_MSG_CHECKING([for PgSQL library directory])
401
for m in $PGSQL_lib_check; do
403
(test -f "$m/libpq.a" || test -f "$m/libpq.so")
409
if test -z "$PGSQL_libdir"; then
410
AC_MSG_ERROR([Didn't find the pgsql library dir in '$PGSQL_lib_check'])
412
case "$PGSQL_libdir" in
413
/usr/lib ) PGSQL_lib="" ;;
414
/usr/lib64 ) PGSQL_lib="" ;;
415
/* ) PGSQL_lib="-L$PGSQL_libdir -Wl,-rpath,$PGSQL_libdir"
416
LDFLAGS="$PGSQL_lib $LDFLAGS"
418
* ) AC_MSG_ERROR([The PgSQL library directory ($PGSQL_libdir) must be an absolute path.]) ;;
422
AC_MSG_RESULT([$PGSQL_libdir])
423
AC_MSG_CHECKING([for PgSQL include directory])
425
for m in $PGSQL_inc_check; do
426
if test -d "$m" && test -f "$m/libpq-fe.h"
432
if test -z "$PGSQL_incdir"; then
433
AC_MSG_ERROR([Didn't find the PgSQL include dir in '$PGSQL_inc_check'])
435
case "$PGSQL_incdir" in
437
* ) AC_MSG_ERROR([The PgSQL include directory ($PGSQL_incdir) must be an absolute path.]) ;;
439
AC_SUBST(PGSQL_incdir)
440
AC_MSG_RESULT([$PGSQL_incdir])
443
if test "$needsqlite"
447
[ --with-sqlite=<path> root directory path of SQLite installation],
448
[SQLITE_lib_check="$withval/lib/sqlite $with_sqlite/lib"
449
SQLITE_inc_check="$withval/include/sqlite"],
450
[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 /usr/lib64"
451
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"])
452
AC_ARG_WITH(sqlite-lib,
453
[ --with-sqlite-lib=<path> directory path of SQLite library installation],
454
[SQLITE_lib_check="$withval/lib/sqlite $withval/sqlite $withval"])
455
AC_ARG_WITH(sqlite-includes,
456
[ --with-sqlite-includes=<path>
457
directory path of SQLite header installation],
458
[SQLITE_inc_check="$withval/include/sqlite $withval/sqlite $withval"])
459
AC_MSG_CHECKING([for SQLite library directory])
461
for m in $SQLITE_lib_check; do
463
(test -f "$m/libsqlite.so" || test -f "$m/libsqlite.a")
469
if test -z "$SQLITE_libdir"; then
470
AC_MSG_ERROR([Didn't find the sqlite library dir in '$SQLITE_lib_check'])
472
case "$SQLITE_libdir" in
473
/usr/lib ) SQLITE_lib="" ;;
474
/usr/lib64 ) SQLITE_lib="" ;;
475
/* ) SQLITE_lib="-L$SQLITE_libdir -Wl,-rpath,$SQLITE_libdir"
476
LDFLAGS="$SQLITE_lib $LDFLAGS"
478
* ) AC_MSG_ERROR([The SQLite library directory ($SQLITE_libdir) must be an absolute path.]) ;;
482
AC_MSG_RESULT([$SQLITE_libdir])
483
AC_MSG_CHECKING([for SQLite include directory])
485
for m in $SQLITE_inc_check; do
486
if test -d "$m" && test -f "$m/sqlite.h"
492
if test -z "$SQLITE_incdir"; then
493
AC_MSG_ERROR([Didn't find the SQLite include dir in '$SQLITE_inc_check'])
495
case "$SQLITE_incdir" in
497
* ) AC_MSG_ERROR([The SQLite include directory ($SQLITE_incdir) must be an absolute path.]) ;;
499
AC_SUBST(SQLITE_incdir)
500
AC_MSG_RESULT([$SQLITE_incdir])
502
# LIBS="$LIBS -lsqlite"
505
if test "$needsqlite3"
507
PKG_CHECK_MODULES(SQLITE3, $SQLITE3PC, HAVE_SQLITE3=yes, AC_MSG_ERROR([+Could not find sqlite3]))
508
AC_SUBST(SQLITE3_LIBS)
509
AC_SUBST(SQLITE3_CFLAGS)
510
AC_DEFINE(HAVE_SQLITE3,1,[If we have sqlite3])
515
PKG_CHECK_MODULES(CDB, libcdb, HAVE_CDB=yes, AC_MSG_ERROR([+Could not find libcdb/tinycdb]))
520
AM_CONDITIONAL(SQLITE3, test "$needsqlite3")
523
if test "$needunixodbc"
525
AC_ARG_WITH(unixodbc,
526
[ --with-unixodbc=<path> root directory path of unixodbc installation],
527
[UNIXODBC_lib_check="$withval/lib/unixodbc $with_unixodbc/lib $withval/lib"
528
UNIXODBC_inc_check="$withval/include/unixodbc"],
529
[UNIXODBC_lib_check="/usr/local/unixodbc/lib/unixodbc /usr/local/lib/unixodbc /usr/lib/unixodbc /usr/local/unixodbc/lib /usr/local/lib /opt/unixodbc/lib /usr/lib"
530
UNIXODBC_inc_check="/usr/local/unixodbc/include/unixodbc /usr/local/include/unixodbc/ /usr/local/include /opt/unixodbc/include/unixodbc /opt/unixodbc/include /usr/include/ /usr/include/unixodbc"])
531
AC_ARG_WITH(unixodbc-lib,
532
[ --with-unixodbc-lib=<path> directory path of unixodbc library installation],
533
[UNIXODBC_lib_check="$withval/lib/unixodbc $withval/unixodbc $withval"])
534
AC_ARG_WITH(unixodbc-includes,
535
[ --with-unixodbc-includes=<path> directory path of unixodbc header installation],
536
[UNIXODBC_inc_check="$withval/include $withval/include/unixodbc $withval/unixodbc $withval"])
537
AC_MSG_CHECKING([for SQLite3 library directory])
539
for m in $UNIXODBC_lib_check; do
541
(test -f "$m/libodbc.so" || test -f "$m/libodbc.a")
547
if test -z "$UNIXODBC_libdir"; then
548
AC_MSG_ERROR([Didn't find the unixodbc library dir in '$UNIXODBC_lib_check'])
550
case "$UNIXODBC_libdir" in
551
/usr/lib ) UNIXODBC_lib="" ;;
552
/* ) UNIXODBC_lib="-L$UNIXODBC_libdir -Wl,-rpath,$UNIXODBC_libdir"
553
LDFLAGS="$UNIXODBC_lib $LDFLAGS"
555
* ) AC_MSG_ERROR([The unixodbc library directory ($UNIXODBC_libdir) must be an absolute path.]) ;;
558
AC_SUBST(UNIXODBC_lib)
559
AC_MSG_RESULT([$UNIXODBC_libdir])
560
AC_MSG_CHECKING([for unixodbc include directory])
562
for m in $UNIXODBC_inc_check; do
563
if test -d "$m" && test -f "$m/sql.h"
569
if test -z "$UNIXODBC_incdir"; then
570
AC_MSG_ERROR([Didn't find the unixodbc include dir in '$UNIXODBC_inc_check'])
572
case "$UNIXODBC_incdir" in
574
* ) AC_MSG_ERROR([The unixodbc include directory ($UNIXODBC_incdir) must be an absolute path.]) ;;
576
AC_SUBST(UNIXODBC_incdir)
577
AC_MSG_RESULT([$UNIXODBC_incdir])
579
# LIBS="$LIBS -lunixodbc"
584
moduledirs="$moduledirs ${a}backend"
586
for b in `cat $srcdir/modules/${a}backend/OBJECTFILES`
588
moduleobjects="$moduleobjects ../modules/${a}backend/$b"
590
modulelibs="$modulelibs `cat $srcdir/modules/${a}backend/OBJECTLIBS`"
592
if test ${a} = "gpgsql"; then
593
LIBS="$LIBS $LIBCRYPT"
599
modulelibs="$modulelibs -lresolv -lnsl"
607
moduledirs="$moduledirs ${a}backend"
612
export moduledirs moduleobjects modulelibs
614
AC_OUTPUT(Makefile modules/Makefile pdns/Makefile codedocs/Makefile \
615
pdns/backends/Makefile pdns/backends/bind/Makefile pdns/pdns pdns/precursor \
616
modules/gmysqlbackend/Makefile modules/db2backend/Makefile \
617
modules/geobackend/Makefile modules/opendbxbackend/Makefile \
618
modules/pipebackend/Makefile modules/oraclebackend/Makefile \
619
modules/xdbbackend/Makefile modules/godbcbackend/Makefile \
620
modules/mongodbbackend/Makefile \
621
modules/gpgsqlbackend/Makefile modules/ldapbackend/Makefile \
622
modules/gsqlitebackend/Makefile modules/gsqlite3backend/Makefile \
623
modules/goraclebackend/Makefile modules/mydnsbackend/Makefile \
624
modules/luabackend/Makefile modules/tinydnsbackend/Makefile)