root/trunk/pdns/configure.ac @ 2165

Revision 2165, 21.5 KB (checked in by ahu, 2 years ago)

rc1 -> rc2, this is not the release yet I think, but it could be

  • Property svn:eol-style set to native
  • Property svn:keywords set to author date id revision
Line 
1dnl intro
2AC_INIT(pdns/receiver.cc)
3AM_INIT_AUTOMAKE(pdns, 3.0-rc2)
4AC_CANONICAL_HOST
5AM_CONFIG_HEADER(config.h)
6AC_C_BIGENDIAN
7AC_PREREQ(2.52)
8CXXFLAGS="$CXXFLAGS -Wall -O2"
9
10AC_PREFIX_DEFAULT(/usr/local)
11AC_PROG_CC
12AC_PROG_CXX
13AC_PROG_YACC
14AM_PROG_LEX
15AC_PROG_INSTALL
16AC_PROG_MAKE_SET
17AC_PROG_LIBTOOL
18AC_LANG_CPLUSPLUS
19
20BOOST_REQUIRE([1.34])
21BOOST_FOREACH
22#BOOST_FILESYSTEM([mt])
23BOOST_PROGRAM_OPTIONS([mt])
24BOOST_SERIALIZATION([mt])
25#BOOST_SYSTEM([mt])
26
27dnl Check for lua
28AC_MSG_CHECKING(if with lua)
29AC_ARG_WITH(lua, AC_HELP_STRING([--with-lua],[lua]), WITH_LUA=$withval],[WITH_LUA=yes])
30
31AC_MSG_RESULT($WITH_LUA)
32if test "$WITH_LUA" != "no"; then
33 # try pkgconfig
34 if test "$WITH_LUA" = "yes"; then
35      LUAPC=lua
36 else
37      LUAPC=$WITH_LUA
38 fi
39 PKG_CHECK_MODULES(LUA, $LUAPC >= 5.1, [
40        AC_DEFINE([HAVE_LUA], [1], [liblua])
41        AC_DEFINE([HAVE_LUA_H], [1], [lua.h])
42        ],[
43        PKG_CHECK_MODULES(LUA, lua5.1 >= 5.1, [
44                AC_DEFINE([HAVE_LUA], [1], [liblua])
45                AC_DEFINE([HAVE_LUA_H], [1], [lua.h])
46        ],[
47        PKG_CHECK_MODULES(LUA, lua-5.1 >= 5.1, [
48                AC_DEFINE([HAVE_LUA], [1], [liblua])
49                AC_DEFINE([HAVE_LUA_H], [1], [lua.h])
50                ])
51                ])
52        ])
53 AC_SUBST(LUA_CFLAGS)
54 AC_SUBST(LUA_LIBS)
55fi
56                                         
57dnl Checks for header files.
58AC_HEADER_STDC
59AC_CHECK_HEADERS(fcntl.h  getopt.h limits.h strings.h sys/time.h syslog.h unistd.h)
60
61dnl Checks for typedefs, structures, and compiler characteristics.
62AC_TYPE_SIZE_T
63AC_HEADER_TIME
64AC_STRUCT_TM
65
66dnl Checks for library functions.
67AC_TYPE_SIGNAL
68AC_CHECK_FUNCS(gethostname gettimeofday mkdir mktime select socket strerror)
69
70# Check for libdl
71
72LIBS="$LIBS -lz"
73
74my_save_LIBS="$LIBS"
75LIBS=""
76AC_CHECK_LIB(dl,dlopen)
77LIBDL=$LIBS
78LIBS="$my_save_LIBS"
79AC_SUBST(LIBDL)
80
81AC_MSG_CHECKING([for RTLD_NOW]);
82ac_save_LIBS="$LIBS"
83LIBS="$LIBS $LIBDL"
84AC_TRY_LINK(
85[#include <dlfcn.h>],
86[ (void) dlopen("",RTLD_NOW); ],
87has_RTLD_NOW=yes, has_RTLD_NOW=no)
88AC_MSG_RESULT([$has_RTLD_NOW])
89if test "$has_RTLD_NOW" = "no"
90then
91        AC_DEFINE(NEED_RTLD_NOW,,[If host OS misses RTLD_NOW])
92fi
93LIBS=$ac_save_LIBS
94
95DYNLINKFLAGS=""
96THREADFLAGS=""
97
98case "$host_os" in
99solaris2.10)
100        AC_DEFINE(HAVE_IPV6,1,[If the host operating system understands IPv6])
101        LIBS="-lposix4 -lresolv -lnsl -lsocket -lpthread -lrt $LIBS"
102        CXXFLAGS="-D_REENTRANT $CXXFLAGS"
103        ;;
104
105solaris2.8 | solaris2.9 )
106        AC_DEFINE(NEED_POSIX_TYPEDEF,,[If POSIX typedefs need to be defined])
107        AC_DEFINE(NEED_INET_NTOP_PROTO,,[If your OS is so broken that it needs an additional prototype])
108        AC_DEFINE(HAVE_IPV6,1,[If the host operating system understands IPv6])
109        LIBS="-lposix4 -lresolv -lnsl -lsocket -lpthread $LIBS"
110        CXXFLAGS="-D_REENTRANT $CXXFLAGS"
111        ;;
112solaris2.6 | solaris2.7)
113        AC_DEFINE(NEED_POSIX_TYPEDEF,,[If POSIX typedefs need to be defined])
114        AC_DEFINE(NEED_INET_NTOP_PROTO,,[If your OS is so broken that it needs an additional prototype])
115        LIBS="-lposix4 -lresolv -lnsl -lsocket -lpthread $LIBS"
116        CXXFLAGS="-D_REENTRANT $CXXFLAGS"
117        ;;
118linux*)
119        AC_DEFINE(HAVE_IPV6,1,[If the host operating system understands IPv6])
120        DYNLINKFLAGS="-rdynamic"
121        LDFLAGS="$LDFLAGS"
122        THREADFLAGS="-pthread"
123        CXXFLAGS="-D_GNU_SOURCE $CXXFLAGS"
124        ;;
125openbsd*)
126        AC_DEFINE(HAVE_IPV6,1,[If the host operating system understands IPv6])
127        DYNLINKFLAGS="-rdynamic"
128        LDFLAGS="-lc_r $LDFLAGS"
129        CXXFLAGS="-pthread $CXXFLAGS"
130        ;;
131*)
132        AC_DEFINE(HAVE_IPV6,1,[If the host operating system understands IPv6])
133        DYNLINKFLAGS="-rdynamic"
134        LDFLAGS="-pthread $LDFLAGS"
135        CXXFLAGS="-pthread $CXXFLAGS"
136        ;;
137esac
138
139AC_SUBST(THREADFLAGS)
140
141AC_SUBST(DYNLINKFLAGS)
142
143AC_MSG_CHECKING(whether we will be doing verbose logging)
144AC_ARG_ENABLE(verbose-logging,
145 [  --enable-verbose-logging    Do verbose logging],enable_verbose_logging=yes ,enable_verbose_logging=no)
146
147if test $enable_verbose_logging = yes; then AC_DEFINE(VERBOSELOG, 1, [If verbose logging should be enabled])
148fi
149AC_MSG_RESULT($enable_verbose_logging)
150
151AC_MSG_CHECKING(whether we will be linking in Botan 1.9)
152AC_ARG_ENABLE(botan1.9,
153 [  --enable-botan1.9   Use Botan 1.9],enable_botan19=yes, enable_botan19=no)
154AC_MSG_RESULT($enable_botan19)
155AM_CONDITIONAL(BOTAN19,test x"$enable_botan19" = "xyes")
156
157AC_MSG_CHECKING(whether we will be linking in Botan 1.8)
158AC_ARG_ENABLE(botan1.8,
159 [  --enable-botan1.8   Use Botan 1.8],enable_botan18=yes, enable_botan18=no)
160AC_MSG_RESULT($enable_botan18)
161AM_CONDITIONAL(BOTAN18,test x"$enable_botan18" = "xyes")
162
163AC_MSG_CHECKING(whether we will be linking in Crypto++)
164AC_ARG_ENABLE(cryptopp,
165 [  --enable-cryptopp   Use Crypto++],enable_cryptopp=yes, enable_cryptopp=no)
166AC_MSG_RESULT($enable_cryptopp)
167AM_CONDITIONAL(CRYPTOPP,test x"$enable_cryptopp" = "xyes")
168
169
170AC_MSG_CHECKING(whether we should build static binaries)
171
172AC_ARG_ENABLE(static-binaries,
173        [  --enable-static-binaries     Build static binaries],
174     [case "${enableval}" in
175       yes) static=true ;;
176       no)  static=false ;;
177       *) AC_MSG_ERROR(bad value ${enableval} for --enable-static-binaries) ;;
178     esac],[debug=false])
179AC_MSG_RESULT($static)
180
181AM_CONDITIONAL(ALLSTATIC, test x$static = xtrue)
182
183if test x$static = xtrue;
184then
185        LDFLAGS="-all-static $LDFLAGS"
186fi
187
188
189
190modules="gmysql geo"
191AC_ARG_WITH(modules, [  --with-modules Which backends to compile with ],
192[
193        modules="$withval" 
194])
195
196dynmodules="pipe"
197AC_ARG_WITH(dynmodules, [  --with-dynmodules Which backends to build for dynamic loading ],
198[
199        dynmodules="$withval" 
200])
201
202
203
204AC_SUBST(socketdir)
205socketdir="/var/run"
206AC_ARG_WITH(socketdir, [  --with-socketdir Where the controlsocket lives ],
207[
208        socketdir="$withval" 
209])
210
211AC_SUBST(moduledirs)
212AC_SUBST(moduleobjects)
213AC_SUBST(modulelibs)
214
215AC_MSG_CHECKING(whether we will be building the server)
216AC_ARG_ENABLE(pdns-server,
217 [  --enable-pdns_server        If we should build the server],
218        enable_pdns_server=$enableval,
219        enable_pdns_server=yes)
220
221AC_MSG_RESULT($enable_pdns_server)
222
223if test x"$enable_pdns_server" = "xyes"
224then
225        programdescend=pdns
226fi
227
228AC_SUBST(programdescend)
229
230AC_ARG_ENABLE(gcc-skip-locking,
231 [ --enable-gcc-skip-locking    If we should forcefully skip gcc locking],
232        AC_DEFINE(GCC_SKIP_LOCKING,,[Skip gcc locking]),
233 )
234
235AC_MSG_CHECKING(whether we will be building the recursor)
236AC_ARG_ENABLE(recursor,
237 [  --enable-recursor   If we should build the recursor],
238        enable_recursor=$enableval,
239        enable_recursor=no )
240
241AC_MSG_RESULT($enable_recursor)
242AM_CONDITIONAL(RECURSOR,test x"$enable_recursor" = "xyes")
243
244for a in $modules $dynmodules
245do
246        case "$a" in
247                mysql )
248                        needmysql=yes
249                ;;
250                gmysql )
251                        needmysql=yes
252                ;;
253                mydns )
254                        needmysql=yes
255                ;;
256                gpgsql )
257                        needpgsql=yes
258                ;;
259                gsqlite )
260                        needsqlite=yes
261                ;;
262                gsqlite3 )
263                        needsqlite3=yes
264                ;;
265                pdns )
266                        needmysql=yes
267                ;;
268                ldap)
269                        AC_CHECK_HEADERS([ldap.h], , [AC_MSG_ERROR([ldap header (ldap.h) not found])])
270                        AC_CHECK_HEADERS([lber.h], , [AC_MSG_ERROR([ldap header (lber.h) not found])])
271                        AC_SUBST([LIBLDAP])
272                        AC_CHECK_LIB(
273                                [ldap_r], [ldap_set_option],
274                                [AC_DEFINE([HAVE_LIBLDAP_R], 1, [Have -lldap_r]) LIBLDAP="ldap_r"],
275                                [AC_CHECK_LIB(
276                                        [ldap], [ldap_set_option],
277                                        [AC_DEFINE([HAVE_LIBLDAP], 1, [Have -lldap]) LIBLDAP="ldap"],
278                                        [AC_MSG_ERROR([ldap library (libldap) not found])]
279                                )]
280                        )
281                        AC_CHECK_LIB(
282                                [$LIBLDAP], [ldap_initialize],
283                                [AC_DEFINE([HAVE_LDAP_INITIALIZE], 1, [Define to 1 if you have ldap_initialize])]
284                        )
285                        AC_CHECK_LIB(
286                                [$LIBLDAP], [ldap_sasl_bind],
287                                [AC_DEFINE([HAVE_LDAP_SASL_BIND], 1, [Define to 1 if you have ldap_sasl_bind])]
288                        )
289                ;;
290                godbc )
291                        needunixodbc=yes
292                ;;
293                opendbx)
294                        AC_CHECK_HEADERS([odbx.h], , [AC_MSG_ERROR([opendbx header (odbx.h) not found])])
295                        AC_SUBST([LIBOPENDBX])
296                        AC_CHECK_LIB(
297                                [opendbx], [odbx_init],
298                                [AC_DEFINE([HAVE_LIBOPENDBX], 1, [Have -lopendbx]) LIBOPENDBX="opendbx"]
299                        )
300                ;;
301        esac
302done
303
304
305if test "$needmysql"
306then
307        AC_ARG_WITH(mysql,
308            [  --with-mysql=<path>     root directory path of MySQL installation],
309            [MYSQL_lib_check="$withval/lib/mysql $with_mysql/lib"
310        MYSQL_inc_check="$withval/include/mysql"],
311            [MYSQL_lib_check="/usr/local/mysql/lib/mysql /usr/local/lib/mysql /opt/mysql/lib/mysql \
312                /usr/lib/mysql /usr/lib64/mysql /usr/local/mysql/lib /usr/local/lib /opt/mysql/lib /usr/lib \
313                /usr/sfw/lib/"
314        MYSQL_inc_check="/usr/local/mysql/include/mysql /usr/local/include/mysql \
315                /opt/mysql/include/mysql /opt/mysql/include /usr/include/mysql /usr/sfw/include/mysql"])
316                AC_ARG_WITH(mysql-lib,
317            [  --with-mysql-lib=<path> directory path of MySQL library installation],
318            [MYSQL_lib_check="$withval/lib/mysql $withval/mysql $withval"])
319                AC_ARG_WITH(mysql-includes,
320            [  --with-mysql-includes=<path>
321                         directory path of MySQL header installation],
322            [MYSQL_inc_check="$withval/include/mysql $withval/mysql $withval"])
323                AC_MSG_CHECKING([for MySQL library directory])
324        MYSQL_libdir=
325        for m in $MYSQL_lib_check; do
326                if test -d "$m" && \
327                   (test -f "$m/libmysqlclient.so" || test -f "$m/libmysqlclient.a")
328                then
329                        MYSQL_libdir=$m
330                        break
331                fi
332        done
333                if test -z "$MYSQL_libdir"; then
334                AC_MSG_ERROR([Didn't find the mysql library dir in '$MYSQL_lib_check'])
335        fi
336        case "$MYSQL_libdir" in
337                 /usr/lib ) MYSQL_lib="" ;;
338          /* ) MYSQL_lib=-L$MYSQL_libdir; LDFLAGS="$MYSQL_lib $LDFLAGS";;
339          * )  AC_MSG_ERROR([The MySQL library directory ($MYSQL_libdir) must be an absolute path.]) ;;
340        esac
341       
342        AC_SUBST(MYSQL_lib)
343       
344        AC_MSG_RESULT([$MYSQL_libdir])
345                AC_MSG_CHECKING([for MySQL include directory])
346        MYSQL_incdir=
347        for m in $MYSQL_inc_check; do
348                if test -d "$m" && test -f "$m/mysql.h"
349                then
350                        MYSQL_incdir=$m
351                        break
352                fi
353        done
354                if test -z "$MYSQL_incdir"; then
355                AC_MSG_ERROR([Didn't find the mysql include dir in '$MYSQL_inc_check'])
356        fi
357       
358        case "$MYSQL_incdir" in
359          /* ) ;;
360          * )  AC_MSG_ERROR([The MySQL include directory ($MYSQL_incdir) must be an absolute path.]) ;;
361        esac
362       
363        AC_SUBST(MYSQL_incdir)
364        AC_MSG_RESULT([$MYSQL_incdir])
365#       LIBS="$LIBS -lmysqlclient"
366fi
367
368
369
370if test "$needpgsql"
371then
372        AC_ARG_WITH(pgsql,
373            [  --with-pgsql=<path>     root directory path of PgSQL installation],
374            [PGSQL_lib_check="$withval/lib/pgsql $with_pgsql/lib"
375        PGSQL_inc_check="$withval/include/pgsql"],
376            [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"
377        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"])
378                AC_ARG_WITH(pgsql-lib,
379            [  --with-pgsql-lib=<path> directory path of PgSQL library installation],
380            [PGSQL_lib_check="$withval/lib/pgsql $withval/pgsql $withval"])
381                AC_ARG_WITH(pgsql-includes,
382            [  --with-pgsql-includes=<path>
383                         directory path of PgSQL header installation],
384            [PGSQL_inc_check="$withval/include/pgsql $withval/pgsql $withval"])
385                AC_MSG_CHECKING([for PgSQL library directory])
386        PGSQL_libdir=
387        for m in $PGSQL_lib_check; do
388                if test -d "$m" && \
389                   (test -f "$m/libpq.a" || test -f "$m/libpq.so")
390                then
391                        PGSQL_libdir=$m
392                        break
393                fi
394        done
395                if test -z "$PGSQL_libdir"; then
396                AC_MSG_ERROR([Didn't find the pgsql library dir in '$PGSQL_lib_check'])
397        fi
398        case "$PGSQL_libdir" in
399           /usr/lib ) PGSQL_lib="" ;;
400          /* ) PGSQL_lib="-L$PGSQL_libdir -Wl,-rpath,$PGSQL_libdir"
401               LDFLAGS="$PGSQL_lib $LDFLAGS"
402               ;;
403          * )  AC_MSG_ERROR([The PgSQL library directory ($PGSQL_libdir) must be an absolute path.]) ;;
404        esac
405
406        AC_SUBST(PGSQL_lib)
407        AC_MSG_RESULT([$PGSQL_libdir])
408                AC_MSG_CHECKING([for PgSQL include directory])
409        PGSQL_incdir=
410        for m in $PGSQL_inc_check; do
411                if test -d "$m" && test -f "$m/libpq-fe.h"
412                then
413                        PGSQL_incdir=$m
414                        break
415                fi
416        done
417                if test -z "$PGSQL_incdir"; then
418                AC_MSG_ERROR([Didn't find the PgSQL include dir in '$PGSQL_inc_check'])
419        fi
420        case "$PGSQL_incdir" in
421          /* ) ;;
422          * )  AC_MSG_ERROR([The PgSQL include directory ($PGSQL_incdir) must be an absolute path.]) ;;
423        esac
424        AC_SUBST(PGSQL_incdir)
425        AC_MSG_RESULT([$PGSQL_incdir])
426
427#       LIBS="$LIBS -lpq++ -lpq -lssl -lcrypt -lcrypto"
428fi
429
430
431if test "$needsqlite"
432then
433        AC_ARG_WITH(sqlite,
434            [  --with-sqlite=<path>     root directory path of SQLite installation],
435            [SQLITE_lib_check="$withval/lib/sqlite $with_sqlite/lib"
436        SQLITE_inc_check="$withval/include/sqlite"],
437            [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"
438        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"])
439                AC_ARG_WITH(sqlite-lib,
440            [  --with-sqlite-lib=<path> directory path of SQLite library installation],
441            [SQLITE_lib_check="$withval/lib/sqlite $withval/sqlite $withval"])
442                AC_ARG_WITH(sqlite-includes,
443            [  --with-sqlite-includes=<path>
444                         directory path of SQLite header installation],
445            [SQLITE_inc_check="$withval/include/sqlite $withval/sqlite $withval"])
446                AC_MSG_CHECKING([for SQLite library directory])
447        SQLITE_libdir=
448        for m in $SQLITE_lib_check; do
449                if test -d "$m" && \
450                   (test -f "$m/libsqlite.so" || test -f "$m/libsqlite.a")
451                then
452                        SQLITE_libdir=$m
453                        break
454                fi
455        done
456                if test -z "$SQLITE_libdir"; then
457                AC_MSG_ERROR([Didn't find the sqlite library dir in '$SQLITE_lib_check'])
458        fi
459        case "$SQLITE_libdir" in
460           /usr/lib ) SQLITE_lib="" ;;
461          /* ) SQLITE_lib="-L$SQLITE_libdir -Wl,-rpath,$SQLITE_libdir"
462               LDFLAGS="$SQLITE_lib $LDFLAGS"
463               ;;
464          * )  AC_MSG_ERROR([The SQLite library directory ($SQLITE_libdir) must be an absolute path.]) ;;
465        esac
466
467        AC_SUBST(SQLITE_lib)
468        AC_MSG_RESULT([$SQLITE_libdir])
469                AC_MSG_CHECKING([for SQLite include directory])
470        SQLITE_incdir=
471        for m in $SQLITE_inc_check; do
472                if test -d "$m" && test -f "$m/sqlite.h"
473                then
474                        SQLITE_incdir=$m
475                        break
476                fi
477        done
478                if test -z "$SQLITE_incdir"; then
479                AC_MSG_ERROR([Didn't find the SQLite include dir in '$SQLITE_inc_check'])
480        fi
481        case "$SQLITE_incdir" in
482          /* ) ;;
483          * )  AC_MSG_ERROR([The SQLite include directory ($SQLITE_incdir) must be an absolute path.]) ;;
484        esac
485        AC_SUBST(SQLITE_incdir)
486        AC_MSG_RESULT([$SQLITE_incdir])
487
488#       LIBS="$LIBS -lsqlite"
489fi
490
491if test "$needsqlite3"
492then
493        AC_ARG_WITH(sqlite3,
494            [  --with-sqlite3=<path>     root directory path of SQLite3 installation],
495            [SQLITE3_lib_check="$withval/lib/sqlite3 $with_sqlite3/lib"
496             SQLITE3_inc_check="$withval/include/sqlite3"],
497            [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"
498             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"])
499        AC_ARG_WITH(sqlite3-lib,
500            [  --with-sqlite3-lib=<path> directory path of SQLite3 library installation],
501            [SQLITE3_lib_check="$withval/lib/sqlite3 $withval/sqlite3 $withval"])
502        AC_ARG_WITH(sqlite3-includes,
503            [  --with-sqlite3-includes=<path> directory path of SQLite3 header installation],
504            [SQLITE3_inc_check="$withval/include/sqlite3 $withval/sqlite3 $withval"])
505        AC_MSG_CHECKING([for SQLite3 library directory])
506        SQLITE3_libdir=
507        for m in $SQLITE3_lib_check; do
508                if test -d "$m" && \
509                   (test -f "$m/libsqlite3.so" || test -f "$m/libsqlite3.a")
510                then
511                        SQLITE3_libdir=$m
512                        break
513                fi
514        done
515                if test -z "$SQLITE3_libdir"; then
516                AC_MSG_ERROR([Didn't find the sqlite3 library dir in '$SQLITE3_lib_check'])
517        fi
518        case "$SQLITE3_libdir" in
519           /usr/lib ) SQLITE3_lib="" ;;
520          /* ) SQLITE3_lib="-L$SQLITE3_libdir -Wl,-rpath,$SQLITE3_libdir"
521               LDFLAGS="$SQLITE3_lib $LDFLAGS"
522               ;;
523          * )  AC_MSG_ERROR([The SQLite3 library directory ($SQLITE3_libdir) must be an absolute path.]) ;;
524        esac
525
526        AC_SUBST(SQLITE3_lib)
527        AC_MSG_RESULT([$SQLITE3_libdir])
528        AC_MSG_CHECKING([for SQLite3 include directory])
529        SQLITE3_incdir=
530        for m in $SQLITE3_inc_check; do
531                if test -d "$m" && test -f "$m/sqlite3.h"
532                then
533                        SQLITE3_incdir=$m
534                        break
535                fi
536        done
537                if test -z "$SQLITE3_incdir"; then
538                AC_MSG_ERROR([Didn't find the SQLite3 include dir in '$SQLITE3_inc_check'])
539        fi
540        case "$SQLITE3_incdir" in
541          /* ) ;;
542          * )  AC_MSG_ERROR([The SQLite3 include directory ($SQLITE3_incdir) must be an absolute path.]) ;;
543        esac
544        AC_SUBST(SQLITE3_incdir)
545        AC_MSG_RESULT([$SQLITE3_incdir])
546
547#       LIBS="$LIBS -lsqlite3"
548fi
549
550if test "$needunixodbc"
551then
552        AC_ARG_WITH(unixodbc,
553            [  --with-unixodbc=<path>     root directory path of unixodbc installation],
554            [UNIXODBC_lib_check="$withval/lib/unixodbc $with_unixodbc/lib $withval/lib"
555             UNIXODBC_inc_check="$withval/include/unixodbc"],
556            [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"
557             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"])
558        AC_ARG_WITH(unixodbc-lib,
559            [  --with-unixodbc-lib=<path> directory path of unixodbc library installation],
560            [UNIXODBC_lib_check="$withval/lib/unixodbc $withval/unixodbc $withval"])
561        AC_ARG_WITH(unixodbc-includes,
562            [  --with-unixodbc-includes=<path> directory path of unixodbc header installation],
563            [UNIXODBC_inc_check="$withval/include $withval/include/unixodbc $withval/unixodbc $withval"])
564        AC_MSG_CHECKING([for SQLite3 library directory])
565        UNIXODBC_libdir=
566        for m in $UNIXODBC_lib_check; do
567                if test -d "$m" && \
568                   (test -f "$m/libodbc.so" || test -f "$m/libodbc.a")
569                then
570                        UNIXODBC_libdir=$m
571                        break
572                fi
573        done
574                if test -z "$UNIXODBC_libdir"; then
575                AC_MSG_ERROR([Didn't find the unixodbc library dir in '$UNIXODBC_lib_check'])
576        fi
577        case "$UNIXODBC_libdir" in
578           /usr/lib ) UNIXODBC_lib="" ;;
579          /* ) UNIXODBC_lib="-L$UNIXODBC_libdir -Wl,-rpath,$UNIXODBC_libdir"
580               LDFLAGS="$UNIXODBC_lib $LDFLAGS"
581               ;;
582          * )  AC_MSG_ERROR([The unixodbc library directory ($UNIXODBC_libdir) must be an absolute path.]) ;;
583        esac
584
585        AC_SUBST(UNIXODBC_lib)
586        AC_MSG_RESULT([$UNIXODBC_libdir])
587        AC_MSG_CHECKING([for unixodbc include directory])
588        UNIXODBC_incdir=
589        for m in $UNIXODBC_inc_check; do
590                if test -d "$m" && test -f "$m/sql.h"
591                then
592                        UNIXODBC_incdir=$m
593                        break
594                fi
595        done
596                if test -z "$UNIXODBC_incdir"; then
597                AC_MSG_ERROR([Didn't find the unixodbc include dir in '$UNIXODBC_inc_check'])
598        fi
599        case "$UNIXODBC_incdir" in
600          /* ) ;;
601          * )  AC_MSG_ERROR([The unixodbc include directory ($UNIXODBC_incdir) must be an absolute path.]) ;;
602        esac
603        AC_SUBST(UNIXODBC_incdir)
604        AC_MSG_RESULT([$UNIXODBC_incdir])
605
606#       LIBS="$LIBS -lunixodbc"
607fi
608
609for a in $modules
610do
611        moduledirs="$moduledirs ${a}backend"
612
613        for b in `cat $srcdir/modules/${a}backend/OBJECTFILES`
614        do
615                moduleobjects="$moduleobjects ../modules/${a}backend/$b"
616        done
617        modulelibs="$modulelibs `cat $srcdir/modules/${a}backend/OBJECTLIBS`"
618
619        if test ${a} == "gpgsql"; then
620                case "$host_os" in
621                freebsd*)
622                        ;;
623                *)
624                        modulelibs="$modulelibs -lresolv -lnsl"
625                        ;;
626                esac
627        fi
628done
629
630for a in $dynmodules
631do
632        moduledirs="$moduledirs ${a}backend"
633done
634
635AC_SUBST(LIBS)
636
637export moduledirs moduleobjects modulelibs
638
639AC_OUTPUT(Makefile modules/Makefile pdns/Makefile codedocs/Makefile \
640pdns/backends/Makefile pdns/backends/bind/Makefile pdns/pdns pdns/precursor \
641modules/mysqlbackend/Makefile modules/pdnsbackend/Makefile \
642modules/gmysqlbackend/Makefile modules/db2backend/Makefile \
643modules/geobackend/Makefile modules/opendbxbackend/Makefile \
644modules/pipebackend/Makefile modules/oraclebackend/Makefile \
645modules/xdbbackend/Makefile modules/godbcbackend/Makefile \
646modules/odbcbackend/Makefile modules/mongodbbackend/Makefile \
647modules/gpgsqlbackend/Makefile modules/ldapbackend/Makefile
648modules/gsqlitebackend/Makefile modules/gsqlite3backend/Makefile
649modules/goraclebackend/Makefile modules/mydnsbackend/Makefile)
Note: See TracBrowser for help on using the browser.