1 # generated automatically by aclocal 1.7.9 -*- Autoconf -*-
3 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002
4 # Free Software Foundation, Inc.
5 # This file is free software; the Free Software Foundation
6 # gives unlimited permission to copy and/or distribute it,
7 # with or without modifications, as long as this notice is preserved.
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY, to the extent permitted by law; without
11 # even the implied warranty of MERCHANTABILITY or FITNESS FOR A
14 # AM_CONDITIONAL -*- Autoconf -*-
16 # Copyright 1997, 2000, 2001 Free Software Foundation, Inc.
18 # This program is free software; you can redistribute it and/or modify
19 # it under the terms of the GNU General Public License as published by
20 # the Free Software Foundation; either version 2, or (at your option)
23 # This program is distributed in the hope that it will be useful,
24 # but WITHOUT ANY WARRANTY; without even the implied warranty of
25 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
26 # GNU General Public License for more details.
28 # You should have received a copy of the GNU General Public License
29 # along with this program; if not, write to the Free Software
30 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
37 # AM_CONDITIONAL(NAME, SHELL-CONDITION)
38 # -------------------------------------
39 # Define a conditional.
40 AC_DEFUN([AM_CONDITIONAL],
41 [ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])],
42 [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
52 AC_CONFIG_COMMANDS_PRE(
53 [if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
54 AC_MSG_ERROR([conditional "$1" was never defined.
55 Usually this means the macro was only invoked conditionally.])
58 # Do all the work for Automake. -*- Autoconf -*-
60 # This macro actually does too much some checks are only needed if
61 # your package does certain things. But this isn't really a big deal.
63 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
64 # Free Software Foundation, Inc.
66 # This program is free software; you can redistribute it and/or modify
67 # it under the terms of the GNU General Public License as published by
68 # the Free Software Foundation; either version 2, or (at your option)
71 # This program is distributed in the hope that it will be useful,
72 # but WITHOUT ANY WARRANTY; without even the implied warranty of
73 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
74 # GNU General Public License for more details.
76 # You should have received a copy of the GNU General Public License
77 # along with this program; if not, write to the Free Software
78 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
85 # Autoconf 2.50 wants to disallow AM_ names. We explicitly allow
86 # the ones we care about.
87 m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
89 # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
90 # AM_INIT_AUTOMAKE([OPTIONS])
91 # -----------------------------------------------
92 # The call with PACKAGE and VERSION arguments is the old style
93 # call (pre autoconf-2.50), which is being phased out. PACKAGE
94 # and VERSION should now be passed to AC_INIT and removed from
95 # the call to AM_INIT_AUTOMAKE.
96 # We support both call styles for the transition. After
97 # the next Automake release, Autoconf can make the AC_INIT
98 # arguments mandatory, and then we can depend on a new Autoconf
99 # release and drop the old call support.
100 AC_DEFUN([AM_INIT_AUTOMAKE],
101 [AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
102 AC_REQUIRE([AC_PROG_INSTALL])dnl
103 # test to see if srcdir already configured
104 if test "`cd $srcdir && pwd`" != "`pwd`" &&
105 test -f $srcdir/config.status; then
106 AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
109 # test whether we have cygpath
110 if test -z "$CYGPATH_W"; then
111 if (cygpath --version) >/dev/null 2>/dev/null; then
112 CYGPATH_W='cygpath -w'
117 AC_SUBST([CYGPATH_W])
119 # Define the identity of the package.
120 dnl Distinguish between old-style and new-style calls.
122 [m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
123 AC_SUBST([PACKAGE], [$1])dnl
124 AC_SUBST([VERSION], [$2])],
125 [_AM_SET_OPTIONS([$1])dnl
126 AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
127 AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
129 _AM_IF_OPTION([no-define],,
130 [AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
131 AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
133 # Some tools Automake needs.
134 AC_REQUIRE([AM_SANITY_CHECK])dnl
135 AC_REQUIRE([AC_ARG_PROGRAM])dnl
136 AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
137 AM_MISSING_PROG(AUTOCONF, autoconf)
138 AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
139 AM_MISSING_PROG(AUTOHEADER, autoheader)
140 AM_MISSING_PROG(MAKEINFO, makeinfo)
141 AM_MISSING_PROG(AMTAR, tar)
143 AM_PROG_INSTALL_STRIP
144 # We need awk for the "check" target. The system "awk" is bad on
146 AC_REQUIRE([AC_PROG_AWK])dnl
147 AC_REQUIRE([AC_PROG_MAKE_SET])dnl
148 AC_REQUIRE([AM_SET_LEADING_DOT])dnl
150 _AM_IF_OPTION([no-dependencies],,
151 [AC_PROVIDE_IFELSE([AC_PROG_CC],
152 [_AM_DEPENDENCIES(CC)],
153 [define([AC_PROG_CC],
154 defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
155 AC_PROVIDE_IFELSE([AC_PROG_CXX],
156 [_AM_DEPENDENCIES(CXX)],
157 [define([AC_PROG_CXX],
158 defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
163 # When config.status generates a header, we must update the stamp-h file.
164 # This file resides in the same directory as the config header
165 # that is generated. The stamp files are numbered to have different names.
167 # Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
168 # loop where config.status creates the headers, so we can generate
169 # our stamp files there.
170 AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
171 [# Compute $1's index in $config_headers.
173 for _am_header in $config_headers :; do
178 _am_stamp_count=`expr $_am_stamp_count + 1` ;;
181 echo "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count])
183 # Copyright 2002 Free Software Foundation, Inc.
185 # This program is free software; you can redistribute it and/or modify
186 # it under the terms of the GNU General Public License as published by
187 # the Free Software Foundation; either version 2, or (at your option)
190 # This program is distributed in the hope that it will be useful,
191 # but WITHOUT ANY WARRANTY; without even the implied warranty of
192 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
193 # GNU General Public License for more details.
195 # You should have received a copy of the GNU General Public License
196 # along with this program; if not, write to the Free Software
197 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
199 # AM_AUTOMAKE_VERSION(VERSION)
200 # ----------------------------
201 # Automake X.Y traces this macro to ensure aclocal.m4 has been
202 # generated from the m4 files accompanying Automake X.Y.
203 AC_DEFUN([AM_AUTOMAKE_VERSION],[am__api_version="1.7"])
205 # AM_SET_CURRENT_AUTOMAKE_VERSION
206 # -------------------------------
207 # Call AM_AUTOMAKE_VERSION so it can be traced.
208 # This function is AC_REQUIREd by AC_INIT_AUTOMAKE.
209 AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
210 [AM_AUTOMAKE_VERSION([1.7.9])])
212 # Helper functions for option handling. -*- Autoconf -*-
214 # Copyright 2001, 2002 Free Software Foundation, Inc.
216 # This program is free software; you can redistribute it and/or modify
217 # it under the terms of the GNU General Public License as published by
218 # the Free Software Foundation; either version 2, or (at your option)
221 # This program is distributed in the hope that it will be useful,
222 # but WITHOUT ANY WARRANTY; without even the implied warranty of
223 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
224 # GNU General Public License for more details.
226 # You should have received a copy of the GNU General Public License
227 # along with this program; if not, write to the Free Software
228 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
233 # _AM_MANGLE_OPTION(NAME)
234 # -----------------------
235 AC_DEFUN([_AM_MANGLE_OPTION],
236 [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
238 # _AM_SET_OPTION(NAME)
239 # ------------------------------
240 # Set option NAME. Presently that only means defining a flag for this option.
241 AC_DEFUN([_AM_SET_OPTION],
242 [m4_define(_AM_MANGLE_OPTION([$1]), 1)])
244 # _AM_SET_OPTIONS(OPTIONS)
245 # ----------------------------------
246 # OPTIONS is a space-separated list of Automake options.
247 AC_DEFUN([_AM_SET_OPTIONS],
248 [AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
250 # _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
251 # -------------------------------------------
252 # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
253 AC_DEFUN([_AM_IF_OPTION],
254 [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
257 # Check to make sure that the build environment is sane.
260 # Copyright 1996, 1997, 2000, 2001 Free Software Foundation, Inc.
262 # This program is free software; you can redistribute it and/or modify
263 # it under the terms of the GNU General Public License as published by
264 # the Free Software Foundation; either version 2, or (at your option)
267 # This program is distributed in the hope that it will be useful,
268 # but WITHOUT ANY WARRANTY; without even the implied warranty of
269 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
270 # GNU General Public License for more details.
272 # You should have received a copy of the GNU General Public License
273 # along with this program; if not, write to the Free Software
274 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
281 AC_DEFUN([AM_SANITY_CHECK],
282 [AC_MSG_CHECKING([whether build environment is sane])
285 echo timestamp > conftest.file
286 # Do `set' in a subshell so we don't clobber the current shell's
287 # arguments. Must try -L first in case configure is actually a
288 # symlink; some systems play weird games with the mod time of symlinks
289 # (eg FreeBSD returns the mod time of the symlink's containing
292 set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
293 if test "$[*]" = "X"; then
295 set X `ls -t $srcdir/configure conftest.file`
298 if test "$[*]" != "X $srcdir/configure conftest.file" \
299 && test "$[*]" != "X conftest.file $srcdir/configure"; then
301 # If neither matched, then we have a broken ls. This can happen
302 # if, for instance, CONFIG_SHELL is bash and it inherits a
303 # broken ls alias from the environment. This has actually
304 # happened. Such a system could not be considered "sane".
305 AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
306 alias in your environment])
309 test "$[2]" = conftest.file
315 AC_MSG_ERROR([newly created file is older than distributed files!
316 Check your system clock])
323 # Copyright 1997, 1999, 2000, 2001 Free Software Foundation, Inc.
325 # This program is free software; you can redistribute it and/or modify
326 # it under the terms of the GNU General Public License as published by
327 # the Free Software Foundation; either version 2, or (at your option)
330 # This program is distributed in the hope that it will be useful,
331 # but WITHOUT ANY WARRANTY; without even the implied warranty of
332 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
333 # GNU General Public License for more details.
335 # You should have received a copy of the GNU General Public License
336 # along with this program; if not, write to the Free Software
337 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
342 # AM_MISSING_PROG(NAME, PROGRAM)
343 # ------------------------------
344 AC_DEFUN([AM_MISSING_PROG],
345 [AC_REQUIRE([AM_MISSING_HAS_RUN])
346 $1=${$1-"${am_missing_run}$2"}
352 # Define MISSING if not defined so far and test if it supports --run.
353 # If it does, set am_missing_run to use it, otherwise, to nothing.
354 AC_DEFUN([AM_MISSING_HAS_RUN],
355 [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
356 test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
357 # Use eval to expand $SHELL
358 if eval "$MISSING --run true"; then
359 am_missing_run="$MISSING --run "
362 AC_MSG_WARN([`missing' script is too old or missing])
368 # Copyright 2001 Free Software Foundation, Inc.
370 # This program is free software; you can redistribute it and/or modify
371 # it under the terms of the GNU General Public License as published by
372 # the Free Software Foundation; either version 2, or (at your option)
375 # This program is distributed in the hope that it will be useful,
376 # but WITHOUT ANY WARRANTY; without even the implied warranty of
377 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
378 # GNU General Public License for more details.
380 # You should have received a copy of the GNU General Public License
381 # along with this program; if not, write to the Free Software
382 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
385 # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
386 # $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to
387 # `$srcdir', `$srcdir/..', or `$srcdir/../..'.
389 # Of course, Automake must honor this variable whenever it calls a
390 # tool from the auxiliary directory. The problem is that $srcdir (and
391 # therefore $ac_aux_dir as well) can be either absolute or relative,
392 # depending on how configure is run. This is pretty annoying, since
393 # it makes $ac_aux_dir quite unusable in subdirectories: in the top
394 # source directory, any form will work fine, but in subdirectories a
395 # relative path needs to be adjusted first.
397 # $ac_aux_dir/missing
398 # fails when called from a subdirectory if $ac_aux_dir is relative
399 # $top_srcdir/$ac_aux_dir/missing
400 # fails if $ac_aux_dir is absolute,
401 # fails when called from a subdirectory in a VPATH build with
402 # a relative $ac_aux_dir
404 # The reason of the latter failure is that $top_srcdir and $ac_aux_dir
405 # are both prefixed by $srcdir. In an in-source build this is usually
406 # harmless because $srcdir is `.', but things will broke when you
407 # start a VPATH build or use an absolute $srcdir.
409 # So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
410 # iff we strip the leading $srcdir from $ac_aux_dir. That would be:
411 # am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
412 # and then we would define $MISSING as
413 # MISSING="\${SHELL} $am_aux_dir/missing"
414 # This will work as long as MISSING is not called from configure, because
415 # unfortunately $(top_srcdir) has no meaning in configure.
416 # However there are other variables, like CC, which are often used in
417 # configure, and could therefore not use this "fixed" $ac_aux_dir.
419 # Another solution, used here, is to always expand $ac_aux_dir to an
420 # absolute PATH. The drawback is that using absolute paths prevent a
421 # configured tree to be moved without reconfiguration.
423 # Rely on autoconf to set up CDPATH properly.
426 AC_DEFUN([AM_AUX_DIR_EXPAND], [
427 # expand $ac_aux_dir to an absolute path
428 am_aux_dir=`cd $ac_aux_dir && pwd`
433 # Define $install_sh.
435 # Copyright 2001 Free Software Foundation, Inc.
437 # This program is free software; you can redistribute it and/or modify
438 # it under the terms of the GNU General Public License as published by
439 # the Free Software Foundation; either version 2, or (at your option)
442 # This program is distributed in the hope that it will be useful,
443 # but WITHOUT ANY WARRANTY; without even the implied warranty of
444 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
445 # GNU General Public License for more details.
447 # You should have received a copy of the GNU General Public License
448 # along with this program; if not, write to the Free Software
449 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
452 AC_DEFUN([AM_PROG_INSTALL_SH],
453 [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
454 install_sh=${install_sh-"$am_aux_dir/install-sh"}
455 AC_SUBST(install_sh)])
457 # AM_PROG_INSTALL_STRIP
459 # Copyright 2001 Free Software Foundation, Inc.
461 # This program is free software; you can redistribute it and/or modify
462 # it under the terms of the GNU General Public License as published by
463 # the Free Software Foundation; either version 2, or (at your option)
466 # This program is distributed in the hope that it will be useful,
467 # but WITHOUT ANY WARRANTY; without even the implied warranty of
468 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
469 # GNU General Public License for more details.
471 # You should have received a copy of the GNU General Public License
472 # along with this program; if not, write to the Free Software
473 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
476 # One issue with vendor `install' (even GNU) is that you can't
477 # specify the program used to strip binaries. This is especially
478 # annoying in cross-compiling environments, where the build's strip
479 # is unlikely to handle the host's binaries.
480 # Fortunately install-sh will honor a STRIPPROG variable, so we
481 # always use install-sh in `make install-strip', and initialize
482 # STRIPPROG with the value of the STRIP variable (set by the user).
483 AC_DEFUN([AM_PROG_INSTALL_STRIP],
484 [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
485 # Installed binaries are usually stripped using `strip' when the user
486 # run `make install-strip'. However `strip' might not be the right
487 # tool to use in cross-compilation environments, therefore Automake
488 # will honor the `STRIP' environment variable to overrule this program.
489 dnl Don't test for $cross_compiling = yes, because it might be `maybe'.
490 if test "$cross_compiling" != no; then
491 AC_CHECK_TOOL([STRIP], [strip], :)
493 INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s"
494 AC_SUBST([INSTALL_STRIP_PROGRAM])])
497 # Copyright (C) 2003 Free Software Foundation, Inc.
499 # This program is free software; you can redistribute it and/or modify
500 # it under the terms of the GNU General Public License as published by
501 # the Free Software Foundation; either version 2, or (at your option)
504 # This program is distributed in the hope that it will be useful,
505 # but WITHOUT ANY WARRANTY; without even the implied warranty of
506 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
507 # GNU General Public License for more details.
509 # You should have received a copy of the GNU General Public License
510 # along with this program; if not, write to the Free Software
511 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
516 # Check whether the underlying file-system supports filenames
517 # with a leading dot. For instance MS-DOS doesn't.
518 AC_DEFUN([AM_SET_LEADING_DOT],
519 [rm -rf .tst 2>/dev/null
520 mkdir .tst 2>/dev/null
521 if test -d .tst; then
526 rmdir .tst 2>/dev/null
527 AC_SUBST([am__leading_dot])])
529 # serial 5 -*- Autoconf -*-
531 # Copyright (C) 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
533 # This program is free software; you can redistribute it and/or modify
534 # it under the terms of the GNU General Public License as published by
535 # the Free Software Foundation; either version 2, or (at your option)
538 # This program is distributed in the hope that it will be useful,
539 # but WITHOUT ANY WARRANTY; without even the implied warranty of
540 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
541 # GNU General Public License for more details.
543 # You should have received a copy of the GNU General Public License
544 # along with this program; if not, write to the Free Software
545 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
549 # There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
550 # written in clear, in which case automake, when reading aclocal.m4,
551 # will think it sees a *use*, and therefore will trigger all it's
552 # C support machinery. Also note that it means that autoscan, seeing
553 # CC etc. in the Makefile, will ask for an AC_PROG_CC use...
557 # _AM_DEPENDENCIES(NAME)
558 # ----------------------
559 # See how the compiler implements dependency checking.
560 # NAME is "CC", "CXX", "GCJ", or "OBJC".
561 # We try a few techniques and use that to set a single cache variable.
563 # We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
564 # modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
565 # dependency, and given that the user is not expected to run this macro,
566 # just rely on AC_PROG_CC.
567 AC_DEFUN([_AM_DEPENDENCIES],
568 [AC_REQUIRE([AM_SET_DEPDIR])dnl
569 AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
570 AC_REQUIRE([AM_MAKE_INCLUDE])dnl
571 AC_REQUIRE([AM_DEP_TRACK])dnl
573 ifelse([$1], CC, [depcc="$CC" am_compiler_list=],
574 [$1], CXX, [depcc="$CXX" am_compiler_list=],
575 [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
576 [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'],
577 [depcc="$$1" am_compiler_list=])
579 AC_CACHE_CHECK([dependency style of $depcc],
580 [am_cv_$1_dependencies_compiler_type],
581 [if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
582 # We make a subdir and do the tests there. Otherwise we can end up
583 # making bogus files that we don't know about and never remove. For
584 # instance it was reported that on HP-UX the gcc test will end up
585 # making a dummy file named `D' -- because `-MD' means `put the output
588 # Copy depcomp to subdir because otherwise we won't find it if we're
589 # using a relative directory.
590 cp "$am_depcomp" conftest.dir
592 # We will build objects and dependencies in a subdirectory because
593 # it helps to detect inapplicable dependency modes. For instance
594 # both Tru64's cc and ICC support -MD to output dependencies as a
595 # side effect of compilation, but ICC will put the dependencies in
596 # the current directory while Tru64 will put them in the object
600 am_cv_$1_dependencies_compiler_type=none
601 if test "$am_compiler_list" = ""; then
602 am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
604 for depmode in $am_compiler_list; do
605 # Setup a source with many dependencies, because some compilers
606 # like to wrap large dependency lists on column 80 (with \), and
607 # we should not choose a depcomp mode which is confused by this.
609 # We need to recreate these files for each test, as the compiler may
610 # overwrite some of them when testing with obscure command lines.
611 # This happens at least with the AIX C compiler.
613 for i in 1 2 3 4 5 6; do
614 echo '#include "conftst'$i'.h"' >> sub/conftest.c
617 echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
621 # after this tag, mechanisms are not by side-effect, so they'll
622 # only be used when explicitly requested
623 if test "x$enable_dependency_tracking" = xyes; then
631 # We check with `-c' and `-o' for the sake of the "dashmstdout"
632 # mode. It turns out that the SunPro C++ compiler does not properly
633 # handle `-M -o', and we need to detect this.
634 if depmode=$depmode \
635 source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
636 depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
637 $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
638 >/dev/null 2>conftest.err &&
639 grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
640 grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
641 ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
642 # icc doesn't choke on unknown options, it will just issue warnings
643 # (even with -Werror). So we grep stderr for any message
644 # that says an option was ignored.
645 if grep 'ignoring option' conftest.err >/dev/null 2>&1; then :; else
646 am_cv_$1_dependencies_compiler_type=$depmode
655 am_cv_$1_dependencies_compiler_type=none
658 AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
659 AM_CONDITIONAL([am__fastdep$1], [
660 test "x$enable_dependency_tracking" != xno \
661 && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
667 # Choose a directory name for dependency files.
668 # This macro is AC_REQUIREd in _AM_DEPENDENCIES
669 AC_DEFUN([AM_SET_DEPDIR],
670 [AC_REQUIRE([AM_SET_LEADING_DOT])dnl
671 AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
677 AC_DEFUN([AM_DEP_TRACK],
678 [AC_ARG_ENABLE(dependency-tracking,
679 [ --disable-dependency-tracking Speeds up one-time builds
680 --enable-dependency-tracking Do not reject slow dependency extractors])
681 if test "x$enable_dependency_tracking" != xno; then
682 am_depcomp="$ac_aux_dir/depcomp"
685 AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
686 AC_SUBST([AMDEPBACKSLASH])
689 # Generate code to set up dependency tracking. -*- Autoconf -*-
691 # Copyright 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
693 # This program is free software; you can redistribute it and/or modify
694 # it under the terms of the GNU General Public License as published by
695 # the Free Software Foundation; either version 2, or (at your option)
698 # This program is distributed in the hope that it will be useful,
699 # but WITHOUT ANY WARRANTY; without even the implied warranty of
700 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
701 # GNU General Public License for more details.
703 # You should have received a copy of the GNU General Public License
704 # along with this program; if not, write to the Free Software
705 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
710 # _AM_OUTPUT_DEPENDENCY_COMMANDS
711 # ------------------------------
712 AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
713 [for mf in $CONFIG_FILES; do
714 # Strip MF so we end up with the name of the file.
715 mf=`echo "$mf" | sed -e 's/:.*$//'`
716 # Check whether this is an Automake generated Makefile or not.
717 # We used to match only the files named `Makefile.in', but
718 # some people rename them; so instead we look at the file content.
719 # Grep'ing the first line is not enough: some people post-process
720 # each Makefile.in and add a new line on top of each file to say so.
721 # So let's grep whole file.
722 if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then
723 dirpart=`AS_DIRNAME("$mf")`
727 grep '^DEP_FILES *= *[[^ @%:@]]' < "$mf" > /dev/null || continue
728 # Extract the definition of DEP_FILES from the Makefile without
730 DEPDIR=`sed -n -e '/^DEPDIR = / s///p' < "$mf"`
731 test -z "$DEPDIR" && continue
732 # When using ansi2knr, U may be empty or an underscore; expand it
733 U=`sed -n -e '/^U = / s///p' < "$mf"`
734 test -d "$dirpart/$DEPDIR" || mkdir "$dirpart/$DEPDIR"
735 # We invoke sed twice because it is the simplest approach to
736 # changing $(DEPDIR) to its actual value in the expansion.
737 for file in `sed -n -e '
738 /^DEP_FILES = .*\\\\$/ {
747 /^DEP_FILES = / s/^DEP_FILES = //p' < "$mf" | \
748 sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
749 # Make sure the directory exists.
750 test -f "$dirpart/$file" && continue
751 fdir=`AS_DIRNAME(["$file"])`
752 AS_MKDIR_P([$dirpart/$fdir])
753 # echo "creating $dirpart/$file"
754 echo '# dummy' > "$dirpart/$file"
757 ])# _AM_OUTPUT_DEPENDENCY_COMMANDS
760 # AM_OUTPUT_DEPENDENCY_COMMANDS
761 # -----------------------------
762 # This macro should only be invoked once -- use via AC_REQUIRE.
764 # This code is only required when automatic dependency tracking
765 # is enabled. FIXME. This creates each `.P' file that we will
766 # need in order to bootstrap the dependency handling code.
767 AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
768 [AC_CONFIG_COMMANDS([depfiles],
769 [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
770 [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
773 # Check to see how 'make' treats includes. -*- Autoconf -*-
775 # Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
777 # This program is free software; you can redistribute it and/or modify
778 # it under the terms of the GNU General Public License as published by
779 # the Free Software Foundation; either version 2, or (at your option)
782 # This program is distributed in the hope that it will be useful,
783 # but WITHOUT ANY WARRANTY; without even the implied warranty of
784 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
785 # GNU General Public License for more details.
787 # You should have received a copy of the GNU General Public License
788 # along with this program; if not, write to the Free Software
789 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
796 # Check to see how make treats includes.
797 AC_DEFUN([AM_MAKE_INCLUDE],
798 [am_make=${MAKE-make}
799 cat > confinc << 'END'
804 # If we don't find an include directive, just comment out the code.
805 AC_MSG_CHECKING([for style of include used by $am_make])
809 # First try GNU make style include.
810 echo "include confinc" > confmf
811 # We grep out `Entering directory' and `Leaving directory'
812 # messages which can occur if `w' ends up in MAKEFLAGS.
813 # In particular we don't look at `^make:' because GNU make might
814 # be invoked under some other name (usually "gmake"), in which
815 # case it prints its new name instead of `make'.
816 if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then
821 # Now try BSD make style include.
822 if test "$am__include" = "#"; then
823 echo '.include "confinc"' > confmf
824 if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
830 AC_SUBST([am__include])
831 AC_SUBST([am__quote])
832 AC_MSG_RESULT([$_am_result])
836 dnl init_automake.m4--cmulocal automake setup macro
838 dnl $Id: init_automake.m4,v 1.4 2003/10/08 20:35:24 rjs3 Exp $
840 AC_DEFUN([CMU_INIT_AUTOMAKE], [
841 AC_REQUIRE([AM_INIT_AUTOMAKE])
842 ACLOCAL="$ACLOCAL -I \$(top_srcdir)/cmulocal"
846 dnl $Id: c-attribute.m4,v 1.3 2003/10/08 20:35:24 rjs3 Exp $
850 dnl Test for __attribute__
853 AC_DEFUN([CMU_C___ATTRIBUTE__], [
854 AC_MSG_CHECKING(for __attribute__)
855 AC_CACHE_VAL(ac_cv___attribute__, [
860 static void foo(void) __attribute__ ((noreturn));
868 ac_cv___attribute__=yes,
869 ac_cv___attribute__=no)])
870 if test "$ac_cv___attribute__" = "yes"; then
871 AC_DEFINE(HAVE___ATTRIBUTE__, 1, [define if your compiler has __attribute__])
873 AC_MSG_RESULT($ac_cv___attribute__)
878 dnl Additional macros for configure.in packaged up for easier theft.
879 dnl $Id: cyrus.m4,v 1.4 2003/10/08 20:35:24 rjs3 Exp $
880 dnl tjs@andrew.cmu.edu 6-may-1998
883 dnl It would be good if ANDREW_ADD_LIBPATH could detect if something was
884 dnl already there and not redundantly add it if it is.
886 dnl add -L(arg), and possibly (runpath switch)(arg), to LDFLAGS
887 dnl (so the runpath for shared libraries is set).
888 AC_DEFUN([CMU_ADD_LIBPATH], [
889 # this is CMU ADD LIBPATH
890 if test "$andrew_runpath_switch" = "none" ; then
891 LDFLAGS="-L$1 ${LDFLAGS}"
893 LDFLAGS="-L$1 $andrew_runpath_switch$1 ${LDFLAGS}"
897 dnl add -L(1st arg), and possibly (runpath switch)(1st arg), to (2nd arg)
898 dnl (so the runpath for shared libraries is set).
899 AC_DEFUN([CMU_ADD_LIBPATH_TO], [
900 # this is CMU ADD LIBPATH TO
901 if test "$andrew_runpath_switch" = "none" ; then
904 $2="-L$1 ${$2} $andrew_runpath_switch$1"
908 dnl runpath initialization
909 AC_DEFUN([CMU_GUESS_RUNPATH_SWITCH], [
910 # CMU GUESS RUNPATH SWITCH
911 AC_CACHE_CHECK(for runpath switch, andrew_runpath_switch, [
913 SAVE_LDFLAGS="${LDFLAGS}"
914 LDFLAGS="-R /usr/lib"
915 AC_TRY_LINK([],[],[andrew_runpath_switch="-R"], [
916 LDFLAGS="-Wl,-rpath,/usr/lib"
917 AC_TRY_LINK([],[],[andrew_runpath_switch="-Wl,-rpath,"],
918 [andrew_runpath_switch="none"])
920 LDFLAGS="${SAVE_LDFLAGS}"
923 dnl bsd_sockets.m4--which socket libraries do we need?
926 dnl $Id: bsd_sockets.m4,v 1.10 2005/04/26 19:14:07 shadow Exp $
928 dnl Hacked on by Rob Earhart to not just toss stuff in LIBS
929 dnl It now puts everything required for sockets into LIB_SOCKET
931 AC_DEFUN([CMU_SOCKETS], [
934 AC_CHECK_FUNC(connect, :,
935 AC_CHECK_LIB(nsl, gethostbyname,
936 LIB_SOCKET="-lnsl $LIB_SOCKET")
937 AC_CHECK_LIB(socket, connect,
938 LIB_SOCKET="-lsocket $LIB_SOCKET")
940 LIBS="$LIB_SOCKET $save_LIBS"
941 AC_CHECK_FUNC(res_search, :,
942 LIBS="-lresolv $LIB_SOCKET $save_LIBS"
944 #include <sys/types.h>
945 #include <netinet/in.h>
946 #include <arpa/nameser.h>
947 #ifdef HAVE_ARPA_NAMESER_COMPAT_H
948 #include <arpa/nameser_compat.h>
950 #include <resolv.h>]],[[
951 const char host[12]="openafs.org";
953 res_search( host, C_IN, T_MX, (u_char *)&ans, sizeof(ans));
955 ]], LIB_SOCKET="-lresolv $LIB_SOCKET")
957 LIBS="$LIB_SOCKET $save_LIBS"
958 AC_CHECK_FUNCS(dn_expand dns_lookup)
964 dnl macros for configure.in to detect openssl
965 dnl $Id: openssl.m4,v 1.11 2006/05/17 18:30:19 murch Exp $
968 AC_DEFUN([CMU_HAVE_OPENSSL], [
969 AC_REQUIRE([CMU_FIND_LIB_SUBDIR])
970 AC_ARG_WITH(openssl,[ --with-openssl=PATH use OpenSSL from PATH],
971 with_openssl=$withval, with_openssl="yes")
973 save_CPPFLAGS=$CPPFLAGS
974 save_LDFLAGS=$LDFLAGS
976 if test -d $with_openssl; then
977 CPPFLAGS="${CPPFLAGS} -I${with_openssl}/include"
978 CMU_ADD_LIBPATH(${with_openssl}/$CMU_LIB_SUBDIR)
981 case "$with_openssl" in
985 dnl if openssl has been compiled with the rsaref2 libraries,
986 dnl we need to include the rsaref libraries in the crypto check
988 AC_CHECK_LIB(rsaref, RSAPublicEncrypt,
990 [AC_CHECK_LIB(RSAglue, RSAPublicEncrypt,
991 LIB_RSAREF="-lRSAglue -lrsaref",
992 LIB_RSAREF="-lrsaref")],
995 AC_CHECK_HEADER(openssl/evp.h, [
996 AC_CHECK_LIB(crypto, EVP_DigestInit,
998 with_openssl="no", $LIB_RSAREF)],
1003 if test "$with_openssl" != "no"; then
1004 AC_DEFINE(HAVE_OPENSSL,[],[Do we have OpenSSL?])
1006 CPPFLAGS=$save_CPPFLAGS
1007 LDFLAGS=$save_LDFLAGS
1011 dnl $Id: common.m4,v 1.13 2006/02/25 18:29:46 cg2v Exp $
1013 AC_DEFUN([CMU_TEST_LIBPATH], [
1015 define(<<CMU_AC_CV_FOUND>>, translit(ac_cv_found_$2_lib, <<- *>>, <<__p>>))
1017 if test "$CMU_AC_CV_FOUND" = "yes"; then
1018 if test \! -r "$1/lib$2.a" -a \! -r "$1/lib$2.so" -a \! -r "$1/lib$2.sl" -a \! -r "$1/lib$2.dylib"; then
1024 AC_DEFUN([CMU_TEST_INCPATH], [
1026 define(<<CMU_AC_CV_FOUND>>, translit(ac_cv_found_$2_inc, [ *], [_p]))
1028 if test "$CMU_AC_CV_FOUND" = "yes"; then
1029 if test \! -r "$1/$2.h"; then
1035 dnl CMU_CHECK_HEADER_NOCACHE(HEADER-FILE, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
1036 AC_DEFUN([CMU_CHECK_HEADER_NOCACHE],
1037 [dnl Do the transliteration at runtime so arg 1 can be a shell variable.
1038 ac_safe=`echo "$1" | sed 'y%./+-%__p_%'`
1039 AC_MSG_CHECKING([for $1])
1040 AC_TRY_CPP([#include <$1>], eval "ac_cv_header_$ac_safe=yes",
1041 eval "ac_cv_header_$ac_safe=no")
1042 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
1044 ifelse([$2], , :, [$2])
1047 ifelse([$3], , , [$3
1052 AC_DEFUN([CMU_FIND_LIB_SUBDIR],
1054 AC_ARG_WITH([lib-subdir], AC_HELP_STRING([--with-lib-subdir=DIR],[Find libraries in DIR instead of lib]))
1055 AC_CHECK_SIZEOF(long)
1056 AC_CACHE_CHECK([what directory libraries are found in], [ac_cv_cmu_lib_subdir],
1057 [test "X$with_lib_subdir" = "Xyes" && with_lib_subdir=
1058 test "X$with_lib_subdir" = "Xno" && with_lib_subdir=
1059 if test "X$with_lib_subdir" = "X" ; then
1060 ac_cv_cmu_lib_subdir=lib
1061 if test $ac_cv_sizeof_long -eq 4 ; then
1062 test -d /usr/lib32 && ac_cv_cmu_lib_subdir=lib32
1064 if test $ac_cv_sizeof_long -eq 8 ; then
1065 test -d /usr/lib64 && ac_cv_cmu_lib_subdir=lib64
1068 ac_cv_cmu_lib_subdir=$with_lib_subdir
1070 AC_SUBST(CMU_LIB_SUBDIR, $ac_cv_cmu_lib_subdir)
1073 dnl checking for kerberos 4 libraries (and DES)
1075 AC_DEFUN([SASL_DES_CHK], [
1076 AC_ARG_WITH(des, [ --with-des=DIR with DES (look in DIR) [yes] ],
1081 if test "$with_des" != no; then
1082 if test -d $with_des; then
1083 CPPFLAGS="$CPPFLAGS -I${with_des}/include"
1084 LDFLAGS="$LDFLAGS -L${with_des}/lib"
1087 if test "$with_openssl" != no; then
1088 dnl check for openssl installing -lcrypto, then make vanilla check
1089 AC_CHECK_LIB(crypto, des_cbc_encrypt, [
1090 AC_CHECK_HEADER(openssl/des.h, [AC_DEFINE(WITH_SSL_DES,[],[Use OpenSSL DES Implementation])
1094 with_des=no, $LIB_RSAREF)
1096 dnl same test again, different symbol name
1097 if test "$with_des" = no; then
1098 AC_CHECK_LIB(crypto, DES_cbc_encrypt, [
1099 AC_CHECK_HEADER(openssl/des.h, [AC_DEFINE(WITH_SSL_DES,[],[Use OpenSSL DES Implementation])
1103 with_des=no, $LIB_RSAREF)
1107 if test "$with_des" = no; then
1108 AC_CHECK_LIB(des, des_cbc_encrypt, [LIB_DES="-ldes";
1109 with_des=yes], with_des=no)
1112 if test "$with_des" = no; then
1113 AC_CHECK_LIB(des425, des_cbc_encrypt, [LIB_DES="-ldes425";
1114 with_des=yes], with_des=no)
1117 if test "$with_des" = no; then
1118 AC_CHECK_LIB(des524, des_cbc_encrypt, [LIB_DES="-ldes524";
1119 with_des=yes], with_des=no)
1122 if test "$with_des" = no; then
1123 dnl if openssl is around, we might be able to use that for des
1125 dnl if openssl has been compiled with the rsaref2 libraries,
1126 dnl we need to include the rsaref libraries in the crypto check
1128 AC_CHECK_LIB(rsaref, RSAPublicEncrypt,
1129 LIB_RSAREF="-lRSAglue -lrsaref"; cmu_have_rsaref=yes,
1132 AC_CHECK_LIB(crypto, des_cbc_encrypt, [
1133 AC_CHECK_HEADER(openssl/des.h, [AC_DEFINE(WITH_SSL_DES,[],[Use OpenSSL DES Implementation])
1137 with_des=no, $LIB_RSAREF)
1141 if test "$with_des" != no; then
1142 AC_DEFINE(WITH_DES,[],[Use DES])
1148 AC_DEFUN([SASL_KERBEROS_V4_CHK], [
1149 AC_REQUIRE([SASL_DES_CHK])
1151 AC_ARG_ENABLE(krb4, [ --enable-krb4 enable KERBEROS_V4 authentication [[no]] ],
1155 if test "$krb4" != no; then
1156 dnl In order to compile kerberos4, we need libkrb and libdes.
1157 dnl (We've already gotten libdes from SASL_DES_CHK)
1158 dnl we might need -lresolv for kerberos
1159 AC_CHECK_LIB(resolv,res_search)
1161 dnl if we were ambitious, we would look more aggressively for the
1163 if test -d ${krb4}; then
1164 AC_CACHE_CHECK(for Kerberos includes, cyrus_krbinclude, [
1165 for krbhloc in include/kerberosIV include/kerberos include
1167 if test -f ${krb4}/${krbhloc}/krb.h ; then
1168 cyrus_krbinclude=${krb4}/${krbhloc}
1174 if test -n "${cyrus_krbinclude}"; then
1175 CPPFLAGS="$CPPFLAGS -I${cyrus_krbinclude}"
1177 LDFLAGS="$LDFLAGS -L$krb4/lib"
1180 if test "$with_des" != no; then
1181 AC_CHECK_HEADER(krb.h, [
1182 AC_CHECK_LIB(com_err, com_err, [
1183 AC_CHECK_LIB(krb, krb_mk_priv,
1184 [COM_ERR="-lcom_err"; SASL_KRB_LIB="-lkrb"; krb4lib="yes"],
1185 krb4lib=no, $LIB_DES -lcom_err)], [
1186 AC_CHECK_LIB(krb, krb_mk_priv,
1187 [COM_ERR=""; SASL_KRB_LIB="-lkrb"; krb4lib="yes"],
1188 krb4lib=no, $LIB_DES)])], krb4="no")
1190 if test "$krb4" != "no" -a "$krb4lib" = "no"; then
1191 AC_CHECK_LIB(krb4, krb_mk_priv,
1192 [COM_ERR=""; SASL_KRB_LIB="-lkrb4"; krb4=yes],
1195 if test "$krb4" = no; then
1196 AC_WARN(No Kerberos V4 found)
1199 AC_WARN(No DES library found for Kerberos V4 support)
1204 if test "$krb4" != no; then
1205 cmu_save_LIBS="$LIBS"
1206 LIBS="$LIBS $SASL_KRB_LIB"
1207 AC_CHECK_FUNCS(krb_get_err_text)
1208 LIBS="$cmu_save_LIBS"
1211 AC_MSG_CHECKING(KERBEROS_V4)
1212 if test "$krb4" != no; then
1213 AC_MSG_RESULT(enabled)
1214 SASL_MECHS="$SASL_MECHS libkerberos4.la"
1215 SASL_STATIC_SRCS="$SASL_STATIC_SRCS ../plugins/kerberos4.c"
1216 SASL_STATIC_OBJS="$SASL_STATIC_OBJS kerberos4.o"
1217 AC_DEFINE(STATIC_KERBEROS4,[],[User KERBEROS_V4 Staticly])
1218 AC_DEFINE(HAVE_KRB,[],[Do we have Kerberos 4 Support?])
1219 SASL_KRB_LIB="$SASL_KRB_LIB $LIB_DES $COM_ERR"
1221 AC_MSG_RESULT(disabled)
1223 AC_SUBST(SASL_KRB_LIB)
1227 # sasl2.m4--sasl2 libraries and includes
1229 # $Id: sasl2.m4,v 1.52 2006/05/18 19:25:00 murch Exp $
1233 AC_DEFUN([SASL_GSSAPI_CHK],
1234 [AC_REQUIRE([SASL2_CRYPT_CHK])
1235 AC_REQUIRE([CMU_SOCKETS])
1236 AC_ARG_ENABLE([gssapi],
1237 [AC_HELP_STRING([--enable-gssapi=<DIR>],
1238 [enable GSSAPI authentication [yes]])],
1239 [gssapi=$enableval],
1241 AC_ARG_WITH([gss_impl],
1242 [AC_HELP_STRING([--with-gss_impl={heimdal|mit|cybersafe|seam|auto}],
1243 [choose specific GSSAPI implementation [[auto]]])],
1244 [gss_impl=$withval],
1247 if test "$gssapi" != no; then
1260 # When should we use __sunos?
1267 AC_WARN([The system type is not recognized. If you believe that CyberSafe GSSAPI works on this platform, please update the configure script])
1268 if test "$gss_impl" = "cybersafe"; then
1269 AC_ERROR([CyberSafe was forced, cannot continue as platform is not supported])
1274 cmu_saved_CPPFLAGS=$CPPFLAGS
1276 if test -d ${gssapi}; then
1277 CPPFLAGS="$CPPFLAGS -I$gssapi/include"
1278 # We want to keep -I in our CPPFLAGS, but only if we succeed
1279 cmu_saved_CPPFLAGS=$CPPFLAGS
1280 LDFLAGS="$LDFLAGS -L$gssapi/lib"
1282 if test -n "$platform"; then
1283 if test "$gss_impl" = "auto" -o "$gss_impl" = "cybersafe"; then
1284 CPPFLAGS="$CPPFLAGS -D$platform"
1285 if test -d "${gssapi}/appsec-sdk/include"; then
1286 CPPFLAGS="$CPPFLAGS -I${gssapi}/appsec-sdk/include"
1291 AC_CHECK_HEADER([gssapi.h],
1292 [AC_DEFINE(HAVE_GSSAPI_H,,
1293 [Define if you have the gssapi.h header file])],
1294 [AC_CHECK_HEADER([gssapi/gssapi.h],,
1295 [AC_WARN([Disabling GSSAPI - no include files found]); gssapi=no])])
1297 CPPFLAGS=$cmu_saved_CPPFLAGS
1301 if test "$gssapi" != no; then
1302 # We need to find out which gssapi implementation we are
1303 # using. Supported alternatives are: MIT Kerberos 5,
1304 # Heimdal Kerberos 5 (http://www.pdc.kth.se/heimdal),
1305 # CyberSafe Kerberos 5 (http://www.cybersafe.com/)
1306 # and Sun SEAM (http://wwws.sun.com/software/security/kerberos/)
1308 # The choice is reflected in GSSAPIBASE_LIBS
1310 AC_CHECK_LIB(resolv,res_search)
1311 if test -d ${gssapi}; then
1312 gssapi_dir="${gssapi}/lib"
1313 GSSAPIBASE_LIBS="-L$gssapi_dir"
1314 GSSAPIBASE_STATIC_LIBS="-L$gssapi_dir"
1316 # FIXME: This is only used for building cyrus, and then only as
1317 # a real hack. it needs to be fixed.
1318 gssapi_dir="/usr/local/lib"
1321 # Check a full link against the Heimdal libraries.
1322 # If this fails, check a full link against the MIT libraries.
1323 # If this fails, check a full link against the CyberSafe libraries.
1324 # If this fails, check a full link against the Solaris 8 and up libgss.
1326 if test "$gss_impl" = "auto" -o "$gss_impl" = "heimdal"; then
1328 AC_CHECK_LIB(gssapi,gss_unwrap,gss_impl="heimdal",gss_failed=1,
1329 ${GSSAPIBASE_LIBS} -lgssapi -lkrb5 -lasn1 -lroken ${LIB_CRYPT} ${LIB_DES} -lcom_err ${LIB_SOCKET})
1330 if test "$gss_impl" != "auto" -a "$gss_failed" = "1"; then
1335 if test "$gss_impl" = "auto" -o "$gss_impl" = "mit"; then
1336 # check for libkrb5support first
1337 AC_CHECK_LIB(krb5support,krb5int_getspecific,K5SUP=-lkrb5support K5SUPSTATIC=$gssapi_dir/libkrb5support.a,,${LIB_SOCKET})
1340 AC_CHECK_LIB(gssapi_krb5,gss_unwrap,gss_impl="mit",gss_failed=1,
1341 ${GSSAPIBASE_LIBS} -lgssapi_krb5 -lkrb5 -lk5crypto -lcom_err ${K5SUP} ${LIB_SOCKET})
1342 if test "$gss_impl" != "auto" -a "$gss_failed" = "1"; then
1347 # For Cybersafe one has to set a platform define in order to make compilation work
1348 if test "$gss_impl" = "auto" -o "$gss_impl" = "cybersafe"; then
1350 cmu_saved_CPPFLAGS=$CPPFLAGS
1351 cmu_saved_GSSAPIBASE_LIBS=$GSSAPIBASE_LIBS
1352 # FIXME - Note that the libraries are in .../lib64 for 64bit kernels
1353 if test -d "${gssapi}/appsec-rt/lib"; then
1354 GSSAPIBASE_LIBS="$GSSAPIBASE_LIBS -L${gssapi}/appsec-rt/lib"
1356 CPPFLAGS="$CPPFLAGS -D$platform"
1357 if test -d "${gssapi}/appsec-sdk/include"; then
1358 CPPFLAGS="$CPPFLAGS -I${gssapi}/appsec-sdk/include"
1363 # Check for CyberSafe with two libraries first, than fall back to a single
1364 # library (older CyberSafe)
1366 unset ac_cv_lib_gss_csf_gss_acq_user
1367 AC_CHECK_LIB(gss,csf_gss_acq_user,gss_impl="cybersafe03",
1368 [unset ac_cv_lib_gss_csf_gss_acq_user;
1369 AC_CHECK_LIB(gss,csf_gss_acq_user,gss_impl="cybersafe",
1370 gss_failed=1,$GSSAPIBASE_LIBS -lgss)],
1371 [${GSSAPIBASE_LIBS} -lgss -lcstbk5])
1373 if test "$gss_failed" = "1"; then
1375 GSSAPIBASE_LIBS=$cmu_saved_GSSAPIBASE_LIBS
1376 CPPFLAGS=$cmu_saved_CPPFLAGS
1378 if test "$gss_impl" != "auto"; then
1384 if test "$gss_impl" = "auto" -o "$gss_impl" = "seam"; then
1386 AC_CHECK_LIB(gss,gss_unwrap,gss_impl="seam",gss_failed=1,-lgss)
1387 if test "$gss_impl" != "auto" -a "$gss_failed" = "1"; then
1392 if test "$gss_impl" = "mit"; then
1393 GSSAPIBASE_LIBS="$GSSAPIBASE_LIBS -lgssapi_krb5 -lkrb5 -lk5crypto -lcom_err ${K5SUP}"
1394 GSSAPIBASE_STATIC_LIBS="$GSSAPIBASE_LIBS $gssapi_dir/libgssapi_krb5.a $gssapi_dir/libkrb5.a $gssapi_dir/libk5crypto.a $gssapi_dir/libcom_err.a ${K5SUPSTATIC}"
1395 elif test "$gss_impl" = "heimdal"; then
1396 CPPFLAGS="$CPPFLAGS -DKRB5_HEIMDAL"
1397 GSSAPIBASE_LIBS="$GSSAPIBASE_LIBS -lgssapi -lkrb5 -lasn1 -lroken ${LIB_CRYPT} ${LIB_DES} -lcom_err"
1398 GSSAPIBASE_STATIC_LIBS="$GSSAPIBASE_STATIC_LIBS $gssapi_dir/libgssapi.a $gssapi_dir/libkrb5.a $gssapi_dir/libasn1.a $gssapi_dir/libroken.a $gssapi_dir/libcom_err.a ${LIB_CRYPT}"
1399 elif test "$gss_impl" = "cybersafe03"; then
1400 # Version of CyberSafe with two libraries
1401 CPPFLAGS="$CPPFLAGS -D$platform -I${gssapi}/appsec-sdk/include"
1402 GSSAPIBASE_LIBS="$GSSAPIBASE_LIBS -lgss -lcstbk5"
1403 # there is no static libgss for CyberSafe
1404 GSSAPIBASE_STATIC_LIBS=none
1405 elif test "$gss_impl" = "cybersafe"; then
1406 CPPFLAGS="$CPPFLAGS -D$platform -I${gssapi}/appsec-sdk/include"
1407 GSSAPIBASE_LIBS="$GSSAPIBASE_LIBS -lgss"
1408 # there is no static libgss for CyberSafe
1409 GSSAPIBASE_STATIC_LIBS=none
1410 elif test "$gss_impl" = "seam"; then
1411 GSSAPIBASE_LIBS=-lgss
1412 # there is no static libgss on Solaris 8 and up
1413 GSSAPIBASE_STATIC_LIBS=none
1414 elif test "$gss_impl" = "failed"; then
1417 GSSAPIBASE_STATIC_LIBS=
1418 AC_WARN([Disabling GSSAPI - specified library not found])
1422 GSSAPIBASE_STATIC_LIBS=
1423 AC_WARN([Disabling GSSAPI - no library])
1428 # Cybersafe defines both GSS_C_NT_HOSTBASED_SERVICE and GSS_C_NT_USER_NAME
1429 # in gssapi\rfckrb5.h
1431 if test "$gssapi" != "no"; then
1432 if test "$gss_impl" = "cybersafe" -o "$gss_impl" = "cybersafe03"; then
1433 AC_EGREP_CPP(hostbased_service_gss_nt_yes,
1434 [#include <gssapi/gssapi.h>
1435 #ifdef GSS_C_NT_HOSTBASED_SERVICE
1436 hostbased_service_gss_nt_yes
1438 [AC_DEFINE(HAVE_GSS_C_NT_HOSTBASED_SERVICE,,
1439 [Define if your GSSAPI implimentation defines GSS_C_NT_HOSTBASED_SERVICE])],
1440 [AC_WARN([Cybersafe define not found])])
1442 elif test "$ac_cv_header_gssapi_h" = "yes"; then
1443 AC_EGREP_HEADER(GSS_C_NT_HOSTBASED_SERVICE, gssapi.h,
1444 [AC_DEFINE(HAVE_GSS_C_NT_HOSTBASED_SERVICE,,
1445 [Define if your GSSAPI implimentation defines GSS_C_NT_HOSTBASED_SERVICE])])
1446 elif test "$ac_cv_header_gssapi_gssapi_h"; then
1447 AC_EGREP_HEADER(GSS_C_NT_HOSTBASED_SERVICE, gssapi/gssapi.h,
1448 [AC_DEFINE(HAVE_GSS_C_NT_HOSTBASED_SERVICE,,
1449 [Define if your GSSAPI implimentation defines GSS_C_NT_HOSTBASED_SERVICE])])
1452 if test "$gss_impl" = "cybersafe" -o "$gss_impl" = "cybersafe03"; then
1453 AC_EGREP_CPP(user_name_yes_gss_nt,
1454 [#include <gssapi/gssapi.h>
1455 #ifdef GSS_C_NT_USER_NAME
1456 user_name_yes_gss_nt
1458 [AC_DEFINE(HAVE_GSS_C_NT_USER_NAME,,
1459 [Define if your GSSAPI implimentation defines GSS_C_NT_USER_NAME])],
1460 [AC_WARN([Cybersafe define not found])])
1461 elif test "$ac_cv_header_gssapi_h" = "yes"; then
1462 AC_EGREP_HEADER(GSS_C_NT_USER_NAME, gssapi.h,
1463 [AC_DEFINE(HAVE_GSS_C_NT_USER_NAME,,
1464 [Define if your GSSAPI implimentation defines GSS_C_NT_USER_NAME])])
1465 elif test "$ac_cv_header_gssapi_gssapi_h"; then
1466 AC_EGREP_HEADER(GSS_C_NT_USER_NAME, gssapi/gssapi.h,
1467 [AC_DEFINE(HAVE_GSS_C_NT_USER_NAME,,
1468 [Define if your GSSAPI implimentation defines GSS_C_NT_USER_NAME])])
1473 AC_MSG_CHECKING([GSSAPI])
1474 if test "$gssapi" != no; then
1475 AC_MSG_RESULT([with implementation ${gss_impl}])
1476 AC_CHECK_LIB(resolv,res_search,GSSAPIBASE_LIBS="$GSSAPIBASE_LIBS -lresolv")
1477 SASL_MECHS="$SASL_MECHS libgssapiv2.la"
1478 SASL_STATIC_OBJS="$SASL_STATIC_OBJS gssapi.o"
1479 SASL_STATIC_SRCS="$SASL_STATIC_SRCS ../plugins/gssapi.c"
1481 cmu_save_LIBS="$LIBS"
1482 LIBS="$LIBS $GSSAPIBASE_LIBS"
1483 AC_CHECK_FUNCS(gsskrb5_register_acceptor_identity)
1484 LIBS="$cmu_save_LIBS"
1486 AC_MSG_RESULT([disabled])
1488 AC_SUBST(GSSAPI_LIBS)
1489 AC_SUBST(GSSAPIBASE_LIBS)
1493 # SASL_SET_GSSAPI_LIBS
1494 # --------------------
1495 AC_DEFUN([SASL_SET_GSSAPI_LIBS],
1496 [SASL_GSSAPI_LIBS_SET="yes"
1502 # What we want to do here is setup LIB_SASL with what one would
1503 # generally want to have (e.g. if static is requested, make it that,
1504 # otherwise make it dynamic.
1506 # We also want to create LIB_DYN_SASL and DYNSASLFLAGS.
1508 # Also sets using_static_sasl to "no" "static" or "staticonly"
1510 AC_DEFUN([CMU_SASL2],
1511 [AC_REQUIRE([SASL_GSSAPI_CHK])
1514 [AC_HELP_STRING([--with-sasl=DIR],[Compile with libsasl2 in <DIR>])],
1515 with_sasl="$withval",
1518 AC_ARG_WITH(staticsasl,
1519 [AC_HELP_STRING([--with-staticsasl=DIR],
1520 [Compile with staticly linked libsasl2 in <DIR>])],
1521 [with_staticsasl="$withval";
1522 if test $with_staticsasl != "no"; then
1523 using_static_sasl="static"
1525 [with_staticsasl="no"; using_static_sasl="no"])
1530 cmu_saved_CPPFLAGS=$CPPFLAGS
1531 cmu_saved_LDFLAGS=$LDFLAGS
1532 cmu_saved_LIBS=$LIBS
1534 if test ${with_staticsasl} != "no"; then
1535 if test -d ${with_staticsasl}; then
1536 if test -d ${with_staticsasl}/lib64 ; then
1537 ac_cv_sasl_where_lib=${with_staticsasl}/lib64
1539 ac_cv_sasl_where_lib=${with_staticsasl}/lib
1541 ac_cv_sasl_where_lib=${with_staticsasl}/lib
1542 ac_cv_sasl_where_inc=${with_staticsasl}/include
1544 SASLFLAGS="-I$ac_cv_sasl_where_inc"
1545 LIB_SASL="-L$ac_cv_sasl_where_lib"
1546 CPPFLAGS="${cmu_saved_CPPFLAGS} -I${ac_cv_sasl_where_inc}"
1547 LDFLAGS="${cmu_saved_LDFLAGS} -L${ac_cv_sasl_where_lib}"
1549 with_staticsasl="/usr"
1552 AC_CHECK_HEADER(sasl/sasl.h,
1553 [AC_CHECK_HEADER(sasl/saslutil.h,
1554 [for i42 in lib64 lib; do
1555 if test -r ${with_staticsasl}/$i42/libsasl2.a; then
1556 ac_cv_found_sasl=yes
1557 AC_MSG_CHECKING([for static libsasl])
1558 LIB_SASL="$LIB_SASL ${with_staticsasl}/$i42/libsasl2.a"
1561 if test ! "$ac_cv_found_sasl" = "yes"; then
1562 AC_MSG_CHECKING([for static libsasl])
1563 AC_ERROR([Could not find ${with_staticsasl}/lib*/libsasl2.a])
1566 AC_MSG_RESULT([found])
1568 if test "x$SASL_GSSAPI_LIBS_SET" = "x"; then
1569 LIB_SASL="$LIB_SASL $GSSAPIBASE_STATIC_LIBS"
1571 SASL_GSSAPI_LIBS_SET=""
1572 cmu_saved_LIBS="$GSSAPIBASE_STATIC_LIBS $cmu_saved_LIBS"
1576 if test -d ${with_sasl}; then
1577 ac_cv_sasl_where_lib=${with_sasl}/lib
1578 ac_cv_sasl_where_inc=${with_sasl}/include
1580 DYNSASLFLAGS="-I$ac_cv_sasl_where_inc"
1581 if test "$ac_cv_sasl_where_lib" != ""; then
1582 CMU_ADD_LIBPATH_TO($ac_cv_sasl_where_lib, LIB_DYN_SASL)
1584 LIB_DYN_SASL="$LIB_DYN_SASL -lsasl2"
1585 CPPFLAGS="${cmu_saved_CPPFLAGS} -I${ac_cv_sasl_where_inc}"
1586 LDFLAGS="${cmu_saved_LDFLAGS} -L${ac_cv_sasl_where_lib}"
1589 # be sure to check for a SASLv2 specific function
1590 AC_CHECK_HEADER(sasl/sasl.h,
1591 [AC_CHECK_HEADER(sasl/saslutil.h,
1592 [AC_CHECK_LIB(sasl2, prop_get,
1593 ac_cv_found_sasl=yes,
1594 ac_cv_found_sasl=no)],
1595 ac_cv_found_sasl=no)],
1596 ac_cv_found_sasl=no)
1598 if test "$ac_cv_found_sasl" = "yes"; then
1599 if test "$ac_cv_sasl_where_lib" != ""; then
1600 CMU_ADD_LIBPATH_TO($ac_cv_sasl_where_lib, DYNLIB_SASL)
1602 DYNLIB_SASL="$DYNLIB_SASL -lsasl2"
1603 if test "$using_static_sasl" != "static"; then
1604 LIB_SASL=$DYNLIB_SASL
1605 SASLFLAGS=$DYNSASLFLAGS
1610 using_static_sasl="staticonly"
1613 if test "x$SASL_GSSAPI_LIBS_SET" != "x"; then
1614 SASL_GSSAPI_LIBS_SET=""
1615 cmu_saved_LIBS="$GSSAPIBASE_LIBS $cmu_saved_LIBS"
1618 LIBS="$cmu_saved_LIBS"
1619 LDFLAGS="$cmu_saved_LDFLAGS"
1620 CPPFLAGS="$cmu_saved_CPPFLAGS"
1622 AC_SUBST(LIB_DYN_SASL)
1623 AC_SUBST(DYNSASLFLAGS)
1629 # CMU_SASL2_REQUIRED
1630 # ------------------
1631 AC_DEFUN([CMU_SASL2_REQUIRED],
1632 [AC_REQUIRE([CMU_SASL2])
1633 if test "$ac_cv_found_sasl" != "yes"; then
1634 AC_ERROR([Cannot continue without libsasl2.
1635 Get it from ftp://ftp.andrew.cmu.edu/pub/cyrus-mail/.])
1639 # CMU_SASL2_REQUIRE_VER
1640 # ---------------------
1641 AC_DEFUN([CMU_SASL2_REQUIRE_VER],
1642 [AC_REQUIRE([CMU_SASL2_REQUIRED])
1644 cmu_saved_CPPFLAGS=$CPPFLAGS
1645 CPPFLAGS="$CPPFLAGS $SASLFLAGS"
1648 #include <sasl/sasl.h>
1650 #ifndef SASL_VERSION_MAJOR
1651 #error SASL_VERSION_MAJOR not defined
1653 #ifndef SASL_VERSION_MINOR
1654 #error SASL_VERSION_MINOR not defined
1656 #ifndef SASL_VERSION_STEP
1657 #error SASL_VERSION_STEP not defined
1660 #if SASL_VERSION_MAJOR < $1 || SASL_VERSION_MINOR < $2 || SASL_VERSION_STEP < $3
1661 #error SASL version is less than $1.$2.$3
1664 [AC_ERROR([Incorrect SASL headers found. This package requires SASL $1.$2.$3 or newer.])])
1666 CPPFLAGS=$cmu_saved_CPPFLAGS
1667 ])# CMU_SASL2_REQUIRE_VER
1670 # CMU_SASL2_CHECKAPOP_REQUIRED
1671 # ----------------------------
1672 AC_DEFUN([CMU_SASL2_CHECKAPOP_REQUIRED],
1673 [AC_REQUIRE([CMU_SASL2_REQUIRED])
1675 cmu_saved_LDFLAGS=$LDFLAGS
1677 LDFLAGS="$LDFLAGS $LIB_SASL"
1679 AC_CHECK_LIB(sasl2, sasl_checkapop,
1680 [AC_DEFINE(HAVE_APOP,[],[Does SASL support APOP?])],
1681 [AC_MSG_ERROR([libsasl2 without working sasl_checkapop. Cannot continue.])])
1683 LDFLAGS=$cmu_saved_LDFLAGS
1684 ])# CMU_SASL2_CHECKAPOP_REQUIRED
1689 AC_DEFUN([SASL2_CRYPT_CHK],
1690 [AC_CHECK_FUNC(crypt, cmu_have_crypt=yes,
1691 [AC_CHECK_LIB(crypt, crypt,
1692 LIB_CRYPT="-lcrypt"; cmu_have_crypt=yes,
1693 cmu_have_crypt=no)])
1697 dnl Functions to check what database to use for libsasldb
1699 dnl Berkeley DB specific checks first..
1701 dnl Figure out what database type we're using
1702 AC_DEFUN([SASL_DB_CHECK], [
1703 cmu_save_LIBS="$LIBS"
1704 AC_ARG_WITH(dblib, [ --with-dblib=DBLIB set the DB library to use [berkeley] ],
1708 CYRUS_BERKELEY_DB_OPTS()
1713 dnl this is unbelievably painful due to confusion over what db-3 should be
1716 CYRUS_BERKELEY_DB_CHK()
1717 CPPFLAGS="${CPPFLAGS} ${BDB_INCADD}"
1718 SASL_DB_INC=$BDB_INCADD
1719 SASL_DB_LIB="${BDB_LIBADD}"
1722 AC_ARG_WITH(gdbm,[ --with-gdbm=PATH use gdbm from PATH],
1723 with_gdbm="${withval}")
1725 case "$with_gdbm" in
1727 AC_CHECK_HEADER(gdbm.h, [
1728 AC_CHECK_LIB(gdbm, gdbm_open, SASL_DB_LIB="-lgdbm",
1733 if test -d $with_gdbm; then
1734 CPPFLAGS="${CPPFLAGS} -I${with_gdbm}/include"
1735 LDFLAGS="${LDFLAGS} -L${with_gdbm}/lib"
1736 SASL_DB_LIB="-lgdbm"
1743 dnl We want to attempt to use -lndbm if we can, just in case
1744 dnl there's some version of it installed and overriding libc
1745 AC_CHECK_HEADER(ndbm.h, [
1746 AC_CHECK_LIB(ndbm, dbm_open, SASL_DB_LIB="-lndbm", [
1747 AC_CHECK_FUNC(dbm_open,,dblib="no")])],
1751 dnl How about berkeley db?
1752 CYRUS_BERKELEY_DB_CHK()
1753 if test "$dblib" = no; then
1755 AC_CHECK_HEADER(ndbm.h, [
1756 AC_CHECK_LIB(ndbm, dbm_open,
1757 dblib="ndbm"; SASL_DB_LIB="-lndbm",
1760 if test "$dblib" = "weird"; then
1761 dnl Is ndbm in the standard library?
1762 AC_CHECK_FUNC(dbm_open, dblib="ndbm", dblib="no")
1765 if test "$dblib" = no; then
1766 dnl Can we use gdbm?
1767 AC_CHECK_HEADER(gdbm.h, [
1768 AC_CHECK_LIB(gdbm, gdbm_open, dblib="gdbm";
1769 SASL_DB_LIB="-lgdbm", dblib="no")],
1773 dnl we took Berkeley
1774 CPPFLAGS="${CPPFLAGS} ${BDB_INCADD}"
1775 SASL_DB_INC=$BDB_INCADD
1776 SASL_DB_LIB="${BDB_LIBADD}"
1784 AC_MSG_WARN([Bad DB library implementation specified;])
1785 AC_ERROR([Use either \"berkeley\", \"gdbm\", \"ndbm\" or \"none\"])
1789 LIBS="$cmu_save_LIBS"
1791 AC_MSG_CHECKING(DB library to use)
1792 AC_MSG_RESULT($dblib)
1794 SASL_DB_BACKEND="db_${dblib}.lo"
1795 SASL_DB_BACKEND_STATIC="db_${dblib}.o allockey.o"
1796 SASL_DB_BACKEND_STATIC_SRCS="../sasldb/db_${dblib}.c ../sasldb/allockey.c"
1797 SASL_DB_UTILS="saslpasswd2 sasldblistusers2"
1798 SASL_DB_MANS="saslpasswd2.8 sasldblistusers2.8"
1802 SASL_MECHS="$SASL_MECHS libsasldb.la"
1803 AC_DEFINE(SASL_GDBM,[],[Use GDBM for SASLdb])
1806 SASL_MECHS="$SASL_MECHS libsasldb.la"
1807 AC_DEFINE(SASL_NDBM,[],[Use NDBM for SASLdb])
1810 SASL_MECHS="$SASL_MECHS libsasldb.la"
1811 AC_DEFINE(SASL_BERKELEYDB,[],[Use BerkeleyDB for SASLdb])
1814 AC_MSG_WARN([Disabling SASL authentication database support])
1815 dnl note that we do not add libsasldb.la to SASL_MECHS, since it
1816 dnl will just fail to load anyway.
1817 SASL_DB_BACKEND="db_none.lo"
1818 SASL_DB_BACKEND_STATIC="db_none.o"
1819 SASL_DB_BACKEND_STATIC_SRCS="../sasldb/db_none.c"
1826 if test "$enable_static" = yes; then
1827 if test "$dblib" != "none"; then
1828 SASL_STATIC_SRCS="$SASL_STATIC_SRCS ../plugins/sasldb.c $SASL_DB_BACKEND_STATIC_SRCS"
1829 SASL_STATIC_OBJS="$SASL_STATIC_OBJS sasldb.o $SASL_DB_BACKEND_STATIC"
1830 AC_DEFINE(STATIC_SASLDB,[],[Link SASLdb Staticly])
1832 SASL_STATIC_OBJS="$SASL_STATIC_OBJS $SASL_DB_BACKEND_STATIC"
1833 SASL_STATIC_SRCS="$SASL_STATIC_SRCS $SASL_DB_BACKEND_STATIC_SRCS"
1837 AC_SUBST(SASL_DB_UTILS)
1838 AC_SUBST(SASL_DB_MANS)
1839 AC_SUBST(SASL_DB_BACKEND)
1840 AC_SUBST(SASL_DB_BACKEND_STATIC)
1841 AC_SUBST(SASL_DB_INC)
1842 AC_SUBST(SASL_DB_LIB)
1845 dnl Figure out what database path we're using
1846 AC_DEFUN([SASL_DB_PATH_CHECK], [
1847 AC_ARG_WITH(dbpath, [ --with-dbpath=PATH set the DB path to use [/etc/sasldb2] ],
1849 dbpath=/etc/sasldb2)
1850 AC_MSG_CHECKING(DB path to use)
1851 AC_MSG_RESULT($dbpath)
1852 AC_DEFINE_UNQUOTED(SASL_DB_PATH, "$dbpath", [Path to default SASLdb database])])
1854 dnl $Id: berkdb.m4,v 1.20 2005/04/26 19:14:07 shadow Exp $
1856 AC_DEFUN([CMU_DB_INC_WHERE1], [
1857 saved_CPPFLAGS=$CPPFLAGS
1858 CPPFLAGS="$saved_CPPFLAGS -I$1"
1859 AC_TRY_COMPILE([#include <db.h>],
1861 db_create(&db, NULL, 0);
1862 db->open(db, "foo.db", NULL, DB_UNKNOWN, DB_RDONLY, 0644);],
1863 ac_cv_found_db_inc=yes,
1864 ac_cv_found_db_inc=no)
1865 CPPFLAGS=$saved_CPPFLAGS
1868 AC_DEFUN([CMU_DB_INC_WHERE], [
1870 AC_MSG_CHECKING(for db headers in $i)
1871 CMU_DB_INC_WHERE1($i)
1872 CMU_TEST_INCPATH($i, db)
1873 if test "$ac_cv_found_db_inc" = "yes"; then
1874 ac_cv_db_where_inc=$i
1875 AC_MSG_RESULT(found)
1878 AC_MSG_RESULT(not found)
1884 # Test for lib files
1887 AC_DEFUN([CMU_DB3_LIB_WHERE1], [
1888 AC_REQUIRE([CMU_AFS])
1889 AC_REQUIRE([CMU_KRB4])
1891 LIBS="$saved_LIBS -L$1 -ldb-3"
1892 AC_TRY_LINK([#include <db.h>],
1893 [db_env_create(NULL, 0);],
1894 [ac_cv_found_db_3_lib=yes],
1895 ac_cv_found_db_3_lib=no)
1898 AC_DEFUN([CMU_DB4_LIB_WHERE1], [
1899 AC_REQUIRE([CMU_AFS])
1900 AC_REQUIRE([CMU_KRB4])
1902 LIBS="$saved_LIBS -L$1 -ldb-4"
1903 AC_TRY_LINK([#include <db.h>],
1904 [db_env_create(NULL, 0);],
1905 [ac_cv_found_db_4_lib=yes],
1906 ac_cv_found_db_4_lib=no)
1910 AC_DEFUN([CMU_DB_LIB_WHERE], [
1912 AC_MSG_CHECKING(for db libraries in $i)
1913 if test "$enable_db4" = "yes"; then
1914 CMU_DB4_LIB_WHERE1($i)
1915 CMU_TEST_LIBPATH($i, [db-4])
1916 ac_cv_found_db_lib=$ac_cv_found_db_4_lib
1918 CMU_DB3_LIB_WHERE1($i)
1919 CMU_TEST_LIBPATH($i, [db-3])
1920 ac_cv_found_db_lib=$ac_cv_found_db_3_lib
1922 if test "$ac_cv_found_db_lib" = "yes" ; then
1923 ac_cv_db_where_lib=$i
1924 AC_MSG_RESULT(found)
1927 AC_MSG_RESULT(not found)
1932 AC_DEFUN([CMU_USE_DB], [
1933 AC_REQUIRE([CMU_FIND_LIB_SUBDIR])
1935 [ --with-db=PREFIX Compile with db support],
1936 [if test "X$with_db" = "X"; then
1940 [ --with-db-lib=dir use db libraries in dir],
1941 [if test "$withval" = "yes" -o "$withval" = "no"; then
1942 AC_MSG_ERROR([No argument for --with-db-lib])
1944 AC_ARG_WITH(db-include,
1945 [ --with-db-include=dir use db headers in dir],
1946 [if test "$withval" = "yes" -o "$withval" = "no"; then
1947 AC_MSG_ERROR([No argument for --with-db-include])
1950 [ --enable-db4 use db 4.x libraries])
1952 if test "X$with_db" != "X"; then
1953 if test "$with_db" != "yes"; then
1954 ac_cv_db_where_lib=$with_db/$CMU_LIB_SUBDIR
1955 ac_cv_db_where_inc=$with_db/include
1959 if test "X$with_db_lib" != "X"; then
1960 ac_cv_db_where_lib=$with_db_lib
1962 if test "X$ac_cv_db_where_lib" = "X"; then
1963 CMU_DB_LIB_WHERE(/usr/athena/$CMU_LIB_SUBDIR /usr/$CMU_LIB_SUBDIR /usr/local/$CMU_LIB_SUBDIR)
1966 if test "X$with_db_include" != "X"; then
1967 ac_cv_db_where_inc=$with_db_include
1969 if test "X$ac_cv_db_where_inc" = "X"; then
1970 CMU_DB_INC_WHERE(/usr/athena/include /usr/local/include)
1973 AC_MSG_CHECKING(whether to include db)
1974 if test "X$ac_cv_db_where_lib" = "X" -o "X$ac_cv_db_where_inc" = "X"; then
1980 DB_INC_DIR=$ac_cv_db_where_inc
1981 DB_LIB_DIR=$ac_cv_db_where_lib
1982 DB_INC_FLAGS="-I${DB_INC_DIR}"
1983 if test "$enable_db4" = "yes"; then
1984 DB_LIB_FLAGS="-L${DB_LIB_DIR} -ldb-4"
1986 DB_LIB_FLAGS="-L${DB_LIB_DIR} -ldb-3"
1988 dnl Do not force configure.in to put these in CFLAGS and LIBS unconditionally
1989 dnl Allow makefile substitutions....
1990 AC_SUBST(DB_INC_FLAGS)
1991 AC_SUBST(DB_LIB_FLAGS)
1992 if test "X$RPATH" = "X"; then
1997 if test "X$RPATH" = "X"; then
1998 RPATH="-Wl,-rpath,${DB_LIB_DIR}"
2000 RPATH="${RPATH}:${DB_LIB_DIR}"
2004 if test "X$RPATH" = "X"; then
2005 RPATH="-Wl,+b${DB_LIB_DIR}"
2007 RPATH="${RPATH}:${DB_LIB_DIR}"
2011 if test "X$RPATH" = "X"; then
2012 RPATH="-Wl,-rpath,${DB_LIB_DIR}"
2014 RPATH="${RPATH}:${DB_LIB_DIR}"
2018 if test "$ac_cv_prog_gcc" = yes; then
2019 if test "X$RPATH" = "X"; then
2020 RPATH="-Wl,-R${DB_LIB_DIR}"
2022 RPATH="${RPATH}:${DB_LIB_DIR}"
2025 RPATH="${RPATH} -R${DB_LIB_DIR}"
2035 dnl ---- CUT HERE ---
2037 dnl These are the Cyrus Berkeley DB macros. In an ideal world these would be
2038 dnl identical to the above.
2040 dnl They are here so that they can be shared between Cyrus IMAPd
2041 dnl and Cyrus SASL with relative ease.
2043 dnl The big difference between this and the ones above is that we don't assume
2044 dnl that we know the name of the library, and we try a lot of permutations
2045 dnl instead. We also assume that DB4 is acceptable.
2047 dnl When we're done, there will be a BDB_LIBADD and a BDB_INCADD which should
2048 dnl be used when necessary. We should probably be smarter about our RPATH
2051 dnl Call these with BERKELEY_DB_CHK.
2053 dnl We will also set $dblib to "berkeley" if we are successful, "no" otherwise.
2055 dnl this is unbelievably painful due to confusion over what db-3 should be
2056 dnl named and where the db-3 header file is located. arg.
2057 AC_DEFUN([CYRUS_BERKELEY_DB_CHK_LIB],
2059 BDB_SAVE_LDFLAGS=$LDFLAGS
2061 if test -d $with_bdb_lib; then
2062 CMU_ADD_LIBPATH_TO($with_bdb_lib, LDFLAGS)
2063 CMU_ADD_LIBPATH_TO($with_bdb_lib, BDB_LIBADD)
2069 for dbname in db-4.4 db4.4 db44 db-4.3 db4.3 db43 db-4.2 db4.2 db42 db-4.1 db4.1 db41 db-4.0 db4.0 db-4 db40 db4 db-3.3 db3.3 db33 db-3.2 db3.2 db32 db-3.1 db3.1 db31 db-3 db30 db3 db
2071 LIBS="$saved_LIBS -l$dbname"
2072 AC_TRY_LINK([#include <db.h>],
2073 [db_create(NULL, NULL, 0);],
2074 BDB_LIBADD="$BDB_LIBADD -l$dbname"; dblib="berkeley"; dbname=db,
2076 if test "$dblib" = "berkeley"; then break; fi
2078 if test "$dblib" = "no"; then
2079 LIBS="$saved_LIBS -ldb"
2080 AC_TRY_LINK([#include <db.h>],
2081 [db_open(NULL, 0, 0, 0, NULL, NULL, NULL);],
2082 BDB_LIBADD="$BDB_LIBADD -ldb"; dblib="berkeley"; dbname=db,
2087 LDFLAGS=$BDB_SAVE_LDFLAGS
2090 AC_DEFUN([CYRUS_BERKELEY_DB_OPTS],
2092 AC_ARG_WITH(bdb-libdir,
2093 [ --with-bdb-libdir=DIR Berkeley DB lib files are in DIR],
2094 with_bdb_lib=$withval,
2095 [ test "${with_bdb_lib+set}" = set || with_bdb_lib=none])
2096 AC_ARG_WITH(bdb-incdir,
2097 [ --with-bdb-incdir=DIR Berkeley DB include files are in DIR],
2098 with_bdb_inc=$withval,
2099 [ test "${with_bdb_inc+set}" = set || with_bdb_inc=none ])
2102 AC_DEFUN([CYRUS_BERKELEY_DB_CHK],
2104 AC_REQUIRE([CYRUS_BERKELEY_DB_OPTS])
2106 cmu_save_CPPFLAGS=$CPPFLAGS
2108 if test -d $with_bdb_inc; then
2109 CPPFLAGS="$CPPFLAGS -I$with_bdb_inc"
2110 BDB_INCADD="-I$with_bdb_inc"
2115 dnl Note that FreeBSD puts it in a wierd place
2116 dnl (but they should use with-bdb-incdir)
2117 AC_CHECK_HEADER(db.h,
2118 [CYRUS_BERKELEY_DB_CHK_LIB()],
2121 CPPFLAGS=$cmu_save_CPPFLAGS
2124 dnl afs.m4--AFS libraries, includes, and dependencies
2125 dnl $Id: afs.m4,v 1.29 2005/04/26 19:14:07 shadow Exp $
2126 dnl Chaskiel Grundman
2127 dnl based on kerberos_v4.m4
2128 dnl Derrick Brashear
2129 dnl from KTH krb and Arla
2131 AC_DEFUN([CMU_AFS_INC_WHERE1], [
2132 cmu_save_CPPFLAGS=$CPPFLAGS
2133 CPPFLAGS="$cmu_save_CPPFLAGS -I$1"
2134 AC_TRY_COMPILE([#include <afs/param.h>],
2139 ac_cv_found_afs_inc=yes,
2140 ac_cv_found_afs_inc=no)
2141 CPPFLAGS=$cmu_save_CPPFLAGS
2144 AC_DEFUN([CMU_AFS_LIB_WHERE1], [
2146 save_LDFLAGS="$LDFLAGS"
2148 LIBS="-lauth $1/afs/util.a $LIB_SOCKET $LIBS"
2149 LDFLAGS="-L$1 -L$1/afs $LDFLAGS"
2150 dnl suppress caching
2151 AC_TRY_LINK([],[afsconf_Open();], ac_cv_found_afs_lib=yes, ac_cv_found_afs_lib=no)
2153 LDFLAGS="$save_LDFLAGS"
2156 AC_DEFUN([CMU_AFS_WHERE], [
2157 AC_REQUIRE([CMU_FIND_LIB_SUBDIR])
2159 AC_MSG_CHECKING(for AFS in $i)
2160 CMU_AFS_INC_WHERE1("$i/include")
2161 ac_cv_found_lwp_inc=$ac_cv_found_afs_inc
2162 CMU_TEST_INCPATH($i/include, lwp)
2163 ac_cv_found_afs_inc=$ac_cv_found_lwp_inc
2164 if test "$ac_cv_found_afs_inc" = "yes"; then
2165 CMU_AFS_LIB_WHERE1("$i/$CMU_LIB_SUBDIR")
2166 if test "$ac_cv_found_afs_lib" = "yes"; then
2168 AC_MSG_RESULT(found)
2171 AC_MSG_RESULT(not found)
2174 AC_MSG_RESULT(not found)
2179 AC_DEFUN([CMU_AFS], [
2180 AC_REQUIRE([CMU_FIND_LIB_SUBDIR])
2181 AC_REQUIRE([CMU_SOCKETS])
2182 AC_REQUIRE([CMU_LIBSSL])
2184 [ --with-afs=PREFIX Compile with AFS support],
2185 [if test "X$with_AFS" = "X"; then
2189 if test "X$with_AFS" != "X"; then
2190 ac_cv_afs_where=$with_AFS
2192 if test "X$ac_cv_afs_where" = "X"; then
2193 CMU_AFS_WHERE(/usr/afsws /usr/local /usr/athena /Library/OpenAFS/Tools)
2196 AC_MSG_CHECKING(whether to include AFS)
2197 if test "X$ac_cv_afs_where" = "Xno" -o "X$ac_cv_afs_where" = "X"; then
2203 AFS_INC_DIR="$ac_cv_afs_where/include"
2204 AFS_LIB_DIR="$ac_cv_afs_where/$CMU_LIB_SUBDIR"
2205 AFS_TOP_DIR="$ac_cv_afs_where"
2206 AFS_INC_FLAGS="-I${AFS_INC_DIR}"
2207 AFS_LIB_FLAGS="-L${AFS_LIB_DIR} -L${AFS_LIB_DIR}/afs"
2208 cmu_save_LIBS="$LIBS"
2209 cmu_save_CPPFLAGS="$CPPFLAGS"
2210 CPPFLAGS="$CPPFLAGS ${AFS_INC_FLAGS}"
2211 cmu_save_LDFLAGS="$LDFLAGS"
2212 LDFLAGS="$cmu_save_LDFLAGS ${AFS_LIB_FLAGS}"
2214 AC_CHECK_HEADERS(afs/stds.h)
2216 AC_MSG_CHECKING([if libdes is needed])
2217 AC_TRY_LINK([],[des_quad_cksum();],AFS_DES_LIB="",AFS_DES_LIB="maybe")
2218 if test "X$AFS_DES_LIB" != "X"; then
2219 LIBS="$cmu_save_LIBS -ldes"
2220 AC_TRY_LINK([], [des_quad_cksum();],AFS_DES_LIB="yes")
2221 if test "X$AFS_DES_LIB" = "Xyes"; then
2222 AC_MSG_RESULT([yes])
2224 AFS_LIBDESA="${AFS_LIB_DIR}/libdes.a"
2226 LIBS="$cmu_save_LIBS $LIBSSL_LIB_FLAGS"
2228 [des_quad_cksum();],AFS_DES_LIB="libcrypto")
2229 if test "X$AFS_DES_LIB" = "Xlibcrypto"; then
2230 AC_MSG_RESULT([libcrypto])
2231 AFS_LIBDES="$LIBSSL_LIB_FLAGS"
2232 AFS_LIBDESA="$LIBSSL_LIB_FLAGS"
2234 LIBS="$cmu_save_LIBS -L$LIBSSL_LIB_DIR -ldescompat $LIBSSL_LIB_FLAGS"
2236 [des_quad_cksum();],AFS_DES_LIB="libcrypto+descompat")
2237 if test "X$AFS_DES_LIB" = "Xlibcrypto+descompat"; then
2238 AC_MSG_RESULT([libcrypto+descompat])
2239 AFS_LIBDES="-L$LIBSSL_LIB_DIR -ldescompat $LIBSSL_LIB_FLAGS"
2240 AFS_LIBDESA="-L$LIBSSL_LIB_DIR -ldescompat $LIBSSL_LIB_FLAGS"
2242 AC_MSG_RESULT([unknown])
2243 AC_MSG_ERROR([Could not use -ldes])
2252 AFS_CLIENT_LIBS_STATIC="${AFS_LIB_DIR}/afs/libvolser.a ${AFS_LIB_DIR}/afs/libvldb.a ${AFS_LIB_DIR}/afs/libkauth.a ${AFS_LIB_DIR}/afs/libprot.a ${AFS_LIB_DIR}/libubik.a ${AFS_LIB_DIR}/afs/libauth.a ${AFS_LIB_DIR}/librxkad.a ${AFS_LIB_DIR}/librx.a ${AFS_LIB_DIR}/afs/libsys.a ${AFS_LIB_DIR}/librx.a ${AFS_LIB_DIR}/liblwp.a ${AFS_LIBDESA} ${AFS_LIB_DIR}/afs/libcmd.a ${AFS_LIB_DIR}/afs/libcom_err.a ${AFS_LIB_DIR}/afs/util.a"
2253 AFS_KTC_LIBS_STATIC="${AFS_LIB_DIR}/afs/libauth.a ${AFS_LIB_DIR}/afs/libsys.a ${AFS_LIB_DIR}/librx.a ${AFS_LIB_DIR}/liblwp.a ${AFS_LIBDESA} ${AFS_LIB_DIR}/afs/libcom_err.a ${AFS_LIB_DIR}/afs/util.a"
2254 AFS_CLIENT_LIBS="-lvolser -lvldb -lkauth -lprot -lubik -lauth -lrxkad -lrx ${AFS_LIB_DIR}/afs/libsys.a -lrx -llwp ${AFS_LIBDES} -lcmd -lcom_err ${AFS_LIB_DIR}/afs/util.a"
2255 AFS_RX_LIBS="-lauth -lrxkad -lrx ${AFS_LIB_DIR}/afs/libsys.a -lrx -llwp ${AFS_LIBDES} -lcmd -lcom_err ${AFS_LIB_DIR}/afs/util.a"
2256 AFS_KTC_LIBS="-lauth ${AFS_LIB_DIR}/afs/libsys.a -lrx -llwp ${AFS_LIBDES} -lcom_err ${AFS_LIB_DIR}/afs/util.a"
2258 LIBS="$cmu_save_LIBS $AFS_CLIENT_LIBS ${LIB_SOCKET}"
2259 AC_CHECK_FUNC(des_pcbc_init)
2260 if test "X$ac_cv_func_des_pcbc_init" != "Xyes"; then
2261 AC_CHECK_LIB(descompat, des_pcbc_init, AFS_DESCOMPAT_LIB="-ldescompat")
2262 if test "X$AFS_DESCOMPAT_LIB" != "X" ; then
2263 AFS_CLIENT_LIBS_STATIC="$AFS_CLIENT_LIBS_STATIC $AFS_DESCOMPAT_LIB"
2264 AFS_KTC_LIBS_STATIC="$AFS_KTC_LIBS_STATIC $AFS_DESCOMPAT_LIB"
2265 AFS_CLIENT_LIBS="$AFS_CLIENT_LIBS $AFS_DESCOMPAT_LIB"
2266 AFS_KTC_LIBS="$AFS_KTC_LIBS $AFS_DESCOMPAT_LIB"
2269 AC_MSG_CHECKING([if rxkad needs des_pcbc_init])
2270 AC_TRY_LINK(,[tkt_DecodeTicket();],RXKAD_PROBLEM=no,RXKAD_PROBLEM=maybe)
2271 if test "$RXKAD_PROBLEM" = "maybe"; then
2272 AC_TRY_LINK([int des_pcbc_init() { return 0;}],
2273 [tkt_DecodeTicket();],RXKAD_PROBLEM=yes,RXKAD_PROBLEM=error)
2274 if test "$RXKAD_PROBLEM" = "yes"; then
2275 AC_MSG_RESULT([yes])
2276 AC_MSG_ERROR([cannot use rxkad])
2278 AC_MSG_RESULT([unknown])
2279 AC_MSG_ERROR([Unknown error testing rxkad])
2287 LIBS="$cmu_save_LIBS"
2288 AC_CHECK_FUNC(flock)
2289 LIBS="$cmu_save_LIBS ${AFS_CLIENT_LIBS} ${LIB_SOCKET}"
2290 if test "X$ac_cv_func_flock" != "Xyes"; then
2291 AC_MSG_CHECKING([if AFS needs flock])
2292 AC_TRY_LINK([#include <afs/param.h>
2293 #ifdef HAVE_AFS_STDS_H
2294 #include <afs/stds.h>
2297 #include <afs/cellconfig.h>
2298 #include <afs/auth.h>
2299 #include <afs/volser.h>
2300 struct ubik_client * cstruct;
2301 int sigvec() {return 0;}
2302 extern int UV_SetSecurity();],
2303 [vsu_ClientInit(1,"","",0,
2304 &cstruct,UV_SetSecurity)],
2305 AFS_FLOCK=no,AFS_FLOCK=yes)
2306 if test $AFS_FLOCK = "no"; then
2309 AC_MSG_RESULT([yes])
2310 LDFLAGS="$LDFLAGS -L/usr/ucblib"
2311 AC_CHECK_LIB(ucb, flock,:, [AC_CHECK_LIB(BSD, flock)])
2314 LIBS="$cmu_save_LIBS"
2315 AC_CHECK_FUNC(sigvec)
2316 LIBS="$cmu_save_LIBS ${AFS_CLIENT_LIBS} ${LIB_SOCKET}"
2317 if test "X$ac_cv_func_sigvec" != "Xyes"; then
2318 AC_MSG_CHECKING([if AFS needs sigvec])
2319 AC_TRY_LINK([#include <afs/param.h>
2320 #ifdef HAVE_AFS_STDS_H
2321 #include <afs/stds.h>
2324 #include <afs/cellconfig.h>
2325 #include <afs/auth.h>
2326 #include <afs/volser.h>
2327 struct ubik_client * cstruct;
2328 int flock() {return 0;}
2329 extern int UV_SetSecurity();],
2330 [vsu_ClientInit(1,"","",0,
2331 &cstruct,UV_SetSecurity)],
2332 AFS_SIGVEC=no,AFS_SIGVEC=yes)
2333 if test $AFS_SIGVEC = "no"; then
2336 AC_MSG_RESULT([yes])
2337 LDFLAGS="$LDFLAGS -L/usr/ucblib"
2338 AC_CHECK_LIB(ucb, sigvec,:,[AC_CHECK_LIB(BSD, sigvec)])
2341 if test "$ac_cv_lib_ucb_flock" = "yes" -o "$ac_cv_lib_ucb_sigvec" = "yes"; then
2342 AFS_LIB_FLAGS="${AFS_LIB_FLAGS} -L/usr/ucblib -R/usr/ucblib"
2344 if test "$ac_cv_lib_ucb_flock" = "yes" -o "$ac_cv_lib_ucb_sigvec" = "yes"; then
2346 elif test "$ac_cv_lib_BSD_flock" = "yes" -o "$ac_cv_lib_BSD_sigvec" = "yes"; then
2349 if test "X$AFS_BSD_LIB" != "X" ; then
2350 AFS_CLIENT_LIBS_STATIC="$AFS_CLIENT_LIBS_STATIC $AFS_BSD_LIB"
2351 AFS_KTC_LIBS_STATIC="$AFS_KTC_LIBS_STATIC $AFS_BSD_LIB"
2352 AFS_CLIENT_LIBS="$AFS_CLIENT_LIBS $AFS_BSD_LIB"
2353 AFS_RX_LIBS="$AFS_CLIENT_LIBS $AFS_BSD_LIB"
2354 AFS_KTC_LIBS="$AFS_KTC_LIBS $AFS_BSD_LIB"
2357 AC_MSG_CHECKING([if libaudit is needed])
2359 LIBS="$cmu_save_LIBS $AFS_CLIENT_LIBS ${LIB_SOCKET}"
2360 AC_TRY_LINK([#include <afs/param.h>
2361 #ifdef HAVE_AFS_STDS_H
2362 #include <afs/stds.h>
2364 #include <afs/cellconfig.h>
2365 #include <afs/auth.h>],
2366 [afsconf_SuperUser();],AFS_AUDIT_LIB="",AFS_AUDIT_LIB="maybe")
2367 if test "X$AFS_AUDIT_LIB" != "X"; then
2368 LIBS="$cmu_save_LIBS -lvolser -lvldb -lkauth -lprot -lubik -lauth -laudit -lrxkad -lrx ${AFS_LIB_DIR}/afs/libsys.a -lrx -llwp ${AFS_LIBDES} -lcmd -lcom_err ${AFS_LIB_DIR}/afs/util.a $AFS_BSD_LIB $AFS_DESCOMPAT_LIB $LIB_SOCKET"
2369 AC_TRY_LINK([#include <afs/param.h>
2370 #ifdef HAVE_AFS_STDS_H
2371 #include <afs/stds.h>
2373 #include <afs/cellconfig.h>
2374 #include <afs/auth.h>],
2375 [afsconf_SuperUser();],AFS_AUDIT_LIB="yes")
2376 if test "X$AFS_AUDIT_LIB" = "Xyes"; then
2377 AC_MSG_RESULT([yes])
2378 AFS_LIBAUDIT="-laudit"
2379 AFS_CLIENT_LIBS_STATIC="${AFS_LIB_DIR}/afs/libvolser.a ${AFS_LIB_DIR}/afs/libvldb.a ${AFS_LIB_DIR}/afs/libkauth.a ${AFS_LIB_DIR}/afs/libprot.a ${AFS_LIB_DIR}/libubik.a ${AFS_LIB_DIR}/afs/libauth.a ${AFS_LIB_DIR}/afs/libaudit.a ${AFS_LIB_DIR}/librxkad.a ${AFS_LIB_DIR}/librx.a ${AFS_LIB_DIR}/afs/libsys.a ${AFS_LIB_DIR}/librx.a ${AFS_LIB_DIR}/liblwp.a ${AFS_LIBDESA} ${AFS_LIB_DIR}/afs/libcmd.a ${AFS_LIB_DIR}/afs/libcom_err.a ${AFS_LIB_DIR}/afs/util.a"
2380 AFS_CLIENT_LIBS="-lvolser -lvldb -lkauth -lprot -lubik -lauth -laudit -lrxkad -lrx ${AFS_LIB_DIR}/afs/libsys.a -lrx -llwp ${AFS_LIBDES} -lcmd -lcom_err ${AFS_LIB_DIR}/afs/util.a $AFS_BSD_LIB $AFS_DESCOMPAT_LIB"
2381 AFS_RX_LIBS="-lauth -laudit -lrxkad -lrx ${AFS_LIB_DIR}/afs/libsys.a -lrx -llwp ${AFS_LIBDES} -lcmd -lcom_err ${AFS_LIB_DIR}/afs/util.a $AFS_BSD_LIB $AFS_DESCOMPAT_LIB"
2383 AC_MSG_RESULT([unknown])
2384 AC_MSG_ERROR([Could not use -lauth while testing for -laudit])
2390 AC_CHECK_FUNCS(VL_ProbeServer)
2391 AC_MSG_CHECKING([if new-style afs_ integer types are defined])
2392 AC_CACHE_VAL(ac_cv_afs_int32,
2393 dnl The next few lines contain a quoted argument to egrep
2394 dnl It is critical that there be no leading or trailing whitespace
2397 changequote(<<,>>)dnl
2398 <<(^|[^a-zA-Z_0-9])afs_int32[^a-zA-Z_0-9]>>dnl
2399 changequote([,]), [#include <afs/param.h>
2400 #ifdef HAVE_AFS_STDS_H
2401 #include <afs/stds.h>
2403 ac_cv_afs_int32=yes, ac_cv_afs_int32=no)])
2404 AC_MSG_RESULT($ac_cv_afs_int32)
2405 if test $ac_cv_afs_int32 = yes ; then
2406 AC_DEFINE(HAVE_AFS_INT32,, [AFS provides new "unambiguous" type names])
2408 AC_DEFINE(afs_int16, int16, [it's a type definition])
2409 AC_DEFINE(afs_int32, int32, [it's a type definition])
2410 AC_DEFINE(afs_uint16, u_int16, [it's a type definition])
2411 AC_DEFINE(afs_uint32, u_int32, [it's a type definition])
2414 CPPFLAGS="${cmu_save_CPPFLAGS}"
2415 LDFLAGS="${cmu_save_LDFLAGS}"
2416 LIBS="${cmu_save_LIBS}"
2417 AC_DEFINE(AFS_ENV,, [Use AFS. (find what needs this and nuke it)])
2418 AC_DEFINE(AFS,, [Use AFS. (find what needs this and nuke it)])
2419 AC_SUBST(AFS_CLIENT_LIBS_STATIC)
2420 AC_SUBST(AFS_KTC_LIBS_STATIC)
2421 AC_SUBST(AFS_CLIENT_LIBS)
2422 AC_SUBST(AFS_RX_LIBS)
2423 AC_SUBST(AFS_KTC_LIBS)
2424 AC_SUBST(AFS_INC_FLAGS)
2425 AC_SUBST(AFS_LIB_FLAGS)
2426 AC_SUBST(AFS_TOP_DIR)
2427 AC_SUBST(AFS_LIBAUDIT)
2428 AC_SUBST(AFS_LIBDES)
2429 AC_SUBST(AFS_LIBDESA)
2433 AC_DEFUN([CMU_NEEDS_AFS],
2434 [AC_REQUIRE([CMU_AFS])
2435 if test "$ac_cv_found_afs" != "yes"; then
2436 AC_ERROR([Cannot continue without AFS])
2439 dnl libssl.m4--Ssl libraries and includes
2440 dnl Derrick Brashear
2441 dnl from KTH kafs and Arla
2442 dnl $Id: libssl.m4,v 1.10 2005/04/26 19:14:08 shadow Exp $
2444 AC_DEFUN([CMU_LIBSSL_INC_WHERE1], [
2445 saved_CPPFLAGS=$CPPFLAGS
2446 CPPFLAGS="$saved_CPPFLAGS -I$1"
2447 CMU_CHECK_HEADER_NOCACHE(openssl/ssl.h,
2448 ac_cv_found_libssl_inc=yes,
2449 ac_cv_found_libssl_inc=no)
2450 CPPFLAGS=$saved_CPPFLAGS
2453 AC_DEFUN([CMU_LIBSSL_INC_WHERE], [
2455 AC_MSG_CHECKING(for libssl headers in $i)
2456 CMU_LIBSSL_INC_WHERE1($i)
2457 CMU_TEST_INCPATH($i, ssl)
2458 if test "$ac_cv_found_libssl_inc" = "yes"; then
2459 ac_cv_libssl_where_inc=$i
2460 AC_MSG_RESULT(found)
2463 AC_MSG_RESULT(not found)
2468 AC_DEFUN([CMU_LIBSSL_LIB_WHERE1], [
2470 LIBS="$saved_LIBS -L$1 -lssl -lcrypto $LIB_SOCKET"
2473 [ac_cv_found_ssl_lib=yes],
2474 ac_cv_found_ssl_lib=no)
2478 AC_DEFUN([CMU_LIBSSL_LIB_WHERE], [
2480 AC_MSG_CHECKING(for libssl libraries in $i)
2481 CMU_LIBSSL_LIB_WHERE1($i)
2482 dnl deal with false positives from implicit link paths
2483 CMU_TEST_LIBPATH($i, ssl)
2484 if test "$ac_cv_found_ssl_lib" = "yes" ; then
2485 ac_cv_libssl_where_lib=$i
2486 AC_MSG_RESULT(found)
2489 AC_MSG_RESULT(not found)
2494 AC_DEFUN([CMU_LIBSSL], [
2495 AC_REQUIRE([CMU_FIND_LIB_SUBDIR])
2496 AC_REQUIRE([CMU_SOCKETS])
2498 [ --with-libssl=PREFIX Compile with Libssl support],
2499 [if test "X$with_libssl" = "X"; then
2502 AC_ARG_WITH(libssl-lib,
2503 [ --with-libssl-lib=dir use libssl libraries in dir],
2504 [if test "$withval" = "yes" -o "$withval" = "no"; then
2505 AC_MSG_ERROR([No argument for --with-libssl-lib])
2507 AC_ARG_WITH(libssl-include,
2508 [ --with-libssl-include=dir use libssl headers in dir],
2509 [if test "$withval" = "yes" -o "$withval" = "no"; then
2510 AC_MSG_ERROR([No argument for --with-libssl-include])
2513 if test "X$with_libssl" != "X"; then
2514 if test "$with_libssl" != "yes" -a "$with_libssl" != no; then
2515 ac_cv_libssl_where_lib=$with_libssl/$CMU_LIB_SUBDIR
2516 ac_cv_libssl_where_inc=$with_libssl/include
2520 if test "$with_libssl" != "no"; then
2521 if test "X$with_libssl_lib" != "X"; then
2522 ac_cv_libssl_where_lib=$with_libssl_lib
2524 if test "X$ac_cv_libssl_where_lib" = "X"; then
2525 CMU_LIBSSL_LIB_WHERE(/usr/local/$CMU_LIB_SUBDIR/openssl /usr/$CMU_LIB_SUBDIR/openssl /usr/local/$CMU_LIB_SUBDIR /usr/$CMU_LIB_SUBDIR)
2528 if test "X$with_libssl_include" != "X"; then
2529 ac_cv_libssl_where_inc=$with_libssl_include
2531 if test "X$ac_cv_libssl_where_inc" = "X"; then
2532 CMU_LIBSSL_INC_WHERE(/usr/local/include /usr/include)
2536 AC_MSG_CHECKING(whether to include libssl)
2537 if test "X$ac_cv_libssl_where_lib" = "X" -a "X$ac_cv_libssl_where_inc" = "X"; then
2538 ac_cv_found_libssl=no
2541 ac_cv_found_libssl=yes
2543 LIBSSL_INC_DIR=$ac_cv_libssl_where_inc
2544 LIBSSL_LIB_DIR=$ac_cv_libssl_where_lib
2545 LIBSSL_INC_FLAGS="-I${LIBSSL_INC_DIR}"
2546 LIBSSL_LIB_FLAGS="-L${LIBSSL_LIB_DIR} -lssl -lcrypto"
2547 if test "X$RPATH" = "X"; then
2552 if test "X$RPATH" = "X"; then
2553 RPATH="-Wl,-rpath,${LIBSSL_LIB_DIR}"
2555 RPATH="${RPATH}:${LIBSSL_LIB_DIR}"
2559 if test "X$RPATH" = "X"; then
2560 RPATH="-Wl,+b${LIBSSL_LIB_DIR}"
2562 RPATH="${RPATH}:${LIBSSL_LIB_DIR}"
2566 if test "X$RPATH" = "X"; then
2567 RPATH="-Wl,-rpath,${LIBSSL_LIB_DIR}"
2569 RPATH="${RPATH}:${LIBSSL_LIB_DIR}"
2573 if test "$ac_cv_prog_gcc" = yes; then
2574 if test "X$RPATH" = "X"; then
2575 RPATH="-Wl,-R${LIBSSL_LIB_DIR}"
2577 RPATH="${RPATH}:${LIBSSL_LIB_DIR}"
2580 RPATH="${RPATH} -R${LIBSSL_LIB_DIR}"
2586 AC_SUBST(LIBSSL_INC_DIR)
2587 AC_SUBST(LIBSSL_LIB_DIR)
2588 AC_SUBST(LIBSSL_INC_FLAGS)
2589 AC_SUBST(LIBSSL_LIB_FLAGS)
2593 dnl kerberos_v4.m4--Kerberos 4 libraries and includes
2594 dnl Derrick Brashear
2595 dnl from KTH krb and Arla
2596 dnl $Id: kerberos_v4.m4,v 1.28 2005/04/26 19:14:08 shadow Exp $
2598 AC_DEFUN([CMU_KRB_SENDAUTH_PROTO], [
2599 AC_MSG_CHECKING(for krb_sendauth prototype)
2602 int krb_sendauth (long options, int fd, KTEXT ktext, char *service,
2603 char *inst, char *realm, u_long checksum,
2604 MSG_DAT *msg_data, CREDENTIALS *cred,
2605 Key_schedule schedule, struct sockaddr_in *laddr,
2606 struct sockaddr_in *faddr, char *version);],
2607 [int foo = krb_sendauth(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); ],
2608 ac_cv_krb_sendauth_proto=no,
2609 ac_cv_krb_sendauth_proto=yes)
2610 AC_MSG_RESULT($ac_cv_krb_sendauth_proto)
2611 if test "$ac_cv_krb_sendauth_proto" = yes; then
2612 AC_DEFINE(HAVE_KRB_SENDAUTH_PROTO)dnl
2614 AC_MSG_RESULT($ac_cv_krb_sendauth_proto)
2617 AC_DEFUN([CMU_KRB_SET_KEY_PROTO], [
2618 AC_MSG_CHECKING(for krb_set_key prototype)
2619 AC_CACHE_VAL(ac_cv_krb_set_key_proto, [
2620 cmu_save_CPPFLAGS="$CPPFLAGS"
2621 CPPFLAGS="${CPPFLAGS} ${KRB_INC_FLAGS}"
2624 int krb_set_key(char *key, int cvt);],
2625 [int foo = krb_set_key(0, 0);],
2626 ac_cv_krb_set_key_proto=no,
2627 ac_cv_krb_set_key_proto=yes)
2629 CPPFLAGS="${cmu_save_CPPFLAGS}"
2630 if test "$ac_cv_krb_set_key_proto" = yes; then
2631 AC_DEFINE(HAVE_KRB_SET_KEY_PROTO)dnl
2633 AC_MSG_RESULT($ac_cv_krb_set_key_proto)
2636 AC_DEFUN([CMU_KRB4_32_DEFN], [
2637 AC_MSG_CHECKING(for KRB4_32 definition)
2638 AC_CACHE_VAL(ac_cv_krb4_32_defn, [
2639 cmu_save_CPPFLAGS="$CPPFLAGS"
2640 CPPFLAGS="${CPPFLAGS} ${KRB_INC_FLAGS}"
2645 ac_cv_krb4_32_defn=yes,
2646 ac_cv_krb4_32_defn=no)
2648 CPPFLAGS="${cmu_save_CPPFLAGS}"
2649 if test "$ac_cv_krb4_32_defn" = yes; then
2650 AC_DEFINE(HAVE_KRB4_32_DEFINE)dnl
2652 AC_MSG_RESULT($ac_cv_krb4_32_defn)
2655 AC_DEFUN([CMU_KRB_RD_REQ_PROTO], [
2656 AC_MSG_CHECKING(for krb_rd_req prototype)
2657 AC_CACHE_VAL(ac_cv_krb_rd_req_proto, [
2658 cmu_save_CPPFLAGS="$CPPFLAGS"
2659 CPPFLAGS="${CPPFLAGS} ${KRB_INC_FLAGS}"
2662 int krb_rd_req(KTEXT authent, char *service, char *instance,
2663 unsigned KRB_INT32 from_addr, AUTH_DAT *ad, char *fn);],
2664 [int foo = krb_rd_req(0,0,0,0,0,0);],
2665 ac_cv_krb_rd_req_proto=no,
2666 ac_cv_krb_rd_req_proto=yes)
2668 CPPFLAGS="${cmu_save_CPPFLAGS}"
2669 if test "$ac_cv_krb_rd_req_proto" = yes; then
2670 AC_DEFINE(HAVE_KRB_RD_REQ_PROTO)dnl
2672 AC_MSG_RESULT($ac_cv_krb_rd_req_proto)
2675 AC_DEFUN([CMU_KRB_INC_WHERE1], [
2676 saved_CPPFLAGS=$CPPFLAGS
2677 CPPFLAGS="$saved_CPPFLAGS -I$1"
2678 AC_TRY_COMPILE([#include <krb.h>],
2679 [struct ktext foo;],
2680 ac_cv_found_krb_inc=yes,
2681 ac_cv_found_krb_inc=no)
2682 if test "$ac_cv_found_krb_inc" = "no"; then
2683 CPPFLAGS="$saved_CPPFLAGS -I$1 -I$1/kerberosIV"
2684 AC_TRY_COMPILE([#include <krb.h>],
2685 [struct ktext foo;],
2686 [ac_cv_found_krb_inc=yes],
2687 ac_cv_found_krb_inc=no)
2689 CPPFLAGS=$saved_CPPFLAGS
2692 AC_DEFUN([CMU_KRB_INC_WHERE], [
2694 AC_MSG_CHECKING(for kerberos headers in $i)
2695 CMU_KRB_INC_WHERE1($i)
2696 CMU_TEST_INCPATH($i, krb)
2697 if test "$ac_cv_found_krb_inc" = "yes"; then
2698 ac_cv_krb_where_inc=$i
2699 AC_MSG_RESULT(found)
2702 AC_MSG_RESULT(not found)
2708 # Test for kerberos lib files
2711 AC_DEFUN([CMU_KRB_LIB_WHERE1], [
2713 LIBS="$saved_LIBS -L$1 -lkrb ${KRB_LIBDES}"
2716 [ac_cv_found_krb_lib=yes],
2717 ac_cv_found_krb_lib=no)
2721 AC_DEFUN([CMU_KRB_LIB_WHERE], [
2723 AC_MSG_CHECKING(for kerberos libraries in $i)
2724 CMU_KRB_LIB_WHERE1($i)
2725 dnl deal with false positives from implicit link paths
2726 CMU_TEST_LIBPATH($i, krb)
2727 if test "$ac_cv_found_krb_lib" = "yes" ; then
2728 ac_cv_krb_where_lib=$i
2729 AC_MSG_RESULT(found)
2732 AC_MSG_RESULT(not found)
2737 AC_DEFUN([CMU_KRB4], [
2738 AC_REQUIRE([CMU_FIND_LIB_SUBDIR])
2739 AC_REQUIRE([CMU_SOCKETS])
2740 AC_REQUIRE([CMU_LIBSSL])
2742 [ --with-krb4=PREFIX Compile with Kerberos 4 support],
2743 [if test "X$with_krb4" = "X"; then
2746 AC_ARG_WITH(krb4-lib,
2747 [ --with-krb4-lib=dir use kerberos 4 libraries in dir],
2748 [if test "$withval" = "yes" -o "$withval" = "no"; then
2749 AC_MSG_ERROR([No argument for --with-krb4-lib])
2751 AC_ARG_WITH(krb4-include,
2752 [ --with-krb4-include=dir use kerberos 4 headers in dir],
2753 [if test "$withval" = "yes" -o "$withval" = "no"; then
2754 AC_MSG_ERROR([No argument for --with-krb4-include])
2757 if test "X$with_krb4" != "X"; then
2758 if test "$with_krb4" != "yes" -a "$with_krb4" != "no"; then
2759 ac_cv_krb_where_lib=$with_krb4/$CMU_LIB_SUBDIR
2760 ac_cv_krb_where_inc=$with_krb4/include
2764 if test "$with_krb4" != "no"; then
2765 if test "X$with_krb4_lib" != "X"; then
2766 ac_cv_krb_where_lib=$with_krb4_lib
2768 if test "X$with_krb4_include" != "X"; then
2769 ac_cv_krb_where_inc=$with_krb4_include
2771 if test "X$ac_cv_krb_where_inc" = "X"; then
2772 CMU_KRB_INC_WHERE(/usr/athena/include /usr/include/kerberosIV /usr/local/include /usr/include/kerberos)
2775 AC_MSG_CHECKING([if libdes is needed])
2776 AC_TRY_LINK([],[des_quad_cksum();],KRB_DES_LIB="",KRB_DES_LIB="maybe")
2777 if test "X$KRB_DES_LIB" != "X"; then
2778 LIBS="$cmu_save_LIBS -ldes"
2779 AC_TRY_LINK([], [des_quad_cksum();],KRB_DES_LIB="yes")
2780 if test "X$KRB_DES_LIB" = "Xyes"; then
2781 AC_MSG_RESULT([yes])
2783 KRB_LIBDESA='$(KRB_LIB_DIR)/libdes.a'
2785 LIBS="$cmu_save_LIBS $LIBSSL_LIB_FLAGS"
2787 [des_quad_cksum();],KRB_DES_LIB="libcrypto")
2788 if test "X$KRB_DES_LIB" = "Xlibcrypto"; then
2789 AC_MSG_RESULT([libcrypto])
2790 KRB_LIBDES="$LIBSSL_LIB_FLAGS"
2791 KRB_LIBDESA="$LIBSSL_LIB_FLAGS"
2793 LIBS="$cmu_save_LIBS -L$LIBSSL_LIB_DIR -ldescompat $LIBSSL_LIB_FLAGS"
2795 [des_quad_cksum();],KRB_DES_LIB="libcrypto+descompat")
2796 if test "X$KRB_DES_LIB" = "Xlibcrypto+descompat"; then
2797 AC_MSG_RESULT([libcrypto+descompat])
2798 KRB_LIBDES="-L$LIBSSL_LIB_DIR -ldescompat $LIBSSL_LIB_FLAGS"
2799 KRB_LIBDESA="-L$LIBSSL_LIB_DIR -ldescompat $LIBSSL_LIB_FLAGS"
2801 AC_MSG_RESULT([unknown])
2802 AC_MSG_ERROR([Could not use -ldes])
2809 if test "X$ac_cv_krb_where_lib" = "X"; then
2810 CMU_KRB_LIB_WHERE(/usr/athena/$CMU_LIB_SUBDIR /usr/local/$CMU_LIB_SUBDIR /usr/$CMU_LIB_SUBDIR)
2813 LIBS="${cmu_save_LIBS}"
2816 AC_MSG_CHECKING([whether to include kerberos 4])
2817 if test "X$ac_cv_krb_where_lib" = "X" -o "X$ac_cv_krb_where_inc" = "X"; then
2823 KRB_INC_DIR=$ac_cv_krb_where_inc
2824 KRB_LIB_DIR=$ac_cv_krb_where_lib
2825 KRB_INC_FLAGS="-I${KRB_INC_DIR}"
2826 KRB_LIB_FLAGS="-L${KRB_LIB_DIR} -lkrb ${KRB_LIBDES}"
2827 LIBS="${cmu_save_LIBS} ${KRB_LIB_FLAGS}"
2828 AC_CHECK_LIB(resolv, dns_lookup, KRB_LIB_FLAGS="${KRB_LIB_FLAGS} -lresolv",,"${KRB_LIB_FLAGS}")
2829 AC_CHECK_LIB(crypt, crypt, KRB_LIB_FLAGS="${KRB_LIB_FLAGS} -lcrypt",,"${KRB_LIB_FLAGS}")
2830 LIBS="${LIBS} ${KRB_LIB_FLAGS}"
2831 AC_CHECK_FUNCS(krb_get_int krb_life_to_time)
2832 AC_SUBST(KRB_INC_FLAGS)
2833 AC_SUBST(KRB_LIB_FLAGS)
2834 LIBS="${cmu_save_LIBS}"
2835 AC_DEFINE(HAVE_KRB4,,[Kerberos V4 is present])dnl zephyr uses this
2836 AC_DEFINE(KERBEROS,,[Use kerberos 4. find out what needs this symbol])
2837 if test "X$RPATH" = "X"; then
2842 if test "X$RPATH" = "X"; then
2843 RPATH="-Wl,-rpath,${KRB_LIB_DIR}"
2845 RPATH="${RPATH}:${KRB_LIB_DIR}"
2849 if test "X$RPATH" = "X"; then
2850 RPATH="-Wl,+b${KRB_LIB_DIR}"
2852 RPATH="${RPATH}:${KRB_LIB_DIR}"
2856 if test "X$RPATH" = "X"; then
2857 RPATH="-Wl,-rpath,${KRB_LIB_DIR}"
2859 RPATH="${RPATH}:${KRB_LIB_DIR}"
2863 if test "$ac_cv_prog_gcc" = yes; then
2864 if test "X$RPATH" = "X"; then
2865 RPATH="-Wl,-R${KRB_LIB_DIR}"
2867 RPATH="${RPATH}:${KRB_LIB_DIR}"
2870 RPATH="${RPATH} -R${KRB_LIB_DIR}"
2879 dnl See whether we can use IPv6 related functions
2880 dnl contributed by Hajimu UMEMOTO
2882 AC_DEFUN([IPv6_CHECK_FUNC], [
2883 AC_CHECK_FUNC($1, [dnl
2884 ac_cv_lib_socket_$1=no
2885 ac_cv_lib_inet6_$1=no
2887 AC_CHECK_LIB(socket, $1, [dnl
2888 LIBS="$LIBS -lsocket"
2889 ac_cv_lib_inet6_$1=no
2891 AC_MSG_CHECKING([whether your system has IPv6 directory])
2892 AC_CACHE_VAL(ipv6_cv_dir, [dnl
2893 for ipv6_cv_dir in /usr/local/v6 /usr/inet6 no; do
2894 if test $ipv6_cv_dir = no -o -d $ipv6_cv_dir; then
2898 AC_MSG_RESULT($ipv6_cv_dir)
2899 if test $ipv6_cv_dir = no; then
2900 ac_cv_lib_inet6_$1=no
2902 if test x$ipv6_libinet6 = x; then
2904 SAVELDFLAGS="$LDFLAGS"
2905 LDFLAGS="$LDFLAGS -L$ipv6_cv_dir/lib"
2907 AC_CHECK_LIB(inet6, $1, [dnl
2908 if test $ipv6_libinet6 = no; then
2910 LIBS="$LIBS -linet6"
2912 if test $ipv6_libinet6 = no; then
2913 LDFLAGS="$SAVELDFLAGS"
2918 if test $ac_cv_func_$1 = yes -o $ac_cv_lib_socket_$1 = yes \
2919 -o $ac_cv_lib_inet6_$1 = yes
2923 if test $ipv6_cv_$1 = no; then
2924 if test $1 = getaddrinfo; then
2925 for ipv6_cv_pfx in o n; do
2926 AC_EGREP_HEADER(${ipv6_cv_pfx}$1, netdb.h,
2927 [AC_CHECK_FUNC(${ipv6_cv_pfx}$1)])
2928 if eval test X\$ac_cv_func_${ipv6_cv_pfx}$1 = Xyes; then
2929 AC_DEFINE(HAVE_GETADDRINFO,[],[Do we have a getaddrinfo?])
2936 if test $ipv6_cv_$1 = yes; then
2937 ifelse([$2], , :, [$2])
2939 ifelse([$3], , :, [$3])
2943 dnl See whether we have ss_family in sockaddr_storage
2944 AC_DEFUN([IPv6_CHECK_SS_FAMILY], [
2945 AC_MSG_CHECKING([whether you have ss_family in struct sockaddr_storage])
2946 AC_CACHE_VAL(ipv6_cv_ss_family, [dnl
2947 AC_TRY_COMPILE([#include <sys/types.h>
2948 #include <sys/socket.h>],
2949 [struct sockaddr_storage ss; int i = ss.ss_family;],
2950 [ipv6_cv_ss_family=yes], [ipv6_cv_ss_family=no])])dnl
2951 if test $ipv6_cv_ss_family = yes; then
2952 ifelse([$1], , AC_DEFINE(HAVE_SS_FAMILY,[],[Is there an ss_family in sockaddr_storage?]), [$1])
2954 ifelse([$2], , :, [$2])
2956 AC_MSG_RESULT($ipv6_cv_ss_family)])
2959 dnl whether you have sa_len in struct sockaddr
2960 AC_DEFUN([IPv6_CHECK_SA_LEN], [
2961 AC_MSG_CHECKING([whether you have sa_len in struct sockaddr])
2962 AC_CACHE_VAL(ipv6_cv_sa_len, [dnl
2963 AC_TRY_COMPILE([#include <sys/types.h>
2964 #include <sys/socket.h>],
2965 [struct sockaddr sa; int i = sa.sa_len;],
2966 [ipv6_cv_sa_len=yes], [ipv6_cv_sa_len=no])])dnl
2967 if test $ipv6_cv_sa_len = yes; then
2968 ifelse([$1], , AC_DEFINE(HAVE_SOCKADDR_SA_LEN,[],[Does sockaddr have an sa_len?]), [$1])
2970 ifelse([$2], , :, [$2])
2972 AC_MSG_RESULT($ipv6_cv_sa_len)])
2975 dnl See whether sys/socket.h has socklen_t
2976 AC_DEFUN([IPv6_CHECK_SOCKLEN_T], [
2977 AC_MSG_CHECKING(for socklen_t)
2978 AC_CACHE_VAL(ipv6_cv_socklen_t, [dnl
2979 AC_TRY_LINK([#include <sys/types.h>
2980 #include <sys/socket.h>],
2981 [socklen_t len = 0;],
2982 [ipv6_cv_socklen_t=yes], [ipv6_cv_socklen_t=no])])dnl
2983 if test $ipv6_cv_socklen_t = yes; then
2984 ifelse([$1], , AC_DEFINE(HAVE_SOCKLEN_T,[],[Do we have a socklen_t?]), [$1])
2986 ifelse([$2], , :, [$2])
2988 AC_MSG_RESULT($ipv6_cv_socklen_t)])