~ubuntu-branches/ubuntu/utopic/pdns/utopic-updates

« back to all changes in this revision

Viewing changes to .pc/conditional-system-polarssl/configure.ac

  • Committer: Package Import Robot
  • Author(s): Marc Haber, Marc Haber, Evgeni Golov
  • Date: 2012-05-11 23:51:27 UTC
  • mfrom: (1.1.9) (12.1.14 sid)
  • Revision ID: package-import@ubuntu.com-20120511235127-v0qjuaplfckcb2cd
Tags: 3.1-1
[ Marc Haber ]
* Imported Upstream version 3.1
  * reduce column size for 'algorithm' to 50. Closes: #662935
  * handle smallcaps RRs. Closes: #656788
* refresh patches
* remove unused patches
* add patch to turn off the traceback handler at run time
* add patch for changeset 2575 (race condition with supermasters)
* fix mysql multiarch build failure, set cflags etc to hardening defaults
* do not run bootstrap a build time, using autotools_dev
* use dh-autoreconf, remove autofoo created files from
  patches/fix-mongodb-backend-patch
* fix dh invocation
* create MySQL databases with engine=innodb instead of type
* set debian/compat to 9
* Standards-Version: 3.9.3 (no changes needed)
* add myself to uploaders, change Vcs-Header to my git. Closes: #672550

[ Evgeni Golov ]
* use system libpolarssl if present, local copy otherwise.
  Closes: #671856, #656861

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
dnl intro
 
2
AC_INIT(pdns/receiver.cc)
 
3
AM_INIT_AUTOMAKE(pdns, 3.1)
 
4
AC_CANONICAL_HOST
 
5
AM_CONFIG_HEADER(config.h)
 
6
AC_C_BIGENDIAN 
 
7
AC_PREREQ(2.52)
 
8
: ${CXXFLAGS="-Wall -O2"}
 
9
AC_PREFIX_DEFAULT(/usr/local)
 
10
AC_PROG_CC
 
11
AC_PROG_CXX
 
12
AC_PROG_YACC
 
13
AM_PROG_LEX
 
14
AC_PROG_INSTALL
 
15
AC_PROG_MAKE_SET
 
16
AC_PROG_LIBTOOL 
 
17
AC_LANG_CPLUSPLUS
 
18
 
 
19
BOOST_REQUIRE([1.34])
 
20
BOOST_FOREACH
 
21
#BOOST_FILESYSTEM([mt])
 
22
BOOST_PROGRAM_OPTIONS([mt])
 
23
BOOST_SERIALIZATION([mt])
 
24
#BOOST_SYSTEM([mt])
 
25
 
 
26
dnl Check for lua
 
27
AC_MSG_CHECKING(if with lua)
 
28
AC_ARG_WITH(lua, AC_HELP_STRING([--with-lua],[lua]), [WITH_LUA=$withval],[WITH_LUA=yes])
 
29
 
 
30
AC_MSG_RESULT($WITH_LUA)
 
31
if test "$WITH_LUA" != "no"; then
 
32
 # try pkgconfig
 
33
 if test "$WITH_LUA" = "yes"; then
 
34
      LUAPC=lua
 
35
 else
 
36
      LUAPC=$WITH_LUA
 
37
 fi
 
38
 PKG_CHECK_MODULES(LUA, $LUAPC >= 5.1, [
 
39
        AC_DEFINE([HAVE_LUA], [1], [liblua])
 
40
        AC_DEFINE([HAVE_LUA_H], [1], [lua.h])
 
41
        ],[
 
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])
 
45
        ],[
 
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])
 
49
                ]) 
 
50
                ]) 
 
51
        ])
 
52
 AC_SUBST(LUA_CFLAGS)
 
53
 AC_SUBST(LUA_LIBS)
 
54
fi
 
55
         
 
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)
 
60
SQLITE3PC=sqlite3
 
61
if test "$WITH_SQLITE3" != "no"; then
 
62
  needsqlite3=yes
 
63
  if test "$WITH_SQLITE3" != "yes"; then
 
64
    SQLITE3PC=$WITH_SQLITE3
 
65
  fi
 
66
fi
 
67
 
 
68
dnl Checks for header files.
 
69
AC_HEADER_STDC
 
70
AC_CHECK_HEADERS(fcntl.h  getopt.h limits.h strings.h sys/time.h syslog.h unistd.h)
 
71
 
 
72
dnl Checks for typedefs, structures, and compiler characteristics.
 
73
AC_TYPE_SIZE_T
 
74
AC_HEADER_TIME
 
