update to 9.7.1-P2
[tridge/bind9.git] / configure.in
1 # Copyright (C) 2004-2010  Internet Systems Consortium, Inc. ("ISC")
2 # Copyright (C) 1998-2003  Internet Software Consortium.
3 #
4 # Permission to use, copy, modify, and/or distribute this software for any
5 # purpose with or without fee is hereby granted, provided that the above
6 # copyright notice and this permission notice appear in all copies.
7 #
8 # THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
9 # REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
10 # AND FITNESS.  IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
11 # INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
12 # LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
13 # OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
14 # PERFORMANCE OF THIS SOFTWARE.
15
16 dnl
17 AC_DIVERT_PUSH(1)dnl
18 esyscmd([sed "s/^/# /" COPYRIGHT])dnl
19 AC_DIVERT_POP()dnl
20
21 AC_REVISION($Revision: 1.489.22.5 $)
22
23 AC_INIT(lib/dns/name.c)
24 AC_PREREQ(2.59)
25
26 AC_CONFIG_HEADER(config.h)
27
28 AC_CANONICAL_HOST
29
30 AC_PROG_MAKE_SET
31
32 #
33 # GNU libtool support
34 #
35 case $build_os in
36 sunos*)
37     # Just set the maximum command line length for sunos as it otherwise
38     # takes a exceptionally long time to work it out. Required for libtool.
39      
40     lt_cv_sys_max_cmd_len=4096;
41     ;;
42 esac
43
44 AC_PROG_LIBTOOL
45 AC_PROG_INSTALL
46 AC_PROG_LN_S
47
48 AC_SUBST(STD_CINCLUDES)
49 AC_SUBST(STD_CDEFINES)
50 AC_SUBST(STD_CWARNINGS)
51 AC_SUBST(CCOPT)
52
53 # Warn if the user specified libbind, which is now deprecated
54 AC_ARG_ENABLE(libbind, [  --enable-libbind        deprecated])
55
56 case "$enable_libbind" in
57         yes)
58                 AC_MSG_ERROR(['libbind' is no longer part of the BIND 9 distribution.
59 It is available from http://www.isc.org as a separate download.])
60                 ;;
61         no|'')
62                 ;;
63 esac
64
65 #
66 # Make very sure that these are the first files processed by
67 # config.status, since we use the processed output as the input for
68 # AC_SUBST_FILE() substitutions in other files.
69 #
70 AC_CONFIG_FILES([make/rules make/includes])
71
72 AC_PATH_PROG(AR, ar)
73 ARFLAGS="cruv"
74 AC_SUBST(AR)
75 AC_SUBST(ARFLAGS)
76
77 # The POSIX ln(1) program.  Non-POSIX systems may substitute
78 # "copy" or something.
79 LN=ln
80 AC_SUBST(LN)
81
82 case "$AR" in
83         "")
84                 AC_MSG_ERROR([
85 ar program not found.  Please fix your PATH to include the directory in
86 which ar resides, or set AR in the environment with the full path to ar.
87 ])
88
89                 ;;
90 esac
91
92 #
93 # Etags.
94 #
95 AC_PATH_PROGS(ETAGS, etags emacs-etags)
96
97 #
98 # Some systems, e.g. RH7, have the Exuberant Ctags etags instead of
99 # GNU emacs etags, and it requires the -L flag.
100 #
101 if test "X$ETAGS" != "X"; then
102         AC_MSG_CHECKING(for Exuberant Ctags etags)
103         if $ETAGS --version 2>&1 | grep 'Exuberant Ctags' >/dev/null 2>&1; then
104                 AC_MSG_RESULT(yes)
105                 ETAGS="$ETAGS -L"
106         else
107                 AC_MSG_RESULT(no)
108         fi
109 fi
110 AC_SUBST(ETAGS)
111
112 #
113 # Perl is optional; it is used only by some of the system test scripts.
114 # Note: the backtrace feature (see below) uses perl to build the symbol table,
115 # but it still compiles without perl, in which case an empty table will be used.
116 #
117 AC_PATH_PROGS(PERL, perl5 perl)
118 AC_SUBST(PERL)
119
120 #
121 # Special processing of paths depending on whether --prefix,
122 # --sysconfdir or --localstatedir arguments were given.  What's
123 # desired is some compatibility with the way previous versions
124 # of BIND built; they defaulted to /usr/local for most parts of
125 # the installation, but named.boot/named.conf was in /etc
126 # and named.pid was in /var/run.
127 #
128 # So ... if none of --prefix, --sysconfdir or --localstatedir are
129 # specified, set things up that way.  If --prefix is given, use
130 # it for sysconfdir and localstatedir the way configure normally
131 # would.  To change the prefix for everything but leave named.conf
132 # in /etc or named.pid in /var/run, then do this the usual configure way:
133 # ./configure --prefix=/somewhere --sysconfdir=/etc
134 # ./configure --prefix=/somewhere --localstatedir=/var
135 #
136 # To put named.conf and named.pid in /usr/local with everything else,
137 # set the prefix explicitly to /usr/local even though that's the default:
138 # ./configure --prefix=/usr/local
139 #
140 case "$prefix" in
141         NONE)
142                 case "$sysconfdir" in
143                         '${prefix}/etc')
144                                 sysconfdir=/etc
145                                 ;;
146                 esac
147                 case "$localstatedir" in
148                         '${prefix}/var')
149                                 localstatedir=/var
150                                 ;;
151                 esac
152                 ;;
153 esac
154
155 #
156 # Make sure INSTALL uses an absolute path, else it will be wrong in all
157 # Makefiles, since they use make/rules.in and INSTALL will be adjusted by
158 # configure based on the location of the file where it is substituted.
159 # Since in BIND9 INSTALL is only substituted into make/rules.in, an immediate
160 # subdirectory of install-sh, This relative path will be wrong for all
161 # directories more than one level down from install-sh.
162 #
163 case "$INSTALL" in
164         /*)
165                 ;;
166         *)
167                 #
168                 # Not all systems have dirname.
169                 #
170                 changequote({, })
171                 ac_dir="`echo $INSTALL | sed 's%/[^/]*$%%'`"
172                 changequote([, ])
173
174                 ac_prog="`echo $INSTALL | sed 's%.*/%%'`"
175                 test "$ac_dir" = "$ac_prog" && ac_dir=.
176                 test -d "$ac_dir" && ac_dir="`(cd \"$ac_dir\" && pwd)`"
177                 INSTALL="$ac_dir/$ac_prog"
178                 ;;
179 esac
180
181 #
182 # On these hosts, we really want to use cc, not gcc, even if it is
183 # found.  The gcc that these systems have will not correctly handle
184 # pthreads.
185 #
186 # However, if the user sets $CC to be something, let that override
187 # our change.
188 #
189 if test "X$CC" = "X" ; then
190         case "$host" in
191                 *-dec-osf*)
192                         CC="cc"
193                         ;;
194                 *-solaris*)
195                         # Use Sun's cc if it is available, but watch
196                         # out for /usr/ucb/cc; it will never be the right
197                         # compiler to use.
198                         #
199                         # If setting CC here fails, the AC_PROG_CC done
200                         # below might still find gcc.
201                         IFS="${IFS=     }"; ac_save_ifs="$IFS"; IFS=":"
202                         for ac_dir in $PATH; do
203                                 test -z "$ac_dir" && ac_dir=.
204                                 case "$ac_dir" in
205                                 /usr/ucb)
206                                         # exclude
207                                         ;;
208                                 *)
209                                         if test -f "$ac_dir/cc"; then
210                                                 CC="$ac_dir/cc"
211                                                 break
212                                         fi
213                                         ;;
214                                 esac
215                         done
216                         IFS="$ac_save_ifs"
217                         ;;
218                 *-hp-hpux*)
219                         CC="cc"
220                         ;;
221                 mips-sgi-irix*)
222                         CC="cc"
223                         ;;
224         esac
225 fi
226
227 AC_PROG_CC
228
229 #
230 # gcc's optimiser is broken at -02 for ultrasparc
231 #
232 if test "$ac_env_CFLAGS_set" != set -a "X$GCC" = "Xyes"; then
233         case "$host" in
234         sparc-*)
235                 CCFLAGS="-g -O1"
236                 ;;
237         esac
238 fi
239
240 #
241 # OS dependent CC flags
242 #
243 case "$host" in
244         # OSF 5.0: recv/send are only available with -D_POSIX_PII_SOCKET or
245         # -D_XOPEN_SOURCE_EXTENDED.
246         *-dec-osf*)
247                 STD_CDEFINES="$STD_CDEFINES -D_POSIX_PII_SOCKET"
248                 CPPFLAGS="$CPPFLAGS -D_POSIX_PII_SOCKET"
249                 ;;
250         #HP-UX: need -D_XOPEN_SOURCE_EXTENDED and -lxnet for CMSG macros
251         *-hp-hpux*)
252                 STD_CDEFINES="$STD_CDEFINES -D_XOPEN_SOURCE_EXTENDED"
253                 CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE_EXTENDED"
254                 LIBS="-lxnet $LIBS"
255                 ;;
256         # Solaris: need -D_XPG4_2 and -D__EXTENSIONS__ for CMSG macros
257         *-solaris*)
258                 STD_CDEFINES="$STD_CDEFINES -D_XPG4_2 -D__EXTENSIONS__"
259                 CPPFLAGS="$CPPFLAGS -D_XPG4_2 -D__EXTENSIONS__"
260                 ;;
261         # POSIX doesn't include the IPv6 Advanced Socket API and glibc hides
262         # parts of the IPv6 Advanced Socket API as a result.  This is stupid
263         # as it breaks how the two halves (Basic and Advanced) of the IPv6
264         # Socket API were designed to be used but we have to live with it.
265         # Define _GNU_SOURCE to pull in the IPv6 Advanced Socket API.
266         *-linux*)
267                 STD_CDEFINES="$STD_CDEFINES -D_GNU_SOURCE"
268                 CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
269                 ;;
270 esac
271
272 AC_HEADER_STDC
273
274 AC_CHECK_HEADERS(fcntl.h regex.h sys/time.h unistd.h sys/sockio.h sys/select.h sys/param.h sys/sysctl.h net/if6.h,,,
275 [$ac_includes_default
276 #ifdef HAVE_SYS_PARAM_H
277 # include <sys/param.h>
278 #endif
279 ])
280
281 AC_C_CONST
282 AC_C_INLINE
283 AC_C_VOLATILE
284 AC_CHECK_FUNC(sysctlbyname, AC_DEFINE(HAVE_SYSCTLBYNAME))
285 AC_C_FLEXIBLE_ARRAY_MEMBER
286
287 #
288 # Older versions of HP/UX don't define seteuid() and setegid()
289 #
290 AC_CHECK_FUNCS(seteuid setresuid)
291 AC_CHECK_FUNCS(setegid setresgid)
292
293 #
294 # UnixWare 7.1.1 with the feature supplement to the UDK compiler
295 # is reported to not support "static inline" (RT #1212).
296 #
297 AC_MSG_CHECKING(for static inline breakage)
298 AC_TRY_COMPILE(, [
299                 foo1();
300         }
301
302         static inline int foo1() {
303                 return 0;
304         }
305
306         static inline int foo2() {
307                 return foo1();
308         ],
309         [AC_MSG_RESULT(no)],
310         [AC_MSG_RESULT(yes)
311          AC_DEFINE(inline, )])
312
313 AC_TYPE_SIZE_T
314 AC_CHECK_TYPE(ssize_t, int)
315 AC_CHECK_TYPE(uintptr_t,unsigned long)
316 AC_CHECK_TYPE(socklen_t,
317 [AC_DEFINE(ISC_SOCKADDR_LEN_T, socklen_t)],
318 [
319 AC_TRY_COMPILE(
320 [
321 #include <sys/types.h>
322 #include <sys/socket.h>
323 int getsockname(int, struct sockaddr *, size_t *);
324 ],[],
325 [AC_DEFINE(ISC_SOCKADDR_LEN_T, size_t)],
326 [AC_DEFINE(ISC_SOCKADDR_LEN_T, int)])
327 ],
328 [
329 #include <sys/types.h>
330 #include <sys/socket.h>
331 ])
332 AC_SUBST(ISC_SOCKADDR_LEN_T)
333 AC_HEADER_TIME
334 AC_MSG_CHECKING(for long long)
335 AC_TRY_COMPILE([],[long long i = 0; return (0);],
336         [AC_MSG_RESULT(yes)
337                 ISC_PLATFORM_HAVELONGLONG="#define ISC_PLATFORM_HAVELONGLONG 1"],
338         [AC_MSG_RESULT(no)
339                 ISC_PLATFORM_HAVELONGLONG="#undef ISC_PLATFORM_HAVELONGLONG"])
340 AC_SUBST(ISC_PLATFORM_HAVELONGLONG)
341
342 #
343 # check for GCC noreturn attribute
344 #
345 AC_MSG_CHECKING(for GCC noreturn attribute)
346 AC_TRY_COMPILE([],[void foo() __attribute__((noreturn));],
347         [AC_MSG_RESULT(yes)
348                 ISC_PLATFORM_NORETURN_PRE="#define ISC_PLATFORM_NORETURN_PRE"
349                 ISC_PLATFORM_NORETURN_POST="#define ISC_PLATFORM_NORETURN_POST __attribute__((noreturn))"],
350         [AC_MSG_RESULT(no)
351                 ISC_PLATFORM_NORETURN_PRE="#define ISC_PLATFORM_NORETURN_PRE"
352                 ISC_PLATFORM_NORETURN_POST="#define ISC_PLATFORM_NORETURN_POST"])
353 AC_SUBST(ISC_PLATFORM_NORETURN_PRE)
354 AC_SUBST(ISC_PLATFORM_NORETURN_POST)
355
356 #
357 # check if we have lifconf
358 #
359 AC_MSG_CHECKING(for struct lifconf)
360 AC_TRY_COMPILE([
361 #include <sys/types.h>
362 #include <sys/socket.h>
363 #include <net/if.h>
364 ],
365 [
366 struct lifconf lifconf;
367 lifconf.lifc_len = 0;
368 ]
369 ,
370         [AC_MSG_RESULT(yes)
371                 ISC_PLATFORM_HAVELIFCONF="#define ISC_PLATFORM_HAVELIFCONF 1"],
372         [AC_MSG_RESULT(no)
373                 ISC_PLATFORM_HAVELIFCONF="#undef ISC_PLATFORM_HAVELIFCONF"])
374 AC_SUBST(ISC_PLATFORM_HAVELIFCONF)
375
376 #
377 # check if we have kqueue
378 #
379 AC_ARG_ENABLE(kqueue,
380         [  --enable-kqueue         use BSD kqueue when available [[default=yes]]],
381               want_kqueue="$enableval",  want_kqueue="yes")
382 case $want_kqueue in
383 yes)
384         AC_CHECK_FUNC(kqueue, ac_cv_have_kqueue=yes, ac_cv_have_kqueue=no)
385         case $ac_cv_have_kqueue in
386         yes)
387                 ISC_PLATFORM_HAVEKQUEUE="#define ISC_PLATFORM_HAVEKQUEUE 1"
388                 ;;
389         *)
390                 ISC_PLATFORM_HAVEKQUEUE="#undef ISC_PLATFORM_HAVEKQUEUE"
391                 ;;
392         esac
393         ;;
394 *)
395         ISC_PLATFORM_HAVEKQUEUE="#undef ISC_PLATFORM_HAVEKQUEUE"
396         ;;
397 esac
398 AC_SUBST(ISC_PLATFORM_HAVEKQUEUE)
399
400 #
401 # check if we have epoll.  Linux kernel 2.4 has epoll_create() which fails,
402 # so we need to try running the code, not just test its existence.
403 #
404 AC_ARG_ENABLE(epoll,
405 [  --enable-epoll          use Linux epoll when available [[default=auto]]],
406               want_epoll="$enableval",  want_epoll="auto")
407 case $want_epoll in
408 auto)
409         AC_MSG_CHECKING(epoll support)
410         AC_TRY_RUN([
411 #include <sys/epoll.h>
412 int main() {
413         if (epoll_create(1) < 0)
414                 return (1);
415         return (0);
416 }
417 ],
418         [AC_MSG_RESULT(yes)
419         ISC_PLATFORM_HAVEEPOLL="#define ISC_PLATFORM_HAVEEPOLL 1"],
420         [AC_MSG_RESULT(no)
421         ISC_PLATFORM_HAVEEPOLL="#undef ISC_PLATFORM_HAVEEPOLL"])
422         ;;
423 yes)
424         ISC_PLATFORM_HAVEEPOLL="#define ISC_PLATFORM_HAVEEPOLL 1"
425         ;;
426 *)
427         ISC_PLATFORM_HAVEEPOLL="#undef ISC_PLATFORM_HAVEEPOLL"
428         ;;
429 esac
430 AC_SUBST(ISC_PLATFORM_HAVEEPOLL)
431
432 #
433 # check if we support /dev/poll
434 #
435 AC_ARG_ENABLE(devpoll,
436         [  --enable-devpoll        use /dev/poll when available [[default=yes]]],
437               want_devpoll="$enableval",  want_devpoll="yes")
438 case $want_devpoll in
439 yes)
440         AC_CHECK_HEADERS(sys/devpoll.h,
441         ISC_PLATFORM_HAVEDEVPOLL="#define ISC_PLATFORM_HAVEDEVPOLL 1"
442         ,
443         ISC_PLATFORM_HAVEDEVPOLL="#undef ISC_PLATFORM_HAVEDEVPOLL"
444         )
445         ;;
446 *)
447         ISC_PLATFORM_HAVEDEVPOLL="#undef ISC_PLATFORM_HAVEDEVPOLL"
448         ;;
449 esac
450 AC_SUBST(ISC_PLATFORM_HAVEDEVPOLL)
451
452 #
453 # check if we need to #include sys/select.h explicitly
454 #
455 case $ac_cv_header_unistd_h in
456 yes)
457 AC_MSG_CHECKING(if unistd.h or sys/types.h defines fd_set)
458 AC_TRY_COMPILE([
459 #include <sys/types.h> /* Ultrix */
460 #include <unistd.h>],
461 [fd_set read_set; return (0);],
462         [AC_MSG_RESULT(yes)
463          ISC_PLATFORM_NEEDSYSSELECTH="#undef ISC_PLATFORM_NEEDSYSSELECTH"
464          LWRES_PLATFORM_NEEDSYSSELECTH="#undef LWRES_PLATFORM_NEEDSYSSELECTH"],
465         [AC_MSG_RESULT(no)
466         case $ac_cv_header_sys_select_h in
467         yes)
468          ISC_PLATFORM_NEEDSYSSELECTH="#define ISC_PLATFORM_NEEDSYSSELECTH 1"
469          LWRES_PLATFORM_NEEDSYSSELECTH="#define LWRES_PLATFORM_NEEDSYSSELECTH 1"
470                 ;;
471         no)
472                 AC_MSG_ERROR([need either working unistd.h or sys/select.h])
473                 ;;
474         esac
475         ])
476         ;;
477 no)
478         case $ac_cv_header_sys_select_h in
479         yes)
480              ISC_PLATFORM_NEEDSYSSELECTH="#define ISC_PLATFORM_NEEDSYSSELECTH 1"
481              LWRES_PLATFORM_NEEDSYSSELECTH="#define LWRES_PLATFORM_NEEDSYSSELECTH 1"
482                 ;;
483         no)
484                 AC_MSG_ERROR([need either unistd.h or sys/select.h])
485                 ;;
486         esac
487         ;;
488 esac
489 AC_SUBST(ISC_PLATFORM_NEEDSYSSELECTH)
490 AC_SUBST(LWRES_PLATFORM_NEEDSYSSELECTH)
491
492 #
493 # Find the machine's endian flavor.
494 #
495 AC_C_BIGENDIAN
496
497
498 #
499 # was --with-openssl specified?
500 #
501 OPENSSL_WARNING=
502 AC_MSG_CHECKING(for OpenSSL library)
503 AC_ARG_WITH(openssl,
504 [  --with-openssl[=PATH]     Build with OpenSSL [yes|no|path].
505                           (Required for DNSSEC)],
506     use_openssl="$withval", use_openssl="auto")
507
508 openssldirs="/usr /usr/local /usr/local/ssl /usr/pkg /usr/sfw"
509 if test "$use_openssl" = "auto"
510 then
511         for d in $openssldirs
512         do
513                 if test -f $d/include/openssl/opensslv.h
514                 then
515                         use_openssl=$d
516                         break
517                 fi
518         done
519 fi
520 case "$use_openssl" in
521         no)
522                 AC_MSG_RESULT(no)
523                 DST_OPENSSL_INC=""
524                 USE_OPENSSL=""
525                 ;;
526         auto)
527                 DST_OPENSSL_INC=""
528                 USE_OPENSSL=""
529                 AC_MSG_ERROR(
530 [OpenSSL was not found in any of $openssldirs; use --with-openssl=/path
531 If you don't want OpenSSL, use --without-openssl])
532                 ;;
533         *)
534                 if test "$use_openssl" = "yes"
535                 then
536                         # User did not specify a path - guess it
537                         for d in $openssldirs
538                         do
539                                 if test -f $d/include/openssl/opensslv.h
540                                 then
541                                         use_openssl=$d
542                                         break
543                                 fi
544                         done
545                         if test "$use_openssl" = "yes"
546                         then
547                                 AC_MSG_RESULT(not found)
548                                 AC_MSG_ERROR(
549 [OpenSSL was not found in any of $openssldirs; use --with-openssl=/path])
550                         fi
551                 elif ! test -f "$use_openssl"/include/openssl/opensslv.h
552                 then
553                         AC_MSG_ERROR(["$use_openssl/include/openssl/opensslv.h" not found])
554                 fi
555                 USE_OPENSSL='-DOPENSSL'
556                 if test "$use_openssl" = "/usr"
557                 then
558                         DST_OPENSSL_INC=""
559                         DNS_OPENSSL_LIBS="-lcrypto"
560                 else
561                         DST_OPENSSL_INC="-I$use_openssl/include"
562                         case $host in
563                         *-solaris*)
564                                 DNS_OPENSSL_LIBS="-L$use_openssl/lib -R$use_openssl/lib -lcrypto"
565                                 ;;
566                         *-hp-hpux*)
567                                 DNS_OPENSSL_LIBS="-L$use_openssl/lib -Wl,+b: -lcrypto"
568                                 ;;
569                         *-apple-darwin*)
570                                 #
571                                 # Apple's ld seaches for serially for dynamic
572                                 # then static libraries.  This means you can't
573                                 # use -L to override dynamic system libraries
574                                 # with static ones when linking.  Instead
575                                 # we specify a absolute path.
576                                 #
577                                 if test -f "$use_openssl/lib/libcrypto.dylib"
578                                 then
579                                         DNS_OPENSSL_LIBS="-L$use_openssl/lib -lcrypto"
580                                 else
581                                         DNS_OPENSSL_LIBS="$use_openssl/lib/libcrypto.a"
582                                 fi
583                                 ;;
584                         *)
585                                 DNS_OPENSSL_LIBS="-L$use_openssl/lib -lcrypto"
586                                 ;;
587                         esac
588                 fi
589                 AC_MSG_RESULT(using OpenSSL from $use_openssl/lib and $use_openssl/include)
590
591                 saved_cflags="$CFLAGS"
592                 saved_libs="$LIBS"
593                 CFLAGS="$CFLAGS $DST_OPENSSL_INC"
594                 LIBS="$LIBS $DNS_OPENSSL_LIBS"
595                 AC_MSG_CHECKING(whether linking with OpenSSL works)
596                 AC_TRY_RUN([
597 #include <openssl/err.h>
598 int main() {
599         ERR_clear_error();
600         return (0);
601 }
602 ],
603                 [AC_MSG_RESULT(yes)],
604                 [AC_MSG_RESULT(no)
605                  AC_MSG_ERROR(Could not run test program using OpenSSL from
606 $use_openssl/lib and $use_openssl/include.
607 Please check the argument to --with-openssl and your
608 shared library configuration (e.g., LD_LIBRARY_PATH).)],
609                 [AC_MSG_RESULT(assuming it does work on target platform)])
610
611                 AC_MSG_CHECKING(whether linking with OpenSSL requires -ldl)
612                 AC_TRY_LINK([
613 #include <openssl/err.h>],
614 [ DSO_METHOD_dlfcn(); ],
615                 [AC_MSG_RESULT(no)],
616                 [LIBS="$LIBS -ldl"
617                 AC_TRY_LINK([
618 #include <openssl/err.h>
619 ],[ DSO_METHOD_dlfcn(); ],
620                 [AC_MSG_RESULT(yes)
621                 DNS_OPENSSL_LIBS="$DNS_OPENSSL_LIBS -ldl"
622                 ],
623                  [AC_MSG_RESULT(unknown)
624                  AC_MSG_ERROR(OpenSSL has unsupported dynamic loading)],
625                 [AC_MSG_RESULT(assuming it does work on target platform)])
626                 ],
627                 [AC_MSG_RESULT(assuming it does work on target platform)]
628                 )
629                  
630 AC_ARG_ENABLE(openssl-version-check,
631 [AC_HELP_STRING([--enable-openssl-version-check],
632         [Check OpenSSL Version @<:@default=yes@:>@])])
633 case "$enable_openssl_version_check" in
634 yes|'')
635                 AC_MSG_CHECKING(OpenSSL library version)
636                 AC_TRY_RUN([
637 #include <stdio.h>
638 #include <openssl/opensslv.h>
639 int main() {
640         if ((OPENSSL_VERSION_NUMBER >= 0x009070cfL &&
641              OPENSSL_VERSION_NUMBER < 0x00908000L) ||
642              OPENSSL_VERSION_NUMBER >= 0x0090804fL)
643                 return (0);
644         printf("\n\nFound   OPENSSL_VERSION_NUMBER %#010x\n",
645                 OPENSSL_VERSION_NUMBER);
646         printf("Require OPENSSL_VERSION_NUMBER 0x009070cf or greater (0.9.7l)\n"
647                "Require OPENSSL_VERSION_NUMBER 0x0090804f or greater (0.9.8d)\n\n");
648         return (1);
649 }
650                 ],
651                 [AC_MSG_RESULT(ok)],
652                 [AC_MSG_RESULT(not compatible)
653                  OPENSSL_WARNING=yes
654                 ],
655                 [AC_MSG_RESULT(assuming target platform has compatible version)])
656 ;;
657 no)
658         AC_MSG_RESULT(Skipped OpenSSL version check)
659 ;;
660 esac
661
662                 AC_MSG_CHECKING(for OpenSSL DSA support)
663                 if test -f $use_openssl/include/openssl/dsa.h
664                 then
665                         AC_DEFINE(HAVE_OPENSSL_DSA)
666                         AC_MSG_RESULT(yes)
667                 else
668                         AC_MSG_RESULT(no)
669                 fi
670                 AC_CHECK_FUNCS(EVP_sha256 EVP_sha512)
671                 CFLAGS="$saved_cflags"
672                 LIBS="$saved_libs"
673
674                 ;;
675 esac
676
677 #
678 # This would include the system openssl path (and linker options to use
679 # it as needed) if it is found.
680 #
681
682 AC_SUBST(USE_OPENSSL)
683 AC_SUBST(DST_OPENSSL_INC)
684 DNS_CRYPTO_LIBS="$DNS_CRYPTO_LIBS $DNS_OPENSSL_LIBS"
685
686 #
687 # Use OpenSSL for hash functions
688 #
689
690 AC_ARG_ENABLE(openssl-hash,
691         [  --enable-openssl-hash   use OpenSSL for hash functions [[default=no]]],
692         want_openssl_hash="$enableval", want_openssl_hash="no")
693 case $want_openssl_hash in
694         yes)
695                 if test "$USE_OPENSSL" = ""
696                 then
697                         AC_MSG_ERROR([No OpenSSL for hash functions])
698                 fi
699                 ISC_PLATFORM_OPENSSLHASH="#define ISC_PLATFORM_OPENSSLHASH 1"
700                 ISC_OPENSSL_INC="$DST_OPENSSL_INC"
701                 ;;
702         no)
703                 ISC_PLATFORM_OPENSSLHASH="#undef ISC_PLATFORM_OPENSSLHASH"
704                 ISC_OPENSSL_INC=""
705                 ;;
706 esac
707 AC_SUBST(ISC_PLATFORM_OPENSSLHASH)
708 AC_SUBST(ISC_OPENSSL_INC)
709
710 #
711 # PKCS11 (aka crypto hardware) support
712 #
713 # This works only with the right OpenSSL with PKCS11 engine!
714 #
715
716 AC_MSG_CHECKING(for PKCS11 support)
717 AC_ARG_WITH(pkcs11,
718 [  --with-pkcs11[=PATH]      Build with PKCS11 support [yes|no|path]
719                           (PATH is for the PKCS11 provider)],
720    use_pkcs11="$withval", use_pkcs11="no")
721
722 case "$use_pkcs11" in
723         no|'')
724                 AC_MSG_RESULT(disabled)
725                 USE_PKCS11=''
726                 PKCS11_TOOLS=''
727                 ;;
728         yes|*)
729                 AC_MSG_RESULT(using OpenSSL with PKCS11 support)
730                 USE_PKCS11='-DUSE_PKCS11'
731                 PKCS11_TOOLS=pkcs11
732                 ;;
733 esac
734 AC_SUBST(USE_PKCS11)
735 AC_SUBST(PKCS11_TOOLS)
736
737 AC_MSG_CHECKING(for PKCS11 tools)
738 case "$use_pkcs11" in
739         no|yes|'')
740                 AC_MSG_RESULT(disabled)
741                 PKCS11_PROVIDER="undefined"
742                 ;;
743        *)
744                 AC_MSG_RESULT(PKCS11 provider is "$use_pkcs11")
745                 PKCS11_PROVIDER="$use_pkcs11"
746                 ;;
747 esac
748 AC_SUBST(PKCS11_PROVIDER)
749
750 AC_MSG_CHECKING(for GSSAPI library)
751 AC_ARG_WITH(gssapi,
752 [  --with-gssapi=PATH      Specify path for system-supplied GSSAPI],
753     use_gssapi="$withval", use_gssapi="no")
754
755 gssapidirs="/usr/local /usr/pkg /usr/kerberos /usr"
756 if test "$use_gssapi" = "yes"
757 then
758         for d in $gssapidirs
759         do
760                 if test -f $d/include/gssapi/gssapi.h -o -f $d/include/gssapi.h
761                 then
762                         use_gssapi=$d
763                         break
764                 fi
765         done
766 fi
767
768 case "$use_gssapi" in
769         no)
770                 AC_MSG_RESULT(disabled)
771                 USE_GSSAPI=''
772                 ;;
773         yes)
774                 AC_MSG_ERROR([--with-gssapi must specify a path])
775                 ;;
776         *)
777                 AC_MSG_RESULT(looking in $use_gssapi/lib)
778                 USE_GSSAPI='-DGSSAPI'
779                 saved_cppflags="$CPPFLAGS"
780                 CPPFLAGS="-I$use_gssapi/include $CPPFLAGS"
781                 AC_CHECK_HEADERS(gssapi.h gssapi/gssapi.h,
782                     [ISC_PLATFORM_GSSAPIHEADER="#define ISC_PLATFORM_GSSAPIHEADER <$ac_header>"])
783
784                 if test "$ISC_PLATFORM_GSSAPIHEADER" = ""; then
785                     AC_MSG_ERROR([gssapi.h not found])
786                 fi
787
788                 CPPFLAGS="$saved_cppflags"
789
790                 #
791                 # XXXDCL This probably doesn't work right on all systems.
792                 # It will need to be worked on as problems become evident.
793                 #
794                 # Essentially the problems here relate to two different
795                 # areas.  The first area is building with either KTH
796                 # or MIT Kerberos, particularly when both are present on
797                 # the machine.  The other is static versus dynamic linking.
798                 #
799                 # On the KTH vs MIT issue, Both have libkrb5 that can mess
800                 # up the works if one implementation ends up trying to
801                 # use the other's krb.  This is unfortunately a situation
802                 # that very easily arises.
803                 #
804                 # Dynamic linking when the dependency information is built
805                 # into MIT's libgssapi_krb5 or KTH's libgssapi magically makes
806                 # all such problems go away, but when that setup is not
807                 # present, because either the dynamic libraries lack
808                 # dependencies or static linking is being done, then the
809                 # problems start to show up.
810                 saved_libs="$LIBS"
811                 for TRY_LIBS in \
812                     "-lgssapi_krb5" \
813                     "-lgssapi_krb5 -lkrb5 -lk5crypto -lcom_err" \
814                     "-lgssapi_krb5 -lkrb5 -lk5crypto -lcom_err -lresolv" \
815                     "-lgssapi" \
816                     "-lgssapi -lkrb5 -ldes -lcrypt -lasn1 -lroken -lcom_err" \
817                     "-lgssapi -lkrb5 -lcrypto -lcrypt -lasn1 -lroken -lcom_err" \
818                     "-lgss"
819                 do
820                     # Note that this does not include $saved_libs, because
821                     # on FreeBSD machines this configure script has added
822                     # -L/usr/local/lib to LIBS, which can make the
823                     # -lgssapi_krb5 test succeed with shared libraries even
824                     # when you are trying to build with KTH in /usr/lib.
825                     LIBS="-L$use_gssapi/lib $TRY_LIBS"
826                     AC_MSG_CHECKING(linking as $TRY_LIBS)
827                     AC_TRY_LINK( , [gss_acquire_cred();],
828                                 gssapi_linked=yes, gssapi_linked=no)
829                     case $gssapi_linked in
830                     yes) AC_MSG_RESULT(yes); break ;;
831                     no)  AC_MSG_RESULT(no) ;;
832                     esac
833                 done
834
835                 case $gssapi_linked in
836                 no) AC_MSG_ERROR(could not determine proper GSSAPI linkage) ;;
837                 esac
838
839                 #
840                 # XXXDCL Major kludge.  Tries to cope with KTH in /usr/lib
841                 # but MIT in /usr/local/lib and trying to build with KTH.
842                 # /usr/local/lib can end up earlier on the link lines.
843                 # Like most kludges, this one is not only inelegant it
844                 # is also likely to be the wrong thing to do at least as
845                 # many times as it is the right thing.  Something better
846                 # needs to be done.
847                 #
848                 if test "$use_gssapi" = "/usr" -a \
849                         -f /usr/local/lib/libkrb5.a; then
850                     FIX_KTH_VS_MIT=yes
851                 fi
852
853                 case "$FIX_KTH_VS_MIT" in
854                 yes)
855                     case "$enable_static_linking" in
856                     yes) gssapi_lib_suffix=".a"  ;;
857                     *)   gssapi_lib_suffix=".so" ;;
858                     esac
859
860                     for lib in $LIBS; do
861                         case $lib in
862                         -L*)
863                             ;;
864                         -l*)
865                             new_lib=`echo $lib |
866                                      sed -e s%^-l%$use_gssapi/lib/lib% \
867                                          -e s%$%$gssapi_lib_suffix%`
868                             NEW_LIBS="$NEW_LIBS $new_lib"
869                             ;;
870                         *)
871                            AC_MSG_ERROR([KTH vs MIT Kerberos confusion!])
872                             ;;
873                         esac
874                     done
875                     LIBS="$NEW_LIBS"
876                     ;;
877                 esac
878
879                 DST_GSSAPI_INC="-I$use_gssapi/include"
880                 DNS_GSSAPI_LIBS="$LIBS"
881
882                 AC_MSG_RESULT(using GSSAPI from $use_gssapi/lib and $use_gssapi/include)
883                 LIBS="$saved_libs"
884                 ;;
885 esac
886
887 AC_SUBST(ISC_PLATFORM_HAVEGSSAPI)
888 AC_SUBST(ISC_PLATFORM_GSSAPIHEADER)
889
890 AC_SUBST(USE_GSSAPI)
891 AC_SUBST(DST_GSSAPI_INC)
892 AC_SUBST(DNS_GSSAPI_LIBS)
893 DNS_CRYPTO_LIBS="$DNS_GSSAPI_LIBS $DNS_CRYPTO_LIBS"
894
895 #
896 # Applications linking with libdns also need to link with these libraries.
897 #
898
899 AC_SUBST(DNS_CRYPTO_LIBS)
900
901 #
902 # was --with-randomdev specified?
903 #
904 AC_MSG_CHECKING(for random device)
905 AC_ARG_WITH(randomdev,
906 [  --with-randomdev=PATH   Specify path for random device],
907     use_randomdev="$withval", use_randomdev="unspec")
908
909 case "$use_randomdev" in
910         unspec)
911                 case "$host" in
912                         *-openbsd*)
913                                 devrandom=/dev/arandom
914                                 ;;
915                         *)
916                                 devrandom=/dev/random
917                                 ;;
918                 esac
919                 AC_MSG_RESULT($devrandom)
920                 AC_CHECK_FILE($devrandom,
921                               AC_DEFINE_UNQUOTED(PATH_RANDOMDEV,
922                                                  "$devrandom"),)
923                 ;;
924         yes)
925                 AC_MSG_ERROR([--with-randomdev must specify a path])
926                 ;;
927         no)
928                 AC_MSG_RESULT(disabled)
929                 ;;
930         *)
931                 AC_DEFINE_UNQUOTED(PATH_RANDOMDEV, "$use_randomdev")
932                 AC_MSG_RESULT(using "$use_randomdev")
933                 ;;
934 esac
935
936 #
937 # Do we have arc4random() ?
938 #
939 AC_CHECK_FUNC(arc4random, AC_DEFINE(HAVE_ARC4RANDOM))
940
941 sinclude(config.threads.in)dnl
942
943 if $use_threads
944 then
945         if test "X$GCC" = "Xyes"; then
946                 case "$host" in
947                 *-freebsd*)
948                         CC="$CC -pthread"
949                         CCOPT="$CCOPT -pthread"
950                         STD_CDEFINES="$STD_CDEFINES -D_THREAD_SAFE"
951                         ;;
952                 *-openbsd*)
953                         CC="$CC -pthread"
954                         CCOPT="$CCOPT -pthread"
955                         ;;
956                 *-solaris*)
957                         LIBS="$LIBS -lthread"
958                         ;;
959                 *-ibm-aix*)
960                         STD_CDEFINES="$STD_CDEFINES -D_THREAD_SAFE"
961                         ;;
962                 esac
963         else
964                 case $host in
965                 *-dec-osf*)
966                         CC="$CC -pthread"
967                         CCOPT="$CCOPT -pthread"
968                         ;;
969                 *-solaris*)
970                         CC="$CC -mt"
971                         CCOPT="$CCOPT -mt"
972                         ;;
973                 *-ibm-aix*)
974                         STD_CDEFINES="$STD_CDEFINES -D_THREAD_SAFE"
975                         ;;
976                 *-sco-sysv*uw*|*-*-sysv*UnixWare*)
977                         CC="$CC -Kthread"
978                         CCOPT="$CCOPT -Kthread"
979                         ;;
980                 *-*-sysv*OpenUNIX*)
981                         CC="$CC -Kpthread"
982                         CCOPT="$CCOPT -Kpthread"
983                         ;;
984                 esac
985         fi
986         ALWAYS_DEFINES="-D_REENTRANT"
987         ISC_PLATFORM_USETHREADS="#define ISC_PLATFORM_USETHREADS 1"
988         thread_dir=pthreads
989         #
990         # We'd like to use sigwait() too
991         #
992         AC_CHECK_FUNC(sigwait,
993                       AC_DEFINE(HAVE_SIGWAIT),
994                       AC_CHECK_LIB(c, sigwait,
995                       AC_DEFINE(HAVE_SIGWAIT),
996                       AC_CHECK_LIB(pthread, sigwait,
997                                    AC_DEFINE(HAVE_SIGWAIT),
998                                    AC_CHECK_LIB(pthread, _Psigwait,
999                                                 AC_DEFINE(HAVE_SIGWAIT),))))
1000
1001         AC_CHECK_FUNC(pthread_attr_getstacksize,
1002                       AC_DEFINE(HAVE_PTHREAD_ATTR_GETSTACKSIZE),)
1003
1004         AC_CHECK_FUNC(pthread_attr_setstacksize,
1005                       AC_DEFINE(HAVE_PTHREAD_ATTR_SETSTACKSIZE),)
1006
1007         #
1008         # Additional OS-specific issues related to pthreads and sigwait.
1009         #
1010         case "$host" in
1011                 #
1012                 # One more place to look for sigwait.
1013                 #
1014                 *-freebsd*)
1015                         AC_CHECK_LIB(c_r, sigwait, AC_DEFINE(HAVE_SIGWAIT),)
1016                         case $host in
1017                         *-freebsd5.[[012]]|*-freebsd5.[[012]].*);;
1018                         *-freebsd5.[[3456789]]|*-freebsd5.[[3456789]].*)
1019                                 AC_DEFINE(NEED_PTHREAD_SCOPE_SYSTEM)
1020                                 ;;
1021                         *-freebsd6.*)
1022                                 AC_DEFINE(NEED_PTHREAD_SCOPE_SYSTEM)
1023                                 ;;
1024                         esac
1025                         ;;
1026                 #
1027                 # BSDI 3.0 through 4.0.1 needs pthread_init() to be
1028                 # called before certain pthreads calls.  This is deprecated
1029                 # in BSD/OS 4.1.
1030                 #
1031                 *-bsdi3.*|*-bsdi4.0*)
1032                         AC_DEFINE(NEED_PTHREAD_INIT)
1033                         ;;
1034                 #
1035                 # LinuxThreads requires some changes to the way we
1036                 # deal with signals.
1037                 #
1038                 *-linux*)
1039                         AC_DEFINE(HAVE_LINUXTHREADS)
1040                         ;;
1041                 #
1042                 # Ensure the right sigwait() semantics on Solaris and make
1043                 # sure we call pthread_setconcurrency.
1044                 #
1045                 *-solaris*)
1046                         AC_DEFINE(_POSIX_PTHREAD_SEMANTICS)
1047                         AC_CHECK_FUNC(pthread_setconcurrency,
1048                                       AC_DEFINE(CALL_PTHREAD_SETCONCURRENCY))
1049                         ;;
1050                 #
1051                 # UnixWare does things its own way.
1052                 #
1053                 *-sco-sysv*uw*|*-*-sysv*UnixWare*|*-*-sysv*OpenUNIX*)
1054                         AC_DEFINE(HAVE_UNIXWARE_SIGWAIT)
1055                         ;;
1056         esac
1057
1058         #
1059         # Look for sysconf to allow detection of the number of processors.
1060         #
1061         AC_CHECK_FUNC(sysconf, AC_DEFINE(HAVE_SYSCONF),)
1062
1063 else
1064         ISC_PLATFORM_USETHREADS="#undef ISC_PLATFORM_USETHREADS"
1065         thread_dir=nothreads
1066         ALWAYS_DEFINES=""
1067 fi
1068
1069 AC_SUBST(ALWAYS_DEFINES)
1070 AC_SUBST(ISC_PLATFORM_USETHREADS)
1071 ISC_THREAD_DIR=$thread_dir
1072 AC_SUBST(ISC_THREAD_DIR)
1073
1074 #
1075 # was --with-libxml2 specified?
1076 #
1077 AC_MSG_CHECKING(for libxml2 library)
1078 AC_ARG_WITH(libxml2,
1079 [  --with-libxml2[=PATH]     Build with libxml2 library [yes|no|path]],
1080     use_libxml2="$withval", use_libxml2="auto")
1081
1082 case "$use_libxml2" in
1083         no)
1084                 DST_LIBXML2_INC=""
1085                 ;;
1086         auto|yes)
1087                 case X`(xml2-config --version) 2>/dev/null` in
1088                 X2.[[67]].*)
1089                         libxml2_libs=`xml2-config --libs`
1090                         libxml2_cflags=`xml2-config --cflags`
1091                         ;;
1092                 *)
1093                         libxml2_libs=
1094                         libxml2_cflags=
1095                         ;;
1096                 esac
1097                 ;;
1098         *)
1099                 if test -f "$use_libxml2/bin/xml2-config" ; then
1100                         libxml2_libs=`$use_libxml2/bin/xml2-config --libs`
1101                         libxml2_cflags=`$use_libxml2/bin/xml2-config --cflags`
1102                 fi
1103                 ;;
1104 esac
1105
1106 if test "X$libxml2_libs" != "X"
1107 then
1108         AC_MSG_RESULT(yes)
1109         CFLAGS="$CFLAGS $libxml2_cflags"
1110         LIBS="$LIBS $libxml2_libs"
1111         AC_DEFINE(HAVE_LIBXML2, 1, [Define if libxml2 was found])
1112 else
1113         AC_MSG_RESULT(no)
1114 fi
1115
1116 #
1117 # In solaris 10, SMF can manage named service
1118 #
1119 AC_CHECK_LIB(scf, smf_enable_instance)
1120
1121 #
1122 # flockfile is usually provided by pthreads, but we may want to use it
1123 # even if compiled with --disable-threads.  getc_unlocked might also not
1124 # be defined.
1125 #
1126 AC_CHECK_FUNC(flockfile, AC_DEFINE(HAVE_FLOCKFILE),)
1127 AC_CHECK_FUNC(getc_unlocked, AC_DEFINE(HAVE_GETCUNLOCKED),)
1128
1129
1130 # Indicate what the final decision was regarding threads.
1131 #
1132 AC_MSG_CHECKING(whether to build with threads)
1133 if $use_threads; then
1134         AC_MSG_RESULT(yes)
1135 else
1136         AC_MSG_RESULT(no)
1137 fi
1138
1139
1140 # End of pthreads stuff.
1141 #
1142
1143 #
1144 # Large File
1145 #
1146 AC_ARG_ENABLE(largefile, [  --enable-largefile    64-bit file support],
1147               want_largefile="yes", want_largefile="no")
1148 case $want_largefile in
1149         yes)
1150                 ALWAYS_DEFINES="$ALWAYS_DEFINES -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"
1151                 ;;
1152         *)
1153                 ;;
1154 esac
1155
1156 #
1157 # Additional compiler settings.
1158 #
1159 MKDEPCC="$CC"
1160 MKDEPCFLAGS="-M"
1161 IRIX_DNSSEC_WARNINGS_HACK=""
1162
1163 if test "X$GCC" = "Xyes"; then
1164         AC_MSG_CHECKING(if "$CC" supports -fno-strict-aliasing)
1165         SAVE_CFLAGS=$CFLAGS
1166         CFLAGS="$CFLAGS -fno-strict-aliasing"
1167         AC_TRY_COMPILE(,, [FNOSTRICTALIASING=yes],[FNOSTRICTALIASING=no])
1168         CFLAGS=$SAVE_CFLAGS
1169         if test "$FNOSTRICTALIASING" = "yes"; then
1170                 AC_MSG_RESULT(yes)
1171         STD_CWARNINGS="$STD_CWARNINGS -W -Wall -Wmissing-prototypes -Wcast-qual -Wwrite-strings -Wformat -Wpointer-arith -fno-strict-aliasing"
1172         else
1173                 AC_MSG_RESULT(no)
1174         STD_CWARNINGS="$STD_CWARNINGS -W -Wall -Wmissing-prototypes -Wcast-qual -Wwrite-strings -Wformat -Wpointer-arith"
1175         fi
1176         case "$host" in
1177         *-hp-hpux*)
1178                 LDFLAGS="-Wl,+vnocompatwarnings $LDFLAGS"
1179                 ;;
1180         esac
1181 else
1182         case $host in
1183         *-dec-osf*)
1184                 CC="$CC -std"
1185                 CCOPT="$CCOPT -std"
1186                 MKDEPCC="$CC"
1187                 ;;
1188         *-hp-hpux*)
1189                 CC="$CC -Ae -z"
1190                 # The version of the C compiler that constantly warns about
1191                 # 'const' as well as alignment issues is unfortunately not
1192                 # able to be discerned via the version of the operating
1193                 # system, nor does cc have a version flag.
1194                 case "`$CC +W 123 2>&1`" in
1195                 *Unknown?option*)
1196                         STD_CWARNINGS="+w1"
1197                         ;;
1198                 *)
1199                         # Turn off the pointlessly noisy warnings.
1200                         STD_CWARNINGS="+w1 +W 474,530,2193,2236"
1201                         ;;
1202                 esac
1203                 CCOPT="$CCOPT -Ae -z"
1204                 LDFLAGS="-Wl,+vnocompatwarnings $LDFLAGS"
1205                 MKDEPPROG='cc -Ae -E -Wp,-M >/dev/null 2>>$TMP'
1206                 ;;
1207         *-sgi-irix*)
1208                 STD_CWARNINGS="-fullwarn -woff 1209"
1209                 #
1210                 # Silence more than 250 instances of
1211                 #   "prototyped function redeclared without prototype"
1212                 # and 11 instances of
1213                 #   "variable ... was set but never used"
1214                 # from lib/dns/sec/openssl.
1215                 #
1216                 IRIX_DNSSEC_WARNINGS_HACK="-woff 1692,1552"
1217                 ;;
1218         *-solaris*)
1219                 MKDEPCFLAGS="-xM"
1220                 ;;
1221         *-sco-sysv*uw*|*-*-sysv*UnixWare*|*-*-sysv*OpenUNIX*)
1222                 # UnixWare
1223                 CC="$CC -w"
1224                 ;;
1225         esac
1226 fi
1227
1228 AC_SUBST(MKDEPCC)
1229 AC_SUBST(MKDEPCFLAGS)
1230 AC_SUBST(MKDEPPROG)
1231 AC_SUBST(IRIX_DNSSEC_WARNINGS_HACK)
1232
1233 #
1234 # NLS
1235 #
1236 AC_CHECK_FUNC(catgets, AC_DEFINE(HAVE_CATGETS),)
1237
1238 #
1239 # -lxnet buys us one big porting headache...  standards, gotta love 'em.
1240 #
1241 # AC_CHECK_LIB(xnet, socket, ,
1242 #    AC_CHECK_LIB(socket, socket)
1243 # )
1244 #
1245 # Use this for now, instead:
1246 #
1247 case "$host" in
1248         mips-sgi-irix*)
1249                 ;;
1250         *-linux*)
1251                 ;;
1252         *)
1253                 AC_CHECK_LIB(socket, socket)
1254                 AC_CHECK_LIB(nsl, inet_addr)
1255                 ;;
1256 esac
1257
1258 #
1259 # Work around Solaris's select() limitations.
1260 #
1261 case "$host" in
1262         *-solaris2.[[89]]|*-solaris2.1?)
1263         AC_DEFINE(FD_SETSIZE, 65536,
1264                   [Solaris hack to get select_large_fdset.])
1265         ;;
1266 esac
1267
1268 #
1269 # Purify support
1270 #
1271 AC_MSG_CHECKING(whether to use purify)
1272 AC_ARG_WITH(purify,
1273         [  --with-purify[=PATH]      use Rational purify],
1274         use_purify="$withval", use_purify="no")
1275
1276 case "$use_purify" in
1277         no)
1278                 ;;
1279         yes)
1280                 AC_PATH_PROG(purify_path, purify, purify)
1281                 ;;
1282         *)
1283                 purify_path="$use_purify"
1284                 ;;
1285 esac
1286
1287 case "$use_purify" in
1288         no)
1289                 AC_MSG_RESULT(no)
1290                 PURIFY=""
1291                 ;;
1292         *)
1293                 if test -f $purify_path || test $purify_path = purify; then
1294                         AC_MSG_RESULT($purify_path)
1295                         PURIFYFLAGS="`echo $PURIFYOPTIONS`"
1296                         PURIFY="$purify_path $PURIFYFLAGS"
1297                 else
1298                         AC_MSG_ERROR([$purify_path not found.
1299
1300 Please choose the proper path with the following command:
1301
1302     configure --with-purify=PATH
1303 ])
1304                 fi
1305                 ;;
1306 esac
1307
1308 AC_SUBST(PURIFY)
1309
1310
1311 AC_ARG_WITH(libtool,
1312             [  --with-libtool          use GNU libtool],
1313             use_libtool="$withval", use_libtool="no")
1314
1315 case $use_libtool in
1316         yes)
1317                 AM_PROG_LIBTOOL
1318                 O=lo
1319                 A=la
1320                 LIBTOOL_MKDEP_SED='s;\.o;\.lo;'
1321                 LIBTOOL_MODE_COMPILE='--mode=compile'
1322                 LIBTOOL_MODE_INSTALL='--mode=install'
1323                 LIBTOOL_MODE_LINK='--mode=link'
1324                 case "$host" in
1325                 *) LIBTOOL_ALLOW_UNDEFINED= ;;
1326                 esac
1327                 case "$host" in
1328                 *-ibm-aix*) LIBTOOL_IN_MAIN="-Wl,-bI:T_testlist.imp" ;;
1329                 *) LIBTOOL_IN_MAIN= ;;
1330                 esac;
1331                 ;;
1332         *)
1333                 O=o
1334                 A=a
1335                 LIBTOOL=
1336                 AC_SUBST(LIBTOOL)
1337                 LIBTOOL_MKDEP_SED=
1338                 LIBTOOL_MODE_COMPILE=
1339                 LIBTOOL_MODE_INSTALL=
1340                 LIBTOOL_MODE_LINK=
1341                 LIBTOOL_ALLOW_UNDEFINED=
1342                 LIBTOOL_IN_MAIN=
1343                 ;;
1344 esac
1345
1346 #
1347 # enable/disable dumping stack backtrace.  Also check if the system supports
1348 # glibc-compatible backtrace() function.
1349 #
1350 AC_ARG_ENABLE(backtrace,
1351 [  --enable-backtrace      log stack backtrace on abort [[default=yes]]],
1352               want_backtrace="$enableval",  want_backtrace="yes")
1353 case $want_backtrace in
1354 yes)
1355         ISC_PLATFORM_USEBACKTRACE="#define ISC_PLATFORM_USEBACKTRACE 1"
1356         AC_TRY_LINK([#include <execinfo.h>],
1357         [return (backtrace((void **)0, 0));],
1358         [AC_DEFINE([HAVE_LIBCTRACE], [], [if system have backtrace function])],)
1359         ;;
1360 *)
1361         ISC_PLATFORM_USEBACKTRACE="#undef ISC_PLATFORM_USEBACKTRACE"
1362         ;;
1363 esac
1364 AC_SUBST(ISC_PLATFORM_USEBACKTRACE)
1365
1366 AC_ARG_ENABLE(symtable,
1367 [  --enable-symtable       use internal symbol table for backtrace
1368                           [[all|minimal(default)|none]]],
1369                 want_symtable="$enableval",  want_symtable="minimal")
1370 case $want_symtable in
1371 yes|all|minimal)     # "yes" is a hidden value equivalent to "minimal"
1372         if test "$PERL" = ""
1373         then
1374                 AC_MSG_ERROR([Internal symbol table requires perl but no perl is found.
1375 Install perl or explicitly disable the feature by --disable-symtable.])
1376         fi
1377         if test "$use_libtool" = "yes"; then
1378                 AC_MSG_WARN([Internal symbol table does not work with libtool.  Disabling symbol table.])
1379         else
1380                 # we generate the internal symbol table only for those systems
1381                 # known to work to avoid unexpected build failure.  Also, warn
1382                 # about unsupported systems when the feature is enabled
1383                 #  manually.
1384                 case $host_os in
1385                 freebsd*|netbsd*|openbsd*|linux*|solaris*|darwin*)
1386                         MKSYMTBL_PROGRAM="$PERL"
1387                         if test $want_symtable = all; then
1388                                 ALWAYS_MAKE_SYMTABLE="yes"
1389                         fi
1390                         ;;
1391                 *)
1392                         if test $want_symtable = yes -o $want_symtable = all
1393                         then
1394                                 AC_MSG_WARN([this system is not known to generate internal symbol table safely; disabling it])
1395                         fi
1396                 esac
1397         fi
1398         ;;
1399 *)
1400         ;;
1401 esac
1402 AC_SUBST(MKSYMTBL_PROGRAM)
1403 AC_SUBST(ALWAYS_MAKE_SYMTABLE)
1404
1405 #
1406 # File name extension for static archive files, for those few places
1407 # where they are treated differently from dynamic ones.
1408 #
1409 SA=a
1410
1411 AC_SUBST(O)
1412 AC_SUBST(A)
1413 AC_SUBST(SA)
1414 AC_SUBST(LIBTOOL_MKDEP_SED)
1415 AC_SUBST(LIBTOOL_MODE_COMPILE)
1416 AC_SUBST(LIBTOOL_MODE_INSTALL)
1417 AC_SUBST(LIBTOOL_MODE_LINK)
1418 AC_SUBST(LIBTOOL_ALLOW_UNDEFINED)
1419 AC_SUBST(LIBTOOL_IN_MAIN)
1420
1421 #
1422 # build exportable DNS library?
1423 #
1424 AC_ARG_ENABLE(exportlib,
1425         [  --enable-exportlib   build exportable library (GNU make required)
1426                         [[default=no]]])
1427 case "$enable_exportlib" in
1428         yes)
1429                 gmake=
1430                 for x in gmake gnumake make; do
1431                         if $x --version 2>/dev/null | grep GNU > /dev/null; then
1432                                 gmake=$x
1433                                 break;
1434                         fi
1435                 done
1436                 if test -z "$gmake"; then
1437                         AC_MSG_ERROR([exportlib requires GNU make.  Install it or disable the feature.])
1438                 fi
1439                 LIBEXPORT=lib/export
1440                 AC_SUBST(LIBEXPORT)
1441                 BIND9_CO_RULE="%.$O:  \${srcdir}/%.c"
1442                 ;;
1443         no|*)
1444                 BIND9_CO_RULE=".c.$O:"
1445                 ;;
1446 esac
1447 AC_SUBST(BIND9_CO_RULE)
1448
1449 AC_ARG_WITH(export-libdir,
1450         [  --with-export-libdir[=PATH]
1451                         installation directory for the export library
1452                         [[EPREFIX/lib/bind9]]],
1453         export_libdir="$withval",)
1454 if test -z "$export_libdir"; then
1455         export_libdir="\${exec_prefix}/lib/bind9/"
1456 fi
1457 AC_SUBST(export_libdir)
1458
1459 AC_ARG_WITH(export-includedir,
1460         [  --with-export-includedir[=PATH]
1461                         installation directory for the header files of the
1462                         export library [[PREFIX/include/bind9]]],
1463         export_includedir="$withval",)
1464 if test -z "$export_includedir"; then
1465         export_includedir="\${prefix}/include/bind9/"
1466 fi
1467 AC_SUBST(export_includedir)
1468
1469 #
1470 # Here begins a very long section to determine the system's networking
1471 # capabilities.  The order of the tests is significant.
1472 #
1473
1474 #
1475 # IPv6
1476 #
1477 AC_ARG_ENABLE(ipv6,
1478         [  --enable-ipv6           use IPv6 [default=autodetect]])
1479
1480 case "$enable_ipv6" in
1481         yes|''|autodetect)
1482                 AC_DEFINE(WANT_IPV6)
1483                 ;;
1484         no)
1485                 ;;
1486 esac
1487
1488 #
1489 # We do the IPv6 compilation checking after libtool so that we can put
1490 # the right suffix on the files.
1491 #
1492 AC_MSG_CHECKING(for IPv6 structures)
1493 AC_TRY_COMPILE([
1494 #include <sys/types.h>
1495 #include <sys/socket.h>
1496 #include <netinet/in.h>],
1497 [struct sockaddr_in6 sin6; return (0);],
1498         [AC_MSG_RESULT(yes)
1499          found_ipv6=yes],
1500         [AC_MSG_RESULT(no)
1501          found_ipv6=no])
1502
1503 #
1504 # See whether IPv6 support is provided via a Kame add-on.
1505 # This is done before other IPv6 linking tests to LIBS is properly set.
1506 #
1507 AC_MSG_CHECKING(for Kame IPv6 support)
1508 AC_ARG_WITH(kame,
1509         [  --with-kame[=PATH]     use Kame IPv6 [default path /usr/local/v6]],
1510         use_kame="$withval", use_kame="no")
1511
1512 case "$use_kame" in
1513         no)
1514                 ;;
1515         yes)
1516                 kame_path=/usr/local/v6
1517                 ;;
1518         *)
1519                 kame_path="$use_kame"
1520                 ;;
1521 esac
1522
1523 case "$use_kame" in
1524         no)
1525                 AC_MSG_RESULT(no)
1526                 ;;
1527         *)
1528                 if test -f $kame_path/lib/libinet6.a; then
1529                         AC_MSG_RESULT($kame_path/lib/libinet6.a)
1530                         LIBS="-L$kame_path/lib -linet6 $LIBS"
1531                 else
1532                         AC_MSG_ERROR([$kame_path/lib/libinet6.a not found.
1533
1534 Please choose the proper path with the following command:
1535
1536     configure --with-kame=PATH
1537 ])
1538                 fi
1539                 ;;
1540 esac
1541
1542 #
1543 # Whether netinet6/in6.h is needed has to be defined in isc/platform.h.
1544 # Including it on Kame-using platforms is very bad, though, because
1545 # Kame uses #error against direct inclusion.   So include it on only
1546 # the platform that is otherwise broken without it -- BSD/OS 4.0 through 4.1.
1547 # This is done before the in6_pktinfo check because that's what
1548 # netinet6/in6.h is needed for.
1549 #
1550 changequote({, })
1551 case "$host" in
1552 *-bsdi4.[01]*)
1553         ISC_PLATFORM_NEEDNETINET6IN6H="#define ISC_PLATFORM_NEEDNETINET6IN6H 1"
1554         LWRES_PLATFORM_NEEDNETINET6IN6H="#define LWRES_PLATFORM_NEEDNETINET6IN6H 1"
1555         isc_netinet6in6_hack="#include <netinet6/in6.h>"
1556         ;;
1557 *)
1558         ISC_PLATFORM_NEEDNETINET6IN6H="#undef ISC_PLATFORM_NEEDNETINET6IN6H"
1559         LWRES_PLATFORM_NEEDNETINET6IN6H="#undef LWRES_PLATFORM_NEEDNETINET6IN6H"
1560         isc_netinet6in6_hack=""
1561         ;;
1562 esac
1563 changequote([, ])
1564
1565 #
1566 # This is similar to the netinet6/in6.h issue.
1567 #
1568 case "$host" in
1569 *-sco-sysv*uw*|*-*-sysv*UnixWare*|*-*-sysv*OpenUNIX*)
1570         # UnixWare
1571         ISC_PLATFORM_NEEDNETINETIN6H="#define ISC_PLATFORM_NEEDNETINETIN6H 1"
1572         LWRES_PLATFORM_NEEDNETINETIN6H="#define LWRES_PLATFORM_NEEDNETINETIN6H 1"
1573         ISC_PLATFORM_FIXIN6ISADDR="#define ISC_PLATFORM_FIXIN6ISADDR 1"
1574         isc_netinetin6_hack="#include <netinet/in6.h>"
1575         ;;
1576 *)
1577         ISC_PLATFORM_NEEDNETINETIN6H="#undef ISC_PLATFORM_NEEDNETINETIN6H"
1578         LWRES_PLATFORM_NEEDNETINETIN6H="#undef LWRES_PLATFORM_NEEDNETINETIN6H"
1579         ISC_PLATFORM_FIXIN6ISADDR="#undef ISC_PLATFORM_FIXIN6ISADDR"
1580         isc_netinetin6_hack=""
1581         ;;
1582 esac
1583
1584 #
1585 # Now delve deeper into the suitability of the IPv6 support.
1586 #
1587 case "$found_ipv6" in
1588         yes)
1589                 ISC_PLATFORM_HAVEIPV6="#define ISC_PLATFORM_HAVEIPV6 1"
1590                 LWRES_PLATFORM_HAVEIPV6="#define LWRES_PLATFORM_HAVEIPV6 1"
1591
1592                 AC_MSG_CHECKING(for in6_addr)
1593                 AC_TRY_COMPILE([
1594 #include <sys/types.h>
1595 #include <sys/socket.h>
1596 #include <netinet/in.h>
1597 $isc_netinetin6_hack
1598 $isc_netinet6in6_hack
1599 ],
1600 [struct in6_addr in6; return (0);],
1601                 [AC_MSG_RESULT(yes)
1602                  ISC_PLATFORM_HAVEINADDR6="#undef ISC_PLATFORM_HAVEINADDR6"
1603                  LWRES_PLATFORM_HAVEINADDR6="#undef LWRES_PLATFORM_HAVEINADDR6"
1604                  isc_in_addr6_hack=""],
1605                 [AC_MSG_RESULT(no)
1606                  ISC_PLATFORM_HAVEINADDR6="#define ISC_PLATFORM_HAVEINADDR6 1"
1607                  LWRES_PLATFORM_HAVEINADDR6="#define LWRES_PLATFORM_HAVEINADDR6 1"
1608                  isc_in_addr6_hack="#define in6_addr in_addr6"])
1609
1610                 AC_MSG_CHECKING(for in6addr_any)
1611                 AC_TRY_LINK([
1612 #include <sys/types.h>
1613 #include <sys/socket.h>
1614 #include <netinet/in.h>
1615 $isc_netinetin6_hack
1616 $isc_netinet6in6_hack
1617 $isc_in_addr6_hack
1618 ],
1619                 [struct in6_addr in6; in6 = in6addr_any; return (in6.s6_addr[0]);],
1620                         [AC_MSG_RESULT(yes)
1621                          ISC_PLATFORM_NEEDIN6ADDRANY="#undef ISC_PLATFORM_NEEDIN6ADDRANY"
1622                          LWRES_PLATFORM_NEEDIN6ADDRANY="#undef LWRES_PLATFORM_NEEDIN6ADDRANY"],
1623                         [AC_MSG_RESULT(no)
1624                          ISC_PLATFORM_NEEDIN6ADDRANY="#define ISC_PLATFORM_NEEDIN6ADDRANY 1"
1625                          LWRES_PLATFORM_NEEDIN6ADDRANY="#define LWRES_PLATFORM_NEEDIN6ADDRANY 1"])
1626
1627                 AC_MSG_CHECKING(for in6addr_loopback)
1628                 AC_TRY_LINK([
1629 #include <sys/types.h>
1630 #include <sys/socket.h>
1631 #include <netinet/in.h>
1632 $isc_netinetin6_hack
1633 $isc_netinet6in6_hack
1634 $isc_in_addr6_hack
1635 ],
1636                 [struct in6_addr in6; in6 = in6addr_loopback; return (in6.s6_addr[0]);],
1637                         [AC_MSG_RESULT(yes)
1638                          ISC_PLATFORM_NEEDIN6ADDRLOOPBACK="#undef ISC_PLATFORM_NEEDIN6ADDRLOOPBACK"
1639                          LWRES_PLATFORM_NEEDIN6ADDRLOOPBACK="#undef LWRES_PLATFORM_NEEDIN6ADDRLOOPBACK"],
1640                         [AC_MSG_RESULT(no)
1641                          ISC_PLATFORM_NEEDIN6ADDRLOOPBACK="#define ISC_PLATFORM_NEEDIN6ADDRLOOPBACK 1"
1642                          LWRES_PLATFORM_NEEDIN6ADDRLOOPBACK="#define LWRES_PLATFORM_NEEDIN6ADDRLOOPBACK 1"])
1643
1644                 AC_MSG_CHECKING(for sin6_scope_id in struct sockaddr_in6)
1645                 AC_TRY_COMPILE([
1646 #include <sys/types.h>
1647 #include <sys/socket.h>
1648 #include <netinet/in.h>
1649 $isc_netinetin6_hack
1650 $isc_netinet6in6_hack
1651 ],
1652                 [struct sockaddr_in6 xyzzy; xyzzy.sin6_scope_id = 0; return (0);],
1653                         [AC_MSG_RESULT(yes)
1654                          ISC_PLATFORM_HAVESCOPEID="#define ISC_PLATFORM_HAVESCOPEID 1"
1655                          result="#define LWRES_HAVE_SIN6_SCOPE_ID 1"],
1656                         [AC_MSG_RESULT(no)
1657                          ISC_PLATFORM_HAVESCOPEID="#undef ISC_PLATFORM_HAVESCOPEID"
1658                          result="#undef LWRES_HAVE_SIN6_SCOPE_ID"])
1659                 LWRES_HAVE_SIN6_SCOPE_ID="$result"
1660
1661                 AC_MSG_CHECKING(for in6_pktinfo)
1662                 AC_TRY_COMPILE([
1663 #include <sys/types.h>
1664 #include <sys/socket.h>
1665 #include <netinet/in.h>
1666 $isc_netinetin6_hack
1667 $isc_netinet6in6_hack
1668 ],
1669                 [struct in6_pktinfo xyzzy; return (0);],
1670                         [AC_MSG_RESULT(yes)
1671                          ISC_PLATFORM_HAVEIN6PKTINFO="#define ISC_PLATFORM_HAVEIN6PKTINFO 1"],
1672                         [AC_MSG_RESULT(no -- disabling runtime ipv6 support)
1673                          ISC_PLATFORM_HAVEIN6PKTINFO="#undef ISC_PLATFORM_HAVEIN6PKTINFO"])
1674                 ;;
1675         no)
1676                 ISC_PLATFORM_HAVEIPV6="#undef ISC_PLATFORM_HAVEIPV6"
1677                 LWRES_PLATFORM_HAVEIPV6="#undef LWRES_PLATFORM_HAVEIPV6"
1678                 ISC_PLATFORM_NEEDIN6ADDRANY="#undef ISC_PLATFORM_NEEDIN6ADDRANY"
1679                 LWRES_PLATFORM_NEEDIN6ADDRANY="#undef LWRES_PLATFORM_NEEDIN6ADDRANY"
1680                 ISC_PLATFORM_HAVEIN6PKTINFO="#undef ISC_PLATFORM_HAVEIN6PKTINFO"
1681                 LWRES_HAVE_SIN6_SCOPE_ID="#define LWRES_HAVE_SIN6_SCOPE_ID 1"
1682                 ISC_PLATFORM_HAVESCOPEID="#define ISC_PLATFORM_HAVESCOPEID 1"
1683                 ISC_IPV6_H="ipv6.h"
1684                 ISC_IPV6_O="ipv6.$O"
1685                 ISC_ISCIPV6_O="unix/ipv6.$O"
1686                 ISC_IPV6_C="ipv6.c"
1687                 ;;
1688 esac
1689
1690 AC_SUBST(ISC_PLATFORM_HAVEIPV6)
1691 AC_SUBST(LWRES_PLATFORM_HAVEIPV6)
1692 AC_SUBST(ISC_PLATFORM_NEEDNETINETIN6H)
1693 AC_SUBST(LWRES_PLATFORM_NEEDNETINETIN6H)
1694 AC_SUBST(ISC_PLATFORM_NEEDNETINET6IN6H)
1695 AC_SUBST(LWRES_PLATFORM_NEEDNETINET6IN6H)
1696 AC_SUBST(ISC_PLATFORM_HAVEINADDR6)
1697 AC_SUBST(LWRES_PLATFORM_HAVEINADDR6)
1698 AC_SUBST(ISC_PLATFORM_NEEDIN6ADDRANY)
1699 AC_SUBST(LWRES_PLATFORM_NEEDIN6ADDRANY)
1700 AC_SUBST(ISC_PLATFORM_NEEDIN6ADDRLOOPBACK)
1701 AC_SUBST(LWRES_PLATFORM_NEEDIN6ADDRLOOPBACK)
1702 AC_SUBST(ISC_PLATFORM_HAVEIN6PKTINFO)
1703 AC_SUBST(ISC_PLATFORM_FIXIN6ISADDR)
1704 AC_SUBST(ISC_IPV6_H)
1705 AC_SUBST(ISC_IPV6_O)
1706 AC_SUBST(ISC_ISCIPV6_O)
1707 AC_SUBST(ISC_IPV6_C)
1708 AC_SUBST(LWRES_HAVE_SIN6_SCOPE_ID)
1709 AC_SUBST(ISC_PLATFORM_HAVESCOPEID)
1710
1711 AC_MSG_CHECKING([for struct if_laddrreq])
1712 AC_TRY_LINK([
1713 #include <sys/types.h>
1714 #include <net/if6.h>
1715 ],[ struct if_laddrreq a; ],
1716         [AC_MSG_RESULT(yes)
1717         ISC_PLATFORM_HAVEIF_LADDRREQ="#define ISC_PLATFORM_HAVEIF_LADDRREQ 1"],
1718         [AC_MSG_RESULT(no)
1719         ISC_PLATFORM_HAVEIF_LADDRREQ="#undef ISC_PLATFORM_HAVEIF_LADDRREQ"])
1720 AC_SUBST(ISC_PLATFORM_HAVEIF_LADDRREQ)
1721
1722 AC_MSG_CHECKING([for struct if_laddrconf])
1723 AC_TRY_LINK([
1724 #include <sys/types.h>
1725 #include <net/if6.h>
1726 ],[ struct if_laddrconf a; ],
1727         [AC_MSG_RESULT(yes)
1728         ISC_PLATFORM_HAVEIF_LADDRCONF="#define ISC_PLATFORM_HAVEIF_LADDRCONF 1"],
1729         [AC_MSG_RESULT(no)
1730         ISC_PLATFORM_HAVEIF_LADDRCONF="#undef ISC_PLATFORM_HAVEIF_LADDRCONF"])
1731 AC_SUBST(ISC_PLATFORM_HAVEIF_LADDRCONF)
1732
1733 #
1734 # Check for network functions that are often missing.  We do this
1735 # after the libtool checking, so we can put the right suffix on
1736 # the files.  It also needs to come after checking for a Kame add-on,
1737 # which provides some (all?) of the desired functions.
1738 #
1739
1740 AC_MSG_CHECKING([for inet_ntop with IPv6 support])
1741 AC_TRY_RUN([
1742 #include <sys/types.h>
1743 #include <sys/socket.h>
1744 #include <netinet/in.h>
1745 #include <arpa/inet.h>
1746 main() {
1747 char a[16],b[64]; return(inet_ntop(AF_INET6, a, b, sizeof(b)) == (char*)0);}],
1748         [AC_MSG_RESULT(yes)
1749         ISC_PLATFORM_NEEDNTOP="#undef ISC_PLATFORM_NEEDNTOP"],
1750
1751         [AC_MSG_RESULT(no)
1752         ISC_EXTRA_OBJS="$ISC_EXTRA_OBJS inet_ntop.$O"
1753         ISC_EXTRA_SRCS="$ISC_EXTRA_SRCS inet_ntop.c"
1754         ISC_PLATFORM_NEEDNTOP="#define ISC_PLATFORM_NEEDNTOP 1"],
1755         [AC_MSG_RESULT(assuming inet_ntop needed)
1756         ISC_EXTRA_OBJS="$ISC_EXTRA_OBJS inet_ntop.$O"
1757         ISC_EXTRA_SRCS="$ISC_EXTRA_SRCS inet_ntop.c"
1758         ISC_PLATFORM_NEEDNTOP="#define ISC_PLATFORM_NEEDNTOP 1"])
1759
1760
1761 # On NetBSD 1.4.2 and maybe others, inet_pton() incorrectly accepts
1762 # addresses with less than four octets, like "1.2.3".  Also leading
1763 # zeros should also be rejected.
1764
1765 AC_MSG_CHECKING([for working inet_pton with IPv6 support])
1766 AC_TRY_RUN([
1767 #include <sys/types.h>
1768 #include <sys/socket.h>
1769 #include <netinet/in.h>
1770 #include <arpa/inet.h>
1771 main() { char a[16]; return (inet_pton(AF_INET, "1.2.3", a) == 1 ? 1 :
1772                              inet_pton(AF_INET, "1.2.3.04", a) == 1 ? 1 : 
1773                              (inet_pton(AF_INET6, "::1.2.3.4", a) != 1)); }],
1774         [AC_MSG_RESULT(yes)
1775         ISC_PLATFORM_NEEDPTON="#undef ISC_PLATFORM_NEEDPTON"],
1776         [AC_MSG_RESULT(no)
1777         ISC_EXTRA_OBJS="$ISC_EXTRA_OBJS inet_pton.$O"
1778         ISC_EXTRA_SRCS="$ISC_EXTRA_SRCS inet_pton.c"
1779         ISC_PLATFORM_NEEDPTON="#define ISC_PLATFORM_NEEDPTON 1"],
1780         [AC_MSG_RESULT(assuming target platform has working inet_pton)
1781         ISC_PLATFORM_NEEDPTON="#undef ISC_PLATFORM_NEEDPTON"],
1782         [AC_MSG_RESULT(assuming inet_pton needed)
1783         ISC_EXTRA_OBJS="$ISC_EXTRA_OBJS inet_pton.$O"
1784         ISC_EXTRA_SRCS="$ISC_EXTRA_SRCS inet_pton.c"
1785         ISC_PLATFORM_NEEDPTON="#define ISC_PLATFORM_NEEDPTON 1"],
1786         [AC_MSG_RESULT(assuming target platform has working inet_pton)
1787         ISC_PLATFORM_NEEDPTON="#undef ISC_PLATFORM_NEEDPTON"])
1788
1789 AC_SUBST(ISC_PLATFORM_NEEDNTOP)
1790 AC_SUBST(ISC_PLATFORM_NEEDPTON)
1791
1792 #
1793 # Look for a 4.4BSD-style sa_len member in struct sockaddr.
1794 #
1795 case "$host" in
1796         *-dec-osf*)
1797                 # Turn on 4.4BSD style sa_len support.
1798                 AC_DEFINE(_SOCKADDR_LEN)
1799                 ;;
1800 esac
1801
1802 AC_MSG_CHECKING(for sa_len in struct sockaddr)
1803 AC_TRY_COMPILE([
1804 #include <sys/types.h>
1805 #include <sys/socket.h>],
1806 [struct sockaddr sa; sa.sa_len = 0; return (0);],
1807         [AC_MSG_RESULT(yes)
1808         ISC_PLATFORM_HAVESALEN="#define ISC_PLATFORM_HAVESALEN 1"
1809         LWRES_PLATFORM_HAVESALEN="#define LWRES_PLATFORM_HAVESALEN 1"],
1810         [AC_MSG_RESULT(no)
1811         ISC_PLATFORM_HAVESALEN="#undef ISC_PLATFORM_HAVESALEN"
1812         LWRES_PLATFORM_HAVESALEN="#undef LWRES_PLATFORM_HAVESALEN"])
1813 AC_SUBST(ISC_PLATFORM_HAVESALEN)
1814 AC_SUBST(LWRES_PLATFORM_HAVESALEN)
1815
1816 #
1817 # Look for a 4.4BSD or 4.3BSD struct msghdr
1818 #
1819 AC_MSG_CHECKING(for struct msghdr flavor)
1820 AC_TRY_COMPILE([
1821 #include <sys/types.h>
1822 #include <sys/socket.h>],
1823 [struct msghdr msg; msg.msg_flags = 0; return (0);],
1824         [AC_MSG_RESULT(4.4BSD)
1825         ISC_PLATFORM_MSGHDRFLAVOR="#define ISC_NET_BSD44MSGHDR 1"],
1826         [AC_MSG_RESULT(4.3BSD)
1827         ISC_PLATFORM_MSGHDRFLAVOR="#define ISC_NET_BSD43MSGHDR 1"])
1828 AC_SUBST(ISC_PLATFORM_MSGHDRFLAVOR)
1829
1830 #
1831 # Look for in_port_t.
1832 #
1833 AC_MSG_CHECKING(for type in_port_t)
1834 AC_TRY_COMPILE([
1835 #include <sys/types.h>
1836 #include <netinet/in.h>],
1837 [in_port_t port = 25; return (0);],
1838         [AC_MSG_RESULT(yes)
1839         ISC_PLATFORM_NEEDPORTT="#undef ISC_PLATFORM_NEEDPORTT"],
1840         [AC_MSG_RESULT(no)
1841         ISC_PLATFORM_NEEDPORTT="#define ISC_PLATFORM_NEEDPORTT 1"])
1842 AC_SUBST(ISC_PLATFORM_NEEDPORTT)
1843
1844 #
1845 # Check for addrinfo
1846 #
1847 AC_MSG_CHECKING(for struct addrinfo)
1848 AC_TRY_COMPILE([
1849 #include <netdb.h>],
1850 [struct addrinfo a; return (0);],
1851         [AC_MSG_RESULT(yes)
1852         ISC_LWRES_NEEDADDRINFO="#undef ISC_LWRES_NEEDADDRINFO"
1853         ISC_IRS_NEEDADDRINFO="#undef ISC_IRS_NEEDADDRINFO"
1854         AC_DEFINE(HAVE_ADDRINFO)],
1855         [AC_MSG_RESULT(no)
1856         ISC_LWRES_NEEDADDRINFO="#define ISC_LWRES_NEEDADDRINFO 1"
1857         ISC_IRS_NEEDADDRINFO="#define ISC_IRS_NEEDADDRINFO 1"])
1858 AC_SUBST(ISC_LWRES_NEEDADDRINFO)
1859 AC_SUBST(ISC_IRS_NEEDADDRINFO)
1860
1861 #
1862 # Check for rrsetinfo
1863 #
1864 AC_MSG_CHECKING(for struct rrsetinfo)
1865 AC_TRY_COMPILE([
1866 #include <netdb.h>],
1867 [struct rrsetinfo r; return (0);],
1868         [AC_MSG_RESULT(yes)
1869         ISC_LWRES_NEEDRRSETINFO="#undef ISC_LWRES_NEEDRRSETINFO"],
1870         [AC_MSG_RESULT(no)
1871         ISC_LWRES_NEEDRRSETINFO="#define ISC_LWRES_NEEDRRSETINFO 1"])
1872 AC_SUBST(ISC_LWRES_NEEDRRSETINFO)
1873
1874 AC_MSG_CHECKING(for int sethostent)
1875 AC_TRY_COMPILE([
1876 #include <netdb.h>],
1877 [int i = sethostent(0); return(0);],
1878         [AC_MSG_RESULT(yes)
1879         ISC_LWRES_SETHOSTENTINT="#define ISC_LWRES_SETHOSTENTINT 1"],
1880         [AC_MSG_RESULT(no)
1881         ISC_LWRES_SETHOSTENTINT="#undef ISC_LWRES_SETHOSTENTINT"])
1882 AC_SUBST(ISC_LWRES_SETHOSTENTINT)
1883
1884 AC_MSG_CHECKING(for int endhostent)
1885 AC_TRY_COMPILE([
1886 #include <netdb.h>],
1887 [int i = endhostent(); return(0);],
1888         [AC_MSG_RESULT(yes)
1889         ISC_LWRES_ENDHOSTENTINT="#define ISC_LWRES_ENDHOSTENTINT 1"],
1890         [AC_MSG_RESULT(no)
1891         ISC_LWRES_ENDHOSTENTINT="#undef ISC_LWRES_ENDHOSTENTINT"])
1892 AC_SUBST(ISC_LWRES_ENDHOSTENTINT)
1893
1894 AC_MSG_CHECKING(for getnetbyaddr(in_addr_t, ...))
1895 AC_TRY_COMPILE([
1896 #include <netdb.h>
1897 struct netent *getnetbyaddr(in_addr_t, int);],
1898 [],
1899         [AC_MSG_RESULT(yes)
1900         ISC_LWRES_GETNETBYADDRINADDR="#define ISC_LWRES_GETNETBYADDRINADDR 1"],
1901         [AC_MSG_RESULT(no)
1902         ISC_LWRES_GETNETBYADDRINADDR="#undef ISC_LWRES_GETNETBYADDRINADDR"])
1903 AC_SUBST(ISC_LWRES_GETNETBYADDRINADDR)
1904
1905 AC_MSG_CHECKING(for int setnetent)
1906 AC_TRY_COMPILE([
1907 #include <netdb.h>],
1908 [int i = setnetent(0); return(0);],
1909         [AC_MSG_RESULT(yes)
1910         ISC_LWRES_SETNETENTINT="#define ISC_LWRES_SETNETENTINT 1"],
1911         [AC_MSG_RESULT(no)
1912         ISC_LWRES_SETNETENTINT="#undef ISC_LWRES_SETNETENTINT"])
1913 AC_SUBST(ISC_LWRES_SETNETENTINT)
1914
1915 AC_MSG_CHECKING(for int endnetent)
1916 AC_TRY_COMPILE([
1917 #include <netdb.h>],
1918 [int i = endnetent(); return(0);],
1919         [AC_MSG_RESULT(yes)
1920         ISC_LWRES_ENDNETENTINT="#define ISC_LWRES_ENDNETENTINT 1"],
1921         [AC_MSG_RESULT(no)
1922         ISC_LWRES_ENDNETENTINT="#undef ISC_LWRES_ENDNETENTINT"])
1923 AC_SUBST(ISC_LWRES_ENDNETENTINT)
1924
1925 AC_MSG_CHECKING(for gethostbyaddr(const void *, size_t, ...))
1926 AC_TRY_COMPILE([
1927 #include <netdb.h>
1928 struct hostent *gethostbyaddr(const void *, size_t, int);],
1929 [return(0);],
1930         [AC_MSG_RESULT(yes)
1931         ISC_LWRES_GETHOSTBYADDRVOID="#define ISC_LWRES_GETHOSTBYADDRVOID 1"],
1932         [AC_MSG_RESULT(no)
1933         ISC_LWRES_GETHOSTBYADDRVOID="#undef ISC_LWRES_GETHOSTBYADDRVOID"])
1934 AC_SUBST(ISC_LWRES_GETHOSTBYADDRVOID)
1935
1936 AC_MSG_CHECKING(for h_errno in netdb.h)
1937 AC_TRY_COMPILE([
1938 #include <netdb.h>],
1939 [h_errno = 1; return(0);],
1940         [AC_MSG_RESULT(yes)
1941         ISC_LWRES_NEEDHERRNO="#undef ISC_LWRES_NEEDHERRNO"],
1942         [AC_MSG_RESULT(no)
1943         ISC_LWRES_NEEDHERRNO="#define ISC_LWRES_NEEDHERRNO 1"])
1944 AC_SUBST(ISC_LWRES_NEEDHERRNO)
1945
1946 #
1947 # Sadly, the definitions of system-supplied getnameinfo(3) vary.  Try to catch
1948 # known variations here:
1949 #
1950 AC_MSG_CHECKING(for getnameinfo prototype definitions)
1951 AC_TRY_COMPILE([
1952 #include <sys/types.h>
1953 #include <sys/socket.h>
1954 #include <netdb.h>
1955 int getnameinfo(const struct sockaddr *, socklen_t, char *,
1956                 socklen_t, char *, socklen_t, unsigned int);],
1957 [ return (0);],
1958         [AC_MSG_RESULT(socklen_t for buflen; u_int for flags)
1959          AC_DEFINE(IRS_GETNAMEINFO_BUFLEN_T, socklen_t,
1960                    [Define to the buffer length type used by getnameinfo(3).])
1961          AC_DEFINE(IRS_GETNAMEINFO_FLAGS_T, unsigned int,
1962                    [Define to the flags type used by getnameinfo(3).])],
1963 [AC_TRY_COMPILE([
1964 #include <sys/types.h>
1965 #include <sys/socket.h>
1966 #include <netdb.h>
1967 int getnameinfo(const struct sockaddr *, socklen_t, char *,
1968                 size_t, char *, size_t, int);],
1969 [ return (0);],
1970         [AC_MSG_RESULT(size_t for buflen; int for flags)
1971          AC_DEFINE(IRS_GETNAMEINFO_BUFLEN_T, size_t)
1972          AC_DEFINE(IRS_GETNAMEINFO_FLAGS_T, int)],
1973 [AC_MSG_RESULT(not match any subspecies; assume standard definition)
1974 AC_DEFINE(IRS_GETNAMEINFO_BUFLEN_T, socklen_t)
1975 AC_DEFINE(IRS_GETNAMEINFO_FLAGS_T, int)])])
1976
1977 #
1978 # ...and same for gai_strerror().
1979 #
1980 AC_MSG_CHECKING(for gai_strerror prototype definitions)
1981 AC_TRY_COMPILE([
1982 #include <sys/types.h>
1983 #include <sys/socket.h>
1984 #include <netdb.h>
1985 char *gai_strerror(int ecode);],
1986 [ return (0); ],
1987         [AC_MSG_RESULT(returning char *)
1988          AC_DEFINE([IRS_GAISTRERROR_RETURN_T], [char *],
1989          [return type of gai_strerror])],
1990 [AC_MSG_RESULT(not match any subspecies; assume standard definition)
1991 AC_DEFINE([IRS_GAISTRERROR_RETURN_T], [const char *])])
1992
1993 AC_CHECK_FUNC(getipnodebyname,
1994         [ISC_LWRES_GETIPNODEPROTO="#undef ISC_LWRES_GETIPNODEPROTO"],
1995         [ISC_LWRES_GETIPNODEPROTO="#define ISC_LWRES_GETIPNODEPROTO 1"])
1996 AC_CHECK_FUNC(getnameinfo,
1997         [ISC_LWRES_GETNAMEINFOPROTO="#undef ISC_LWRES_GETNAMEINFOPROTO"],
1998         [ISC_LWRES_GETNAMEINFOPROTO="#define ISC_LWRES_GETNAMEINFOPROTO 1"])
1999 AC_CHECK_FUNC(getaddrinfo,
2000         [ISC_LWRES_GETADDRINFOPROTO="#undef ISC_LWRES_GETADDRINFOPROTO"
2001         AC_DEFINE(HAVE_GETADDRINFO)],
2002         [ISC_LWRES_GETADDRINFOPROTO="#define ISC_LWRES_GETADDRINFOPROTO 1"])
2003 AC_CHECK_FUNC(gai_strerror, AC_DEFINE(HAVE_GAISTRERROR))
2004 AC_SUBST(ISC_LWRES_GETIPNODEPROTO)
2005 AC_SUBST(ISC_LWRES_GETADDRINFOPROTO)
2006 AC_SUBST(ISC_LWRES_GETNAMEINFOPROTO)
2007 AC_SUBST(ISC_IRS_GETNAMEINFOSOCKLEN)
2008
2009 AC_ARG_ENABLE(getifaddrs,
2010 [  --enable-getifaddrs     Enable the use of getifaddrs() [[yes|no]].],
2011     want_getifaddrs="$enableval",  want_getifaddrs="yes")
2012
2013 #
2014 # This interface iteration code for getifaddrs() will fall back to using
2015 # /proc/net/if_inet6 if getifaddrs() in glibc doesn't return any IPv6
2016 # addresses.
2017
2018 case $want_getifaddrs in
2019 glibc)
2020 AC_MSG_WARN("--enable-getifaddrs=glibc is no longer required")
2021 AC_CHECK_FUNC(getifaddrs, AC_DEFINE(HAVE_GETIFADDRS))
2022 ;;
2023 yes)
2024 AC_CHECK_FUNC(getifaddrs, AC_DEFINE(HAVE_GETIFADDRS))
2025 ;;
2026 no)
2027 ;;
2028 esac
2029
2030 #
2031 # Look for a sysctl call to get the list of network interfaces.
2032 #
2033 case $ac_cv_header_sys_sysctl_h in
2034 yes)
2035 AC_MSG_CHECKING(for interface list sysctl)
2036 AC_EGREP_CPP(found_rt_iflist, [
2037 #include <sys/param.h>
2038 #include <sys/sysctl.h>
2039 #include <sys/socket.h>
2040 #ifdef NET_RT_IFLIST
2041 found_rt_iflist
2042 #endif
2043 ],
2044         [AC_MSG_RESULT(yes)
2045          AC_DEFINE(HAVE_IFLIST_SYSCTL)],
2046         [AC_MSG_RESULT(no)])
2047 ;;
2048 esac
2049
2050 #
2051 # Check for some other useful functions that are not ever-present.
2052 #
2053
2054 # We test for strsep() using AC_TRY_LINK instead of AC_CHECK_FUNC
2055 # because AIX 4.3.3 with patches for bos.adt.include to version 4.3.3.77
2056 # reportedly defines strsep() without declaring it in <string.h> when
2057 # -D_LINUX_SOURCE_COMPAT is not defined [RT #2190], and
2058 # AC_CHECK_FUNC() incorrectly succeeds because it declares
2059 # the function itself.
2060 AC_MSG_CHECKING(for correctly declared strsep())
2061 AC_TRY_LINK([#include <string.h>], [char *sp; char *foo = strsep(&sp, ".");],
2062         [AC_MSG_RESULT(yes); ISC_PLATFORM_NEEDSTRSEP="#undef ISC_PLATFORM_NEEDSTRSEP"],
2063         [AC_MSG_RESULT(no); ISC_PLATFORM_NEEDSTRSEP="#define ISC_PLATFORM_NEEDSTRSEP 1"])
2064 AC_SUBST(ISC_PLATFORM_NEEDSTRSEP)
2065
2066 AC_CHECK_FUNC(memmove,
2067         [ISC_PLATFORM_NEEDMEMMOVE="#undef ISC_PLATFORM_NEEDMEMMOVE"],
2068         [ISC_PLATFORM_NEEDMEMMOVE="#define ISC_PLATFORM_NEEDMEMMOVE 1"])
2069 AC_SUBST(ISC_PLATFORM_NEEDMEMMOVE)
2070
2071 AC_CHECK_FUNC(strtoul,
2072         [ISC_PLATFORM_NEEDSTRTOUL="#undef ISC_PLATFORM_NEEDSTRTOUL"
2073          LWRES_PLATFORM_NEEDSTRTOUL="#undef LWRES_PLATFORM_NEEDSTRTOUL"
2074          GENRANDOMLIB=""],
2075         [ISC_PLATFORM_NEEDSTRTOUL="#define ISC_PLATFORM_NEEDSTRTOUL 1"
2076          LWRES_PLATFORM_NEEDSTRTOUL="#define LWRES_PLATFORM_NEEDSTRTOUL 1"
2077          GENRANDOMLIB='${ISCLIBS}'])
2078 AC_SUBST(ISC_PLATFORM_NEEDSTRTOUL)
2079 AC_SUBST(LWRES_PLATFORM_NEEDSTRTOUL)
2080 AC_SUBST(GENRANDOMLIB)
2081
2082 AC_CHECK_FUNC(strlcpy,
2083         [ISC_PLATFORM_NEEDSTRLCPY="#undef ISC_PLATFORM_NEEDSTRLCPY"],
2084         [ISC_PLATFORM_NEEDSTRLCPY="#define ISC_PLATFORM_NEEDSTRLCPY 1"])
2085 AC_SUBST(ISC_PLATFORM_NEEDSTRLCPY)
2086
2087 AC_CHECK_FUNC(strlcat,
2088         [ISC_PLATFORM_NEEDSTRLCAT="#undef ISC_PLATFORM_NEEDSTRLCAT"],
2089         [ISC_PLATFORM_NEEDSTRLCAT="#define ISC_PLATFORM_NEEDSTRLCAT 1"])
2090 AC_SUBST(ISC_PLATFORM_NEEDSTRLCAT)
2091
2092 ISC_PRINT_OBJS=
2093 ISC_PRINT_SRCS=
2094 AC_MSG_CHECKING(sprintf)
2095 AC_TRY_COMPILE([
2096 #include <stdio.h>
2097 ],
2098 [ char buf[2]; return(*sprintf(buf,"x"));],
2099 [
2100 ISC_PRINT_OBJS="print.$O"
2101 ISC_PRINT_SRCS="print.c"
2102 ISC_PLATFORM_NEEDSPRINTF="#define ISC_PLATFORM_NEEDSPRINTF"
2103 LWRES_PLATFORM_NEEDSPRINTF="#define LWRES_PLATFORM_NEEDSPRINTF"
2104 ],
2105 [ISC_PLATFORM_NEEDSPRINTF="#undef ISC_PLATFORM_NEEDSPRINTF"
2106  LWRES_PLATFORM_NEEDSPRINTF="#undef LWRES_PLATFORM_NEEDSPRINTF"]
2107 )
2108 AC_SUBST(ISC_PLATFORM_NEEDSPRINTF)
2109 AC_SUBST(LWRES_PLATFORM_NEEDSPRINTF)
2110
2111 AC_CHECK_FUNC(vsnprintf,
2112         [ISC_PLATFORM_NEEDVSNPRINTF="#undef ISC_PLATFORM_NEEDVSNPRINTF"
2113          LWRES_PLATFORM_NEEDVSNPRINTF="#undef LWRES_PLATFORM_NEEDVSNPRINTF"],
2114         [ISC_PRINT_OBJS="print.$O"
2115          ISC_PRINT_SRCS="print.c"
2116          ISC_PLATFORM_NEEDVSNPRINTF="#define ISC_PLATFORM_NEEDVSNPRINTF 1"
2117          LWRES_PLATFORM_NEEDVSNPRINTF="#define LWRES_PLATFORM_NEEDVSNPRINTF 1"])
2118 AC_SUBST(ISC_PLATFORM_NEEDVSNPRINTF)
2119 AC_SUBST(LWRES_PLATFORM_NEEDVSNPRINTF)
2120 ISC_EXTRA_OBJS="$ISC_EXTRA_OBJS $ISC_PRINT_OBJS"
2121 ISC_EXTRA_SRCS="$ISC_EXTRA_SRCS $ISC_PRINT_SRCS"
2122
2123 AC_CHECK_FUNC(strerror, AC_DEFINE(HAVE_STRERROR))
2124
2125 AC_SUBST(ISC_EXTRA_OBJS)
2126 AC_SUBST(ISC_EXTRA_SRCS)
2127
2128 #
2129 # Use our own SPNEGO implementation?
2130 #
2131 AC_ARG_ENABLE(isc-spnego,
2132         [  --disable-isc-spnego    use SPNEGO from GSSAPI library])
2133
2134 if test -n "$USE_GSSAPI"
2135 then
2136         case "$enable_isc_spnego" in
2137                 yes|'')
2138                         USE_ISC_SPNEGO='-DUSE_ISC_SPNEGO'
2139                         DST_EXTRA_OBJS="$DST_EXTRA_OBJS spnego.$O"
2140                         DST_EXTRA_SRCS="$DST_EXTRA_SRCS spnego.c"
2141                         AC_MSG_RESULT(using SPNEGO from lib/dns)
2142                         ;;
2143                 no)
2144                         AC_MSG_RESULT(using SPNEGO from GSSAPI library)
2145                         ;;
2146         esac
2147 fi
2148
2149 AC_SUBST(USE_ISC_SPNEGO)
2150
2151 AC_SUBST(DST_EXTRA_OBJS)
2152 AC_SUBST(DST_EXTRA_SRCS)
2153
2154 # Determine the printf format characters to use when printing
2155 # values of type isc_int64_t. This will normally be "ll", but where
2156 # the compiler treats "long long" as a alias for "long" and printf
2157 # doesn't know about "long long" use "l".  Hopefully the sprintf
2158 # will produce a inconsistent result in the later case.  If the compiler
2159 # fails due to seeing "%lld" we fall back to "l".
2160 #
2161 # Digital Unix 4.0 (gcc?) (long long) is 64 bits as is its long. It uses
2162 # %ld even for (long long)/
2163 #
2164 # Win32 uses "%I64d", but that's defined elsewhere since we don't use
2165 # configure on Win32.
2166 #
2167 AC_MSG_CHECKING(printf format modifier for 64-bit integers)
2168 AC_TRY_RUN([
2169 #include <stdio.h>
2170 main() {
2171         long long int j = 0;
2172         char buf[100];
2173         buf[0] = 0;
2174         sprintf(buf, "%lld", j);
2175         exit((sizeof(long long int) != sizeof(long int))? 0 :
2176              (strcmp(buf, "0") != 0));
2177
2178 ],
2179         [AC_MSG_RESULT(ll)
2180         ISC_PLATFORM_QUADFORMAT='#define ISC_PLATFORM_QUADFORMAT "ll"'
2181         LWRES_PLATFORM_QUADFORMAT='#define LWRES_PLATFORM_QUADFORMAT "ll"'],
2182         [AC_MSG_RESULT(l)
2183         ISC_PLATFORM_QUADFORMAT='#define ISC_PLATFORM_QUADFORMAT "l"'
2184         LWRES_PLATFORM_QUADFORMAT='#define LWRES_PLATFORM_QUADFORMAT "l"'],
2185         [AC_MSG_RESULT(assuming target platform uses ll)
2186         ISC_PLATFORM_QUADFORMAT='#define ISC_PLATFORM_QUADFORMAT "ll"'
2187         LWRES_PLATFORM_QUADFORMAT='#define LWRES_PLATFORM_QUADFORMAT "ll"'])
2188 AC_SUBST(ISC_PLATFORM_QUADFORMAT)
2189 AC_SUBST(LWRES_PLATFORM_QUADFORMAT)
2190
2191 #
2192 # Security Stuff
2193 #
2194 # Note it is very recommended to *not* disable chroot(),
2195 # this is only because chroot() was made obsolete by Posix.
2196 AC_ARG_ENABLE(chroot,
2197         [  --disable-chroot        disable chroot])
2198 case "$enable_chroot" in
2199         yes|'')
2200                 AC_CHECK_FUNCS(chroot)
2201                 ;;
2202         no)
2203                 ;;
2204 esac
2205 AC_ARG_ENABLE(linux-caps,
2206         [  --disable-linux-caps   disable linux capabilities])
2207 case "$enable_linux_caps" in
2208         yes|'')
2209                 AC_CHECK_HEADERS(linux/capability.h sys/capability.h)
2210                 AC_CHECK_LIB(cap, cap_set_proc)
2211                 ;;
2212         no)
2213                 ;;
2214 esac
2215 AC_CHECK_HEADERS(sys/prctl.h)
2216
2217 AC_CHECK_HEADERS(sys/un.h,
2218 ISC_PLATFORM_HAVESYSUNH="#define ISC_PLATFORM_HAVESYSUNH 1"
2219 ,
2220 ISC_PLATFORM_HAVESYSUNH="#undef ISC_PLATFORM_HAVESYSUNH"
2221 )
2222 AC_SUBST(ISC_PLATFORM_HAVESYSUNH)
2223
2224 case "$host" in
2225 *-solaris*)
2226         AC_DEFINE(NEED_SECURE_DIRECTORY, 1,
2227                   [Define if connect does not honour the permission on the UNIX domain socket.])
2228         ;;
2229 *-sunos*)
2230         AC_DEFINE(NEED_SECURE_DIRECTORY, 1,
2231                   [Define if connect does not honour the permission on the UNIX domain socket.])
2232         ;;
2233 esac
2234
2235 #
2236 # Time Zone Stuff
2237 #
2238 AC_CHECK_FUNC(tzset, AC_DEFINE(HAVE_TZSET))
2239
2240 AC_MSG_CHECKING(for optarg declaration)
2241 AC_TRY_COMPILE([
2242 #include <unistd.h>
2243 ],
2244 [optarg = 0;],
2245 [AC_MSG_RESULT(yes)],
2246 [AC_MSG_RESULT(no)
2247 GEN_NEED_OPTARG="-DNEED_OPTARG=1"
2248 AC_DEFINE(NEED_OPTARG, 1, [Defined if extern char *optarg is not declared.])])
2249
2250 #
2251 # BSD/OS, and perhaps some others, don't define rlim_t.
2252 #
2253 AC_MSG_CHECKING(for type rlim_t)
2254 AC_TRY_COMPILE([
2255 #include <sys/types.h>
2256 #include <sys/time.h>
2257 #include <sys/resource.h>],
2258 [rlim_t rl = 19671212; return (0);],
2259 [AC_MSG_RESULT(yes)
2260  ISC_PLATFORM_RLIMITTYPE="#define ISC_PLATFORM_RLIMITTYPE rlim_t"],
2261 [AC_MSG_RESULT(no)
2262
2263 AC_MSG_CHECKING(type of rlim_cur)
2264 AC_TRY_RUN([
2265 #include <sys/types.h>
2266 #include <sys/time.h>
2267 #include <sys/resource.h>
2268 main() { struct rlimit r; exit(!(sizeof(r.rlim_cur) == sizeof(int)));}],
2269 [AC_MSG_RESULT(int)
2270 ISC_PLATFORM_RLIMITTYPE="#define ISC_PLATFORM_RLIMITTYPE int"],
2271 [
2272 AC_TRY_RUN([
2273 #include <sys/types.h>
2274 #include <sys/time.h>
2275 #include <sys/resource.h>
2276 main() { struct rlimit r; exit(!(sizeof(r.rlim_cur) == sizeof(long int)));}],
2277 [AC_MSG_RESULT(long int)
2278 ISC_PLATFORM_RLIMITTYPE="#define ISC_PLATFORM_RLIMITTYPE long int"],
2279 [
2280 AC_TRY_RUN([
2281 #include <sys/types.h>
2282 #include <sys/time.h>
2283 #include <sys/resource.h>
2284 main() { struct rlimit r; exit((!sizeof(r.rlim_cur) == sizeof(long long int)));}],
2285 [AC_MSG_RESULT(long long int)
2286 ISC_PLATFORM_RLIMITTYPE="#define ISC_PLATFORM_RLIMITTYPE long long int"],
2287 [AC_MSG_ERROR([unable to determine sizeof rlim_cur])
2288 ],[AC_MSG_ERROR(this cannot happen)])
2289 ],[AC_MSG_ERROR(this cannot happen)])
2290 ],[
2291 ISC_PLATFORM_RLIMITTYPE="#define ISC_PLATFORM_RLIMITTYPE long long int"
2292 AC_MSG_RESULT(cannot determine type of rlim_cur when cross compiling - assuming long long int)])
2293 ])
2294 AC_SUBST(ISC_PLATFORM_RLIMITTYPE)
2295
2296 #
2297 # Older HP-UX doesn't have gettune
2298 #
2299 case "$host" in
2300         *-hp-hpux*)
2301                 AC_CHECK_HEADERS(sys/dyntune.h)
2302                 ;;
2303         *)
2304                 ;;
2305 esac
2306
2307
2308 #
2309 # Compaq TruCluster requires more code for handling cluster IP aliases
2310 #
2311 case "$host" in
2312         *-dec-osf*)
2313                 AC_CHECK_LIB(clua, clua_getaliasaddress, LIBS="-lclua $LIBS")
2314                 AC_CHECK_FUNC(clua_getaliasaddress,
2315                                 AC_DEFINE(HAVE_TRUCLUSTER, 1,
2316                                         [Define if running under Compaq TruCluster]))
2317                 ;;
2318         *)
2319                 ;;
2320 esac
2321
2322 #
2323 # Some hosts need msg_namelen to match the size of the socket structure.
2324 # Some hosts don't set msg_namelen appropriately on return from recvmsg().
2325 #
2326 case $host in
2327 *os2*|*hp-mpeix*)
2328         AC_DEFINE(BROKEN_RECVMSG, 1,
2329                   [Define if recvmsg() does not meet all of the BSD socket API specifications.])
2330         ;;
2331 esac
2332
2333 #
2334 # Microsoft has their own way of handling shared libraries that requires
2335 # additional qualifiers on extern variables.  Unix systems don't need it.
2336 #
2337 AC_SUBST(ISC_PLATFORM_USEDECLSPEC)
2338 ISC_PLATFORM_USEDECLSPEC="#undef ISC_PLATFORM_USEDECLSPEC"
2339 AC_SUBST(LWRES_PLATFORM_USEDECLSPEC)
2340 LWRES_PLATFORM_USEDECLSPEC="#undef LWRES_PLATFORM_USEDECLSPEC"
2341 AC_SUBST(IRS_PLATFORM_USEDECLSPEC)
2342 IRS_PLATFORM_USEDECLSPEC="#undef IRS_PLATFORM_USEDECLSPEC"
2343
2344 #
2345 # Random remaining OS-specific issues involving compiler warnings.
2346 # XXXDCL print messages to indicate some compensation is being done?
2347 #
2348 AC_SUBST(ISC_PLATFORM_BRACEPTHREADONCEINIT)
2349 ISC_PLATFORM_BRACEPTHREADONCEINIT="#undef ISC_PLATFORM_BRACEPTHREADONCEINIT"
2350
2351 case "$host" in
2352         *-aix5.[[123]].*)
2353                 hack_shutup_pthreadonceinit=yes
2354                 ;;
2355         *-bsdi3.1*)
2356                 hack_shutup_sputaux=yes
2357                 ;;
2358         *-bsdi4.0*)
2359                 hack_shutup_sigwait=yes
2360                 hack_shutup_sputaux=yes
2361                 ;;
2362         [*-bsdi4.[12]*])
2363                 hack_shutup_stdargcast=yes
2364                 ;;
2365         [*-solaris2.[89]])
2366                 hack_shutup_pthreadonceinit=yes
2367                 ;;
2368         *-solaris2.1[[0-9]])
2369                 AC_TRY_COMPILE([ #include <pthread.h> ], [ static pthread_once_t once_test = { PTHREAD_ONCE_INIT }; ], [hack_shutup_pthreadonceinit=yes], )
2370                 ;;
2371 esac
2372
2373 case "$hack_shutup_pthreadonceinit" in
2374         yes)
2375                 #
2376                 # Shut up PTHREAD_ONCE_INIT unbraced initializer warnings.
2377                 #
2378                 ISC_PLATFORM_BRACEPTHREADONCEINIT="#define ISC_PLATFORM_BRACEPTHREADONCEINIT 1"
2379                 ;;
2380 esac
2381
2382 case "$hack_shutup_sigwait" in
2383         yes)
2384                 #
2385                 # Shut up a -Wmissing-prototypes warning for sigwait().
2386                 #
2387                 AC_DEFINE(SHUTUP_SIGWAIT)
2388                 ;;
2389 esac
2390
2391 case "$hack_shutup_sputaux" in
2392         yes)
2393                 #
2394                 # Shut up a -Wmissing-prototypes warning from <stdio.h>.
2395                 #
2396                 AC_DEFINE(SHUTUP_SPUTAUX)
2397                 ;;
2398 esac
2399
2400 case "$hack_shutup_stdargcast" in
2401         yes)
2402                 #
2403                 # Shut up a -Wcast-qual warning from va_start().
2404                 #
2405                 AC_DEFINE(SHUTUP_STDARG_CAST)
2406                 ;;
2407 esac
2408
2409 AC_CHECK_HEADERS(strings.h,
2410   ISC_PLATFORM_HAVESTRINGSH="#define ISC_PLATFORM_HAVESTRINGSH 1"
2411 ,
2412   ISC_PLATFORM_HAVESTRINGSH="#undef ISC_PLATFORM_HAVESTRINGSH"
2413 )
2414 AC_SUBST(ISC_PLATFORM_HAVESTRINGSH)
2415
2416 #
2417 # Check for if_nametoindex() for IPv6 scoped addresses support
2418 #
2419 AC_CHECK_FUNC(if_nametoindex, ac_cv_have_if_nametoindex=yes,
2420                 ac_cv_have_if_nametoindex=no)
2421 case $ac_cv_have_if_nametoindex in
2422 no)
2423         case "$host" in
2424         *-hp-hpux*)
2425                 AC_CHECK_LIB(ipv6, if_nametoindex,
2426                                 ac_cv_have_if_nametoindex=yes
2427                                 LIBS="-lipv6 $LIBS",)
2428         ;;
2429         esac
2430 esac
2431 case $ac_cv_have_if_nametoindex in
2432 yes)
2433         ISC_PLATFORM_HAVEIFNAMETOINDEX="#define ISC_PLATFORM_HAVEIFNAMETOINDEX 1"
2434         ;;
2435 *)
2436         ISC_PLATFORM_HAVEIFNAMETOINDEX="#undef ISC_PLATFORM_HAVEIFNAMETOINDEX"
2437         ;;
2438 esac
2439 AC_SUBST(ISC_PLATFORM_HAVEIFNAMETOINDEX)
2440
2441 AC_CHECK_FUNCS(nanosleep)
2442
2443 #
2444 # Machine architecture dependent features
2445 #
2446 AC_ARG_ENABLE(atomic,
2447         [  --enable-atomic        enable machine specific atomic operations
2448                           [[default=autodetect]]],
2449                         enable_atomic="$enableval",
2450                         enable_atomic="autodetect")
2451 case "$enable_atomic" in
2452         yes|''|autodetect)
2453                 case "$host" in
2454                 powerpc-ibm-aix*)
2455                         if test "X$GCC" = "Xyes"; then
2456                                 AC_MSG_CHECKING([if asm("isc"); works])
2457                                 AC_TRY_COMPILE(,[
2458                                 main() { asm("ics"); exit(0); }
2459                                 ],
2460                                 [AC_MSG_RESULT(yes)
2461                                  use_atomic=yes],
2462                                 [
2463                                 saved_cflags="$CFLAGS"
2464                                 CFLAGS="$CFLAGS -Wa,-many"
2465                                 AC_TRY_RUN([
2466                                 main() { asm("ics"); exit(0); }
2467                                 ],
2468                                 [AC_MSG_RESULT([yes, required -Wa,-many])
2469                                  use_atomic=yes],
2470                                 [AC_MSG_RESULT([no, use_atomic disabled])
2471                                  CFLAGS="$saved_cflags"
2472                                  use_atomic=no],
2473                                 [AC_MSG_RESULT([cross compile, assume yes])
2474                                  CFLAGS="$saved_cflags"
2475                                  use_atomic=yes])
2476                                 ]
2477                                 )
2478                         else
2479                                 use_atomic=yes
2480                         fi
2481                         ;;
2482                 *)
2483                         use_atomic=yes
2484                         ;;
2485                 esac
2486                 ;;
2487         no)
2488                 use_atomic=no
2489                 arch=noatomic
2490                 ;;
2491 esac
2492
2493 ISC_PLATFORM_USEOSFASM="#undef ISC_PLATFORM_USEOSFASM"
2494 if test "$use_atomic" = "yes"; then
2495         AC_MSG_CHECKING([architecture type for atomic operations])
2496         have_atomic=yes         # set default
2497         case "$host" in
2498         [i[3456]86-*])
2499                 # XXX: some old x86 architectures actually do not support
2500                 #      (some of) these operations.  Do we need stricter checks?
2501 AC_TRY_RUN([
2502 main() {
2503         exit((sizeof(void *) == 8) ? 0 : 1);
2504 }
2505 ],
2506                 [arch=x86_64
2507                 have_xaddq=yes],
2508                 [arch=x86_32],
2509                 [arch=x86_32])
2510         ;;
2511         x86_64-*|amd64-*)
2512 AC_TRY_RUN([
2513 main() {
2514        exit((sizeof(void *) == 8) ? 0 : 1);
2515 }
2516 ],
2517                [arch=x86_64
2518                have_xaddq=yes],
2519                [arch=x86_32],
2520                [arch=x86_64
2521                have_xaddq=yes])
2522         ;;
2523         alpha*-*)
2524                 arch=alpha
2525         ;;
2526         powerpc-*)
2527                 arch=powerpc
2528         ;;
2529         mips-*|mipsel-*|mips64-*|mips64el-*)
2530                 arch=mips
2531         ;;
2532         ia64-*)
2533                 arch=ia64
2534         ;;
2535         *)
2536                 have_atomic=no
2537                 arch=noatomic
2538         ;;
2539         esac
2540         AC_MSG_RESULT($arch)
2541 fi
2542
2543 if test "$have_atomic" = "yes"; then
2544         AC_MSG_CHECKING([compiler support for inline assembly code])
2545
2546         compiler=generic
2547         # Check whether the compiler supports the assembly syntax we provide.
2548         if test "X$GCC" = "Xyes"; then
2549                 # GCC's ASM extension always works
2550                 compiler=gcc
2551                 if test $arch = "x86_64"; then
2552                         # We can share the same code for gcc with x86_32
2553                         arch=x86_32
2554                 fi
2555                 if test $arch = "powerpc"; then
2556                         #
2557                         # The MacOS (and maybe others) uses "r0" for register
2558                         # zero. Under linux/ibm it is "0" for register 0.
2559                         # Probe to see if we have a MacOS style assembler.
2560                         #
2561                         AC_MSG_CHECKING([Checking for MacOS style assembler syntax])
2562                         AC_TRY_COMPILE(, [
2563                         __asm__ volatile ("li r0, 0x0\n"::);
2564                         ], [
2565                         AC_MSG_RESULT(yes)
2566                         compiler="mac"
2567                         ISC_PLATFORM_USEMACASM="#define ISC_PLATFORM_USEMACASM 1"
2568                         ], [AC_MSG_RESULT(no)])
2569                 fi
2570         else
2571                 case "$host" in
2572                 alpha*-dec-osf*)
2573                         # Tru64 compiler has its own syntax for inline 
2574                         # assembly.
2575                         AC_TRY_COMPILE(, [
2576 #ifndef __DECC
2577 #error "unexpected compiler"
2578 #endif
2579                                 return (0);],
2580                                 [compiler=osf],)
2581                 ;;
2582                 powerpc-ibm-aix*)
2583                         compiler=aix
2584                 ;;
2585                 esac
2586         fi
2587         case "$compiler" in
2588         gcc)
2589                 ISC_PLATFORM_USEGCCASM="#define ISC_PLATFORM_USEGCCASM 1"
2590                 ;;
2591         osf)
2592                 ISC_PLATFORM_USEOSFASM="#define ISC_PLATFORM_USEOSFASM 1"
2593                 ;;
2594         aix)
2595                 ;;
2596         mac)
2597                 ;;
2598         *)
2599                 # See if the generic __asm function works.  If not,
2600                 # we need to disable the atomic operations.
2601                 AC_TRY_LINK(, [
2602                                         __asm("nop")
2603                                 ],
2604                 [compiler="standard"
2605                 ISC_PLATFORM_USESTDASM="#define ISC_PLATFORM_USESTDASM 1"],
2606                 [compiler="not supported (atomic operations disabled)"
2607                 have_atomic=no
2608                 arch=noatomic ]);
2609                 ;;
2610         esac
2611
2612         AC_MSG_RESULT($compiler)
2613 fi
2614
2615 if test "$have_atomic" = "yes"; then
2616         ISC_PLATFORM_HAVEXADD="#define ISC_PLATFORM_HAVEXADD 1"
2617         ISC_PLATFORM_HAVECMPXCHG="#define ISC_PLATFORM_HAVECMPXCHG 1"
2618         ISC_PLATFORM_HAVEATOMICSTORE="#define ISC_PLATFORM_HAVEATOMICSTORE 1"
2619 else
2620         ISC_PLATFORM_HAVEXADD="#undef ISC_PLATFORM_HAVEXADD"
2621         ISC_PLATFORM_HAVECMPXCHG="#undef ISC_PLATFORM_HAVECMPXCHG"
2622         ISC_PLATFORM_HAVEATOMICSTORE="#undef ISC_PLATFORM_HAVEATOMICSTORE"
2623 fi
2624
2625 if test "$have_xaddq" = "yes"; then
2626         ISC_PLATFORM_HAVEXADDQ="#define ISC_PLATFORM_HAVEXADDQ 1"
2627 else
2628         ISC_PLATFORM_HAVEXADDQ="#undef ISC_PLATFORM_HAVEXADDQ"
2629 fi
2630
2631 AC_SUBST(ISC_PLATFORM_HAVEXADD)
2632 AC_SUBST(ISC_PLATFORM_HAVEXADDQ)
2633 AC_SUBST(ISC_PLATFORM_HAVECMPXCHG)
2634 AC_SUBST(ISC_PLATFORM_HAVEATOMICSTORE)
2635
2636 AC_SUBST(ISC_PLATFORM_USEGCCASM)
2637 AC_SUBST(ISC_PLATFORM_USEOSFASM)
2638 AC_SUBST(ISC_PLATFORM_USESTDASM)
2639 AC_SUBST(ISC_PLATFORM_USEMACASM)
2640
2641 ISC_ARCH_DIR=$arch
2642 AC_SUBST(ISC_ARCH_DIR)
2643
2644 #
2645 # Activate "rrset-order fixed" or not?
2646 #
2647 AC_ARG_ENABLE(fixed-rrset,
2648         [  --enable-fixed-rrset    enable fixed rrset ordering
2649                           [[default=no]]],
2650                         enable_fixed="$enableval",
2651                         enable_fixed="no")
2652 case "$enable_fixed" in
2653         yes)
2654                 AC_DEFINE(DNS_RDATASET_FIXED, 1,
2655                           [Define to enable "rrset-order fixed" syntax.])
2656                 ;;
2657         no)
2658                 ;;
2659         *)
2660                 ;;
2661 esac
2662
2663 #
2664 # Activate "filter-aaaa-on-v4" or not?
2665 #
2666 AC_ARG_ENABLE(filter-aaaa,
2667         [  --enable-filter-aaaa    enable filtering of AAAA records over IPv4
2668                           [[default=no]]],
2669                         enable_filter="$enableval",
2670                         enable_filter="no")
2671 case "$enable_filter" in
2672         yes)
2673                 AC_DEFINE(ALLOW_FILTER_AAAA_ON_V4, 1,
2674                           [Define to enable the "filter-aaaa-on-v4" option.])
2675                 ;;
2676         no)
2677                 ;;
2678         *)
2679                 ;;
2680 esac
2681
2682 #
2683 #  The following sets up how non-blocking i/o is established.
2684 #  Sunos, cygwin and solaris 2.x (x<5) require special handling.
2685 #
2686 case "$host" in
2687 *-sunos*) AC_DEFINE(PORT_NONBLOCK, O_NDELAY);;
2688 *-cygwin*) AC_DEFINE(PORT_NONBLOCK, O_NDELAY);;
2689 *-solaris2.[[01234]])
2690         AC_DEFINE(PORT_NONBLOCK, O_NONBLOCK)
2691         AC_DEFINE(USE_FIONBIO_IOCTL, 1,
2692                   [Defined if you need to use ioctl(FIONBIO) instead a fcntl call to make non-blocking.])
2693         ;;
2694 *) AC_DEFINE(PORT_NONBLOCK, O_NONBLOCK,
2695              [Sets which flag to pass to open/fcntl to make non-blocking (O_NDELAY/O_NONBLOCK).])
2696         ;;
2697 esac
2698 #
2699 # Solaris 2.5.1 and earlier cannot bind() then connect() a TCP socket.
2700 # This prevents the source address being set.
2701 #
2702 case "$host" in
2703 *-solaris2.[[012345]]|*-solaris2.5.1)
2704         AC_DEFINE(BROKEN_TCP_BIND_BEFORE_CONNECT, 1,
2705                   [Define if you cannot bind() before connect() for TCP sockets.])
2706         ;;
2707 esac
2708 #
2709 # The following sections deal with tools used for formatting
2710 # the documentation.  They are all optional, unless you are
2711 # a developer editing the documentation source.
2712 #
2713
2714 #
2715 # Look for TeX.
2716 #
2717
2718 AC_PATH_PROGS(LATEX, latex, latex)
2719 AC_SUBST(LATEX)
2720
2721 AC_PATH_PROGS(PDFLATEX, pdflatex, pdflatex)
2722 AC_SUBST(PDFLATEX)
2723
2724 #
2725 # Look for w3m
2726 #
2727
2728 AC_PATH_PROGS(W3M, w3m, w3m)
2729 AC_SUBST(W3M)
2730
2731 #
2732 # Look for xsltproc (libxslt)
2733 #
2734
2735 AC_PATH_PROG(XSLTPROC, xsltproc, xsltproc)
2736 AC_SUBST(XSLTPROC)
2737
2738 #
2739 # Look for xmllint (libxml2)
2740 #
2741
2742 AC_PATH_PROG(XMLLINT, xmllint, xmllint)
2743 AC_SUBST(XMLLINT)
2744
2745 #
2746 # Look for Doxygen
2747 #
2748
2749 AC_PATH_PROG(DOXYGEN, doxygen, doxygen)
2750 AC_SUBST(DOXYGEN)
2751
2752 #
2753 # Subroutine for searching for an ordinary file (e.g., a stylesheet)
2754 # in a number of directories:
2755 #
2756 #   NOM_PATH_FILE(VARIABLE, FILENAME, DIRECTORIES)
2757 #
2758 # If the file FILENAME is found in one of the DIRECTORIES, the shell
2759 # variable VARIABLE is defined to its absolute pathname.  Otherwise, 
2760 # it is set to FILENAME, with no directory prefix (that's not terribly
2761 # useful, but looks less confusing in substitutions than leaving it
2762 # empty).  The variable VARIABLE will be substituted into output files.
2763
2764
2765 AC_DEFUN(NOM_PATH_FILE, [
2766 $1=""
2767 AC_MSG_CHECKING(for $2)
2768 for d in $3
2769 do
2770         f=$d/$2
2771         if test -f $f
2772         then
2773                 $1=$f
2774                 AC_MSG_RESULT($f)
2775                 break
2776         fi
2777 done
2778 if test "X[$]$1" = "X"
2779 then
2780         AC_MSG_RESULT("not found");
2781         $1=$2
2782 fi
2783 AC_SUBST($1)
2784 ])
2785
2786 #
2787 # Look for Docbook-XSL stylesheets.  Location probably varies by system.
2788 # If it's not explicitly specified, guess where it might be found, based on
2789 # where SGML stuff lives on some systems (FreeBSD is the only one we're sure
2790 # of at the moment).
2791 #
2792 AC_MSG_CHECKING(for Docbook-XSL path)
2793 AC_ARG_WITH(docbook-xsl,
2794 [  --with-docbook-xsl=PATH Specify path for Docbook-XSL stylesheets],
2795    docbook_path="$withval", docbook_path="auto")
2796 case "$docbook_path" in
2797 auto)
2798         AC_MSG_RESULT(auto)
2799         docbook_xsl_trees="/usr/pkg/share/xsl/docbook /usr/local/share/xsl/docbook /usr/share/xsl/docbook"
2800         ;;
2801 *)
2802         docbook_xsl_trees="$withval"
2803         AC_MSG_RESULT($docbook_xsl_trees)
2804         ;;
2805 esac
2806
2807 #
2808 # Look for stylesheets we need.
2809 #
2810
2811 NOM_PATH_FILE(XSLT_DOCBOOK_STYLE_HTML, html/docbook.xsl, $docbook_xsl_trees)
2812 NOM_PATH_FILE(XSLT_DOCBOOK_STYLE_XHTML, xhtml/docbook.xsl, $docbook_xsl_trees)
2813 NOM_PATH_FILE(XSLT_DOCBOOK_STYLE_MAN, manpages/docbook.xsl, $docbook_xsl_trees)
2814 NOM_PATH_FILE(XSLT_DOCBOOK_CHUNK_HTML, html/chunk.xsl, $docbook_xsl_trees)
2815 NOM_PATH_FILE(XSLT_DOCBOOK_CHUNK_XHTML, xhtml/chunk.xsl, $docbook_xsl_trees)
2816 NOM_PATH_FILE(XSLT_DOCBOOK_CHUNKTOC_HTML, html/chunktoc.xsl, $docbook_xsl_trees)
2817 NOM_PATH_FILE(XSLT_DOCBOOK_CHUNKTOC_XHTML, xhtml/chunktoc.xsl, $docbook_xsl_trees)
2818 NOM_PATH_FILE(XSLT_DOCBOOK_MAKETOC_HTML, html/maketoc.xsl, $docbook_xsl_trees)
2819 NOM_PATH_FILE(XSLT_DOCBOOK_MAKETOC_XHTML, xhtml/maketoc.xsl, $docbook_xsl_trees)
2820
2821 #
2822 # Same dance for db2latex
2823 #
2824 # No idea where this lives except on FreeBSD.
2825 #
2826
2827 db2latex_xsl_trees="/usr/local/share"
2828
2829 #
2830 # Look for stylesheets we need.
2831 #
2832
2833 NOM_PATH_FILE(XSLT_DB2LATEX_STYLE, db2latex/xsl/docbook.xsl, $db2latex_xsl_trees)
2834
2835 #
2836 # Look for "admonition" image directory.  Can't use NOM_PATH_FILE()
2837 # because it's a directory, so just do the same things, inline.
2838 #
2839
2840 AC_MSG_CHECKING(for db2latex/xsl/figures)
2841 for d in $db2latex_xsl_trees
2842 do
2843         dd=$d/db2latex/xsl/figures
2844         if test -d $dd
2845         then
2846                 XSLT_DB2LATEX_ADMONITIONS=$dd
2847                 AC_MSG_RESULT($dd)
2848                 break
2849         fi
2850 done
2851 if test "X$XSLT_DB2LATEX_ADMONITIONS" = "X"
2852 then
2853         AC_MSG_RESULT(not found)
2854         XSLT_DB2LATEX_ADMONITIONS=db2latex/xsl/figures
2855 fi
2856 AC_SUBST(XSLT_DB2LATEX_ADMONITIONS)
2857
2858 #
2859 # IDN support
2860 #
2861 AC_ARG_WITH(idn,
2862         [  --with-idn[=MPREFIX]      enable IDN support using idnkit [default PREFIX]],
2863         use_idn="$withval", use_idn="no")
2864 case "$use_idn" in
2865 yes)
2866         if test X$prefix = XNONE ; then
2867                 idn_path=/usr/local
2868         else
2869                 idn_path=$prefix
2870         fi
2871         ;;
2872 no)
2873         ;;
2874 *)
2875         idn_path="$use_idn"
2876         ;;
2877 esac
2878
2879 iconvinc=
2880 iconvlib=
2881 AC_ARG_WITH(libiconv,
2882         [  --with-libiconv[=IPREFIX] GNU libiconv are in IPREFIX [default PREFIX]],
2883         use_libiconv="$withval", use_libiconv="no")
2884 case "$use_libiconv" in
2885 yes)
2886         if test X$prefix = XNONE ; then
2887                 iconvlib="-L/usr/local/lib -R/usr/local/lib -liconv"
2888         else
2889                 iconvlib="-L$prefix/lib -R$prefix/lib -liconv"
2890         fi
2891         ;;
2892 no)
2893         iconvlib=
2894         ;;
2895 *)
2896         iconvlib="-L$use_libiconv/lib -R$use_libiconv/lib -liconv"
2897         ;;
2898 esac
2899
2900 AC_ARG_WITH(iconv,
2901         [  --with-iconv[=LIBSPEC]    specify iconv library [default -liconv]],
2902         iconvlib="$withval")
2903 case "$iconvlib" in
2904 no)
2905         iconvlib=
2906         ;;
2907 yes)
2908         iconvlib=-liconv
2909         ;;
2910 esac
2911
2912 AC_ARG_WITH(idnlib,
2913         [  --with-idnlib=ARG       specify libidnkit],
2914         idnlib="$withval", idnlib="no")
2915 if test "$idnlib" = yes; then
2916         AC_MSG_ERROR([You must specify ARG for --with-idnlib.])
2917 fi
2918
2919 IDNLIBS=
2920 if test "$use_idn" != no; then
2921         AC_DEFINE(WITH_IDN, 1, [define if idnkit support is to be included.])
2922         STD_CINCLUDES="$STD_CINCLUDES -I$idn_path/include"
2923         if test "$idnlib" != no; then
2924                 IDNLIBS="$idnlib $iconvlib"
2925         else
2926                 IDNLIBS="-L$idn_path/lib -lidnkit $iconvlib"
2927         fi
2928 fi
2929 AC_SUBST(IDNLIBS)
2930
2931 AC_CHECK_HEADERS(locale.h)
2932 AC_CHECK_FUNCS(setlocale)
2933
2934 #
2935 # Substitutions
2936 #
2937 AC_SUBST(BIND9_TOP_BUILDDIR)
2938 BIND9_TOP_BUILDDIR=`pwd`
2939
2940 AC_SUBST(BIND9_ISC_BUILDINCLUDE)
2941 AC_SUBST(BIND9_ISCCC_BUILDINCLUDE)
2942 AC_SUBST(BIND9_ISCCFG_BUILDINCLUDE)
2943 AC_SUBST(BIND9_DNS_BUILDINCLUDE)
2944 AC_SUBST(BIND9_LWRES_BUILDINCLUDE)
2945 AC_SUBST(BIND9_BIND9_BUILDINCLUDE)
2946 if test "X$srcdir" != "X"; then
2947         BIND9_ISC_BUILDINCLUDE="-I${BIND9_TOP_BUILDDIR}/lib/isc/include"
2948         BIND9_ISCCC_BUILDINCLUDE="-I${BIND9_TOP_BUILDDIR}/lib/isccc/include"
2949         BIND9_ISCCFG_BUILDINCLUDE="-I${BIND9_TOP_BUILDDIR}/lib/isccfg/include"
2950         BIND9_DNS_BUILDINCLUDE="-I${BIND9_TOP_BUILDDIR}/lib/dns/include"
2951         BIND9_LWRES_BUILDINCLUDE="-I${BIND9_TOP_BUILDDIR}/lib/lwres/include"
2952         BIND9_BIND9_BUILDINCLUDE="-I${BIND9_TOP_BUILDDIR}/lib/bind9/include"
2953 else
2954         BIND9_ISC_BUILDINCLUDE=""
2955         BIND9_ISCCC_BUILDINCLUDE=""
2956         BIND9_ISCCFG_BUILDINCLUDE=""
2957         BIND9_DNS_BUILDINCLUDE=""
2958         BIND9_LWRES_BUILDINCLUDE=""
2959         BIND9_BIND9_BUILDINCLUDE=""
2960 fi
2961
2962 AC_SUBST_FILE(BIND9_MAKE_INCLUDES)
2963 BIND9_MAKE_INCLUDES=$BIND9_TOP_BUILDDIR/make/includes
2964
2965 AC_SUBST_FILE(BIND9_MAKE_RULES)
2966 BIND9_MAKE_RULES=$BIND9_TOP_BUILDDIR/make/rules
2967
2968 . $srcdir/version
2969 BIND9_VERSION="VERSION=${MAJORVER}.${MINORVER}${PATCHVER:+.}${PATCHVER}${RELEASETYPE}${RELEASEVER}"
2970 AC_SUBST(BIND9_VERSION)
2971
2972 if test -z "$ac_configure_args"; then
2973         BIND9_CONFIGARGS="defaults"
2974 else
2975         for a in $ac_configure_args
2976         do
2977                 BIND9_CONFIGARGS="$BIND9_CONFIGARGS $a"
2978         done
2979 fi
2980 BIND9_CONFIGARGS="`echo $BIND9_CONFIGARGS | sed 's/^ //'`"
2981 BIND9_CONFIGARGS="CONFIGARGS=${BIND9_CONFIGARGS}"
2982 AC_SUBST(BIND9_CONFIGARGS)
2983
2984 AC_SUBST_FILE(LIBISC_API)
2985 LIBISC_API=$srcdir/lib/isc/api
2986
2987 AC_SUBST_FILE(LIBISCCC_API)
2988 LIBISCCC_API=$srcdir/lib/isccc/api
2989
2990 AC_SUBST_FILE(LIBISCCFG_API)
2991 LIBISCCFG_API=$srcdir/lib/isccfg/api
2992
2993 AC_SUBST_FILE(LIBDNS_API)
2994 LIBDNS_API=$srcdir/lib/dns/api
2995
2996 AC_SUBST_FILE(LIBBIND9_API)
2997 LIBBIND9_API=$srcdir/lib/bind9/api
2998
2999 AC_SUBST_FILE(LIBLWRES_API)
3000 LIBLWRES_API=$srcdir/lib/lwres/api
3001
3002 AC_SUBST_FILE(LIBIRS_API)
3003 LIBIRS_API=$srcdir/lib/irs/api
3004
3005 #
3006 # Configure any DLZ drivers.
3007 #
3008 # If config.dlz.in selects one or more DLZ drivers, it will set
3009 # USE_DLZ to a non-empty value, which will be our clue to
3010 # enable the DLZ core functions.
3011 #
3012 # This section has to come after the libtool stuff because it needs to
3013 # know how to name the driver object files.
3014 #
3015
3016 USE_DLZ=""
3017 DLZ_DRIVER_INCLUDES=""
3018 DLZ_DRIVER_LIBS=""
3019 DLZ_DRIVER_SRCS=""
3020 DLZ_DRIVER_OBJS=""
3021
3022 sinclude(contrib/dlz/config.dlz.in)
3023
3024 AC_MSG_CHECKING(for DLZ)
3025
3026 if test -n "$USE_DLZ"
3027 then
3028         AC_MSG_RESULT(yes)
3029         USE_DLZ="-DDLZ $USE_DLZ"
3030         DLZ_DRIVER_RULES=contrib/dlz/drivers/rules
3031         AC_CONFIG_FILES([$DLZ_DRIVER_RULES])
3032 else
3033         AC_MSG_RESULT(no)
3034         DLZ_DRIVER_RULES=/dev/null
3035 fi
3036
3037 AC_SUBST(USE_DLZ)
3038 AC_SUBST(DLZ_DRIVER_INCLUDES)
3039 AC_SUBST(DLZ_DRIVER_LIBS)
3040 AC_SUBST(DLZ_DRIVER_SRCS)
3041 AC_SUBST(DLZ_DRIVER_OBJS)
3042 AC_SUBST_FILE(DLZ_DRIVER_RULES)
3043
3044 if test "$cross_compiling" = "yes"; then
3045         if test -z "$BUILD_CC"; then
3046                 AC_ERROR([BUILD_CC not set])
3047         fi
3048         BUILD_CFLAGS="$BUILD_CFLAGS"
3049         BUILD_CPPFLAGS="$BUILD_CPPFLAGS"
3050         BUILD_LDFLAGS="$BUILD_LDFLAGS"
3051         BUILD_LIBS="$BUILD_LIBS"
3052 else
3053         BUILD_CC="$CC" 
3054         BUILD_CFLAGS="$CFLAGS" 
3055         BUILD_CPPFLAGS="$CPPFLAGS $GEN_NEED_OPTARG"
3056         BUILD_LDFLAGS="$LDFLAGS"
3057         BUILD_LIBS="$LIBS"
3058 fi
3059
3060 NEWFLAGS=""
3061 for e in $BUILD_LDFLAGS ; do
3062     case $e in
3063         -L*)
3064             case $host_os in
3065                 netbsd*)
3066                     ee=`echo $e | sed -e 's%^-L%-Wl,-rpath,%'`
3067                     NEWFLAGS="$NEWFLAGS $e $ee"
3068                     ;;
3069                 freebsd*)
3070                     ee=`echo $e | sed -e 's%^-L%-Wl,-rpath,%'`
3071                     NEWFLAGS="$NEWFLAGS $e $ee"
3072                     ;;
3073                 solaris*)
3074                     ee=`echo $e | sed -e 's%^-L%-R%'`
3075                     NEWFLAGS="$NEWFLAGS $e $ee"
3076                     ;;
3077                 *)
3078                     NEWFLAGS="$NEWFLAGS $e"
3079                     ;;
3080                 esac
3081             ;;
3082         *)
3083             NEWFLAGS="$NEWFLAGS $e"
3084             ;;
3085     esac
3086 done
3087 BUILD_LDFLAGS="$NEWFLAGS"
3088
3089 NEWFLAGS=""
3090 for e in $DNS_GSSAPI_LIBS ; do
3091     case $e in
3092         -L*)
3093             case $host_os in
3094                 netbsd*)
3095                     ee=`echo $e | sed -e 's%^-L%-Wl,-rpath,%'`
3096                     NEWFLAGS="$NEWFLAGS $e $ee"
3097                     ;;
3098                 freebsd*)
3099                     ee=`echo $e | sed -e 's%^-L%-Wl,-rpath,%'`
3100                     NEWFLAGS="$NEWFLAGS $e $ee"
3101                     ;;
3102                 solaris*)
3103                     ee=`echo $e | sed -e 's%^-L%-R%'`
3104                     NEWFLAGS="$NEWFLAGS $e $ee"
3105                     ;;
3106                 *)
3107                     NEWFLAGS="$NEWFLAGS $e"
3108                     ;;
3109                 esac
3110             ;;
3111         *)
3112             NEWFLAGS="$NEWFLAGS $e"
3113             ;;
3114     esac
3115 done
3116 DNS_GSSAPI_LIBS="$NEWFLAGS"
3117
3118 NEWFLAGS=""
3119 for e in $DNS_CRYPTO_LIBS ; do
3120     case $e in
3121         -L*)
3122             case $host_os in
3123                 netbsd*)
3124                     ee=`echo $e | sed -e 's%^-L%-Wl,-rpath,%'`
3125                     NEWFLAGS="$NEWFLAGS $e $ee"
3126                     ;;
3127                 freebsd*)
3128                     ee=`echo $e | sed -e 's%^-L%-Wl,-rpath,%'`
3129                     NEWFLAGS="$NEWFLAGS $e $ee"
3130                     ;;
3131                 solaris*)
3132                     ee=`echo $e | sed -e 's%^-L%-R%'`
3133                     NEWFLAGS="$NEWFLAGS $e $ee"
3134                     ;;
3135                 *)
3136                     NEWFLAGS="$NEWFLAGS $e"
3137                     ;;
3138                 esac
3139             ;;
3140         *)
3141             NEWFLAGS="$NEWFLAGS $e"
3142             ;;
3143     esac
3144 done
3145 DNS_CRYPTO_LIBS="$NEWFLAGS"
3146
3147 AC_SUBST(BUILD_CC)
3148 AC_SUBST(BUILD_CFLAGS)
3149 AC_SUBST(BUILD_CPPFLAGS)
3150 AC_SUBST(BUILD_LDFLAGS)
3151 AC_SUBST(BUILD_LIBS)
3152
3153 #
3154 # Commands to run at the end of config.status.
3155 # Don't just put these into configure, it won't work right if somebody
3156 # runs config.status directly (which autoconf allows).
3157 #
3158
3159 AC_CONFIG_COMMANDS(
3160         [chmod],
3161         [chmod a+x isc-config.sh doc/doxygen/doxygen-input-filter])
3162
3163 #
3164 # Files to configure.  These are listed here because we used to
3165 # specify them as arguments to AC_OUTPUT.  It's (now) ok to move these
3166 # elsewhere if there's a good reason for doing so.
3167 #
3168
3169 AC_CONFIG_FILES([
3170         Makefile
3171         make/Makefile
3172         make/mkdep
3173         lib/Makefile
3174         lib/isc/Makefile
3175         lib/isc/include/Makefile
3176         lib/isc/include/isc/Makefile
3177         lib/isc/include/isc/platform.h
3178         lib/isc/unix/Makefile
3179         lib/isc/unix/include/Makefile
3180         lib/isc/unix/include/isc/Makefile
3181         lib/isc/nls/Makefile
3182         lib/isc/$thread_dir/Makefile
3183         lib/isc/$thread_dir/include/Makefile
3184         lib/isc/$thread_dir/include/isc/Makefile
3185         lib/isc/$arch/Makefile
3186         lib/isc/$arch/include/Makefile
3187         lib/isc/$arch/include/isc/Makefile
3188         lib/isccc/Makefile
3189         lib/isccc/include/Makefile
3190         lib/isccc/include/isccc/Makefile
3191         lib/isccfg/Makefile
3192         lib/isccfg/include/Makefile
3193         lib/isccfg/include/isccfg/Makefile
3194         lib/irs/Makefile
3195         lib/irs/include/Makefile
3196         lib/irs/include/irs/Makefile
3197         lib/irs/include/irs/netdb.h
3198         lib/irs/include/irs/platform.h
3199         lib/dns/Makefile
3200         lib/dns/include/Makefile
3201         lib/dns/include/dns/Makefile
3202         lib/dns/include/dst/Makefile
3203         lib/export/Makefile
3204         lib/export/isc/Makefile
3205         lib/export/isc/include/Makefile
3206         lib/export/isc/include/isc/Makefile
3207         lib/export/isc/unix/Makefile
3208         lib/export/isc/unix/include/Makefile
3209         lib/export/isc/unix/include/isc/Makefile
3210         lib/export/isc/nls/Makefile
3211         lib/export/isc/$thread_dir/Makefile
3212         lib/export/isc/$thread_dir/include/Makefile
3213         lib/export/isc/$thread_dir/include/isc/Makefile
3214         lib/export/dns/Makefile
3215         lib/export/dns/include/Makefile
3216         lib/export/dns/include/dns/Makefile
3217         lib/export/dns/include/dst/Makefile
3218         lib/export/irs/Makefile
3219         lib/export/irs/include/Makefile
3220         lib/export/irs/include/irs/Makefile
3221         lib/export/isccfg/Makefile
3222         lib/export/isccfg/include/Makefile
3223         lib/export/isccfg/include/isccfg/Makefile
3224         lib/export/samples/Makefile
3225         lib/export/samples/Makefile-postinstall
3226         lib/bind9/Makefile
3227         lib/bind9/include/Makefile
3228         lib/bind9/include/bind9/Makefile
3229         lib/lwres/Makefile
3230         lib/lwres/include/Makefile
3231         lib/lwres/include/lwres/Makefile
3232         lib/lwres/include/lwres/netdb.h
3233         lib/lwres/include/lwres/platform.h
3234         lib/lwres/man/Makefile
3235         lib/lwres/unix/Makefile
3236         lib/lwres/unix/include/Makefile
3237         lib/lwres/unix/include/lwres/Makefile
3238         lib/tests/Makefile
3239         lib/tests/include/Makefile
3240         lib/tests/include/tests/Makefile
3241         bin/Makefile
3242         bin/check/Makefile
3243         bin/confgen/Makefile
3244         bin/confgen/unix/Makefile
3245         bin/named/Makefile
3246         bin/named/unix/Makefile
3247         bin/rndc/Makefile
3248         bin/dig/Makefile
3249         bin/nsupdate/Makefile
3250         bin/tests/Makefile
3251         bin/tests/names/Makefile
3252         bin/tests/master/Makefile
3253         bin/tests/rbt/Makefile
3254         bin/tests/db/Makefile
3255         bin/tests/tasks/Makefile
3256         bin/tests/timers/Makefile
3257         bin/tests/dst/Makefile
3258         bin/tests/mem/Makefile
3259         bin/tests/net/Makefile
3260         bin/tests/sockaddr/Makefile
3261         bin/tests/system/Makefile
3262         bin/tests/system/conf.sh
3263         bin/tests/system/lwresd/Makefile
3264         bin/tests/system/tkey/Makefile
3265         bin/tests/headerdep_test.sh
3266         bin/tools/Makefile
3267         bin/dnssec/Makefile
3268         bin/pkcs11/Makefile
3269         doc/Makefile
3270         doc/arm/Makefile
3271         doc/misc/Makefile
3272         isc-config.sh
3273         doc/xsl/Makefile
3274         doc/xsl/isc-docbook-chunk.xsl
3275         doc/xsl/isc-docbook-html.xsl
3276         doc/xsl/isc-docbook-latex.xsl
3277         doc/xsl/isc-manpage.xsl
3278         doc/doxygen/Doxyfile
3279         doc/doxygen/Makefile
3280         doc/doxygen/doxygen-input-filter
3281 ])
3282
3283 #
3284 # Do it
3285 #
3286
3287 AC_OUTPUT
3288
3289 #
3290 # Now that the Makefiles exist we can ensure that everything is rebuilt.
3291 #
3292 AC_ARG_WITH(make-clean,
3293 [  --with-make-clean      Run "make clean" at end of configure [[yes|no]].],
3294     make_clean="$withval", make_clean="yes")
3295 case "$make_clean" in
3296 yes)
3297         make clean
3298         ;;
3299 esac
3300
3301 if test "X$USE_OPENSSL" = "X"; then
3302 cat << \EOF                                                             
3303 BIND is being built without OpenSSL. This means it will not have DNSSEC support.
3304 EOF
3305 fi
3306
3307 if test "X$OPENSSL_WARNING" != "X"; then
3308 cat << \EOF
3309 WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
3310 WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
3311 WARNING                                                                 WARNING
3312 WARNING         Your OpenSSL crypto library may be vulnerable to        WARNING
3313 WARNING         one or more of the the following known security         WARNING
3314 WARNING         flaws:                                                  WARNING
3315 WARNING                                                                 WARNING
3316 WARNING         CAN-2002-0659, CAN-2006-4339, CVE-2006-2937 and         WARNING
3317 WARNING         CVE-2006-2940.                                          WARNING
3318 WARNING                                                                 WARNING
3319 WARNING         It is recommended that you upgrade to OpenSSL           WARNING
3320 WARNING         version 0.9.8d/0.9.7l (or greater).                     WARNING
3321 WARNING                                                                 WARNING
3322 WARNING         You can disable this warning by specifying:             WARNING
3323 WARNING                                                                 WARNING
3324 WARNING               --disable-openssl-version-check                   WARNING
3325 WARNING                                                                 WARNING
3326 WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
3327 WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
3328 EOF
3329 fi
3330
3331 # Tell Emacs to edit this file in shell mode.
3332 # Local Variables:
3333 # mode: sh
3334 # End: