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 # Do all the work for Automake. -*- Autoconf -*-
16 # This macro actually does too much some checks are only needed if
17 # your package does certain things. But this isn't really a big deal.
19 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
20 # Free Software Foundation, Inc.
22 # This program is free software; you can redistribute it and/or modify
23 # it under the terms of the GNU General Public License as published by
24 # the Free Software Foundation; either version 2, or (at your option)
27 # This program is distributed in the hope that it will be useful,
28 # but WITHOUT ANY WARRANTY; without even the implied warranty of
29 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
30 # GNU General Public License for more details.
32 # You should have received a copy of the GNU General Public License
33 # along with this program; if not, write to the Free Software
34 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
41 # Autoconf 2.50 wants to disallow AM_ names. We explicitly allow
42 # the ones we care about.
43 m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
45 # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
46 # AM_INIT_AUTOMAKE([OPTIONS])
47 # -----------------------------------------------
48 # The call with PACKAGE and VERSION arguments is the old style
49 # call (pre autoconf-2.50), which is being phased out. PACKAGE
50 # and VERSION should now be passed to AC_INIT and removed from
51 # the call to AM_INIT_AUTOMAKE.
52 # We support both call styles for the transition. After
53 # the next Automake release, Autoconf can make the AC_INIT
54 # arguments mandatory, and then we can depend on a new Autoconf
55 # release and drop the old call support.
56 AC_DEFUN([AM_INIT_AUTOMAKE],
57 [AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
58 AC_REQUIRE([AC_PROG_INSTALL])dnl
59 # test to see if srcdir already configured
60 if test "`cd $srcdir && pwd`" != "`pwd`" &&
61 test -f $srcdir/config.status; then
62 AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
65 # test whether we have cygpath
66 if test -z "$CYGPATH_W"; then
67 if (cygpath --version) >/dev/null 2>/dev/null; then
68 CYGPATH_W='cygpath -w'
75 # Define the identity of the package.
76 dnl Distinguish between old-style and new-style calls.
78 [m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
79 AC_SUBST([PACKAGE], [$1])dnl
80 AC_SUBST([VERSION], [$2])],
81 [_AM_SET_OPTIONS([$1])dnl
82 AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
83 AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
85 _AM_IF_OPTION([no-define],,
86 [AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
87 AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
89 # Some tools Automake needs.
90 AC_REQUIRE([AM_SANITY_CHECK])dnl
91 AC_REQUIRE([AC_ARG_PROGRAM])dnl
92 AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
93 AM_MISSING_PROG(AUTOCONF, autoconf)
94 AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
95 AM_MISSING_PROG(AUTOHEADER, autoheader)
96 AM_MISSING_PROG(MAKEINFO, makeinfo)
97 AM_MISSING_PROG(AMTAR, tar)
100 # We need awk for the "check" target. The system "awk" is bad on
102 AC_REQUIRE([AC_PROG_AWK])dnl
103 AC_REQUIRE([AC_PROG_MAKE_SET])dnl
104 AC_REQUIRE([AM_SET_LEADING_DOT])dnl
106 _AM_IF_OPTION([no-dependencies],,
107 [AC_PROVIDE_IFELSE([AC_PROG_CC],
108 [_AM_DEPENDENCIES(CC)],
109 [define([AC_PROG_CC],
110 defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
111 AC_PROVIDE_IFELSE([AC_PROG_CXX],
112 [_AM_DEPENDENCIES(CXX)],
113 [define([AC_PROG_CXX],
114 defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
119 # When config.status generates a header, we must update the stamp-h file.
120 # This file resides in the same directory as the config header
121 # that is generated. The stamp files are numbered to have different names.
123 # Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
124 # loop where config.status creates the headers, so we can generate
125 # our stamp files there.
126 AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
127 [# Compute $1's index in $config_headers.
129 for _am_header in $config_headers :; do
134 _am_stamp_count=`expr $_am_stamp_count + 1` ;;
137 echo "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count])
139 # Copyright 2002 Free Software Foundation, Inc.
141 # This program is free software; you can redistribute it and/or modify
142 # it under the terms of the GNU General Public License as published by
143 # the Free Software Foundation; either version 2, or (at your option)
146 # This program is distributed in the hope that it will be useful,
147 # but WITHOUT ANY WARRANTY; without even the implied warranty of
148 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
149 # GNU General Public License for more details.
151 # You should have received a copy of the GNU General Public License
152 # along with this program; if not, write to the Free Software
153 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
155 # AM_AUTOMAKE_VERSION(VERSION)
156 # ----------------------------
157 # Automake X.Y traces this macro to ensure aclocal.m4 has been
158 # generated from the m4 files accompanying Automake X.Y.
159 AC_DEFUN([AM_AUTOMAKE_VERSION],[am__api_version="1.7"])
161 # AM_SET_CURRENT_AUTOMAKE_VERSION
162 # -------------------------------
163 # Call AM_AUTOMAKE_VERSION so it can be traced.
164 # This function is AC_REQUIREd by AC_INIT_AUTOMAKE.
165 AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
166 [AM_AUTOMAKE_VERSION([1.7.9])])
168 # Helper functions for option handling. -*- Autoconf -*-
170 # Copyright 2001, 2002 Free Software Foundation, Inc.
172 # This program is free software; you can redistribute it and/or modify
173 # it under the terms of the GNU General Public License as published by
174 # the Free Software Foundation; either version 2, or (at your option)
177 # This program is distributed in the hope that it will be useful,
178 # but WITHOUT ANY WARRANTY; without even the implied warranty of
179 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
180 # GNU General Public License for more details.
182 # You should have received a copy of the GNU General Public License
183 # along with this program; if not, write to the Free Software
184 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
189 # _AM_MANGLE_OPTION(NAME)
190 # -----------------------
191 AC_DEFUN([_AM_MANGLE_OPTION],
192 [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
194 # _AM_SET_OPTION(NAME)
195 # ------------------------------
196 # Set option NAME. Presently that only means defining a flag for this option.
197 AC_DEFUN([_AM_SET_OPTION],
198 [m4_define(_AM_MANGLE_OPTION([$1]), 1)])
200 # _AM_SET_OPTIONS(OPTIONS)
201 # ----------------------------------
202 # OPTIONS is a space-separated list of Automake options.
203 AC_DEFUN([_AM_SET_OPTIONS],
204 [AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
206 # _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
207 # -------------------------------------------
208 # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
209 AC_DEFUN([_AM_IF_OPTION],
210 [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
213 # Check to make sure that the build environment is sane.
216 # Copyright 1996, 1997, 2000, 2001 Free Software Foundation, Inc.
218 # This program is free software; you can redistribute it and/or modify
219 # it under the terms of the GNU General Public License as published by
220 # the Free Software Foundation; either version 2, or (at your option)
223 # This program is distributed in the hope that it will be useful,
224 # but WITHOUT ANY WARRANTY; without even the implied warranty of
225 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
226 # GNU General Public License for more details.
228 # You should have received a copy of the GNU General Public License
229 # along with this program; if not, write to the Free Software
230 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
237 AC_DEFUN([AM_SANITY_CHECK],
238 [AC_MSG_CHECKING([whether build environment is sane])
241 echo timestamp > conftest.file
242 # Do `set' in a subshell so we don't clobber the current shell's
243 # arguments. Must try -L first in case configure is actually a
244 # symlink; some systems play weird games with the mod time of symlinks
245 # (eg FreeBSD returns the mod time of the symlink's containing
248 set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
249 if test "$[*]" = "X"; then
251 set X `ls -t $srcdir/configure conftest.file`
254 if test "$[*]" != "X $srcdir/configure conftest.file" \
255 && test "$[*]" != "X conftest.file $srcdir/configure"; then
257 # If neither matched, then we have a broken ls. This can happen
258 # if, for instance, CONFIG_SHELL is bash and it inherits a
259 # broken ls alias from the environment. This has actually
260 # happened. Such a system could not be considered "sane".
261 AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
262 alias in your environment])
265 test "$[2]" = conftest.file
271 AC_MSG_ERROR([newly created file is older than distributed files!
272 Check your system clock])
279 # Copyright 1997, 1999, 2000, 2001 Free Software Foundation, Inc.
281 # This program is free software; you can redistribute it and/or modify
282 # it under the terms of the GNU General Public License as published by
283 # the Free Software Foundation; either version 2, or (at your option)
286 # This program is distributed in the hope that it will be useful,
287 # but WITHOUT ANY WARRANTY; without even the implied warranty of
288 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
289 # GNU General Public License for more details.
291 # You should have received a copy of the GNU General Public License
292 # along with this program; if not, write to the Free Software
293 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
298 # AM_MISSING_PROG(NAME, PROGRAM)
299 # ------------------------------
300 AC_DEFUN([AM_MISSING_PROG],
301 [AC_REQUIRE([AM_MISSING_HAS_RUN])
302 $1=${$1-"${am_missing_run}$2"}
308 # Define MISSING if not defined so far and test if it supports --run.
309 # If it does, set am_missing_run to use it, otherwise, to nothing.
310 AC_DEFUN([AM_MISSING_HAS_RUN],
311 [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
312 test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
313 # Use eval to expand $SHELL
314 if eval "$MISSING --run true"; then
315 am_missing_run="$MISSING --run "
318 AC_MSG_WARN([`missing' script is too old or missing])
324 # Copyright 2001 Free Software Foundation, Inc.
326 # This program is free software; you can redistribute it and/or modify
327 # it under the terms of the GNU General Public License as published by
328 # the Free Software Foundation; either version 2, or (at your option)
331 # This program is distributed in the hope that it will be useful,
332 # but WITHOUT ANY WARRANTY; without even the implied warranty of
333 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
334 # GNU General Public License for more details.
336 # You should have received a copy of the GNU General Public License
337 # along with this program; if not, write to the Free Software
338 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
341 # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
342 # $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to
343 # `$srcdir', `$srcdir/..', or `$srcdir/../..'.
345 # Of course, Automake must honor this variable whenever it calls a
346 # tool from the auxiliary directory. The problem is that $srcdir (and
347 # therefore $ac_aux_dir as well) can be either absolute or relative,
348 # depending on how configure is run. This is pretty annoying, since
349 # it makes $ac_aux_dir quite unusable in subdirectories: in the top
350 # source directory, any form will work fine, but in subdirectories a
351 # relative path needs to be adjusted first.
353 # $ac_aux_dir/missing
354 # fails when called from a subdirectory if $ac_aux_dir is relative
355 # $top_srcdir/$ac_aux_dir/missing
356 # fails if $ac_aux_dir is absolute,
357 # fails when called from a subdirectory in a VPATH build with
358 # a relative $ac_aux_dir
360 # The reason of the latter failure is that $top_srcdir and $ac_aux_dir
361 # are both prefixed by $srcdir. In an in-source build this is usually
362 # harmless because $srcdir is `.', but things will broke when you
363 # start a VPATH build or use an absolute $srcdir.
365 # So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
366 # iff we strip the leading $srcdir from $ac_aux_dir. That would be:
367 # am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
368 # and then we would define $MISSING as
369 # MISSING="\${SHELL} $am_aux_dir/missing"
370 # This will work as long as MISSING is not called from configure, because
371 # unfortunately $(top_srcdir) has no meaning in configure.
372 # However there are other variables, like CC, which are often used in
373 # configure, and could therefore not use this "fixed" $ac_aux_dir.
375 # Another solution, used here, is to always expand $ac_aux_dir to an
376 # absolute PATH. The drawback is that using absolute paths prevent a
377 # configured tree to be moved without reconfiguration.
379 # Rely on autoconf to set up CDPATH properly.
382 AC_DEFUN([AM_AUX_DIR_EXPAND], [
383 # expand $ac_aux_dir to an absolute path
384 am_aux_dir=`cd $ac_aux_dir && pwd`
389 # Define $install_sh.
391 # Copyright 2001 Free Software Foundation, Inc.
393 # This program is free software; you can redistribute it and/or modify
394 # it under the terms of the GNU General Public License as published by
395 # the Free Software Foundation; either version 2, or (at your option)
398 # This program is distributed in the hope that it will be useful,
399 # but WITHOUT ANY WARRANTY; without even the implied warranty of
400 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
401 # GNU General Public License for more details.
403 # You should have received a copy of the GNU General Public License
404 # along with this program; if not, write to the Free Software
405 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
408 AC_DEFUN([AM_PROG_INSTALL_SH],
409 [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
410 install_sh=${install_sh-"$am_aux_dir/install-sh"}
411 AC_SUBST(install_sh)])
413 # AM_PROG_INSTALL_STRIP
415 # Copyright 2001 Free Software Foundation, Inc.
417 # This program is free software; you can redistribute it and/or modify
418 # it under the terms of the GNU General Public License as published by
419 # the Free Software Foundation; either version 2, or (at your option)
422 # This program is distributed in the hope that it will be useful,
423 # but WITHOUT ANY WARRANTY; without even the implied warranty of
424 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
425 # GNU General Public License for more details.
427 # You should have received a copy of the GNU General Public License
428 # along with this program; if not, write to the Free Software
429 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
432 # One issue with vendor `install' (even GNU) is that you can't
433 # specify the program used to strip binaries. This is especially
434 # annoying in cross-compiling environments, where the build's strip
435 # is unlikely to handle the host's binaries.
436 # Fortunately install-sh will honor a STRIPPROG variable, so we
437 # always use install-sh in `make install-strip', and initialize
438 # STRIPPROG with the value of the STRIP variable (set by the user).
439 AC_DEFUN([AM_PROG_INSTALL_STRIP],
440 [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
441 # Installed binaries are usually stripped using `strip' when the user
442 # run `make install-strip'. However `strip' might not be the right
443 # tool to use in cross-compilation environments, therefore Automake
444 # will honor the `STRIP' environment variable to overrule this program.
445 dnl Don't test for $cross_compiling = yes, because it might be `maybe'.
446 if test "$cross_compiling" != no; then
447 AC_CHECK_TOOL([STRIP], [strip], :)
449 INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s"
450 AC_SUBST([INSTALL_STRIP_PROGRAM])])
453 # Copyright (C) 2003 Free Software Foundation, Inc.
455 # This program is free software; you can redistribute it and/or modify
456 # it under the terms of the GNU General Public License as published by
457 # the Free Software Foundation; either version 2, or (at your option)
460 # This program is distributed in the hope that it will be useful,
461 # but WITHOUT ANY WARRANTY; without even the implied warranty of
462 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
463 # GNU General Public License for more details.
465 # You should have received a copy of the GNU General Public License
466 # along with this program; if not, write to the Free Software
467 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
472 # Check whether the underlying file-system supports filenames
473 # with a leading dot. For instance MS-DOS doesn't.
474 AC_DEFUN([AM_SET_LEADING_DOT],
475 [rm -rf .tst 2>/dev/null
476 mkdir .tst 2>/dev/null
477 if test -d .tst; then
482 rmdir .tst 2>/dev/null
483 AC_SUBST([am__leading_dot])])
485 # serial 5 -*- Autoconf -*-
487 # Copyright (C) 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
489 # This program is free software; you can redistribute it and/or modify
490 # it under the terms of the GNU General Public License as published by
491 # the Free Software Foundation; either version 2, or (at your option)
494 # This program is distributed in the hope that it will be useful,
495 # but WITHOUT ANY WARRANTY; without even the implied warranty of
496 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
497 # GNU General Public License for more details.
499 # You should have received a copy of the GNU General Public License
500 # along with this program; if not, write to the Free Software
501 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
505 # There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
506 # written in clear, in which case automake, when reading aclocal.m4,
507 # will think it sees a *use*, and therefore will trigger all it's
508 # C support machinery. Also note that it means that autoscan, seeing
509 # CC etc. in the Makefile, will ask for an AC_PROG_CC use...
513 # _AM_DEPENDENCIES(NAME)
514 # ----------------------
515 # See how the compiler implements dependency checking.
516 # NAME is "CC", "CXX", "GCJ", or "OBJC".
517 # We try a few techniques and use that to set a single cache variable.
519 # We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
520 # modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
521 # dependency, and given that the user is not expected to run this macro,
522 # just rely on AC_PROG_CC.
523 AC_DEFUN([_AM_DEPENDENCIES],
524 [AC_REQUIRE([AM_SET_DEPDIR])dnl
525 AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
526 AC_REQUIRE([AM_MAKE_INCLUDE])dnl
527 AC_REQUIRE([AM_DEP_TRACK])dnl
529 ifelse([$1], CC, [depcc="$CC" am_compiler_list=],
530 [$1], CXX, [depcc="$CXX" am_compiler_list=],
531 [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
532 [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'],
533 [depcc="$$1" am_compiler_list=])
535 AC_CACHE_CHECK([dependency style of $depcc],
536 [am_cv_$1_dependencies_compiler_type],
537 [if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
538 # We make a subdir and do the tests there. Otherwise we can end up
539 # making bogus files that we don't know about and never remove. For
540 # instance it was reported that on HP-UX the gcc test will end up
541 # making a dummy file named `D' -- because `-MD' means `put the output
544 # Copy depcomp to subdir because otherwise we won't find it if we're
545 # using a relative directory.
546 cp "$am_depcomp" conftest.dir
548 # We will build objects and dependencies in a subdirectory because
549 # it helps to detect inapplicable dependency modes. For instance
550 # both Tru64's cc and ICC support -MD to output dependencies as a
551 # side effect of compilation, but ICC will put the dependencies in
552 # the current directory while Tru64 will put them in the object
556 am_cv_$1_dependencies_compiler_type=none
557 if test "$am_compiler_list" = ""; then
558 am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
560 for depmode in $am_compiler_list; do
561 # Setup a source with many dependencies, because some compilers
562 # like to wrap large dependency lists on column 80 (with \), and
563 # we should not choose a depcomp mode which is confused by this.
565 # We need to recreate these files for each test, as the compiler may
566 # overwrite some of them when testing with obscure command lines.
567 # This happens at least with the AIX C compiler.
569 for i in 1 2 3 4 5 6; do
570 echo '#include "conftst'$i'.h"' >> sub/conftest.c
573 echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
577 # after this tag, mechanisms are not by side-effect, so they'll
578 # only be used when explicitly requested
579 if test "x$enable_dependency_tracking" = xyes; then
587 # We check with `-c' and `-o' for the sake of the "dashmstdout"
588 # mode. It turns out that the SunPro C++ compiler does not properly
589 # handle `-M -o', and we need to detect this.
590 if depmode=$depmode \
591 source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
592 depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
593 $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
594 >/dev/null 2>conftest.err &&
595 grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
596 grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
597 ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
598 # icc doesn't choke on unknown options, it will just issue warnings
599 # (even with -Werror). So we grep stderr for any message
600 # that says an option was ignored.
601 if grep 'ignoring option' conftest.err >/dev/null 2>&1; then :; else
602 am_cv_$1_dependencies_compiler_type=$depmode
611 am_cv_$1_dependencies_compiler_type=none
614 AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
615 AM_CONDITIONAL([am__fastdep$1], [
616 test "x$enable_dependency_tracking" != xno \
617 && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
623 # Choose a directory name for dependency files.
624 # This macro is AC_REQUIREd in _AM_DEPENDENCIES
625 AC_DEFUN([AM_SET_DEPDIR],
626 [AC_REQUIRE([AM_SET_LEADING_DOT])dnl
627 AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
633 AC_DEFUN([AM_DEP_TRACK],
634 [AC_ARG_ENABLE(dependency-tracking,
635 [ --disable-dependency-tracking Speeds up one-time builds
636 --enable-dependency-tracking Do not reject slow dependency extractors])
637 if test "x$enable_dependency_tracking" != xno; then
638 am_depcomp="$ac_aux_dir/depcomp"
641 AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
642 AC_SUBST([AMDEPBACKSLASH])
645 # Generate code to set up dependency tracking. -*- Autoconf -*-
647 # Copyright 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
649 # This program is free software; you can redistribute it and/or modify
650 # it under the terms of the GNU General Public License as published by
651 # the Free Software Foundation; either version 2, or (at your option)
654 # This program is distributed in the hope that it will be useful,
655 # but WITHOUT ANY WARRANTY; without even the implied warranty of
656 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
657 # GNU General Public License for more details.
659 # You should have received a copy of the GNU General Public License
660 # along with this program; if not, write to the Free Software
661 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
666 # _AM_OUTPUT_DEPENDENCY_COMMANDS
667 # ------------------------------
668 AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
669 [for mf in $CONFIG_FILES; do
670 # Strip MF so we end up with the name of the file.
671 mf=`echo "$mf" | sed -e 's/:.*$//'`
672 # Check whether this is an Automake generated Makefile or not.
673 # We used to match only the files named `Makefile.in', but
674 # some people rename them; so instead we look at the file content.
675 # Grep'ing the first line is not enough: some people post-process
676 # each Makefile.in and add a new line on top of each file to say so.
677 # So let's grep whole file.
678 if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then
679 dirpart=`AS_DIRNAME("$mf")`
683 grep '^DEP_FILES *= *[[^ @%:@]]' < "$mf" > /dev/null || continue
684 # Extract the definition of DEP_FILES from the Makefile without
686 DEPDIR=`sed -n -e '/^DEPDIR = / s///p' < "$mf"`
687 test -z "$DEPDIR" && continue
688 # When using ansi2knr, U may be empty or an underscore; expand it
689 U=`sed -n -e '/^U = / s///p' < "$mf"`
690 test -d "$dirpart/$DEPDIR" || mkdir "$dirpart/$DEPDIR"
691 # We invoke sed twice because it is the simplest approach to
692 # changing $(DEPDIR) to its actual value in the expansion.
693 for file in `sed -n -e '
694 /^DEP_FILES = .*\\\\$/ {
703 /^DEP_FILES = / s/^DEP_FILES = //p' < "$mf" | \
704 sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
705 # Make sure the directory exists.
706 test -f "$dirpart/$file" && continue
707 fdir=`AS_DIRNAME(["$file"])`
708 AS_MKDIR_P([$dirpart/$fdir])
709 # echo "creating $dirpart/$file"
710 echo '# dummy' > "$dirpart/$file"
713 ])# _AM_OUTPUT_DEPENDENCY_COMMANDS
716 # AM_OUTPUT_DEPENDENCY_COMMANDS
717 # -----------------------------
718 # This macro should only be invoked once -- use via AC_REQUIRE.
720 # This code is only required when automatic dependency tracking
721 # is enabled. FIXME. This creates each `.P' file that we will
722 # need in order to bootstrap the dependency handling code.
723 AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
724 [AC_CONFIG_COMMANDS([depfiles],
725 [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
726 [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
729 # Check to see how 'make' treats includes. -*- Autoconf -*-
731 # Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
733 # This program is free software; you can redistribute it and/or modify
734 # it under the terms of the GNU General Public License as published by
735 # the Free Software Foundation; either version 2, or (at your option)
738 # This program is distributed in the hope that it will be useful,
739 # but WITHOUT ANY WARRANTY; without even the implied warranty of
740 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
741 # GNU General Public License for more details.
743 # You should have received a copy of the GNU General Public License
744 # along with this program; if not, write to the Free Software
745 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
752 # Check to see how make treats includes.
753 AC_DEFUN([AM_MAKE_INCLUDE],
754 [am_make=${MAKE-make}
755 cat > confinc << 'END'
760 # If we don't find an include directive, just comment out the code.
761 AC_MSG_CHECKING([for style of include used by $am_make])
765 # First try GNU make style include.
766 echo "include confinc" > confmf
767 # We grep out `Entering directory' and `Leaving directory'
768 # messages which can occur if `w' ends up in MAKEFLAGS.
769 # In particular we don't look at `^make:' because GNU make might
770 # be invoked under some other name (usually "gmake"), in which
771 # case it prints its new name instead of `make'.
772 if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then
777 # Now try BSD make style include.
778 if test "$am__include" = "#"; then
779 echo '.include "confinc"' > confmf
780 if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
786 AC_SUBST([am__include])
787 AC_SUBST([am__quote])
788 AC_MSG_RESULT([$_am_result])
792 # AM_CONDITIONAL -*- Autoconf -*-
794 # Copyright 1997, 2000, 2001 Free Software Foundation, Inc.
796 # This program is free software; you can redistribute it and/or modify
797 # it under the terms of the GNU General Public License as published by
798 # the Free Software Foundation; either version 2, or (at your option)
801 # This program is distributed in the hope that it will be useful,
802 # but WITHOUT ANY WARRANTY; without even the implied warranty of
803 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
804 # GNU General Public License for more details.
806 # You should have received a copy of the GNU General Public License
807 # along with this program; if not, write to the Free Software
808 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
815 # AM_CONDITIONAL(NAME, SHELL-CONDITION)
816 # -------------------------------------
817 # Define a conditional.
818 AC_DEFUN([AM_CONDITIONAL],
819 [ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])],
820 [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
830 AC_CONFIG_COMMANDS_PRE(
831 [if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
832 AC_MSG_ERROR([conditional "$1" was never defined.
833 Usually this means the macro was only invoked conditionally.])
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}"
924 # serial 40 AC_PROG_LIBTOOL
925 AC_DEFUN([AC_PROG_LIBTOOL],
926 [AC_REQUIRE([AC_LIBTOOL_SETUP])dnl
928 # Save cache, so that ltconfig can load it
931 # Actually configure libtool. ac_aux_dir is where install-sh is found.
932 CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \
933 LD="$LD" LDFLAGS="$LDFLAGS" LIBS="$LIBS" \
934 LN_S="$LN_S" NM="$NM" RANLIB="$RANLIB" \
935 DLLTOOL="$DLLTOOL" AS="$AS" OBJDUMP="$OBJDUMP" \
936 ${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig --no-reexec \
937 $libtool_flags --no-verify $ac_aux_dir/ltmain.sh $lt_target \
938 || AC_MSG_ERROR([libtool configure failed])
940 # Reload cache, that may have been modified by ltconfig
943 # This can be used to rebuild libtool when needed
944 LIBTOOL_DEPS="$ac_aux_dir/ltconfig $ac_aux_dir/ltmain.sh"
946 # Always use our own libtool.
947 LIBTOOL='$(SHELL) $(top_builddir)/libtool'
950 # Redirect the config.log output again, so that the ltconfig log is not
951 # clobbered by the next message.
955 AC_DEFUN([AC_LIBTOOL_SETUP],
957 AC_REQUIRE([AC_ENABLE_SHARED])dnl
958 AC_REQUIRE([AC_ENABLE_STATIC])dnl
959 AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl
960 AC_REQUIRE([AC_CANONICAL_HOST])dnl
961 AC_REQUIRE([AC_CANONICAL_BUILD])dnl
962 AC_REQUIRE([AC_PROG_RANLIB])dnl
963 AC_REQUIRE([AC_PROG_CC])dnl
964 AC_REQUIRE([AC_PROG_LD])dnl
965 AC_REQUIRE([AC_PROG_NM])dnl
966 AC_REQUIRE([AC_PROG_LN_S])dnl
970 NONE) lt_target="$host" ;;
971 *) lt_target="$target" ;;
974 # Check for any special flags to pass to ltconfig.
975 libtool_flags="--cache-file=$cache_file"
976 test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared"
977 test "$enable_static" = no && libtool_flags="$libtool_flags --disable-static"
978 test "$enable_fast_install" = no && libtool_flags="$libtool_flags --disable-fast-install"
979 test "$ac_cv_prog_gcc" = yes && libtool_flags="$libtool_flags --with-gcc"
980 test "$ac_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld"
981 ifdef([AC_PROVIDE_AC_LIBTOOL_DLOPEN],
982 [libtool_flags="$libtool_flags --enable-dlopen"])
983 ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
984 [libtool_flags="$libtool_flags --enable-win32-dll"])
985 AC_ARG_ENABLE(libtool-lock,
986 [ --disable-libtool-lock avoid locking (might break parallel builds)])
987 test "x$enable_libtool_lock" = xno && libtool_flags="$libtool_flags --disable-lock"
988 test x"$silent" = xyes && libtool_flags="$libtool_flags --silent"
990 # Some flags need to be propagated to the compiler or linker for good
994 # Find out which ABI we are using.
995 echo '[#]line __oline__ "configure"' > conftest.$ac_ext
996 if AC_TRY_EVAL(ac_compile); then
997 case "`/usr/bin/file conftest.o`" in
1013 # On SCO OpenServer 5, we need -belf to get full-featured binaries.
1014 SAVE_CFLAGS="$CFLAGS"
1015 CFLAGS="$CFLAGS -belf"
1016 AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
1017 [AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])])
1018 if test x"$lt_cv_cc_needs_belf" != x"yes"; then
1019 # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
1020 CFLAGS="$SAVE_CFLAGS"
1024 ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
1025 [*-*-cygwin* | *-*-mingw*)
1026 AC_CHECK_TOOL(DLLTOOL, dlltool, false)
1027 AC_CHECK_TOOL(AS, as, false)
1028 AC_CHECK_TOOL(OBJDUMP, objdump, false)
1034 # AC_LIBTOOL_DLOPEN - enable checks for dlopen support
1035 AC_DEFUN([AC_LIBTOOL_DLOPEN], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])])
1037 # AC_LIBTOOL_WIN32_DLL - declare package support for building win32 dll's
1038 AC_DEFUN([AC_LIBTOOL_WIN32_DLL], [AC_BEFORE([$0], [AC_LIBTOOL_SETUP])])
1040 # AC_ENABLE_SHARED - implement the --enable-shared flag
1041 # Usage: AC_ENABLE_SHARED[(DEFAULT)]
1042 # Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
1044 AC_DEFUN([AC_ENABLE_SHARED], [dnl
1045 define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl
1046 AC_ARG_ENABLE(shared,
1047 changequote(<<, >>)dnl
1048 << --enable-shared[=PKGS] build shared libraries [default=>>AC_ENABLE_SHARED_DEFAULT],
1049 changequote([, ])dnl
1050 [p=${PACKAGE-default}
1051 case "$enableval" in
1052 yes) enable_shared=yes ;;
1053 no) enable_shared=no ;;
1056 # Look at the argument we got. We use all the common list separators.
1057 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
1058 for pkg in $enableval; do
1059 if test "X$pkg" = "X$p"; then
1066 enable_shared=AC_ENABLE_SHARED_DEFAULT)dnl
1069 # AC_DISABLE_SHARED - set the default shared flag to --disable-shared
1070 AC_DEFUN([AC_DISABLE_SHARED], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
1071 AC_ENABLE_SHARED(no)])
1073 # AC_ENABLE_STATIC - implement the --enable-static flag
1074 # Usage: AC_ENABLE_STATIC[(DEFAULT)]
1075 # Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
1077 AC_DEFUN([AC_ENABLE_STATIC], [dnl
1078 define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl
1079 AC_ARG_ENABLE(static,
1080 changequote(<<, >>)dnl
1081 << --enable-static[=PKGS] build static libraries [default=>>AC_ENABLE_STATIC_DEFAULT],
1082 changequote([, ])dnl
1083 [p=${PACKAGE-default}
1084 case "$enableval" in
1085 yes) enable_static=yes ;;
1086 no) enable_static=no ;;
1089 # Look at the argument we got. We use all the common list separators.
1090 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
1091 for pkg in $enableval; do
1092 if test "X$pkg" = "X$p"; then
1099 enable_static=AC_ENABLE_STATIC_DEFAULT)dnl
1102 # AC_DISABLE_STATIC - set the default static flag to --disable-static
1103 AC_DEFUN([AC_DISABLE_STATIC], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
1104 AC_ENABLE_STATIC(no)])
1107 # AC_ENABLE_FAST_INSTALL - implement the --enable-fast-install flag
1108 # Usage: AC_ENABLE_FAST_INSTALL[(DEFAULT)]
1109 # Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
1111 AC_DEFUN([AC_ENABLE_FAST_INSTALL], [dnl
1112 define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl
1113 AC_ARG_ENABLE(fast-install,
1114 changequote(<<, >>)dnl
1115 << --enable-fast-install[=PKGS] optimize for fast installation [default=>>AC_ENABLE_FAST_INSTALL_DEFAULT],
1116 changequote([, ])dnl
1117 [p=${PACKAGE-default}
1118 case "$enableval" in
1119 yes) enable_fast_install=yes ;;
1120 no) enable_fast_install=no ;;
1122 enable_fast_install=no
1123 # Look at the argument we got. We use all the common list separators.
1124 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
1125 for pkg in $enableval; do
1126 if test "X$pkg" = "X$p"; then
1127 enable_fast_install=yes
1133 enable_fast_install=AC_ENABLE_FAST_INSTALL_DEFAULT)dnl
1136 # AC_ENABLE_FAST_INSTALL - set the default to --disable-fast-install
1137 AC_DEFUN([AC_DISABLE_FAST_INSTALL], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
1138 AC_ENABLE_FAST_INSTALL(no)])
1140 # AC_PROG_LD - find the path to the GNU or non-GNU linker
1141 AC_DEFUN([AC_PROG_LD],
1142 [AC_ARG_WITH(gnu-ld,
1143 [ --with-gnu-ld assume the C compiler uses GNU ld [default=no]],
1144 test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
1145 AC_REQUIRE([AC_PROG_CC])dnl
1146 AC_REQUIRE([AC_CANONICAL_HOST])dnl
1147 AC_REQUIRE([AC_CANONICAL_BUILD])dnl
1149 if test "$ac_cv_prog_gcc" = yes; then
1150 # Check if gcc -print-prog-name=ld gives a path.
1151 AC_MSG_CHECKING([for ld used by GCC])
1152 ac_prog=`($CC -print-prog-name=ld) 2>&5`
1154 # Accept absolute paths.
1156 [\\/]* | [A-Za-z]:[\\/]*)
1157 re_direlt='/[^/][^/]*/\.\./'
1159 # Canonicalize the path of ld
1160 ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
1161 while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
1162 ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
1164 test -z "$LD" && LD="$ac_prog"
1167 # If it fails, then pretend we aren't using GCC.
1171 # If it is relative, then search for the first ld in PATH.
1175 elif test "$with_gnu_ld" = yes; then
1176 AC_MSG_CHECKING([for GNU ld])
1178 AC_MSG_CHECKING([for non-GNU ld])
1180 AC_CACHE_VAL(ac_cv_path_LD,
1181 [if test -z "$LD"; then
1182 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
1183 for ac_dir in $PATH; do
1184 test -z "$ac_dir" && ac_dir=.
1185 if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
1186 ac_cv_path_LD="$ac_dir/$ac_prog"
1187 # Check to see if the program is GNU ld. I'd rather use --version,
1188 # but apparently some GNU ld's only accept -v.
1189 # Break only if it was the GNU/non-GNU ld that we prefer.
1190 if "$ac_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
1191 test "$with_gnu_ld" != no && break
1193 test "$with_gnu_ld" != yes && break
1199 ac_cv_path_LD="$LD" # Let the user override the test with a path.
1202 if test -n "$LD"; then
1207 test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
1211 AC_DEFUN([AC_PROG_LD_GNU],
1212 [AC_CACHE_CHECK([if the linker ($LD) is GNU ld], ac_cv_prog_gnu_ld,
1213 [# I'd rather use --version here, but apparently some GNU ld's only accept -v.
1214 if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
1215 ac_cv_prog_gnu_ld=yes
1217 ac_cv_prog_gnu_ld=no
1221 # AC_PROG_NM - find the path to a BSD-compatible name lister
1222 AC_DEFUN([AC_PROG_NM],
1223 [AC_MSG_CHECKING([for BSD-compatible nm])
1224 AC_CACHE_VAL(ac_cv_path_NM,
1225 [if test -n "$NM"; then
1226 # Let the user override the test.
1229 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
1230 for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do
1231 test -z "$ac_dir" && ac_dir=.
1232 if test -f $ac_dir/nm || test -f $ac_dir/nm$ac_exeext ; then
1233 # Check to see if the nm accepts a BSD-compat flag.
1234 # Adding the `sed 1q' prevents false positives on HP-UX, which says:
1235 # nm: unknown option "B" ignored
1236 if ($ac_dir/nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
1237 ac_cv_path_NM="$ac_dir/nm -B"
1239 elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
1240 ac_cv_path_NM="$ac_dir/nm -p"
1243 ac_cv_path_NM=${ac_cv_path_NM="$ac_dir/nm"} # keep the first match, but
1244 continue # so that we can try to find one that supports BSD flags
1249 test -z "$ac_cv_path_NM" && ac_cv_path_NM=nm
1252 AC_MSG_RESULT([$NM])
1255 # AC_CHECK_LIBM - check for math library
1256 AC_DEFUN([AC_CHECK_LIBM],
1257 [AC_REQUIRE([AC_CANONICAL_HOST])dnl
1259 case "$lt_target" in
1260 *-*-beos* | *-*-cygwin*)
1261 # These system don't have libm
1264 AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
1265 AC_CHECK_LIB(m, main, LIBM="$LIBM -lm")
1268 AC_CHECK_LIB(m, main, LIBM="-lm")
1273 # AC_LIBLTDL_CONVENIENCE[(dir)] - sets LIBLTDL to the link flags for
1274 # the libltdl convenience library, adds --enable-ltdl-convenience to
1275 # the configure arguments. Note that LIBLTDL is not AC_SUBSTed, nor
1276 # is AC_CONFIG_SUBDIRS called. If DIR is not provided, it is assumed
1277 # to be `${top_builddir}/libltdl'. Make sure you start DIR with
1278 # '${top_builddir}/' (note the single quotes!) if your package is not
1279 # flat, and, if you're not using automake, define top_builddir as
1280 # appropriate in the Makefiles.
1281 AC_DEFUN([AC_LIBLTDL_CONVENIENCE], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
1282 case "$enable_ltdl_convenience" in
1283 no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;;
1284 "") enable_ltdl_convenience=yes
1285 ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;;
1287 LIBLTDL=ifelse($#,1,$1,['${top_builddir}/libltdl'])/libltdlc.la
1288 INCLTDL=ifelse($#,1,-I$1,['-I${top_builddir}/libltdl'])
1291 # AC_LIBLTDL_INSTALLABLE[(dir)] - sets LIBLTDL to the link flags for
1292 # the libltdl installable library, and adds --enable-ltdl-install to
1293 # the configure arguments. Note that LIBLTDL is not AC_SUBSTed, nor
1294 # is AC_CONFIG_SUBDIRS called. If DIR is not provided, it is assumed
1295 # to be `${top_builddir}/libltdl'. Make sure you start DIR with
1296 # '${top_builddir}/' (note the single quotes!) if your package is not
1297 # flat, and, if you're not using automake, define top_builddir as
1298 # appropriate in the Makefiles.
1299 # In the future, this macro may have to be called after AC_PROG_LIBTOOL.
1300 AC_DEFUN([AC_LIBLTDL_INSTALLABLE], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
1301 AC_CHECK_LIB(ltdl, main,
1302 [test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no],
1303 [if test x"$enable_ltdl_install" = xno; then
1304 AC_MSG_WARN([libltdl not installed, but installation disabled])
1306 enable_ltdl_install=yes
1309 if test x"$enable_ltdl_install" = x"yes"; then
1310 ac_configure_args="$ac_configure_args --enable-ltdl-install"
1311 LIBLTDL=ifelse($#,1,$1,['${top_builddir}/libltdl'])/libltdl.la
1312 INCLTDL=ifelse($#,1,-I$1,['-I${top_builddir}/libltdl'])
1314 ac_configure_args="$ac_configure_args --enable-ltdl-install=no"
1321 AC_DEFUN([AM_PROG_LIBTOOL], [indir([AC_PROG_LIBTOOL])])dnl
1322 AC_DEFUN([AM_ENABLE_SHARED], [indir([AC_ENABLE_SHARED], $@)])dnl
1323 AC_DEFUN([AM_ENABLE_STATIC], [indir([AC_ENABLE_STATIC], $@)])dnl
1324 AC_DEFUN([AM_DISABLE_SHARED], [indir([AC_DISABLE_SHARED], $@)])dnl
1325 AC_DEFUN([AM_DISABLE_STATIC], [indir([AC_DISABLE_STATIC], $@)])dnl
1326 AC_DEFUN([AM_PROG_LD], [indir([AC_PROG_LD])])dnl
1327 AC_DEFUN([AM_PROG_NM], [indir([AC_PROG_NM])])dnl
1329 dnl This is just to silence aclocal about the macro not being used
1330 ifelse([AC_DISABLE_FAST_INSTALL])dnl
1332 dnl bsd_sockets.m4--which socket libraries do we need?
1333 dnl Derrick Brashear
1335 dnl $Id: bsd_sockets.m4,v 1.10 2005/04/26 19:14:07 shadow Exp $
1337 dnl Hacked on by Rob Earhart to not just toss stuff in LIBS
1338 dnl It now puts everything required for sockets into LIB_SOCKET
1340 AC_DEFUN([CMU_SOCKETS], [
1343 AC_CHECK_FUNC(connect, :,
1344 AC_CHECK_LIB(nsl, gethostbyname,
1345 LIB_SOCKET="-lnsl $LIB_SOCKET")
1346 AC_CHECK_LIB(socket, connect,
1347 LIB_SOCKET="-lsocket $LIB_SOCKET")
1349 LIBS="$LIB_SOCKET $save_LIBS"
1350 AC_CHECK_FUNC(res_search, :,
1351 LIBS="-lresolv $LIB_SOCKET $save_LIBS"
1353 #include <sys/types.h>
1354 #include <netinet/in.h>
1355 #include <arpa/nameser.h>
1356 #ifdef HAVE_ARPA_NAMESER_COMPAT_H
1357 #include <arpa/nameser_compat.h>
1359 #include <resolv.h>]],[[
1360 const char host[12]="openafs.org";
1362 res_search( host, C_IN, T_MX, (u_char *)&ans, sizeof(ans));
1364 ]], LIB_SOCKET="-lresolv $LIB_SOCKET")
1366 LIBS="$LIB_SOCKET $save_LIBS"
1367 AC_CHECK_FUNCS(dn_expand dns_lookup)
1369 AC_SUBST(LIB_SOCKET)
1372 dnl Functions to check what database to use for libsasldb
1374 dnl Berkeley DB specific checks first..
1376 dnl Figure out what database type we're using
1377 AC_DEFUN([SASL_DB_CHECK], [
1378 cmu_save_LIBS="$LIBS"
1379 AC_ARG_WITH(dblib, [ --with-dblib=DBLIB set the DB library to use [berkeley] ],
1383 CYRUS_BERKELEY_DB_OPTS()
1388 dnl this is unbelievably painful due to confusion over what db-3 should be
1391 CYRUS_BERKELEY_DB_CHK()
1392 CPPFLAGS="${CPPFLAGS} ${BDB_INCADD}"
1393 SASL_DB_INC=$BDB_INCADD
1394 SASL_DB_LIB="${BDB_LIBADD}"
1397 AC_ARG_WITH(gdbm,[ --with-gdbm=PATH use gdbm from PATH],
1398 with_gdbm="${withval}")
1400 case "$with_gdbm" in
1402 AC_CHECK_HEADER(gdbm.h, [
1403 AC_CHECK_LIB(gdbm, gdbm_open, SASL_DB_LIB="-lgdbm",
1408 if test -d $with_gdbm; then
1409 CPPFLAGS="${CPPFLAGS} -I${with_gdbm}/include"
1410 LDFLAGS="${LDFLAGS} -L${with_gdbm}/lib"
1411 SASL_DB_LIB="-lgdbm"
1418 dnl We want to attempt to use -lndbm if we can, just in case
1419 dnl there's some version of it installed and overriding libc
1420 AC_CHECK_HEADER(ndbm.h, [
1421 AC_CHECK_LIB(ndbm, dbm_open, SASL_DB_LIB="-lndbm", [
1422 AC_CHECK_FUNC(dbm_open,,dblib="no")])],
1426 dnl How about berkeley db?
1427 CYRUS_BERKELEY_DB_CHK()
1428 if test "$dblib" = no; then
1430 AC_CHECK_HEADER(ndbm.h, [
1431 AC_CHECK_LIB(ndbm, dbm_open,
1432 dblib="ndbm"; SASL_DB_LIB="-lndbm",
1435 if test "$dblib" = "weird"; then
1436 dnl Is ndbm in the standard library?
1437 AC_CHECK_FUNC(dbm_open, dblib="ndbm", dblib="no")
1440 if test "$dblib" = no; then
1441 dnl Can we use gdbm?
1442 AC_CHECK_HEADER(gdbm.h, [
1443 AC_CHECK_LIB(gdbm, gdbm_open, dblib="gdbm";
1444 SASL_DB_LIB="-lgdbm", dblib="no")],
1448 dnl we took Berkeley
1449 CPPFLAGS="${CPPFLAGS} ${BDB_INCADD}"
1450 SASL_DB_INC=$BDB_INCADD
1451 SASL_DB_LIB="${BDB_LIBADD}"
1459 AC_MSG_WARN([Bad DB library implementation specified;])
1460 AC_ERROR([Use either \"berkeley\", \"gdbm\", \"ndbm\" or \"none\"])
1464 LIBS="$cmu_save_LIBS"
1466 AC_MSG_CHECKING(DB library to use)
1467 AC_MSG_RESULT($dblib)
1469 SASL_DB_BACKEND="db_${dblib}.lo"
1470 SASL_DB_BACKEND_STATIC="db_${dblib}.o allockey.o"
1471 SASL_DB_BACKEND_STATIC_SRCS="../sasldb/db_${dblib}.c ../sasldb/allockey.c"
1472 SASL_DB_UTILS="saslpasswd2 sasldblistusers2"
1473 SASL_DB_MANS="saslpasswd2.8 sasldblistusers2.8"
1477 SASL_MECHS="$SASL_MECHS libsasldb.la"
1478 AC_DEFINE(SASL_GDBM,[],[Use GDBM for SASLdb])
1481 SASL_MECHS="$SASL_MECHS libsasldb.la"
1482 AC_DEFINE(SASL_NDBM,[],[Use NDBM for SASLdb])
1485 SASL_MECHS="$SASL_MECHS libsasldb.la"
1486 AC_DEFINE(SASL_BERKELEYDB,[],[Use BerkeleyDB for SASLdb])
1489 AC_MSG_WARN([Disabling SASL authentication database support])
1490 dnl note that we do not add libsasldb.la to SASL_MECHS, since it
1491 dnl will just fail to load anyway.
1492 SASL_DB_BACKEND="db_none.lo"
1493 SASL_DB_BACKEND_STATIC="db_none.o"
1494 SASL_DB_BACKEND_STATIC_SRCS="../sasldb/db_none.c"
1501 if test "$enable_static" = yes; then
1502 if test "$dblib" != "none"; then
1503 SASL_STATIC_SRCS="$SASL_STATIC_SRCS ../plugins/sasldb.c $SASL_DB_BACKEND_STATIC_SRCS"
1504 SASL_STATIC_OBJS="$SASL_STATIC_OBJS sasldb.o $SASL_DB_BACKEND_STATIC"
1505 AC_DEFINE(STATIC_SASLDB,[],[Link SASLdb Staticly])
1507 SASL_STATIC_OBJS="$SASL_STATIC_OBJS $SASL_DB_BACKEND_STATIC"
1508 SASL_STATIC_SRCS="$SASL_STATIC_SRCS $SASL_DB_BACKEND_STATIC_SRCS"
1512 AC_SUBST(SASL_DB_UTILS)
1513 AC_SUBST(SASL_DB_MANS)
1514 AC_SUBST(SASL_DB_BACKEND)
1515 AC_SUBST(SASL_DB_BACKEND_STATIC)
1516 AC_SUBST(SASL_DB_INC)
1517 AC_SUBST(SASL_DB_LIB)
1520 dnl Figure out what database path we're using
1521 AC_DEFUN([SASL_DB_PATH_CHECK], [
1522 AC_ARG_WITH(dbpath, [ --with-dbpath=PATH set the DB path to use [/etc/sasldb2] ],
1524 dbpath=/etc/sasldb2)
1525 AC_MSG_CHECKING(DB path to use)
1526 AC_MSG_RESULT($dbpath)
1527 AC_DEFINE_UNQUOTED(SASL_DB_PATH, "$dbpath", [Path to default SASLdb database])])
1529 dnl $Id: berkdb.m4,v 1.20 2005/04/26 19:14:07 shadow Exp $
1531 AC_DEFUN([CMU_DB_INC_WHERE1], [
1532 saved_CPPFLAGS=$CPPFLAGS
1533 CPPFLAGS="$saved_CPPFLAGS -I$1"
1534 AC_TRY_COMPILE([#include <db.h>],
1536 db_create(&db, NULL, 0);
1537 db->open(db, "foo.db", NULL, DB_UNKNOWN, DB_RDONLY, 0644);],
1538 ac_cv_found_db_inc=yes,
1539 ac_cv_found_db_inc=no)
1540 CPPFLAGS=$saved_CPPFLAGS
1543 AC_DEFUN([CMU_DB_INC_WHERE], [
1545 AC_MSG_CHECKING(for db headers in $i)
1546 CMU_DB_INC_WHERE1($i)
1547 CMU_TEST_INCPATH($i, db)
1548 if test "$ac_cv_found_db_inc" = "yes"; then
1549 ac_cv_db_where_inc=$i
1550 AC_MSG_RESULT(found)
1553 AC_MSG_RESULT(not found)
1559 # Test for lib files
1562 AC_DEFUN([CMU_DB3_LIB_WHERE1], [
1563 AC_REQUIRE([CMU_AFS])
1564 AC_REQUIRE([CMU_KRB4])
1566 LIBS="$saved_LIBS -L$1 -ldb-3"
1567 AC_TRY_LINK([#include <db.h>],
1568 [db_env_create(NULL, 0);],
1569 [ac_cv_found_db_3_lib=yes],
1570 ac_cv_found_db_3_lib=no)
1573 AC_DEFUN([CMU_DB4_LIB_WHERE1], [
1574 AC_REQUIRE([CMU_AFS])
1575 AC_REQUIRE([CMU_KRB4])
1577 LIBS="$saved_LIBS -L$1 -ldb-4"
1578 AC_TRY_LINK([#include <db.h>],
1579 [db_env_create(NULL, 0);],
1580 [ac_cv_found_db_4_lib=yes],
1581 ac_cv_found_db_4_lib=no)
1585 AC_DEFUN([CMU_DB_LIB_WHERE], [
1587 AC_MSG_CHECKING(for db libraries in $i)
1588 if test "$enable_db4" = "yes"; then
1589 CMU_DB4_LIB_WHERE1($i)
1590 CMU_TEST_LIBPATH($i, [db-4])
1591 ac_cv_found_db_lib=$ac_cv_found_db_4_lib
1593 CMU_DB3_LIB_WHERE1($i)
1594 CMU_TEST_LIBPATH($i, [db-3])
1595 ac_cv_found_db_lib=$ac_cv_found_db_3_lib
1597 if test "$ac_cv_found_db_lib" = "yes" ; then
1598 ac_cv_db_where_lib=$i
1599 AC_MSG_RESULT(found)
1602 AC_MSG_RESULT(not found)
1607 AC_DEFUN([CMU_USE_DB], [
1608 AC_REQUIRE([CMU_FIND_LIB_SUBDIR])
1610 [ --with-db=PREFIX Compile with db support],
1611 [if test "X$with_db" = "X"; then
1615 [ --with-db-lib=dir use db libraries in dir],
1616 [if test "$withval" = "yes" -o "$withval" = "no"; then
1617 AC_MSG_ERROR([No argument for --with-db-lib])
1619 AC_ARG_WITH(db-include,
1620 [ --with-db-include=dir use db headers in dir],
1621 [if test "$withval" = "yes" -o "$withval" = "no"; then
1622 AC_MSG_ERROR([No argument for --with-db-include])
1625 [ --enable-db4 use db 4.x libraries])
1627 if test "X$with_db" != "X"; then
1628 if test "$with_db" != "yes"; then
1629 ac_cv_db_where_lib=$with_db/$CMU_LIB_SUBDIR
1630 ac_cv_db_where_inc=$with_db/include
1634 if test "X$with_db_lib" != "X"; then
1635 ac_cv_db_where_lib=$with_db_lib
1637 if test "X$ac_cv_db_where_lib" = "X"; then
1638 CMU_DB_LIB_WHERE(/usr/athena/$CMU_LIB_SUBDIR /usr/$CMU_LIB_SUBDIR /usr/local/$CMU_LIB_SUBDIR)
1641 if test "X$with_db_include" != "X"; then
1642 ac_cv_db_where_inc=$with_db_include
1644 if test "X$ac_cv_db_where_inc" = "X"; then
1645 CMU_DB_INC_WHERE(/usr/athena/include /usr/local/include)
1648 AC_MSG_CHECKING(whether to include db)
1649 if test "X$ac_cv_db_where_lib" = "X" -o "X$ac_cv_db_where_inc" = "X"; then
1655 DB_INC_DIR=$ac_cv_db_where_inc
1656 DB_LIB_DIR=$ac_cv_db_where_lib
1657 DB_INC_FLAGS="-I${DB_INC_DIR}"
1658 if test "$enable_db4" = "yes"; then
1659 DB_LIB_FLAGS="-L${DB_LIB_DIR} -ldb-4"
1661 DB_LIB_FLAGS="-L${DB_LIB_DIR} -ldb-3"
1663 dnl Do not force configure.in to put these in CFLAGS and LIBS unconditionally
1664 dnl Allow makefile substitutions....
1665 AC_SUBST(DB_INC_FLAGS)
1666 AC_SUBST(DB_LIB_FLAGS)
1667 if test "X$RPATH" = "X"; then
1672 if test "X$RPATH" = "X"; then
1673 RPATH="-Wl,-rpath,${DB_LIB_DIR}"
1675 RPATH="${RPATH}:${DB_LIB_DIR}"
1679 if test "X$RPATH" = "X"; then
1680 RPATH="-Wl,+b${DB_LIB_DIR}"
1682 RPATH="${RPATH}:${DB_LIB_DIR}"
1686 if test "X$RPATH" = "X"; then
1687 RPATH="-Wl,-rpath,${DB_LIB_DIR}"
1689 RPATH="${RPATH}:${DB_LIB_DIR}"
1693 if test "$ac_cv_prog_gcc" = yes; then
1694 if test "X$RPATH" = "X"; then
1695 RPATH="-Wl,-R${DB_LIB_DIR}"
1697 RPATH="${RPATH}:${DB_LIB_DIR}"
1700 RPATH="${RPATH} -R${DB_LIB_DIR}"
1710 dnl ---- CUT HERE ---
1712 dnl These are the Cyrus Berkeley DB macros. In an ideal world these would be
1713 dnl identical to the above.
1715 dnl They are here so that they can be shared between Cyrus IMAPd
1716 dnl and Cyrus SASL with relative ease.
1718 dnl The big difference between this and the ones above is that we don't assume
1719 dnl that we know the name of the library, and we try a lot of permutations
1720 dnl instead. We also assume that DB4 is acceptable.
1722 dnl When we're done, there will be a BDB_LIBADD and a BDB_INCADD which should
1723 dnl be used when necessary. We should probably be smarter about our RPATH
1726 dnl Call these with BERKELEY_DB_CHK.
1728 dnl We will also set $dblib to "berkeley" if we are successful, "no" otherwise.
1730 dnl this is unbelievably painful due to confusion over what db-3 should be
1731 dnl named and where the db-3 header file is located. arg.
1732 AC_DEFUN([CYRUS_BERKELEY_DB_CHK_LIB],
1734 BDB_SAVE_LDFLAGS=$LDFLAGS
1736 if test -d $with_bdb_lib; then
1737 CMU_ADD_LIBPATH_TO($with_bdb_lib, LDFLAGS)
1738 CMU_ADD_LIBPATH_TO($with_bdb_lib, BDB_LIBADD)
1744 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
1746 LIBS="$saved_LIBS -l$dbname"
1747 AC_TRY_LINK([#include <db.h>],
1748 [db_create(NULL, NULL, 0);],
1749 BDB_LIBADD="$BDB_LIBADD -l$dbname"; dblib="berkeley"; dbname=db,
1751 if test "$dblib" = "berkeley"; then break; fi
1753 if test "$dblib" = "no"; then
1754 LIBS="$saved_LIBS -ldb"
1755 AC_TRY_LINK([#include <db.h>],
1756 [db_open(NULL, 0, 0, 0, NULL, NULL, NULL);],
1757 BDB_LIBADD="$BDB_LIBADD -ldb"; dblib="berkeley"; dbname=db,
1762 LDFLAGS=$BDB_SAVE_LDFLAGS
1765 AC_DEFUN([CYRUS_BERKELEY_DB_OPTS],
1767 AC_ARG_WITH(bdb-libdir,
1768 [ --with-bdb-libdir=DIR Berkeley DB lib files are in DIR],
1769 with_bdb_lib=$withval,
1770 [ test "${with_bdb_lib+set}" = set || with_bdb_lib=none])
1771 AC_ARG_WITH(bdb-incdir,
1772 [ --with-bdb-incdir=DIR Berkeley DB include files are in DIR],
1773 with_bdb_inc=$withval,
1774 [ test "${with_bdb_inc+set}" = set || with_bdb_inc=none ])
1777 AC_DEFUN([CYRUS_BERKELEY_DB_CHK],
1779 AC_REQUIRE([CYRUS_BERKELEY_DB_OPTS])
1781 cmu_save_CPPFLAGS=$CPPFLAGS
1783 if test -d $with_bdb_inc; then
1784 CPPFLAGS="$CPPFLAGS -I$with_bdb_inc"
1785 BDB_INCADD="-I$with_bdb_inc"
1790 dnl Note that FreeBSD puts it in a wierd place
1791 dnl (but they should use with-bdb-incdir)
1792 AC_CHECK_HEADER(db.h,
1793 [CYRUS_BERKELEY_DB_CHK_LIB()],
1796 CPPFLAGS=$cmu_save_CPPFLAGS
1799 dnl $Id: common.m4,v 1.13 2006/02/25 18:29:46 cg2v Exp $
1801 AC_DEFUN([CMU_TEST_LIBPATH], [
1803 define(<<CMU_AC_CV_FOUND>>, translit(ac_cv_found_$2_lib, <<- *>>, <<__p>>))
1805 if test "$CMU_AC_CV_FOUND" = "yes"; then
1806 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
1812 AC_DEFUN([CMU_TEST_INCPATH], [
1814 define(<<CMU_AC_CV_FOUND>>, translit(ac_cv_found_$2_inc, [ *], [_p]))
1816 if test "$CMU_AC_CV_FOUND" = "yes"; then
1817 if test \! -r "$1/$2.h"; then
1823 dnl CMU_CHECK_HEADER_NOCACHE(HEADER-FILE, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
1824 AC_DEFUN([CMU_CHECK_HEADER_NOCACHE],
1825 [dnl Do the transliteration at runtime so arg 1 can be a shell variable.
1826 ac_safe=`echo "$1" | sed 'y%./+-%__p_%'`
1827 AC_MSG_CHECKING([for $1])
1828 AC_TRY_CPP([#include <$1>], eval "ac_cv_header_$ac_safe=yes",
1829 eval "ac_cv_header_$ac_safe=no")
1830 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
1832 ifelse([$2], , :, [$2])
1835 ifelse([$3], , , [$3
1840 AC_DEFUN([CMU_FIND_LIB_SUBDIR],
1842 AC_ARG_WITH([lib-subdir], AC_HELP_STRING([--with-lib-subdir=DIR],[Find libraries in DIR instead of lib]))
1843 AC_CHECK_SIZEOF(long)
1844 AC_CACHE_CHECK([what directory libraries are found in], [ac_cv_cmu_lib_subdir],
1845 [test "X$with_lib_subdir" = "Xyes" && with_lib_subdir=
1846 test "X$with_lib_subdir" = "Xno" && with_lib_subdir=
1847 if test "X$with_lib_subdir" = "X" ; then
1848 ac_cv_cmu_lib_subdir=lib
1849 if test $ac_cv_sizeof_long -eq 4 ; then
1850 test -d /usr/lib32 && ac_cv_cmu_lib_subdir=lib32
1852 if test $ac_cv_sizeof_long -eq 8 ; then
1853 test -d /usr/lib64 && ac_cv_cmu_lib_subdir=lib64
1856 ac_cv_cmu_lib_subdir=$with_lib_subdir
1858 AC_SUBST(CMU_LIB_SUBDIR, $ac_cv_cmu_lib_subdir)
1861 dnl afs.m4--AFS libraries, includes, and dependencies
1862 dnl $Id: afs.m4,v 1.29 2005/04/26 19:14:07 shadow Exp $
1863 dnl Chaskiel Grundman
1864 dnl based on kerberos_v4.m4
1865 dnl Derrick Brashear
1866 dnl from KTH krb and Arla
1868 AC_DEFUN([CMU_AFS_INC_WHERE1], [
1869 cmu_save_CPPFLAGS=$CPPFLAGS
1870 CPPFLAGS="$cmu_save_CPPFLAGS -I$1"
1871 AC_TRY_COMPILE([#include <afs/param.h>],
1876 ac_cv_found_afs_inc=yes,
1877 ac_cv_found_afs_inc=no)
1878 CPPFLAGS=$cmu_save_CPPFLAGS
1881 AC_DEFUN([CMU_AFS_LIB_WHERE1], [
1883 save_LDFLAGS="$LDFLAGS"
1885 LIBS="-lauth $1/afs/util.a $LIB_SOCKET $LIBS"
1886 LDFLAGS="-L$1 -L$1/afs $LDFLAGS"
1887 dnl suppress caching
1888 AC_TRY_LINK([],[afsconf_Open();], ac_cv_found_afs_lib=yes, ac_cv_found_afs_lib=no)
1890 LDFLAGS="$save_LDFLAGS"
1893 AC_DEFUN([CMU_AFS_WHERE], [
1894 AC_REQUIRE([CMU_FIND_LIB_SUBDIR])
1896 AC_MSG_CHECKING(for AFS in $i)
1897 CMU_AFS_INC_WHERE1("$i/include")
1898 ac_cv_found_lwp_inc=$ac_cv_found_afs_inc
1899 CMU_TEST_INCPATH($i/include, lwp)
1900 ac_cv_found_afs_inc=$ac_cv_found_lwp_inc
1901 if test "$ac_cv_found_afs_inc" = "yes"; then
1902 CMU_AFS_LIB_WHERE1("$i/$CMU_LIB_SUBDIR")
1903 if test "$ac_cv_found_afs_lib" = "yes"; then
1905 AC_MSG_RESULT(found)
1908 AC_MSG_RESULT(not found)
1911 AC_MSG_RESULT(not found)
1916 AC_DEFUN([CMU_AFS], [
1917 AC_REQUIRE([CMU_FIND_LIB_SUBDIR])
1918 AC_REQUIRE([CMU_SOCKETS])
1919 AC_REQUIRE([CMU_LIBSSL])
1921 [ --with-afs=PREFIX Compile with AFS support],
1922 [if test "X$with_AFS" = "X"; then
1926 if test "X$with_AFS" != "X"; then
1927 ac_cv_afs_where=$with_AFS
1929 if test "X$ac_cv_afs_where" = "X"; then
1930 CMU_AFS_WHERE(/usr/afsws /usr/local /usr/athena /Library/OpenAFS/Tools)
1933 AC_MSG_CHECKING(whether to include AFS)
1934 if test "X$ac_cv_afs_where" = "Xno" -o "X$ac_cv_afs_where" = "X"; then
1940 AFS_INC_DIR="$ac_cv_afs_where/include"
1941 AFS_LIB_DIR="$ac_cv_afs_where/$CMU_LIB_SUBDIR"
1942 AFS_TOP_DIR="$ac_cv_afs_where"
1943 AFS_INC_FLAGS="-I${AFS_INC_DIR}"
1944 AFS_LIB_FLAGS="-L${AFS_LIB_DIR} -L${AFS_LIB_DIR}/afs"
1945 cmu_save_LIBS="$LIBS"
1946 cmu_save_CPPFLAGS="$CPPFLAGS"
1947 CPPFLAGS="$CPPFLAGS ${AFS_INC_FLAGS}"
1948 cmu_save_LDFLAGS="$LDFLAGS"
1949 LDFLAGS="$cmu_save_LDFLAGS ${AFS_LIB_FLAGS}"
1951 AC_CHECK_HEADERS(afs/stds.h)
1953 AC_MSG_CHECKING([if libdes is needed])
1954 AC_TRY_LINK([],[des_quad_cksum();],AFS_DES_LIB="",AFS_DES_LIB="maybe")
1955 if test "X$AFS_DES_LIB" != "X"; then
1956 LIBS="$cmu_save_LIBS -ldes"
1957 AC_TRY_LINK([], [des_quad_cksum();],AFS_DES_LIB="yes")
1958 if test "X$AFS_DES_LIB" = "Xyes"; then
1959 AC_MSG_RESULT([yes])
1961 AFS_LIBDESA="${AFS_LIB_DIR}/libdes.a"
1963 LIBS="$cmu_save_LIBS $LIBSSL_LIB_FLAGS"
1965 [des_quad_cksum();],AFS_DES_LIB="libcrypto")
1966 if test "X$AFS_DES_LIB" = "Xlibcrypto"; then
1967 AC_MSG_RESULT([libcrypto])
1968 AFS_LIBDES="$LIBSSL_LIB_FLAGS"
1969 AFS_LIBDESA="$LIBSSL_LIB_FLAGS"
1971 LIBS="$cmu_save_LIBS -L$LIBSSL_LIB_DIR -ldescompat $LIBSSL_LIB_FLAGS"
1973 [des_quad_cksum();],AFS_DES_LIB="libcrypto+descompat")
1974 if test "X$AFS_DES_LIB" = "Xlibcrypto+descompat"; then
1975 AC_MSG_RESULT([libcrypto+descompat])
1976 AFS_LIBDES="-L$LIBSSL_LIB_DIR -ldescompat $LIBSSL_LIB_FLAGS"
1977 AFS_LIBDESA="-L$LIBSSL_LIB_DIR -ldescompat $LIBSSL_LIB_FLAGS"
1979 AC_MSG_RESULT([unknown])
1980 AC_MSG_ERROR([Could not use -ldes])
1989 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"
1990 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"
1991 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"
1992 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"
1993 AFS_KTC_LIBS="-lauth ${AFS_LIB_DIR}/afs/libsys.a -lrx -llwp ${AFS_LIBDES} -lcom_err ${AFS_LIB_DIR}/afs/util.a"
1995 LIBS="$cmu_save_LIBS $AFS_CLIENT_LIBS ${LIB_SOCKET}"
1996 AC_CHECK_FUNC(des_pcbc_init)
1997 if test "X$ac_cv_func_des_pcbc_init" != "Xyes"; then
1998 AC_CHECK_LIB(descompat, des_pcbc_init, AFS_DESCOMPAT_LIB="-ldescompat")
1999 if test "X$AFS_DESCOMPAT_LIB" != "X" ; then
2000 AFS_CLIENT_LIBS_STATIC="$AFS_CLIENT_LIBS_STATIC $AFS_DESCOMPAT_LIB"
2001 AFS_KTC_LIBS_STATIC="$AFS_KTC_LIBS_STATIC $AFS_DESCOMPAT_LIB"
2002 AFS_CLIENT_LIBS="$AFS_CLIENT_LIBS $AFS_DESCOMPAT_LIB"
2003 AFS_KTC_LIBS="$AFS_KTC_LIBS $AFS_DESCOMPAT_LIB"
2006 AC_MSG_CHECKING([if rxkad needs des_pcbc_init])
2007 AC_TRY_LINK(,[tkt_DecodeTicket();],RXKAD_PROBLEM=no,RXKAD_PROBLEM=maybe)
2008 if test "$RXKAD_PROBLEM" = "maybe"; then
2009 AC_TRY_LINK([int des_pcbc_init() { return 0;}],
2010 [tkt_DecodeTicket();],RXKAD_PROBLEM=yes,RXKAD_PROBLEM=error)
2011 if test "$RXKAD_PROBLEM" = "yes"; then
2012 AC_MSG_RESULT([yes])
2013 AC_MSG_ERROR([cannot use rxkad])
2015 AC_MSG_RESULT([unknown])
2016 AC_MSG_ERROR([Unknown error testing rxkad])
2024 LIBS="$cmu_save_LIBS"
2025 AC_CHECK_FUNC(flock)
2026 LIBS="$cmu_save_LIBS ${AFS_CLIENT_LIBS} ${LIB_SOCKET}"
2027 if test "X$ac_cv_func_flock" != "Xyes"; then
2028 AC_MSG_CHECKING([if AFS needs flock])
2029 AC_TRY_LINK([#include <afs/param.h>
2030 #ifdef HAVE_AFS_STDS_H
2031 #include <afs/stds.h>
2034 #include <afs/cellconfig.h>
2035 #include <afs/auth.h>
2036 #include <afs/volser.h>
2037 struct ubik_client * cstruct;
2038 int sigvec() {return 0;}
2039 extern int UV_SetSecurity();],
2040 [vsu_ClientInit(1,"","",0,
2041 &cstruct,UV_SetSecurity)],
2042 AFS_FLOCK=no,AFS_FLOCK=yes)
2043 if test $AFS_FLOCK = "no"; then
2046 AC_MSG_RESULT([yes])
2047 LDFLAGS="$LDFLAGS -L/usr/ucblib"
2048 AC_CHECK_LIB(ucb, flock,:, [AC_CHECK_LIB(BSD, flock)])
2051 LIBS="$cmu_save_LIBS"
2052 AC_CHECK_FUNC(sigvec)
2053 LIBS="$cmu_save_LIBS ${AFS_CLIENT_LIBS} ${LIB_SOCKET}"
2054 if test "X$ac_cv_func_sigvec" != "Xyes"; then
2055 AC_MSG_CHECKING([if AFS needs sigvec])
2056 AC_TRY_LINK([#include <afs/param.h>
2057 #ifdef HAVE_AFS_STDS_H
2058 #include <afs/stds.h>
2061 #include <afs/cellconfig.h>
2062 #include <afs/auth.h>
2063 #include <afs/volser.h>
2064 struct ubik_client * cstruct;
2065 int flock() {return 0;}
2066 extern int UV_SetSecurity();],
2067 [vsu_ClientInit(1,"","",0,
2068 &cstruct,UV_SetSecurity)],
2069 AFS_SIGVEC=no,AFS_SIGVEC=yes)
2070 if test $AFS_SIGVEC = "no"; then
2073 AC_MSG_RESULT([yes])
2074 LDFLAGS="$LDFLAGS -L/usr/ucblib"
2075 AC_CHECK_LIB(ucb, sigvec,:,[AC_CHECK_LIB(BSD, sigvec)])
2078 if test "$ac_cv_lib_ucb_flock" = "yes" -o "$ac_cv_lib_ucb_sigvec" = "yes"; then
2079 AFS_LIB_FLAGS="${AFS_LIB_FLAGS} -L/usr/ucblib -R/usr/ucblib"
2081 if test "$ac_cv_lib_ucb_flock" = "yes" -o "$ac_cv_lib_ucb_sigvec" = "yes"; then
2083 elif test "$ac_cv_lib_BSD_flock" = "yes" -o "$ac_cv_lib_BSD_sigvec" = "yes"; then
2086 if test "X$AFS_BSD_LIB" != "X" ; then
2087 AFS_CLIENT_LIBS_STATIC="$AFS_CLIENT_LIBS_STATIC $AFS_BSD_LIB"
2088 AFS_KTC_LIBS_STATIC="$AFS_KTC_LIBS_STATIC $AFS_BSD_LIB"
2089 AFS_CLIENT_LIBS="$AFS_CLIENT_LIBS $AFS_BSD_LIB"
2090 AFS_RX_LIBS="$AFS_CLIENT_LIBS $AFS_BSD_LIB"
2091 AFS_KTC_LIBS="$AFS_KTC_LIBS $AFS_BSD_LIB"
2094 AC_MSG_CHECKING([if libaudit is needed])
2096 LIBS="$cmu_save_LIBS $AFS_CLIENT_LIBS ${LIB_SOCKET}"
2097 AC_TRY_LINK([#include <afs/param.h>
2098 #ifdef HAVE_AFS_STDS_H
2099 #include <afs/stds.h>
2101 #include <afs/cellconfig.h>
2102 #include <afs/auth.h>],
2103 [afsconf_SuperUser();],AFS_AUDIT_LIB="",AFS_AUDIT_LIB="maybe")
2104 if test "X$AFS_AUDIT_LIB" != "X"; then
2105 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"
2106 AC_TRY_LINK([#include <afs/param.h>
2107 #ifdef HAVE_AFS_STDS_H
2108 #include <afs/stds.h>
2110 #include <afs/cellconfig.h>
2111 #include <afs/auth.h>],
2112 [afsconf_SuperUser();],AFS_AUDIT_LIB="yes")
2113 if test "X$AFS_AUDIT_LIB" = "Xyes"; then
2114 AC_MSG_RESULT([yes])
2115 AFS_LIBAUDIT="-laudit"
2116 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"
2117 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"
2118 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"
2120 AC_MSG_RESULT([unknown])
2121 AC_MSG_ERROR([Could not use -lauth while testing for -laudit])
2127 AC_CHECK_FUNCS(VL_ProbeServer)
2128 AC_MSG_CHECKING([if new-style afs_ integer types are defined])
2129 AC_CACHE_VAL(ac_cv_afs_int32,
2130 dnl The next few lines contain a quoted argument to egrep
2131 dnl It is critical that there be no leading or trailing whitespace
2134 changequote(<<,>>)dnl
2135 <<(^|[^a-zA-Z_0-9])afs_int32[^a-zA-Z_0-9]>>dnl
2136 changequote([,]), [#include <afs/param.h>
2137 #ifdef HAVE_AFS_STDS_H
2138 #include <afs/stds.h>
2140 ac_cv_afs_int32=yes, ac_cv_afs_int32=no)])
2141 AC_MSG_RESULT($ac_cv_afs_int32)
2142 if test $ac_cv_afs_int32 = yes ; then
2143 AC_DEFINE(HAVE_AFS_INT32,, [AFS provides new "unambiguous" type names])
2145 AC_DEFINE(afs_int16, int16, [it's a type definition])
2146 AC_DEFINE(afs_int32, int32, [it's a type definition])
2147 AC_DEFINE(afs_uint16, u_int16, [it's a type definition])
2148 AC_DEFINE(afs_uint32, u_int32, [it's a type definition])
2151 CPPFLAGS="${cmu_save_CPPFLAGS}"
2152 LDFLAGS="${cmu_save_LDFLAGS}"
2153 LIBS="${cmu_save_LIBS}"
2154 AC_DEFINE(AFS_ENV,, [Use AFS. (find what needs this and nuke it)])
2155 AC_DEFINE(AFS,, [Use AFS. (find what needs this and nuke it)])
2156 AC_SUBST(AFS_CLIENT_LIBS_STATIC)
2157 AC_SUBST(AFS_KTC_LIBS_STATIC)
2158 AC_SUBST(AFS_CLIENT_LIBS)
2159 AC_SUBST(AFS_RX_LIBS)
2160 AC_SUBST(AFS_KTC_LIBS)
2161 AC_SUBST(AFS_INC_FLAGS)
2162 AC_SUBST(AFS_LIB_FLAGS)
2163 AC_SUBST(AFS_TOP_DIR)
2164 AC_SUBST(AFS_LIBAUDIT)
2165 AC_SUBST(AFS_LIBDES)
2166 AC_SUBST(AFS_LIBDESA)
2170 AC_DEFUN([CMU_NEEDS_AFS],
2171 [AC_REQUIRE([CMU_AFS])
2172 if test "$ac_cv_found_afs" != "yes"; then
2173 AC_ERROR([Cannot continue without AFS])
2176 dnl libssl.m4--Ssl libraries and includes
2177 dnl Derrick Brashear
2178 dnl from KTH kafs and Arla
2179 dnl $Id: libssl.m4,v 1.10 2005/04/26 19:14:08 shadow Exp $
2181 AC_DEFUN([CMU_LIBSSL_INC_WHERE1], [
2182 saved_CPPFLAGS=$CPPFLAGS
2183 CPPFLAGS="$saved_CPPFLAGS -I$1"
2184 CMU_CHECK_HEADER_NOCACHE(openssl/ssl.h,
2185 ac_cv_found_libssl_inc=yes,
2186 ac_cv_found_libssl_inc=no)
2187 CPPFLAGS=$saved_CPPFLAGS
2190 AC_DEFUN([CMU_LIBSSL_INC_WHERE], [
2192 AC_MSG_CHECKING(for libssl headers in $i)
2193 CMU_LIBSSL_INC_WHERE1($i)
2194 CMU_TEST_INCPATH($i, ssl)
2195 if test "$ac_cv_found_libssl_inc" = "yes"; then
2196 ac_cv_libssl_where_inc=$i
2197 AC_MSG_RESULT(found)
2200 AC_MSG_RESULT(not found)
2205 AC_DEFUN([CMU_LIBSSL_LIB_WHERE1], [
2207 LIBS="$saved_LIBS -L$1 -lssl -lcrypto $LIB_SOCKET"
2210 [ac_cv_found_ssl_lib=yes],
2211 ac_cv_found_ssl_lib=no)
2215 AC_DEFUN([CMU_LIBSSL_LIB_WHERE], [
2217 AC_MSG_CHECKING(for libssl libraries in $i)
2218 CMU_LIBSSL_LIB_WHERE1($i)
2219 dnl deal with false positives from implicit link paths
2220 CMU_TEST_LIBPATH($i, ssl)
2221 if test "$ac_cv_found_ssl_lib" = "yes" ; then
2222 ac_cv_libssl_where_lib=$i
2223 AC_MSG_RESULT(found)
2226 AC_MSG_RESULT(not found)
2231 AC_DEFUN([CMU_LIBSSL], [
2232 AC_REQUIRE([CMU_FIND_LIB_SUBDIR])
2233 AC_REQUIRE([CMU_SOCKETS])
2235 [ --with-libssl=PREFIX Compile with Libssl support],
2236 [if test "X$with_libssl" = "X"; then
2239 AC_ARG_WITH(libssl-lib,
2240 [ --with-libssl-lib=dir use libssl libraries in dir],
2241 [if test "$withval" = "yes" -o "$withval" = "no"; then
2242 AC_MSG_ERROR([No argument for --with-libssl-lib])
2244 AC_ARG_WITH(libssl-include,
2245 [ --with-libssl-include=dir use libssl headers in dir],
2246 [if test "$withval" = "yes" -o "$withval" = "no"; then
2247 AC_MSG_ERROR([No argument for --with-libssl-include])
2250 if test "X$with_libssl" != "X"; then
2251 if test "$with_libssl" != "yes" -a "$with_libssl" != no; then
2252 ac_cv_libssl_where_lib=$with_libssl/$CMU_LIB_SUBDIR
2253 ac_cv_libssl_where_inc=$with_libssl/include
2257 if test "$with_libssl" != "no"; then
2258 if test "X$with_libssl_lib" != "X"; then
2259 ac_cv_libssl_where_lib=$with_libssl_lib
2261 if test "X$ac_cv_libssl_where_lib" = "X"; then
2262 CMU_LIBSSL_LIB_WHERE(/usr/local/$CMU_LIB_SUBDIR/openssl /usr/$CMU_LIB_SUBDIR/openssl /usr/local/$CMU_LIB_SUBDIR /usr/$CMU_LIB_SUBDIR)
2265 if test "X$with_libssl_include" != "X"; then
2266 ac_cv_libssl_where_inc=$with_libssl_include
2268 if test "X$ac_cv_libssl_where_inc" = "X"; then
2269 CMU_LIBSSL_INC_WHERE(/usr/local/include /usr/include)
2273 AC_MSG_CHECKING(whether to include libssl)
2274 if test "X$ac_cv_libssl_where_lib" = "X" -a "X$ac_cv_libssl_where_inc" = "X"; then
2275 ac_cv_found_libssl=no
2278 ac_cv_found_libssl=yes
2280 LIBSSL_INC_DIR=$ac_cv_libssl_where_inc
2281 LIBSSL_LIB_DIR=$ac_cv_libssl_where_lib
2282 LIBSSL_INC_FLAGS="-I${LIBSSL_INC_DIR}"
2283 LIBSSL_LIB_FLAGS="-L${LIBSSL_LIB_DIR} -lssl -lcrypto"
2284 if test "X$RPATH" = "X"; then
2289 if test "X$RPATH" = "X"; then
2290 RPATH="-Wl,-rpath,${LIBSSL_LIB_DIR}"
2292 RPATH="${RPATH}:${LIBSSL_LIB_DIR}"
2296 if test "X$RPATH" = "X"; then
2297 RPATH="-Wl,+b${LIBSSL_LIB_DIR}"
2299 RPATH="${RPATH}:${LIBSSL_LIB_DIR}"
2303 if test "X$RPATH" = "X"; then
2304 RPATH="-Wl,-rpath,${LIBSSL_LIB_DIR}"
2306 RPATH="${RPATH}:${LIBSSL_LIB_DIR}"
2310 if test "$ac_cv_prog_gcc" = yes; then
2311 if test "X$RPATH" = "X"; then
2312 RPATH="-Wl,-R${LIBSSL_LIB_DIR}"
2314 RPATH="${RPATH}:${LIBSSL_LIB_DIR}"
2317 RPATH="${RPATH} -R${LIBSSL_LIB_DIR}"
2323 AC_SUBST(LIBSSL_INC_DIR)
2324 AC_SUBST(LIBSSL_LIB_DIR)
2325 AC_SUBST(LIBSSL_INC_FLAGS)
2326 AC_SUBST(LIBSSL_LIB_FLAGS)
2330 dnl kerberos_v4.m4--Kerberos 4 libraries and includes
2331 dnl Derrick Brashear
2332 dnl from KTH krb and Arla
2333 dnl $Id: kerberos_v4.m4,v 1.28 2005/04/26 19:14:08 shadow Exp $
2335 AC_DEFUN([CMU_KRB_SENDAUTH_PROTO], [
2336 AC_MSG_CHECKING(for krb_sendauth prototype)
2339 int krb_sendauth (long options, int fd, KTEXT ktext, char *service,
2340 char *inst, char *realm, u_long checksum,
2341 MSG_DAT *msg_data, CREDENTIALS *cred,
2342 Key_schedule schedule, struct sockaddr_in *laddr,
2343 struct sockaddr_in *faddr, char *version);],
2344 [int foo = krb_sendauth(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); ],
2345 ac_cv_krb_sendauth_proto=no,
2346 ac_cv_krb_sendauth_proto=yes)
2347 AC_MSG_RESULT($ac_cv_krb_sendauth_proto)
2348 if test "$ac_cv_krb_sendauth_proto" = yes; then
2349 AC_DEFINE(HAVE_KRB_SENDAUTH_PROTO)dnl
2351 AC_MSG_RESULT($ac_cv_krb_sendauth_proto)
2354 AC_DEFUN([CMU_KRB_SET_KEY_PROTO], [
2355 AC_MSG_CHECKING(for krb_set_key prototype)
2356 AC_CACHE_VAL(ac_cv_krb_set_key_proto, [
2357 cmu_save_CPPFLAGS="$CPPFLAGS"
2358 CPPFLAGS="${CPPFLAGS} ${KRB_INC_FLAGS}"
2361 int krb_set_key(char *key, int cvt);],
2362 [int foo = krb_set_key(0, 0);],
2363 ac_cv_krb_set_key_proto=no,
2364 ac_cv_krb_set_key_proto=yes)
2366 CPPFLAGS="${cmu_save_CPPFLAGS}"
2367 if test "$ac_cv_krb_set_key_proto" = yes; then
2368 AC_DEFINE(HAVE_KRB_SET_KEY_PROTO)dnl
2370 AC_MSG_RESULT($ac_cv_krb_set_key_proto)
2373 AC_DEFUN([CMU_KRB4_32_DEFN], [
2374 AC_MSG_CHECKING(for KRB4_32 definition)
2375 AC_CACHE_VAL(ac_cv_krb4_32_defn, [
2376 cmu_save_CPPFLAGS="$CPPFLAGS"
2377 CPPFLAGS="${CPPFLAGS} ${KRB_INC_FLAGS}"
2382 ac_cv_krb4_32_defn=yes,
2383 ac_cv_krb4_32_defn=no)
2385 CPPFLAGS="${cmu_save_CPPFLAGS}"
2386 if test "$ac_cv_krb4_32_defn" = yes; then
2387 AC_DEFINE(HAVE_KRB4_32_DEFINE)dnl
2389 AC_MSG_RESULT($ac_cv_krb4_32_defn)
2392 AC_DEFUN([CMU_KRB_RD_REQ_PROTO], [
2393 AC_MSG_CHECKING(for krb_rd_req prototype)
2394 AC_CACHE_VAL(ac_cv_krb_rd_req_proto, [
2395 cmu_save_CPPFLAGS="$CPPFLAGS"
2396 CPPFLAGS="${CPPFLAGS} ${KRB_INC_FLAGS}"
2399 int krb_rd_req(KTEXT authent, char *service, char *instance,
2400 unsigned KRB_INT32 from_addr, AUTH_DAT *ad, char *fn);],
2401 [int foo = krb_rd_req(0,0,0,0,0,0);],
2402 ac_cv_krb_rd_req_proto=no,
2403 ac_cv_krb_rd_req_proto=yes)
2405 CPPFLAGS="${cmu_save_CPPFLAGS}"
2406 if test "$ac_cv_krb_rd_req_proto" = yes; then
2407 AC_DEFINE(HAVE_KRB_RD_REQ_PROTO)dnl
2409 AC_MSG_RESULT($ac_cv_krb_rd_req_proto)
2412 AC_DEFUN([CMU_KRB_INC_WHERE1], [
2413 saved_CPPFLAGS=$CPPFLAGS
2414 CPPFLAGS="$saved_CPPFLAGS -I$1"
2415 AC_TRY_COMPILE([#include <krb.h>],
2416 [struct ktext foo;],
2417 ac_cv_found_krb_inc=yes,
2418 ac_cv_found_krb_inc=no)
2419 if test "$ac_cv_found_krb_inc" = "no"; then
2420 CPPFLAGS="$saved_CPPFLAGS -I$1 -I$1/kerberosIV"
2421 AC_TRY_COMPILE([#include <krb.h>],
2422 [struct ktext foo;],
2423 [ac_cv_found_krb_inc=yes],
2424 ac_cv_found_krb_inc=no)
2426 CPPFLAGS=$saved_CPPFLAGS
2429 AC_DEFUN([CMU_KRB_INC_WHERE], [
2431 AC_MSG_CHECKING(for kerberos headers in $i)
2432 CMU_KRB_INC_WHERE1($i)
2433 CMU_TEST_INCPATH($i, krb)
2434 if test "$ac_cv_found_krb_inc" = "yes"; then
2435 ac_cv_krb_where_inc=$i
2436 AC_MSG_RESULT(found)
2439 AC_MSG_RESULT(not found)
2445 # Test for kerberos lib files
2448 AC_DEFUN([CMU_KRB_LIB_WHERE1], [
2450 LIBS="$saved_LIBS -L$1 -lkrb ${KRB_LIBDES}"
2453 [ac_cv_found_krb_lib=yes],
2454 ac_cv_found_krb_lib=no)
2458 AC_DEFUN([CMU_KRB_LIB_WHERE], [
2460 AC_MSG_CHECKING(for kerberos libraries in $i)
2461 CMU_KRB_LIB_WHERE1($i)
2462 dnl deal with false positives from implicit link paths
2463 CMU_TEST_LIBPATH($i, krb)
2464 if test "$ac_cv_found_krb_lib" = "yes" ; then
2465 ac_cv_krb_where_lib=$i
2466 AC_MSG_RESULT(found)
2469 AC_MSG_RESULT(not found)
2474 AC_DEFUN([CMU_KRB4], [
2475 AC_REQUIRE([CMU_FIND_LIB_SUBDIR])
2476 AC_REQUIRE([CMU_SOCKETS])
2477 AC_REQUIRE([CMU_LIBSSL])
2479 [ --with-krb4=PREFIX Compile with Kerberos 4 support],
2480 [if test "X$with_krb4" = "X"; then
2483 AC_ARG_WITH(krb4-lib,
2484 [ --with-krb4-lib=dir use kerberos 4 libraries in dir],
2485 [if test "$withval" = "yes" -o "$withval" = "no"; then
2486 AC_MSG_ERROR([No argument for --with-krb4-lib])
2488 AC_ARG_WITH(krb4-include,
2489 [ --with-krb4-include=dir use kerberos 4 headers in dir],
2490 [if test "$withval" = "yes" -o "$withval" = "no"; then
2491 AC_MSG_ERROR([No argument for --with-krb4-include])
2494 if test "X$with_krb4" != "X"; then
2495 if test "$with_krb4" != "yes" -a "$with_krb4" != "no"; then
2496 ac_cv_krb_where_lib=$with_krb4/$CMU_LIB_SUBDIR
2497 ac_cv_krb_where_inc=$with_krb4/include
2501 if test "$with_krb4" != "no"; then
2502 if test "X$with_krb4_lib" != "X"; then
2503 ac_cv_krb_where_lib=$with_krb4_lib
2505 if test "X$with_krb4_include" != "X"; then
2506 ac_cv_krb_where_inc=$with_krb4_include
2508 if test "X$ac_cv_krb_where_inc" = "X"; then
2509 CMU_KRB_INC_WHERE(/usr/athena/include /usr/include/kerberosIV /usr/local/include /usr/include/kerberos)
2512 AC_MSG_CHECKING([if libdes is needed])
2513 AC_TRY_LINK([],[des_quad_cksum();],KRB_DES_LIB="",KRB_DES_LIB="maybe")
2514 if test "X$KRB_DES_LIB" != "X"; then
2515 LIBS="$cmu_save_LIBS -ldes"
2516 AC_TRY_LINK([], [des_quad_cksum();],KRB_DES_LIB="yes")
2517 if test "X$KRB_DES_LIB" = "Xyes"; then
2518 AC_MSG_RESULT([yes])
2520 KRB_LIBDESA='$(KRB_LIB_DIR)/libdes.a'
2522 LIBS="$cmu_save_LIBS $LIBSSL_LIB_FLAGS"
2524 [des_quad_cksum();],KRB_DES_LIB="libcrypto")
2525 if test "X$KRB_DES_LIB" = "Xlibcrypto"; then
2526 AC_MSG_RESULT([libcrypto])
2527 KRB_LIBDES="$LIBSSL_LIB_FLAGS"
2528 KRB_LIBDESA="$LIBSSL_LIB_FLAGS"
2530 LIBS="$cmu_save_LIBS -L$LIBSSL_LIB_DIR -ldescompat $LIBSSL_LIB_FLAGS"
2532 [des_quad_cksum();],KRB_DES_LIB="libcrypto+descompat")
2533 if test "X$KRB_DES_LIB" = "Xlibcrypto+descompat"; then
2534 AC_MSG_RESULT([libcrypto+descompat])
2535 KRB_LIBDES="-L$LIBSSL_LIB_DIR -ldescompat $LIBSSL_LIB_FLAGS"
2536 KRB_LIBDESA="-L$LIBSSL_LIB_DIR -ldescompat $LIBSSL_LIB_FLAGS"
2538 AC_MSG_RESULT([unknown])
2539 AC_MSG_ERROR([Could not use -ldes])
2546 if test "X$ac_cv_krb_where_lib" = "X"; then
2547 CMU_KRB_LIB_WHERE(/usr/athena/$CMU_LIB_SUBDIR /usr/local/$CMU_LIB_SUBDIR /usr/$CMU_LIB_SUBDIR)
2550 LIBS="${cmu_save_LIBS}"
2553 AC_MSG_CHECKING([whether to include kerberos 4])
2554 if test "X$ac_cv_krb_where_lib" = "X" -o "X$ac_cv_krb_where_inc" = "X"; then
2560 KRB_INC_DIR=$ac_cv_krb_where_inc
2561 KRB_LIB_DIR=$ac_cv_krb_where_lib
2562 KRB_INC_FLAGS="-I${KRB_INC_DIR}"
2563 KRB_LIB_FLAGS="-L${KRB_LIB_DIR} -lkrb ${KRB_LIBDES}"
2564 LIBS="${cmu_save_LIBS} ${KRB_LIB_FLAGS}"
2565 AC_CHECK_LIB(resolv, dns_lookup, KRB_LIB_FLAGS="${KRB_LIB_FLAGS} -lresolv",,"${KRB_LIB_FLAGS}")
2566 AC_CHECK_LIB(crypt, crypt, KRB_LIB_FLAGS="${KRB_LIB_FLAGS} -lcrypt",,"${KRB_LIB_FLAGS}")
2567 LIBS="${LIBS} ${KRB_LIB_FLAGS}"
2568 AC_CHECK_FUNCS(krb_get_int krb_life_to_time)
2569 AC_SUBST(KRB_INC_FLAGS)
2570 AC_SUBST(KRB_LIB_FLAGS)
2571 LIBS="${cmu_save_LIBS}"
2572 AC_DEFINE(HAVE_KRB4,,[Kerberos V4 is present])dnl zephyr uses this
2573 AC_DEFINE(KERBEROS,,[Use kerberos 4. find out what needs this symbol])
2574 if test "X$RPATH" = "X"; then
2579 if test "X$RPATH" = "X"; then
2580 RPATH="-Wl,-rpath,${KRB_LIB_DIR}"
2582 RPATH="${RPATH}:${KRB_LIB_DIR}"
2586 if test "X$RPATH" = "X"; then
2587 RPATH="-Wl,+b${KRB_LIB_DIR}"
2589 RPATH="${RPATH}:${KRB_LIB_DIR}"
2593 if test "X$RPATH" = "X"; then
2594 RPATH="-Wl,-rpath,${KRB_LIB_DIR}"
2596 RPATH="${RPATH}:${KRB_LIB_DIR}"
2600 if test "$ac_cv_prog_gcc" = yes; then
2601 if test "X$RPATH" = "X"; then
2602 RPATH="-Wl,-R${KRB_LIB_DIR}"
2604 RPATH="${RPATH}:${KRB_LIB_DIR}"
2607 RPATH="${RPATH} -R${KRB_LIB_DIR}"
2617 dnl macros for configure.in to detect openssl
2618 dnl $Id: openssl.m4,v 1.11 2006/05/17 18:30:19 murch Exp $
2621 AC_DEFUN([CMU_HAVE_OPENSSL], [
2622 AC_REQUIRE([CMU_FIND_LIB_SUBDIR])
2623 AC_ARG_WITH(openssl,[ --with-openssl=PATH use OpenSSL from PATH],
2624 with_openssl=$withval, with_openssl="yes")
2626 save_CPPFLAGS=$CPPFLAGS
2627 save_LDFLAGS=$LDFLAGS
2629 if test -d $with_openssl; then
2630 CPPFLAGS="${CPPFLAGS} -I${with_openssl}/include"
2631 CMU_ADD_LIBPATH(${with_openssl}/$CMU_LIB_SUBDIR)
2634 case "$with_openssl" in
2638 dnl if openssl has been compiled with the rsaref2 libraries,
2639 dnl we need to include the rsaref libraries in the crypto check
2641 AC_CHECK_LIB(rsaref, RSAPublicEncrypt,
2642 cmu_have_rsaref=yes;
2643 [AC_CHECK_LIB(RSAglue, RSAPublicEncrypt,
2644 LIB_RSAREF="-lRSAglue -lrsaref",
2645 LIB_RSAREF="-lrsaref")],
2648 AC_CHECK_HEADER(openssl/evp.h, [
2649 AC_CHECK_LIB(crypto, EVP_DigestInit,
2651 with_openssl="no", $LIB_RSAREF)],
2656 if test "$with_openssl" != "no"; then
2657 AC_DEFINE(HAVE_OPENSSL,[],[Do we have OpenSSL?])
2659 CPPFLAGS=$save_CPPFLAGS
2660 LDFLAGS=$save_LDFLAGS
2664 dnl checking for kerberos 4 libraries (and DES)
2666 AC_DEFUN([SASL_DES_CHK], [
2667 AC_ARG_WITH(des, [ --with-des=DIR with DES (look in DIR) [yes] ],
2672 if test "$with_des" != no; then
2673 if test -d $with_des; then
2674 CPPFLAGS="$CPPFLAGS -I${with_des}/include"
2675 LDFLAGS="$LDFLAGS -L${with_des}/lib"
2678 if test "$with_openssl" != no; then
2679 dnl check for openssl installing -lcrypto, then make vanilla check
2680 AC_CHECK_LIB(crypto, des_cbc_encrypt, [
2681 AC_CHECK_HEADER(openssl/des.h, [AC_DEFINE(WITH_SSL_DES,[],[Use OpenSSL DES Implementation])
2685 with_des=no, $LIB_RSAREF)
2687 dnl same test again, different symbol name
2688 if test "$with_des" = no; then
2689 AC_CHECK_LIB(crypto, DES_cbc_encrypt, [
2690 AC_CHECK_HEADER(openssl/des.h, [AC_DEFINE(WITH_SSL_DES,[],[Use OpenSSL DES Implementation])
2694 with_des=no, $LIB_RSAREF)
2698 if test "$with_des" = no; then
2699 AC_CHECK_LIB(des, des_cbc_encrypt, [LIB_DES="-ldes";
2700 with_des=yes], with_des=no)
2703 if test "$with_des" = no; then
2704 AC_CHECK_LIB(des425, des_cbc_encrypt, [LIB_DES="-ldes425";
2705 with_des=yes], with_des=no)
2708 if test "$with_des" = no; then
2709 AC_CHECK_LIB(des524, des_cbc_encrypt, [LIB_DES="-ldes524";
2710 with_des=yes], with_des=no)
2713 if test "$with_des" = no; then
2714 dnl if openssl is around, we might be able to use that for des
2716 dnl if openssl has been compiled with the rsaref2 libraries,
2717 dnl we need to include the rsaref libraries in the crypto check
2719 AC_CHECK_LIB(rsaref, RSAPublicEncrypt,
2720 LIB_RSAREF="-lRSAglue -lrsaref"; cmu_have_rsaref=yes,
2723 AC_CHECK_LIB(crypto, des_cbc_encrypt, [
2724 AC_CHECK_HEADER(openssl/des.h, [AC_DEFINE(WITH_SSL_DES,[],[Use OpenSSL DES Implementation])
2728 with_des=no, $LIB_RSAREF)
2732 if test "$with_des" != no; then
2733 AC_DEFINE(WITH_DES,[],[Use DES])
2739 AC_DEFUN([SASL_KERBEROS_V4_CHK], [
2740 AC_REQUIRE([SASL_DES_CHK])
2742 AC_ARG_ENABLE(krb4, [ --enable-krb4 enable KERBEROS_V4 authentication [[no]] ],
2746 if test "$krb4" != no; then
2747 dnl In order to compile kerberos4, we need libkrb and libdes.
2748 dnl (We've already gotten libdes from SASL_DES_CHK)
2749 dnl we might need -lresolv for kerberos
2750 AC_CHECK_LIB(resolv,res_search)
2752 dnl if we were ambitious, we would look more aggressively for the
2754 if test -d ${krb4}; then
2755 AC_CACHE_CHECK(for Kerberos includes, cyrus_krbinclude, [
2756 for krbhloc in include/kerberosIV include/kerberos include
2758 if test -f ${krb4}/${krbhloc}/krb.h ; then
2759 cyrus_krbinclude=${krb4}/${krbhloc}
2765 if test -n "${cyrus_krbinclude}"; then
2766 CPPFLAGS="$CPPFLAGS -I${cyrus_krbinclude}"
2768 LDFLAGS="$LDFLAGS -L$krb4/lib"
2771 if test "$with_des" != no; then
2772 AC_CHECK_HEADER(krb.h, [
2773 AC_CHECK_LIB(com_err, com_err, [
2774 AC_CHECK_LIB(krb, krb_mk_priv,
2775 [COM_ERR="-lcom_err"; SASL_KRB_LIB="-lkrb"; krb4lib="yes"],
2776 krb4lib=no, $LIB_DES -lcom_err)], [
2777 AC_CHECK_LIB(krb, krb_mk_priv,
2778 [COM_ERR=""; SASL_KRB_LIB="-lkrb"; krb4lib="yes"],
2779 krb4lib=no, $LIB_DES)])], krb4="no")
2781 if test "$krb4" != "no" -a "$krb4lib" = "no"; then
2782 AC_CHECK_LIB(krb4, krb_mk_priv,
2783 [COM_ERR=""; SASL_KRB_LIB="-lkrb4"; krb4=yes],
2786 if test "$krb4" = no; then
2787 AC_WARN(No Kerberos V4 found)
2790 AC_WARN(No DES library found for Kerberos V4 support)
2795 if test "$krb4" != no; then
2796 cmu_save_LIBS="$LIBS"
2797 LIBS="$LIBS $SASL_KRB_LIB"
2798 AC_CHECK_FUNCS(krb_get_err_text)
2799 LIBS="$cmu_save_LIBS"
2802 AC_MSG_CHECKING(KERBEROS_V4)
2803 if test "$krb4" != no; then
2804 AC_MSG_RESULT(enabled)
2805 SASL_MECHS="$SASL_MECHS libkerberos4.la"
2806 SASL_STATIC_SRCS="$SASL_STATIC_SRCS ../plugins/kerberos4.c"
2807 SASL_STATIC_OBJS="$SASL_STATIC_OBJS kerberos4.o"
2808 AC_DEFINE(STATIC_KERBEROS4,[],[User KERBEROS_V4 Staticly])
2809 AC_DEFINE(HAVE_KRB,[],[Do we have Kerberos 4 Support?])
2810 SASL_KRB_LIB="$SASL_KRB_LIB $LIB_DES $COM_ERR"
2812 AC_MSG_RESULT(disabled)
2814 AC_SUBST(SASL_KRB_LIB)
2818 # sasl2.m4--sasl2 libraries and includes
2820 # $Id: sasl2.m4,v 1.52 2006/05/18 19:25:00 murch Exp $
2824 AC_DEFUN([SASL_GSSAPI_CHK],
2825 [AC_REQUIRE([SASL2_CRYPT_CHK])
2826 AC_REQUIRE([CMU_SOCKETS])
2827 AC_ARG_ENABLE([gssapi],
2828 [AC_HELP_STRING([--enable-gssapi=<DIR>],
2829 [enable GSSAPI authentication [yes]])],
2830 [gssapi=$enableval],
2832 AC_ARG_WITH([gss_impl],
2833 [AC_HELP_STRING([--with-gss_impl={heimdal|mit|cybersafe|seam|auto}],
2834 [choose specific GSSAPI implementation [[auto]]])],
2835 [gss_impl=$withval],
2838 if test "$gssapi" != no; then
2851 # When should we use __sunos?
2858 AC_WARN([The system type is not recognized. If you believe that CyberSafe GSSAPI works on this platform, please update the configure script])
2859 if test "$gss_impl" = "cybersafe"; then
2860 AC_ERROR([CyberSafe was forced, cannot continue as platform is not supported])
2865 cmu_saved_CPPFLAGS=$CPPFLAGS
2867 if test -d ${gssapi}; then
2868 CPPFLAGS="$CPPFLAGS -I$gssapi/include"
2869 # We want to keep -I in our CPPFLAGS, but only if we succeed
2870 cmu_saved_CPPFLAGS=$CPPFLAGS
2871 LDFLAGS="$LDFLAGS -L$gssapi/lib"
2873 if test -n "$platform"; then
2874 if test "$gss_impl" = "auto" -o "$gss_impl" = "cybersafe"; then
2875 CPPFLAGS="$CPPFLAGS -D$platform"
2876 if test -d "${gssapi}/appsec-sdk/include"; then
2877 CPPFLAGS="$CPPFLAGS -I${gssapi}/appsec-sdk/include"
2882 AC_CHECK_HEADER([gssapi.h],
2883 [AC_DEFINE(HAVE_GSSAPI_H,,
2884 [Define if you have the gssapi.h header file])],
2885 [AC_CHECK_HEADER([gssapi/gssapi.h],,
2886 [AC_WARN([Disabling GSSAPI - no include files found]); gssapi=no])])
2888 CPPFLAGS=$cmu_saved_CPPFLAGS
2892 if test "$gssapi" != no; then
2893 # We need to find out which gssapi implementation we are
2894 # using. Supported alternatives are: MIT Kerberos 5,
2895 # Heimdal Kerberos 5 (http://www.pdc.kth.se/heimdal),
2896 # CyberSafe Kerberos 5 (http://www.cybersafe.com/)
2897 # and Sun SEAM (http://wwws.sun.com/software/security/kerberos/)
2899 # The choice is reflected in GSSAPIBASE_LIBS
2901 AC_CHECK_LIB(resolv,res_search)
2902 if test -d ${gssapi}; then
2903 gssapi_dir="${gssapi}/lib"
2904 GSSAPIBASE_LIBS="-L$gssapi_dir"
2905 GSSAPIBASE_STATIC_LIBS="-L$gssapi_dir"
2907 # FIXME: This is only used for building cyrus, and then only as
2908 # a real hack. it needs to be fixed.
2909 gssapi_dir="/usr/local/lib"
2912 # Check a full link against the Heimdal libraries.
2913 # If this fails, check a full link against the MIT libraries.
2914 # If this fails, check a full link against the CyberSafe libraries.
2915 # If this fails, check a full link against the Solaris 8 and up libgss.
2917 if test "$gss_impl" = "auto" -o "$gss_impl" = "heimdal"; then
2919 AC_CHECK_LIB(gssapi,gss_unwrap,gss_impl="heimdal",gss_failed=1,
2920 ${GSSAPIBASE_LIBS} -lgssapi -lkrb5 -lasn1 -lroken ${LIB_CRYPT} ${LIB_DES} -lcom_err ${LIB_SOCKET})
2921 if test "$gss_impl" != "auto" -a "$gss_failed" = "1"; then
2926 if test "$gss_impl" = "auto" -o "$gss_impl" = "mit"; then
2927 # check for libkrb5support first
2928 AC_CHECK_LIB(krb5support,krb5int_getspecific,K5SUP=-lkrb5support K5SUPSTATIC=$gssapi_dir/libkrb5support.a,,${LIB_SOCKET})
2931 AC_CHECK_LIB(gssapi_krb5,gss_unwrap,gss_impl="mit",gss_failed=1,
2932 ${GSSAPIBASE_LIBS} -lgssapi_krb5 -lkrb5 -lk5crypto -lcom_err ${K5SUP} ${LIB_SOCKET})
2933 if test "$gss_impl" != "auto" -a "$gss_failed" = "1"; then
2938 # For Cybersafe one has to set a platform define in order to make compilation work
2939 if test "$gss_impl" = "auto" -o "$gss_impl" = "cybersafe"; then
2941 cmu_saved_CPPFLAGS=$CPPFLAGS
2942 cmu_saved_GSSAPIBASE_LIBS=$GSSAPIBASE_LIBS
2943 # FIXME - Note that the libraries are in .../lib64 for 64bit kernels
2944 if test -d "${gssapi}/appsec-rt/lib"; then
2945 GSSAPIBASE_LIBS="$GSSAPIBASE_LIBS -L${gssapi}/appsec-rt/lib"
2947 CPPFLAGS="$CPPFLAGS -D$platform"
2948 if test -d "${gssapi}/appsec-sdk/include"; then
2949 CPPFLAGS="$CPPFLAGS -I${gssapi}/appsec-sdk/include"
2954 # Check for CyberSafe with two libraries first, than fall back to a single
2955 # library (older CyberSafe)
2957 unset ac_cv_lib_gss_csf_gss_acq_user
2958 AC_CHECK_LIB(gss,csf_gss_acq_user,gss_impl="cybersafe03",
2959 [unset ac_cv_lib_gss_csf_gss_acq_user;
2960 AC_CHECK_LIB(gss,csf_gss_acq_user,gss_impl="cybersafe",
2961 gss_failed=1,$GSSAPIBASE_LIBS -lgss)],
2962 [${GSSAPIBASE_LIBS} -lgss -lcstbk5])
2964 if test "$gss_failed" = "1"; then
2966 GSSAPIBASE_LIBS=$cmu_saved_GSSAPIBASE_LIBS
2967 CPPFLAGS=$cmu_saved_CPPFLAGS
2969 if test "$gss_impl" != "auto"; then
2975 if test "$gss_impl" = "auto" -o "$gss_impl" = "seam"; then
2977 AC_CHECK_LIB(gss,gss_unwrap,gss_impl="seam",gss_failed=1,-lgss)
2978 if test "$gss_impl" != "auto" -a "$gss_failed" = "1"; then
2983 if test "$gss_impl" = "mit"; then
2984 GSSAPIBASE_LIBS="$GSSAPIBASE_LIBS -lgssapi_krb5 -lkrb5 -lk5crypto -lcom_err ${K5SUP}"
2985 GSSAPIBASE_STATIC_LIBS="$GSSAPIBASE_LIBS $gssapi_dir/libgssapi_krb5.a $gssapi_dir/libkrb5.a $gssapi_dir/libk5crypto.a $gssapi_dir/libcom_err.a ${K5SUPSTATIC}"
2986 elif test "$gss_impl" = "heimdal"; then
2987 CPPFLAGS="$CPPFLAGS -DKRB5_HEIMDAL"
2988 GSSAPIBASE_LIBS="$GSSAPIBASE_LIBS -lgssapi -lkrb5 -lasn1 -lroken ${LIB_CRYPT} ${LIB_DES} -lcom_err"
2989 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}"
2990 elif test "$gss_impl" = "cybersafe03"; then
2991 # Version of CyberSafe with two libraries
2992 CPPFLAGS="$CPPFLAGS -D$platform -I${gssapi}/appsec-sdk/include"
2993 GSSAPIBASE_LIBS="$GSSAPIBASE_LIBS -lgss -lcstbk5"
2994 # there is no static libgss for CyberSafe
2995 GSSAPIBASE_STATIC_LIBS=none
2996 elif test "$gss_impl" = "cybersafe"; then
2997 CPPFLAGS="$CPPFLAGS -D$platform -I${gssapi}/appsec-sdk/include"
2998 GSSAPIBASE_LIBS="$GSSAPIBASE_LIBS -lgss"
2999 # there is no static libgss for CyberSafe
3000 GSSAPIBASE_STATIC_LIBS=none
3001 elif test "$gss_impl" = "seam"; then
3002 GSSAPIBASE_LIBS=-lgss
3003 # there is no static libgss on Solaris 8 and up
3004 GSSAPIBASE_STATIC_LIBS=none
3005 elif test "$gss_impl" = "failed"; then
3008 GSSAPIBASE_STATIC_LIBS=
3009 AC_WARN([Disabling GSSAPI - specified library not found])
3013 GSSAPIBASE_STATIC_LIBS=
3014 AC_WARN([Disabling GSSAPI - no library])
3019 # Cybersafe defines both GSS_C_NT_HOSTBASED_SERVICE and GSS_C_NT_USER_NAME
3020 # in gssapi\rfckrb5.h
3022 if test "$gssapi" != "no"; then
3023 if test "$gss_impl" = "cybersafe" -o "$gss_impl" = "cybersafe03"; then
3024 AC_EGREP_CPP(hostbased_service_gss_nt_yes,
3025 [#include <gssapi/gssapi.h>
3026 #ifdef GSS_C_NT_HOSTBASED_SERVICE
3027 hostbased_service_gss_nt_yes
3029 [AC_DEFINE(HAVE_GSS_C_NT_HOSTBASED_SERVICE,,
3030 [Define if your GSSAPI implimentation defines GSS_C_NT_HOSTBASED_SERVICE])],
3031 [AC_WARN([Cybersafe define not found])])
3033 elif test "$ac_cv_header_gssapi_h" = "yes"; then
3034 AC_EGREP_HEADER(GSS_C_NT_HOSTBASED_SERVICE, gssapi.h,
3035 [AC_DEFINE(HAVE_GSS_C_NT_HOSTBASED_SERVICE,,
3036 [Define if your GSSAPI implimentation defines GSS_C_NT_HOSTBASED_SERVICE])])
3037 elif test "$ac_cv_header_gssapi_gssapi_h"; then
3038 AC_EGREP_HEADER(GSS_C_NT_HOSTBASED_SERVICE, gssapi/gssapi.h,
3039 [AC_DEFINE(HAVE_GSS_C_NT_HOSTBASED_SERVICE,,
3040 [Define if your GSSAPI implimentation defines GSS_C_NT_HOSTBASED_SERVICE])])
3043 if test "$gss_impl" = "cybersafe" -o "$gss_impl" = "cybersafe03"; then
3044 AC_EGREP_CPP(user_name_yes_gss_nt,
3045 [#include <gssapi/gssapi.h>
3046 #ifdef GSS_C_NT_USER_NAME
3047 user_name_yes_gss_nt
3049 [AC_DEFINE(HAVE_GSS_C_NT_USER_NAME,,
3050 [Define if your GSSAPI implimentation defines GSS_C_NT_USER_NAME])],
3051 [AC_WARN([Cybersafe define not found])])
3052 elif test "$ac_cv_header_gssapi_h" = "yes"; then
3053 AC_EGREP_HEADER(GSS_C_NT_USER_NAME, gssapi.h,
3054 [AC_DEFINE(HAVE_GSS_C_NT_USER_NAME,,
3055 [Define if your GSSAPI implimentation defines GSS_C_NT_USER_NAME])])
3056 elif test "$ac_cv_header_gssapi_gssapi_h"; then
3057 AC_EGREP_HEADER(GSS_C_NT_USER_NAME, gssapi/gssapi.h,
3058 [AC_DEFINE(HAVE_GSS_C_NT_USER_NAME,,
3059 [Define if your GSSAPI implimentation defines GSS_C_NT_USER_NAME])])
3064 AC_MSG_CHECKING([GSSAPI])
3065 if test "$gssapi" != no; then
3066 AC_MSG_RESULT([with implementation ${gss_impl}])
3067 AC_CHECK_LIB(resolv,res_search,GSSAPIBASE_LIBS="$GSSAPIBASE_LIBS -lresolv")
3068 SASL_MECHS="$SASL_MECHS libgssapiv2.la"
3069 SASL_STATIC_OBJS="$SASL_STATIC_OBJS gssapi.o"
3070 SASL_STATIC_SRCS="$SASL_STATIC_SRCS ../plugins/gssapi.c"
3072 cmu_save_LIBS="$LIBS"
3073 LIBS="$LIBS $GSSAPIBASE_LIBS"
3074 AC_CHECK_FUNCS(gsskrb5_register_acceptor_identity)
3075 LIBS="$cmu_save_LIBS"
3077 AC_MSG_RESULT([disabled])
3079 AC_SUBST(GSSAPI_LIBS)
3080 AC_SUBST(GSSAPIBASE_LIBS)
3084 # SASL_SET_GSSAPI_LIBS
3085 # --------------------
3086 AC_DEFUN([SASL_SET_GSSAPI_LIBS],
3087 [SASL_GSSAPI_LIBS_SET="yes"
3093 # What we want to do here is setup LIB_SASL with what one would
3094 # generally want to have (e.g. if static is requested, make it that,
3095 # otherwise make it dynamic.
3097 # We also want to create LIB_DYN_SASL and DYNSASLFLAGS.
3099 # Also sets using_static_sasl to "no" "static" or "staticonly"
3101 AC_DEFUN([CMU_SASL2],
3102 [AC_REQUIRE([SASL_GSSAPI_CHK])
3105 [AC_HELP_STRING([--with-sasl=DIR],[Compile with libsasl2 in <DIR>])],
3106 with_sasl="$withval",
3109 AC_ARG_WITH(staticsasl,
3110 [AC_HELP_STRING([--with-staticsasl=DIR],
3111 [Compile with staticly linked libsasl2 in <DIR>])],
3112 [with_staticsasl="$withval";
3113 if test $with_staticsasl != "no"; then
3114 using_static_sasl="static"
3116 [with_staticsasl="no"; using_static_sasl="no"])
3121 cmu_saved_CPPFLAGS=$CPPFLAGS
3122 cmu_saved_LDFLAGS=$LDFLAGS
3123 cmu_saved_LIBS=$LIBS
3125 if test ${with_staticsasl} != "no"; then
3126 if test -d ${with_staticsasl}; then
3127 if test -d ${with_staticsasl}/lib64 ; then
3128 ac_cv_sasl_where_lib=${with_staticsasl}/lib64
3130 ac_cv_sasl_where_lib=${with_staticsasl}/lib
3132 ac_cv_sasl_where_lib=${with_staticsasl}/lib
3133 ac_cv_sasl_where_inc=${with_staticsasl}/include
3135 SASLFLAGS="-I$ac_cv_sasl_where_inc"
3136 LIB_SASL="-L$ac_cv_sasl_where_lib"
3137 CPPFLAGS="${cmu_saved_CPPFLAGS} -I${ac_cv_sasl_where_inc}"
3138 LDFLAGS="${cmu_saved_LDFLAGS} -L${ac_cv_sasl_where_lib}"
3140 with_staticsasl="/usr"
3143 AC_CHECK_HEADER(sasl/sasl.h,
3144 [AC_CHECK_HEADER(sasl/saslutil.h,
3145 [for i42 in lib64 lib; do
3146 if test -r ${with_staticsasl}/$i42/libsasl2.a; then
3147 ac_cv_found_sasl=yes
3148 AC_MSG_CHECKING([for static libsasl])
3149 LIB_SASL="$LIB_SASL ${with_staticsasl}/$i42/libsasl2.a"
3152 if test ! "$ac_cv_found_sasl" = "yes"; then
3153 AC_MSG_CHECKING([for static libsasl])
3154 AC_ERROR([Could not find ${with_staticsasl}/lib*/libsasl2.a])
3157 AC_MSG_RESULT([found])
3159 if test "x$SASL_GSSAPI_LIBS_SET" = "x"; then
3160 LIB_SASL="$LIB_SASL $GSSAPIBASE_STATIC_LIBS"
3162 SASL_GSSAPI_LIBS_SET=""
3163 cmu_saved_LIBS="$GSSAPIBASE_STATIC_LIBS $cmu_saved_LIBS"
3167 if test -d ${with_sasl}; then
3168 ac_cv_sasl_where_lib=${with_sasl}/lib
3169 ac_cv_sasl_where_inc=${with_sasl}/include
3171 DYNSASLFLAGS="-I$ac_cv_sasl_where_inc"
3172 if test "$ac_cv_sasl_where_lib" != ""; then
3173 CMU_ADD_LIBPATH_TO($ac_cv_sasl_where_lib, LIB_DYN_SASL)
3175 LIB_DYN_SASL="$LIB_DYN_SASL -lsasl2"
3176 CPPFLAGS="${cmu_saved_CPPFLAGS} -I${ac_cv_sasl_where_inc}"
3177 LDFLAGS="${cmu_saved_LDFLAGS} -L${ac_cv_sasl_where_lib}"
3180 # be sure to check for a SASLv2 specific function
3181 AC_CHECK_HEADER(sasl/sasl.h,
3182 [AC_CHECK_HEADER(sasl/saslutil.h,
3183 [AC_CHECK_LIB(sasl2, prop_get,
3184 ac_cv_found_sasl=yes,
3185 ac_cv_found_sasl=no)],
3186 ac_cv_found_sasl=no)],
3187 ac_cv_found_sasl=no)
3189 if test "$ac_cv_found_sasl" = "yes"; then
3190 if test "$ac_cv_sasl_where_lib" != ""; then
3191 CMU_ADD_LIBPATH_TO($ac_cv_sasl_where_lib, DYNLIB_SASL)
3193 DYNLIB_SASL="$DYNLIB_SASL -lsasl2"
3194 if test "$using_static_sasl" != "static"; then
3195 LIB_SASL=$DYNLIB_SASL
3196 SASLFLAGS=$DYNSASLFLAGS
3201 using_static_sasl="staticonly"
3204 if test "x$SASL_GSSAPI_LIBS_SET" != "x"; then
3205 SASL_GSSAPI_LIBS_SET=""
3206 cmu_saved_LIBS="$GSSAPIBASE_LIBS $cmu_saved_LIBS"
3209 LIBS="$cmu_saved_LIBS"
3210 LDFLAGS="$cmu_saved_LDFLAGS"
3211 CPPFLAGS="$cmu_saved_CPPFLAGS"
3213 AC_SUBST(LIB_DYN_SASL)
3214 AC_SUBST(DYNSASLFLAGS)
3220 # CMU_SASL2_REQUIRED
3221 # ------------------
3222 AC_DEFUN([CMU_SASL2_REQUIRED],
3223 [AC_REQUIRE([CMU_SASL2])
3224 if test "$ac_cv_found_sasl" != "yes"; then
3225 AC_ERROR([Cannot continue without libsasl2.
3226 Get it from ftp://ftp.andrew.cmu.edu/pub/cyrus-mail/.])
3230 # CMU_SASL2_REQUIRE_VER
3231 # ---------------------
3232 AC_DEFUN([CMU_SASL2_REQUIRE_VER],
3233 [AC_REQUIRE([CMU_SASL2_REQUIRED])
3235 cmu_saved_CPPFLAGS=$CPPFLAGS
3236 CPPFLAGS="$CPPFLAGS $SASLFLAGS"
3239 #include <sasl/sasl.h>
3241 #ifndef SASL_VERSION_MAJOR
3242 #error SASL_VERSION_MAJOR not defined
3244 #ifndef SASL_VERSION_MINOR
3245 #error SASL_VERSION_MINOR not defined
3247 #ifndef SASL_VERSION_STEP
3248 #error SASL_VERSION_STEP not defined
3251 #if SASL_VERSION_MAJOR < $1 || SASL_VERSION_MINOR < $2 || SASL_VERSION_STEP < $3
3252 #error SASL version is less than $1.$2.$3
3255 [AC_ERROR([Incorrect SASL headers found. This package requires SASL $1.$2.$3 or newer.])])
3257 CPPFLAGS=$cmu_saved_CPPFLAGS
3258 ])# CMU_SASL2_REQUIRE_VER
3261 # CMU_SASL2_CHECKAPOP_REQUIRED
3262 # ----------------------------
3263 AC_DEFUN([CMU_SASL2_CHECKAPOP_REQUIRED],
3264 [AC_REQUIRE([CMU_SASL2_REQUIRED])
3266 cmu_saved_LDFLAGS=$LDFLAGS
3268 LDFLAGS="$LDFLAGS $LIB_SASL"
3270 AC_CHECK_LIB(sasl2, sasl_checkapop,
3271 [AC_DEFINE(HAVE_APOP,[],[Does SASL support APOP?])],
3272 [AC_MSG_ERROR([libsasl2 without working sasl_checkapop. Cannot continue.])])
3274 LDFLAGS=$cmu_saved_LDFLAGS
3275 ])# CMU_SASL2_CHECKAPOP_REQUIRED
3280 AC_DEFUN([SASL2_CRYPT_CHK],
3281 [AC_CHECK_FUNC(crypt, cmu_have_crypt=yes,
3282 [AC_CHECK_LIB(crypt, crypt,
3283 LIB_CRYPT="-lcrypt"; cmu_have_crypt=yes,
3284 cmu_have_crypt=no)])
3288 dnl Check for PLAIN (and therefore crypt)
3290 AC_DEFUN([SASL_PLAIN_CHK],[
3291 AC_REQUIRE([SASL2_CRYPT_CHK])
3294 AC_ARG_ENABLE(plain, [ --enable-plain enable PLAIN authentication [yes] ],
3299 if test "$plain" != no; then
3300 dnl In order to compile plain, we need crypt.
3301 if test "$cmu_have_crypt" = yes; then
3302 PLAIN_LIBS=$LIB_CRYPT
3305 AC_SUBST(PLAIN_LIBS)
3307 AC_MSG_CHECKING(PLAIN)
3308 if test "$plain" != no; then
3309 AC_MSG_RESULT(enabled)
3310 SASL_MECHS="$SASL_MECHS libplain.la"
3311 if test "$enable_static" = yes; then
3312 SASL_STATIC_OBJS="$SASL_STATIC_OBJS plain.o"
3313 SASL_STATIC_SRCS="$SASL_STATIC_SRCS ../plugins/plain.c"
3314 AC_DEFINE(STATIC_PLAIN,[],[Link PLAIN Staticly])
3317 AC_MSG_RESULT(disabled)
3322 dnl macros for configure.in to detect openldap
3323 dnl $Id: openldap.m4,v 1.2 2006/03/13 19:16:11 mel Exp $
3327 dnl Check for OpenLDAP version compatility
3328 AC_DEFUN([CMU_OPENLDAP_API],
3329 [AC_CACHE_CHECK([OpenLDAP api], [cmu_cv_openldap_api],[
3330 AC_EGREP_CPP(__openldap_api,[
3333 #ifdef LDAP_API_FEATURE_X_OPENLDAP
3334 char *__openldap_api = LDAP_API_FEATURE_X_OPENLDAP;
3336 ], [cmu_cv_openldap_api=yes], [cmu_cv_openldap_api=no])])
3340 dnl Check for OpenLDAP version compatility
3341 AC_DEFUN([CMU_OPENLDAP_COMPAT],
3342 [AC_CACHE_CHECK([OpenLDAP version], [cmu_cv_openldap_compat],[
3343 AC_EGREP_CPP(__openldap_compat,[
3346 /* Require 2.1.27+ and 2.2.6+ */
3347 #if LDAP_VENDOR_VERSION_MAJOR == 2 && LDAP_VENDOR_VERSION_MINOR == 1 && LDAP_VENDOR_VERSION_PATCH > 26
3348 char *__openldap_compat = "2.1.27 or better okay";
3349 #elif LDAP_VENDOR_VERSION_MAJOR == 2 && LDAP_VENDOR_VERSION_MINOR == 2 && LDAP_VENDOR_VERSION_PATCH > 5
3350 char *__openldap_compat = "2.2.6 or better okay";
3351 #elif LDAP_VENDOR_VERSION_MAJOR == 2 && LDAP_VENDOR_VERSION_MINOR > 2
3352 char *__openldap_compat = "2.3 or better okay"
3354 ], [cmu_cv_openldap_compat=yes], [cmu_cv_openldap_compat=no])])
3358 dnl See whether we can use IPv6 related functions
3359 dnl contributed by Hajimu UMEMOTO
3361 AC_DEFUN([IPv6_CHECK_FUNC], [
3362 AC_CHECK_FUNC($1, [dnl
3363 ac_cv_lib_socket_$1=no
3364 ac_cv_lib_inet6_$1=no
3366 AC_CHECK_LIB(socket, $1, [dnl
3367 LIBS="$LIBS -lsocket"
3368 ac_cv_lib_inet6_$1=no
3370 AC_MSG_CHECKING([whether your system has IPv6 directory])
3371 AC_CACHE_VAL(ipv6_cv_dir, [dnl
3372 for ipv6_cv_dir in /usr/local/v6 /usr/inet6 no; do
3373 if test $ipv6_cv_dir = no -o -d $ipv6_cv_dir; then
3377 AC_MSG_RESULT($ipv6_cv_dir)
3378 if test $ipv6_cv_dir = no; then
3379 ac_cv_lib_inet6_$1=no
3381 if test x$ipv6_libinet6 = x; then
3383 SAVELDFLAGS="$LDFLAGS"
3384 LDFLAGS="$LDFLAGS -L$ipv6_cv_dir/lib"
3386 AC_CHECK_LIB(inet6, $1, [dnl
3387 if test $ipv6_libinet6 = no; then
3389 LIBS="$LIBS -linet6"
3391 if test $ipv6_libinet6 = no; then
3392 LDFLAGS="$SAVELDFLAGS"
3397 if test $ac_cv_func_$1 = yes -o $ac_cv_lib_socket_$1 = yes \
3398 -o $ac_cv_lib_inet6_$1 = yes
3402 if test $ipv6_cv_$1 = no; then
3403 if test $1 = getaddrinfo; then
3404 for ipv6_cv_pfx in o n; do
3405 AC_EGREP_HEADER(${ipv6_cv_pfx}$1, netdb.h,
3406 [AC_CHECK_FUNC(${ipv6_cv_pfx}$1)])
3407 if eval test X\$ac_cv_func_${ipv6_cv_pfx}$1 = Xyes; then
3408 AC_DEFINE(HAVE_GETADDRINFO,[],[Do we have a getaddrinfo?])
3415 if test $ipv6_cv_$1 = yes; then
3416 ifelse([$2], , :, [$2])
3418 ifelse([$3], , :, [$3])
3422 dnl See whether we have ss_family in sockaddr_storage
3423 AC_DEFUN([IPv6_CHECK_SS_FAMILY], [
3424 AC_MSG_CHECKING([whether you have ss_family in struct sockaddr_storage])
3425 AC_CACHE_VAL(ipv6_cv_ss_family, [dnl
3426 AC_TRY_COMPILE([#include <sys/types.h>
3427 #include <sys/socket.h>],
3428 [struct sockaddr_storage ss; int i = ss.ss_family;],
3429 [ipv6_cv_ss_family=yes], [ipv6_cv_ss_family=no])])dnl
3430 if test $ipv6_cv_ss_family = yes; then
3431 ifelse([$1], , AC_DEFINE(HAVE_SS_FAMILY,[],[Is there an ss_family in sockaddr_storage?]), [$1])
3433 ifelse([$2], , :, [$2])
3435 AC_MSG_RESULT($ipv6_cv_ss_family)])
3438 dnl whether you have sa_len in struct sockaddr
3439 AC_DEFUN([IPv6_CHECK_SA_LEN], [
3440 AC_MSG_CHECKING([whether you have sa_len in struct sockaddr])
3441 AC_CACHE_VAL(ipv6_cv_sa_len, [dnl
3442 AC_TRY_COMPILE([#include <sys/types.h>
3443 #include <sys/socket.h>],
3444 [struct sockaddr sa; int i = sa.sa_len;],
3445 [ipv6_cv_sa_len=yes], [ipv6_cv_sa_len=no])])dnl
3446 if test $ipv6_cv_sa_len = yes; then
3447 ifelse([$1], , AC_DEFINE(HAVE_SOCKADDR_SA_LEN,[],[Does sockaddr have an sa_len?]), [$1])
3449 ifelse([$2], , :, [$2])
3451 AC_MSG_RESULT($ipv6_cv_sa_len)])
3454 dnl See whether sys/socket.h has socklen_t
3455 AC_DEFUN([IPv6_CHECK_SOCKLEN_T], [
3456 AC_MSG_CHECKING(for socklen_t)
3457 AC_CACHE_VAL(ipv6_cv_socklen_t, [dnl
3458 AC_TRY_LINK([#include <sys/types.h>
3459 #include <sys/socket.h>],
3460 [socklen_t len = 0;],
3461 [ipv6_cv_socklen_t=yes], [ipv6_cv_socklen_t=no])])dnl
3462 if test $ipv6_cv_socklen_t = yes; then
3463 ifelse([$1], , AC_DEFINE(HAVE_SOCKLEN_T,[],[Do we have a socklen_t?]), [$1])
3465 ifelse([$2], , :, [$2])
3467 AC_MSG_RESULT($ipv6_cv_socklen_t)])