75
AC_STRUCT_TM
 
76
 
 
77
dnl Checks for library functions.
 
78
AC_TYPE_SIGNAL
 
79
AC_CHECK_FUNCS(gethostname gettimeofday mkdir mktime select socket strerror)
 
80
 
 
81
# Check for libdl
 
82
 
 
83
LIBS="$LIBS -lz"
 
84
 
 
85
my_save_LIBS="$LIBS"
 
86
LIBS=""
 
87
AC_CHECK_LIB(dl,dlopen)
 
88
LIBDL=$LIBS
 
89
LIBS="$my_save_LIBS"
 
90
AC_SUBST(LIBDL)
 
91
 
 
92
AC_MSG_CHECKING([for RTLD_NOW]);
 
93
ac_save_LIBS="$LIBS"
 
94
LIBS="$LIBS $LIBDL"
 
95
AC_TRY_LINK(
 
96
[#include <dlfcn.h>],
 
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"
 
101
then
 
102
        AC_DEFINE(NEED_RTLD_NOW,,[If host OS misses RTLD_NOW])
 
103
fi
 
104
LIBS=$ac_save_LIBS
 
105
 
 
106
# Check for libcrypt
 
107
 
 
108
my_save_LIBS="$LIBS"
 
109
LIBS=""
 
110
AC_CHECK_LIB(crypt, crypt)
 
111
LIBCRYPT=$LIBS
 
112
LIBS="$my_save_LIBS"
 
113
AC_SUBST(LIBCRYPT)
 
114
 
 
115
DYNLINKFLAGS=""
 
116
THREADFLAGS=""
 
117
 
 
118
case "$host_os" in
 
119
solaris2.10)
 
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"
 
123
        ;;
 
124
 
 
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"
 
131
        ;;
 
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"
 
137
        ;;
 
138
linux*)
 
139
        AC_DEFINE(HAVE_IPV6,1,[If the host operating system understands IPv6])
 
140
        DYNLINKFLAGS="-rdynamic"
 
141
        LDFLAGS="$LDFLAGS"
 
142
        THREADFLAGS="-pthread"
 
143
        CXXFLAGS="-D_GNU_SOURCE $CXXFLAGS"
 
144
        ;;
 
145
*)
 
146
        AC_DEFINE(HAVE_IPV6,1,[If the host operating system understands IPv6])
 
147
        DYNLINKFLAGS="-rdynamic"
 
148
        LDFLAGS="-pthread $LDFLAGS"
 
149
        CXXFLAGS="-pthread $CXXFLAGS"
 
150
        ;;
 
151
esac
 
152
 
 
153
AC_SUBST(THREADFLAGS)
 
154
 
 
155
AC_SUBST(DYNLINKFLAGS)
 
156
 
 
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)
 
160
 
 
161
if test $enable_verbose_logging = yes; then AC_DEFINE(VERBOSELOG, 1, [If verbose logging should be enabled]) 
 
162
fi
 
163
AC_MSG_RESULT($enable_verbose_logging)
 
164
 
 
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")
 
170
 
 
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")
 
176
 
 
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")
 
182
 
 
183
 
 
184
AC_MSG_CHECKING(whether we should build static binaries)
 
185
 
 
186
AC_ARG_ENABLE(static-binaries, 
 
187
        [  --enable-static-binaries     Build static binaries],
 
188
     [case "${enableval}" in
 
189
       yes) static=true ;;
 
190
       no)  static=false ;;
 
191
       *) AC_MSG_ERROR(bad value ${enableval} for --enable-static-binaries) ;;
 
192
     esac],[debug=false])
 
193
AC_MSG_RESULT($static)
 
194
 
 
195
AM_CONDITIONAL(ALLSTATIC, test x$static = xtrue)
 
196
 
 
197
if test x$static = xtrue; 
 
198
then 
 
199
        LDFLAGS="-all-static $LDFLAGS"
 
200
fi
 
201
 
 
202
 
 
203
 
 
204
modules="gmysql geo"
 
205
AC_ARG_WITH(modules, [  --with-modules Which backends to compile with ], 
 
206
[
 
207
        modules="$withval"  
 
208
])
 
209
 
 
210
dynmodules="pipe"
 
211
AC_ARG_WITH(dynmodules, [  --with-dynmodules Which backends to build for dynamic loading ], 
 
212
[
 
213
        dynmodules="$withval"  
 
214
])
 
215
 
 
216
 
 
217
 
 
218
AC_SUBST(socketdir)
 
219
socketdir="/var/run"
 
220
AC_ARG_WITH(socketdir, [  --with-socketdir Where the controlsocket lives ], 
 
221
[
 
222
        socketdir="$withval"  
 
223
])
 
224
 
 
225
AC_SUBST(moduledirs)
 
226
AC_SUBST(moduleobjects)
 
227
AC_SUBST(modulelibs)
 
228
 
 
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)
 
234
 
 
235
AC_MSG_RESULT($enable_pdns_server)
 
236
 
 
237
if test x"$enable_pdns_server" = "xyes"
 
238
then 
 
239
        programdescend=pdns
 
240
fi
 
241
 
 
242
AC_SUBST(programdescend)
 
243
 
 
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]),
 
247
 )
 
248
 
 
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,
 
253
        enable_recursor=no )
 
254
 
 
255
AC_MSG_RESULT($enable_recursor)
 
256
AM_CONDITIONAL(RECURSOR,test x"$enable_recursor" = "xyes")
 
257
 
 
258
for a in $modules $dynmodules
 
259
do
 
260
        case "$a" in
 
261
                gmysql )
 
262
                        needmysql=yes
 
263
                ;;
 
264
                mydns )
 
265
                        needmysql=yes
 
266
                ;;
 
267
                gpgsql )
 
268
                        needpgsql=yes
 
269
                ;;
 
270
                gsqlite )
 
271
                        needsqlite=yes
 
272
                ;;
 
273
                gsqlite3 )
 
274
                        needsqlite3=yes
 
275
                ;;
 
276
                pdns )
 
277
                        needmysql=yes
 
278
                ;;
 
279
                ldap)
 
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])])
 
282
                        AC_SUBST([LIBLDAP])
 
283
                        AC_CHECK_LIB(
 
284
                                [ldap_r], [ldap_set_option],
 
285
                                [AC_DEFINE([HAVE_LIBLDAP_R], 1, [Have -lldap_r]) LIBLDAP="ldap_r"],
 
286
                                [AC_CHECK_LIB(
 
287
                                        [ldap], [ldap_set_option],
 
288
                                        [AC_DEFINE([HAVE_LIBLDAP], 1, [Have -lldap]) LIBLDAP="ldap"],
 
289
                                        [AC_MSG_ERROR([ldap library (libldap) not found])]
 
290
                                )]
 
291
                        )
 
292
                        AC_CHECK_LIB(
 
293
                                [$LIBLDAP], [ldap_initialize],
 
294
                                [AC_DEFINE([HAVE_LDAP_INITIALIZE], 1, [Define to 1 if you have ldap_initialize])]
 
295
                        )
 
296
                        AC_CHECK_LIB(
 
297
                                [$LIBLDAP], [ldap_sasl_bind],
 
298
                                [AC_DEFINE([HAVE_LDAP_SASL_BIND], 1, [Define to 1 if you have ldap_sasl_bind])]
 
299
                        )
 
300
                ;;
 
301
                godbc )
 
302
                        needunixodbc=yes
 
303
                ;;
 
304
                opendbx)
 
305
                        AC_CHECK_HEADERS([odbx.h], , [AC_MSG_ERROR([opendbx header (odbx.h) not found])])
 
306
                        AC_SUBST([LIBOPENDBX])
 
307
                        AC_CHECK_LIB(
 
308
                                [opendbx], [odbx_init],
 
309
                                [AC_DEFINE([HAVE_LIBOPENDBX], 1, [Have -lopendbx]) LIBOPENDBX="opendbx"]
 
310
                        )
 
311
                ;;
 
312
                tinydns)
 
313
                        needcdb=yes
 
314
                ;;
 
315
        esac
 
316
done
 
317
 
 
318
 
 
319
if test "$needmysql"
 
320
then
 
321
        AC_ARG_WITH(mysql,
 
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 \
 
327
                /usr/sfw/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])
 
338
        MYSQL_libdir=
 
339
        for m in $MYSQL_lib_check; do
 
340
                if test -d "$m" && \
 
341
                   (test -f "$m/libmysqlclient.so" || test -f "$m/libmysqlclient.a")
 
342
                then
 
343
                        MYSQL_libdir=$m
 
344
                        break
 
345
                fi
 
346
        done
 
347
                if test -z "$MYSQL_libdir"; then
 
348
                AC_MSG_ERROR([Didn't find the mysql library dir in '$MYSQL_lib_check'])
 
349
        fi
 
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.]) ;;
 
354
        esac
 
355
        
 
356
        AC_SUBST(MYSQL_lib)
 
