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