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