357
        
 
358
        AC_MSG_RESULT([$MYSQL_libdir])
 
359
                AC_MSG_CHECKING([for MySQL include directory])
 
360
        MYSQL_incdir=
 
361
        for m in $MYSQL_inc_check; do
 
362
                if test -d "$m" && test -f "$m/mysql.h"
 
363
                then
 
364
                        MYSQL_incdir=$m
 
365
                        break
 
366
                fi
 
367
        done
 
368
                if test -z "$MYSQL_incdir"; then
 
369
                AC_MSG_ERROR([Didn't find the mysql include dir in '$MYSQL_inc_check'])
 
370
        fi
 
371
        
 
372
        case "$MYSQL_incdir" in
 
373
          /* ) ;;
 
374
          * )  AC_MSG_ERROR([The MySQL include directory ($MYSQL_incdir) must be an absolute path.]) ;;
 
375
        esac
 
376
        
 
377
        AC_SUBST(MYSQL_incdir)
 
378
        AC_MSG_RESULT([$MYSQL_incdir])
 
379
#       LIBS="$LIBS -lmysqlclient"
 
380
fi
 
381
 
 
382
 
 
383
 
 
384
if test "$needpgsql" 
 
385
then
 
386
        AC_ARG_WITH(pgsql,
 
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])
 
400
        PGSQL_libdir=
 
401
        for m in $PGSQL_lib_check; do
 
402
                if test -d "$m" && \
 
403
                   (test -f "$m/libpq.a" || test -f "$m/libpq.so")
 
404
                then
 
405
                        PGSQL_libdir=$m
 
406
                        break
 
407
                fi
 
408
        done
 
409
                if test -z "$PGSQL_libdir"; then
 
410
                AC_MSG_ERROR([Didn't find the pgsql library dir in '$PGSQL_lib_check'])
 
411
        fi
 
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"
 
417
               ;;
 
418
          * )  AC_MSG_ERROR([The PgSQL library directory ($PGSQL_libdir) must be an absolute path.]) ;;
 
419
        esac
 
420
 
 
421
        AC_SUBST(PGSQL_lib)
 
422
        AC_MSG_RESULT([$PGSQL_libdir])
 
423
                AC_MSG_CHECKING([for PgSQL include directory])
 
424
        PGSQL_incdir=
 
425
        for m in $PGSQL_inc_check; do
 
426
                if test -d "$m" && test -f "$m/libpq-fe.h"
 
427
                then
 
428
                        PGSQL_incdir=$m
 
429
                        break
 
430
                fi
 
431
        done
 
432
                if test -z "$PGSQL_incdir"; then
 
433
                AC_MSG_ERROR([Didn't find the PgSQL include dir in '$PGSQL_inc_check'])
 
434
        fi
 
435
        case "$PGSQL_incdir" in
 
436
          /* ) ;;
 
437
          * )  AC_MSG_ERROR([The PgSQL include directory ($PGSQL_incdir) must be an absolute path.]) ;;
 
438
        esac
 
439
        AC_SUBST(PGSQL_incdir)
 
440
        AC_MSG_RESULT([$PGSQL_incdir])
 
441
fi
 
442
 
 
443
if test "$needsqlite"
 
444
then
 
445
 
 
446
        AC_ARG_WITH(sqlite,
 
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])
 
460
        SQLITE_libdir=
 
461
        for m in $SQLITE_lib_check; do
 
462
                if test -d "$m" && \
 
463
                   (test -f "$m/libsqlite.so" || test -f "$m/libsqlite.a")
 
464
                then
 
465
                        SQLITE_libdir=$m
 
466
                        break
 
467
                fi
 
468
        done
 
469
                if test -z "$SQLITE_libdir"; then
 
470
                AC_MSG_ERROR([Didn't find the sqlite library dir in '$SQLITE_lib_check'])
 
471
        fi
 
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"
 
477
               ;;
 
478
          * )  AC_MSG_ERROR([The SQLite library directory ($SQLITE_libdir) must be an absolute path.]) ;;
 
479
        esac
 
480
 
 
481
        AC_SUBST(SQLITE_lib)
 
482
        AC_MSG_RESULT([$SQLITE_libdir])
 
483
                AC_MSG_CHECKING([for SQLite include directory])
 
484
        SQLITE_incdir=
 
485
        for m in $SQLITE_inc_check; do
 
486
                if test -d "$m" && test -f "$m/sqlite.h"
 
487
                then
 
488
                        SQLITE_incdir=$m
 
489
                        break
 
490
                fi
 
491
        done
 
492
                if test -z "$SQLITE_incdir"; then
 
493
                AC_MSG_ERROR([Didn't find the SQLite include dir in '$SQLITE_inc_check'])
 
494
        fi
 
495
        case "$SQLITE_incdir" in
 
496
          /* ) ;;
 
497
          * )  AC_MSG_ERROR([The SQLite include directory ($SQLITE_incdir) must be an absolute path.]) ;;
 
498
        esac
 
499
        AC_SUBST(SQLITE_incdir)
 
500
        AC_MSG_RESULT([$SQLITE_incdir])
 
501
 
 
502
#       LIBS="$LIBS -lsqlite"
 
503
fi
 
504
 
 
505
if test "$needsqlite3"
 
506
then
 
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])
 
511
fi
 
512
 
 
513
if test "$needcdb"
 
514
then
 
515
        PKG_CHECK_MODULES(CDB, libcdb, HAVE_CDB=yes, AC_MSG_ERROR([+Could not find libcdb/tinycdb]))
 
516
        AC_SUBST(CDB_LIBS)
 
517
        AC_SUBST(CDB_CFLAGS)
 
518
fi
 
519
 
 
520
AM_CONDITIONAL(SQLITE3, test "$needsqlite3")
 
521
 
 
522
 
 
523
if test "$needunixodbc"
 
524
then
 
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])
 
538
        UNIXODBC_libdir=
 
539
        for m in $UNIXODBC_lib_check; do
 
540
                if test -d "$m" && \
 
541
                   (test -f "$m/libodbc.so" || test -f "$m/libodbc.a")
 
542
                then
 
543
                        UNIXODBC_libdir=$m
 
544
                        break
 
545
                fi
 
546
        done
 
547
                if test -z "$UNIXODBC_libdir"; then
 
548
                AC_MSG_ERROR([Didn't find the unixodbc library dir in '$UNIXODBC_lib_check'])
 
549
        fi
 
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"
 
554
               ;;
 
555
          * )  AC_MSG_ERROR([The unixodbc library directory ($UNIXODBC_libdir) must be an absolute path.]) ;;
 
556
        esac
 
557
 
 
558
        AC_SUBST(UNIXODBC_lib)
 
559
        AC_MSG_RESULT([$UNIXODBC_libdir])
 
560
        AC_MSG_CHECKING([for unixodbc include directory])
 
561
        UNIXODBC_incdir=
 
562
        for m in $UNIXODBC_inc_check; do
 
563
                if test -d "$m" && test -f "$m/sql.h"
 
564
                then
 
565
                        UNIXODBC_incdir=$m
 
566
                        break
 
567
                fi
 
568
        done
 
569
                if test -z "$UNIXODBC_incdir"; then
 
570
                AC_MSG_ERROR([Didn't find the unixodbc include dir in '$UNIXODBC_inc_check'])
 
571
        fi
 
572
        case "$UNIXODBC_incdir" in
 
573
          /* ) ;;
 
574
          * )  AC_MSG_ERROR([The unixodbc include directory ($UNIXODBC_incdir) must be an absolute path.]) ;;
 
575
        esac
 
576
        AC_SUBST(UNIXODBC_incdir)
 
577
        AC_MSG_RESULT([$UNIXODBC_incdir])
 
578
 
 
579
#       LIBS="$LIBS -lunixodbc"
 
580
fi
 
581
 
 
582
for a in $modules
 
583
do
 
584
        moduledirs="$moduledirs ${a}backend"
 
585
 
 
586
        for b in `cat $srcdir/modules/${a}backend/OBJECTFILES`
 
587
        do
 
588
                moduleobjects="$moduleobjects ../modules/${a}backend/$b"
 
589
        done
 
590
        modulelibs="$modulelibs `cat $srcdir/modules/${a}backend/OBJECTLIBS`"
 
591
 
 
592
        if test ${a} = "gpgsql"; then
 
593
                LIBS="$LIBS $LIBCRYPT"
 
594
        
 
595
                case "$host_os" in
 
596
                freebsd*)
 
597
                        ;;
 
598
                *)
 
599
                        modulelibs="$modulelibs -lresolv -lnsl"
 
600
                        ;;
 
601
                esac
 
602
        fi
 
603
done
 
604
 
 
605
for a in $dynmodules
 
606
do
 
607
        moduledirs="$moduledirs ${a}backend"
 
608
done
 
609
 
 
610
AC_SUBST(LIBS)
 
611
 
 
612
export moduledirs moduleobjects modulelibs
 
613
 
 
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)