2 AC_INIT(pdns/receiver.cc)
3 AM_INIT_AUTOMAKE(pdns, 2.9.19-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 boost/shared_ptr.hpp getopt.h limits.h strings.h sys/time.h syslog.h unistd.h)
24 dnl Checks for typedefs, structures, and compiler characteristics.
29 dnl Checks for library functions.
31 AC_CHECK_FUNCS(gethostname gettimeofday mkdir mktime select socket strerror)
39 AC_CHECK_LIB(dl,dlopen)
44 AC_MSG_CHECKING([for RTLD_NOW]);
49 [ (void) dlopen("",RTLD_NOW); ],
50 has_RTLD_NOW=yes, has_RTLD_NOW=no)
51 AC_MSG_RESULT([$has_RTLD_NOW])
52 if test "$has_RTLD_NOW" = "no"
54 AC_DEFINE(NEED_RTLD_NOW,,[If host OS misses RTLD_NOW])
62 solaris2.8 | solaris2.9 )
63 AC_DEFINE(NEED_POSIX_TYPEDEF,,[If POSIX typedefs need to be defined])
64 AC_DEFINE(NEED_INET_NTOP_PROTO,,[If your OS is so broken that it needs an additional prototype])
65 AC_DEFINE(HAVE_IPV6,1,[If the host operating system understands IPv6])
66 LIBS="-lposix4 -lresolv -lnsl -lsocket -lpthread $LIBS"
67 CXXFLAGS="-D_REENTRANT $CXXFLAGS"
69 solaris2.6 | solaris2.7)
70 AC_DEFINE(NEED_POSIX_TYPEDEF,,[If POSIX typedefs need to be defined])
71 AC_DEFINE(NEED_INET_NTOP_PROTO,,[If your OS is so broken that it needs an additional prototype])
72 LIBS="-lposix4 -lresolv -lnsl -lsocket -lpthread $LIBS"
73 CXXFLAGS="-D_REENTRANT $CXXFLAGS"
76 AC_DEFINE(HAVE_IPV6,1,[If the host operating system understands IPv6])
77 DYNLINKFLAGS="-rdynamic"
79 THREADFLAGS="-pthread"
80 CXXFLAGS="-D_GNU_SOURCE $CXXFLAGS"
83 AC_DEFINE(HAVE_IPV6,1,[If the host operating system understands IPv6])
84 DYNLINKFLAGS="-rdynamic"
85 LDFLAGS="-lc_r $LDFLAGS"
86 CXXFLAGS="-pthread $CXXFLAGS"
89 AC_DEFINE(HAVE_IPV6,1,[If the host operating system understands IPv6])
90 DYNLINKFLAGS="-rdynamic"
91 LDFLAGS="-pthread $LDFLAGS"
92 CXXFLAGS="-pthread $CXXFLAGS"
98 AC_SUBST(DYNLINKFLAGS)
100 AC_MSG_CHECKING(whether we will be doing verbose logging)
101 AC_ARG_ENABLE(verbose-logging,
102 [ --enable-verbose-logging Do verbose logging],enable_verbose_logging=yes ,enable_verbose_logging=no)
104 if test $enable_verbose_logging = yes; then AC_DEFINE(VERBOSELOG, 1, [If verbose logging should be enabled])
106 AC_MSG_RESULT($enable_verbose_logging)
108 AC_MSG_CHECKING(whether we should build static binaries)
110 AC_ARG_ENABLE(static-binaries,
111 [ --enable-static-binaries Build static binaries],
112 [case "${enableval}" in
115 *) AC_MSG_ERROR(bad value ${enableval} for --enable-static-binaries) ;;
117 AC_MSG_RESULT($static)
119 AM_CONDITIONAL(ALLSTATIC, test x$static = xtrue)
121 if test x$static = xtrue;
123 LDFLAGS="-all-static $LDFLAGS"
129 AC_ARG_WITH(modules, [ --with-modules Which backends to compile with ],
135 AC_ARG_WITH(dynmodules, [ --with-dynmodules Which backends to build for dynamic loading ],
137 dynmodules="$withval"
144 AC_ARG_WITH(socketdir, [ --with-socketdir Where the controlsocket lives ],
150 AC_SUBST(moduleobjects)
153 AC_MSG_CHECKING(whether we will be building the server)
154 AC_ARG_ENABLE(pdns-server,
155 [ --enable-pdns_server If we should build the server],
156 enable_pdns_server=$enableval,
157 enable_pdns_server=yes)
159 AC_MSG_RESULT($enable_pdns_server)
161 if test x"$enable_pdns_server" = "xyes"
166 AC_SUBST(programdescend)
169 AC_MSG_CHECKING(whether we will be building the recursor)
170 AC_ARG_ENABLE(recursor,
171 [ --enable-recursor If we should build the server],
172 enable_recursor=$enableval,
175 AC_MSG_RESULT($enable_recursor)
177 AM_CONDITIONAL(RECURSOR,test x"$enable_recursor" = "xyes")
179 for a in $modules $dynmodules
204 [ --with-mysql=<path> root directory path of MySQL installation],
205 [MYSQL_lib_check="$withval/lib/mysql $with_mysql/lib"
206 MYSQL_inc_check="$withval/include/mysql"],
207 [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"
208 MYSQL_inc_check="/usr/local/mysql/include/mysql /usr/local/include/mysql /opt/mysql/include/mysql /opt/mysql/include /usr/include/mysql"])
209 AC_ARG_WITH(mysql-lib,
210 [ --with-mysql-lib=<path> directory path of MySQL library installation],
211 [MYSQL_lib_check="$withval/lib/mysql $withval/mysql $withval"])
212 AC_ARG_WITH(mysql-includes,
213 [ --with-mysql-includes=<path>
214 directory path of MySQL header installation],
215 [MYSQL_inc_check="$withval/include/mysql $withval/mysql $withval"])
216 AC_MSG_CHECKING([for MySQL library directory])
218 for m in $MYSQL_lib_check; do
220 (test -f "$m/libmysqlclient.so" || test -f "$m/libmysqlclient.a")
226 if test -z "$MYSQL_libdir"; then
227 AC_MSG_ERROR([Didn't find the mysql library dir in '$MYSQL_lib_check'])
229 case "$MYSQL_libdir" in
230 /usr/lib ) MYSQL_lib="" ;;
231 /* ) MYSQL_lib=-L$MYSQL_libdir; LDFLAGS="$MYSQL_lib $LDFLAGS";;
232 * ) AC_MSG_ERROR([The MySQL library directory ($MYSQL_libdir) must be an absolute path.]) ;;
237 AC_MSG_RESULT([$MYSQL_libdir])
238 AC_MSG_CHECKING([for MySQL include directory])
240 for m in $MYSQL_inc_check; do
241 if test -d "$m" && test -f "$m/mysql.h"
247 if test -z "$MYSQL_incdir"; then
248 AC_MSG_ERROR([Didn't find the mysql include dir in '$MYSQL_inc_check'])
251 case "$MYSQL_incdir" in
253 * ) AC_MSG_ERROR([The MySQL include directory ($MYSQL_incdir) must be an absolute path.]) ;;
256 AC_SUBST(MYSQL_incdir)
257 AC_MSG_RESULT([$MYSQL_incdir])
258 # LIBS="$LIBS -lmysqlclient"
266 [ --with-pgsql=<path> root directory path of PgSQL installation],
267 [PGSQL_lib_check="$withval/lib/pgsql $with_pgsql/lib"
268 PGSQL_inc_check="$withval/include/pgsql"],
269 [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"
270 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"])
271 AC_ARG_WITH(pgsql-lib,
272 [ --with-pgsql-lib=<path> directory path of PgSQL library installation],
273 [PGSQL_lib_check="$withval/lib/pgsql $withval/pgsql $withval"])
274 AC_ARG_WITH(pgsql-includes,
275 [ --with-pgsql-includes=<path>
276 directory path of PgSQL header installation],
277 [PGSQL_inc_check="$withval/include/pgsql $withval/pgsql $withval"])
278 AC_MSG_CHECKING([for PgSQL library directory])
280 for m in $PGSQL_lib_check; do
282 (test -f "$m/libpq.a" || test -f "$m/libpq++.a")
288 if test -z "$PGSQL_libdir"; then
289 AC_MSG_ERROR([Didn't find the pgsql library dir in '$PGSQL_lib_check'])
291 case "$PGSQL_libdir" in
292 /usr/lib ) PGSQL_lib="" ;;
293 /* ) PGSQL_lib="-L$PGSQL_libdir -Wl,-rpath,$PGSQL_libdir"
294 LDFLAGS="$PGSQL_lib $LDFLAGS"
296 * ) AC_MSG_ERROR([The PgSQL library directory ($PGSQL_libdir) must be an absolute path.]) ;;
300 AC_MSG_RESULT([$PGSQL_libdir])
301 AC_MSG_CHECKING([for PgSQL include directory])
303 for m in $PGSQL_inc_check; do
304 if test -d "$m" && test -f "$m/libpq-fe.h"
310 if test -z "$PGSQL_incdir"; then
311 AC_MSG_ERROR([Didn't find the PgSQL include dir in '$PGSQL_inc_check'])
313 case "$PGSQL_incdir" in
315 * ) AC_MSG_ERROR([The PgSQL include directory ($PGSQL_incdir) must be an absolute path.]) ;;
317 AC_SUBST(PGSQL_incdir)
318 AC_MSG_RESULT([$PGSQL_incdir])
320 # LIBS="$LIBS -lpq++ -lpq -lssl -lcrypt -lcrypto"
324 if test "$needsqlite"
327 [ --with-sqlite=<path> root directory path of SQLite installation],
328 [SQLITE_lib_check="$withval/lib/sqlite $with_sqlite/lib"
329 SQLITE_inc_check="$withval/include/sqlite"],
330 [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"
331 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"])
332 AC_ARG_WITH(sqlite-lib,
333 [ --with-sqlite-lib=<path> directory path of SQLite library installation],
334 [SQLITE_lib_check="$withval/lib/sqlite $withval/sqlite $withval"])
335 AC_ARG_WITH(sqlite-includes,
336 [ --with-sqlite-includes=<path>
337 directory path of SQLite header installation],
338 [SQLITE_inc_check="$withval/include/sqlite $withval/sqlite $withval"])
339 AC_MSG_CHECKING([for SQLite library directory])
341 for m in $SQLITE_lib_check; do
343 (test -f "$m/libsqlite.so" || test -f "$m/libsqlite.a")
349 if test -z "$SQLITE_libdir"; then
350 AC_MSG_ERROR([Didn't find the sqlite library dir in '$SQLITE_lib_check'])
352 case "$SQLITE_libdir" in
353 /usr/lib ) SQLITE_lib="" ;;
354 /* ) SQLITE_lib="-L$SQLITE_libdir -Wl,-rpath,$SQLITE_libdir"
355 LDFLAGS="$SQLITE_lib $LDFLAGS"
357 * ) AC_MSG_ERROR([The SQLite library directory ($SQLITE_libdir) must be an absolute path.]) ;;
361 AC_MSG_RESULT([$SQLITE_libdir])
362 AC_MSG_CHECKING([for SQLite include directory])
364 for m in $SQLITE_inc_check; do
365 if test -d "$m" && test -f "$m/sqlite.h"
371 if test -z "$SQLITE_incdir"; then
372 AC_MSG_ERROR([Didn't find the SQLite include dir in '$SQLITE_inc_check'])
374 case "$SQLITE_incdir" in
376 * ) AC_MSG_ERROR([The SQLite include directory ($SQLITE_incdir) must be an absolute path.]) ;;
378 AC_SUBST(SQLITE_incdir)
379 AC_MSG_RESULT([$SQLITE_incdir])
381 # LIBS="$LIBS -lsqlite"
387 moduledirs="$moduledirs ${a}backend"
389 for b in `cat $srcdir/modules/${a}backend/OBJECTFILES`
391 moduleobjects="$moduleobjects ../modules/${a}backend/$b"
393 modulelibs="$modulelibs `cat $srcdir/modules/${a}backend/OBJECTLIBS`"
398 moduledirs="$moduledirs ${a}backend"
403 export moduledirs moduleobjects modulelibs
405 AC_OUTPUT(Makefile modules/Makefile pdns/Makefile codedocs/Makefile \
406 pdns/backends/Makefile pdns/backends/bind/Makefile pdns/pdns pdns/precursor \
407 modules/mysqlbackend/Makefile modules/pdnsbackend/Makefile \
408 modules/gmysqlbackend/Makefile modules/db2backend/Makefile \
409 modules/geobackend/Makefile \
410 modules/pipebackend/Makefile modules/oraclebackend/Makefile \
411 modules/xdbbackend/Makefile modules/odbcbackend/Makefile \
412 modules/gpgsqlbackend/Makefile modules/ldapbackend/Makefile
413 modules/gsqlitebackend/Makefile modules/goraclebackend/Makefile )