1 # aclocal.m4 generated automatically by aclocal 1.6 -*- Autoconf -*-
3 # Copyright 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 # Like AC_CONFIG_HEADER, but automatically create stamp file. -*- Autoconf -*-
16 # Copyright 1996, 1997, 2000, 2001 Free Software Foundation, Inc.
18 # This program is free software; you can redistribute it and/or modify
19 # it under the terms of the GNU General Public License as published by
20 # the Free Software Foundation; either version 2, or (at your option)
23 # This program is distributed in the hope that it will be useful,
24 # but WITHOUT ANY WARRANTY; without even the implied warranty of
25 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
26 # GNU General Public License for more details.
28 # You should have received a copy of the GNU General Public License
29 # along with this program; if not, write to the Free Software
30 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
37 # When config.status generates a header, we must update the stamp-h file.
38 # This file resides in the same directory as the config header
39 # that is generated. We must strip everything past the first ":",
40 # and everything past the last "/".
44 # Like AS_DIRNAME, only do it during macro expansion
45 AC_DEFUN([_AM_DIRNAME],
46 [m4_if(regexp([$1], [^.*[^/]//*[^/][^/]*/*$]), -1,
47 m4_if(regexp([$1], [^//\([^/]\|$\)]), -1,
48 m4_if(regexp([$1], [^/.*]), -1,
50 patsubst([$1], [^\(/\).*], [\1])),
51 patsubst([$1], [^\(//\)\([^/].*\|$\)], [\1])),
52 patsubst([$1], [^\(.*[^/]\)//*[^/][^/]*/*$], [\1]))[]dnl
56 # The stamp files are numbered to have different names.
57 # We could number them on a directory basis, but that's additional
58 # complications, let's have a unique counter.
59 m4_define([_AM_STAMP_Count], [0])
64 # The name of the stamp file for HEADER.
66 [m4_define([_AM_STAMP_Count], m4_incr(_AM_STAMP_Count))dnl
67 AS_ESCAPE(_AM_DIRNAME(patsubst([$1],
68 [:.*])))/stamp-h[]_AM_STAMP_Count])
71 # _AM_CONFIG_HEADER(HEADER[:SOURCES], COMMANDS, INIT-COMMANDS)
72 # ------------------------------------------------------------
73 # We used to try to get a real timestamp in stamp-h. But the fear is that
74 # that will cause unnecessary cvs conflicts.
75 AC_DEFUN([_AM_CONFIG_HEADER],
76 [# Add the stamp file to the list of files AC keeps track of,
77 # along with our hook.
78 AC_CONFIG_HEADERS([$1],
79 [# update the timestamp
80 echo 'timestamp for $1' >"_AM_STAMP([$1])"
86 # AM_CONFIG_HEADER(HEADER[:SOURCES]..., COMMANDS, INIT-COMMANDS)
87 # --------------------------------------------------------------
88 AC_DEFUN([AM_CONFIG_HEADER],
89 [AC_FOREACH([_AM_File], [$1], [_AM_CONFIG_HEADER(_AM_File, [$2], [$3])])
92 # Do all the work for Automake. -*- Autoconf -*-
94 # This macro actually does too much some checks are only needed if
95 # your package does certain things. But this isn't really a big deal.
97 # Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002
98 # Free Software Foundation, Inc.
100 # This program is free software; you can redistribute it and/or modify
101 # it under the terms of the GNU General Public License as published by
102 # the Free Software Foundation; either version 2, or (at your option)
105 # This program is distributed in the hope that it will be useful,
106 # but WITHOUT ANY WARRANTY; without even the implied warranty of
107 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
108 # GNU General Public License for more details.
110 # You should have received a copy of the GNU General Public License
111 # along with this program; if not, write to the Free Software
112 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
117 # There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
118 # written in clear, in which case automake, when reading aclocal.m4,
119 # will think it sees a *use*, and therefore will trigger all it's
120 # C support machinery. Also note that it means that autoscan, seeing
121 # CC etc. in the Makefile, will ask for an AC_PROG_CC use...
126 # Autoconf 2.50 wants to disallow AM_ names. We explicitly allow
127 # the ones we care about.
128 m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
130 # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
131 # AM_INIT_AUTOMAKE([OPTIONS])
132 # -----------------------------------------------
133 # The call with PACKAGE and VERSION arguments is the old style
134 # call (pre autoconf-2.50), which is being phased out. PACKAGE
135 # and VERSION should now be passed to AC_INIT and removed from
136 # the call to AM_INIT_AUTOMAKE.
137 # We support both call styles for the transition. After
138 # the next Automake release, Autoconf can make the AC_INIT
139 # arguments mandatory, and then we can depend on a new Autoconf
140 # release and drop the old call support.
141 AC_DEFUN([AM_INIT_AUTOMAKE],
142 [AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
143 AC_REQUIRE([AC_PROG_INSTALL])dnl
144 # test to see if srcdir already configured
145 if test "`cd $srcdir && pwd`" != "`pwd`" &&
146 test -f $srcdir/config.status; then
147 AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
150 # Define the identity of the package.
151 dnl Distinguish between old-style and new-style calls.
153 [m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
154 AC_SUBST([PACKAGE], [$1])dnl
155 AC_SUBST([VERSION], [$2])],
156 [_AM_SET_OPTIONS([$1])dnl
157 AC_SUBST([PACKAGE], [AC_PACKAGE_TARNAME])dnl
158 AC_SUBST([VERSION], [AC_PACKAGE_VERSION])])dnl
160 _AM_IF_OPTION([no-define],,
161 [AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
162 AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
164 # Some tools Automake needs.
165 AC_REQUIRE([AM_SANITY_CHECK])dnl
166 AC_REQUIRE([AC_ARG_PROGRAM])dnl
167 AM_MISSING_PROG(ACLOCAL, "aclocal-${am__api_version}")
168 AM_MISSING_PROG(AUTOCONF, autoconf)
169 AM_MISSING_PROG(AUTOMAKE, "automake-${am__api_version}")
170 AM_MISSING_PROG(AUTOHEADER, autoheader)
171 AM_MISSING_PROG(MAKEINFO, makeinfo)
172 AM_MISSING_PROG(AMTAR, tar)
174 AM_PROG_INSTALL_STRIP
175 # We need awk for the "check" target. The system "awk" is bad on
177 AC_REQUIRE([AC_PROG_AWK])dnl
178 AC_REQUIRE([AC_PROG_MAKE_SET])dnl
180 _AM_IF_OPTION([no-dependencies],,
181 [AC_PROVIDE_IFELSE([AC_PROG_][CC],
182 [_AM_DEPENDENCIES(CC)],
183 [define([AC_PROG_][CC],
184 defn([AC_PROG_][CC])[_AM_DEPENDENCIES(CC)])])dnl
185 AC_PROVIDE_IFELSE([AC_PROG_][CXX],
186 [_AM_DEPENDENCIES(CXX)],
187 [define([AC_PROG_][CXX],
188 defn([AC_PROG_][CXX])[_AM_DEPENDENCIES(CXX)])])dnl
192 # Copyright 2002 Free Software Foundation, Inc.
194 # This program is free software; you can redistribute it and/or modify
195 # it under the terms of the GNU General Public License as published by
196 # the Free Software Foundation; either version 2, or (at your option)
199 # This program is distributed in the hope that it will be useful,
200 # but WITHOUT ANY WARRANTY; without even the implied warranty of
201 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
202 # GNU General Public License for more details.
204 # You should have received a copy of the GNU General Public License
205 # along with this program; if not, write to the Free Software
206 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
208 # AM_AUTOMAKE_VERSION(VERSION)
209 # ----------------------------
210 # Automake X.Y traces this macro to ensure aclocal.m4 has been
211 # generated from the m4 files accompanying Automake X.Y.
212 AC_DEFUN([AM_AUTOMAKE_VERSION],[am__api_version="1.6"])
214 # AM_SET_CURRENT_AUTOMAKE_VERSION
215 # -------------------------------
216 # Call AM_AUTOMAKE_VERSION so it can be traced.
217 # This function is AC_REQUIREd by AC_INIT_AUTOMAKE.
218 AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
219 [AM_AUTOMAKE_VERSION([1.6])])
221 # Helper functions for option handling. -*- Autoconf -*-
223 # Copyright 2001, 2002 Free Software Foundation, Inc.
225 # This program is free software; you can redistribute it and/or modify
226 # it under the terms of the GNU General Public License as published by
227 # the Free Software Foundation; either version 2, or (at your option)
230 # This program is distributed in the hope that it will be useful,
231 # but WITHOUT ANY WARRANTY; without even the implied warranty of
232 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
233 # GNU General Public License for more details.
235 # You should have received a copy of the GNU General Public License
236 # along with this program; if not, write to the Free Software
237 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
242 # _AM_MANGLE_OPTION(NAME)
243 # -----------------------
244 AC_DEFUN([_AM_MANGLE_OPTION],
245 [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
247 # _AM_SET_OPTION(NAME)
248 # ------------------------------
249 # Set option NAME. Presently that only means defining a flag for this option.
250 AC_DEFUN([_AM_SET_OPTION],
251 [m4_define(_AM_MANGLE_OPTION([$1]), 1)])
253 # _AM_SET_OPTIONS(OPTIONS)
254 # ----------------------------------
255 # OPTIONS is a space-separated list of Automake options.
256 AC_DEFUN([_AM_SET_OPTIONS],
257 [AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
259 # _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
260 # -------------------------------------------
261 # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
262 AC_DEFUN([_AM_IF_OPTION],
263 [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
266 # Check to make sure that the build environment is sane.
269 # Copyright 1996, 1997, 2000, 2001 Free Software Foundation, Inc.
271 # This program is free software; you can redistribute it and/or modify
272 # it under the terms of the GNU General Public License as published by
273 # the Free Software Foundation; either version 2, or (at your option)
276 # This program is distributed in the hope that it will be useful,
277 # but WITHOUT ANY WARRANTY; without even the implied warranty of
278 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
279 # GNU General Public License for more details.
281 # You should have received a copy of the GNU General Public License
282 # along with this program; if not, write to the Free Software
283 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
290 AC_DEFUN([AM_SANITY_CHECK],
291 [AC_MSG_CHECKING([whether build environment is sane])
294 echo timestamp > conftest.file
295 # Do `set' in a subshell so we don't clobber the current shell's
296 # arguments. Must try -L first in case configure is actually a
297 # symlink; some systems play weird games with the mod time of symlinks
298 # (eg FreeBSD returns the mod time of the symlink's containing
301 set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
302 if test "$[*]" = "X"; then
304 set X `ls -t $srcdir/configure conftest.file`
307 if test "$[*]" != "X $srcdir/configure conftest.file" \
308 && test "$[*]" != "X conftest.file $srcdir/configure"; then
310 # If neither matched, then we have a broken ls. This can happen
311 # if, for instance, CONFIG_SHELL is bash and it inherits a
312 # broken ls alias from the environment. This has actually
313 # happened. Such a system could not be considered "sane".
314 AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
315 alias in your environment])
318 test "$[2]" = conftest.file
324 AC_MSG_ERROR([newly created file is older than distributed files!
325 Check your system clock])
332 # Copyright 1997, 1999, 2000, 2001 Free Software Foundation, Inc.
334 # This program is free software; you can redistribute it and/or modify
335 # it under the terms of the GNU General Public License as published by
336 # the Free Software Foundation; either version 2, or (at your option)
339 # This program is distributed in the hope that it will be useful,
340 # but WITHOUT ANY WARRANTY; without even the implied warranty of
341 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
342 # GNU General Public License for more details.
344 # You should have received a copy of the GNU General Public License
345 # along with this program; if not, write to the Free Software
346 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
351 # AM_MISSING_PROG(NAME, PROGRAM)
352 # ------------------------------
353 AC_DEFUN([AM_MISSING_PROG],
354 [AC_REQUIRE([AM_MISSING_HAS_RUN])
355 $1=${$1-"${am_missing_run}$2"}
361 # Define MISSING if not defined so far and test if it supports --run.
362 # If it does, set am_missing_run to use it, otherwise, to nothing.
363 AC_DEFUN([AM_MISSING_HAS_RUN],
364 [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
365 test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
366 # Use eval to expand $SHELL
367 if eval "$MISSING --run true"; then
368 am_missing_run="$MISSING --run "
371 AC_MSG_WARN([`missing' script is too old or missing])
377 # Copyright 2001 Free Software Foundation, Inc.
379 # This program is free software; you can redistribute it and/or modify
380 # it under the terms of the GNU General Public License as published by
381 # the Free Software Foundation; either version 2, or (at your option)
384 # This program is distributed in the hope that it will be useful,
385 # but WITHOUT ANY WARRANTY; without even the implied warranty of
386 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
387 # GNU General Public License for more details.
389 # You should have received a copy of the GNU General Public License
390 # along with this program; if not, write to the Free Software
391 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
394 # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
395 # $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to
396 # `$srcdir', `$srcdir/..', or `$srcdir/../..'.
398 # Of course, Automake must honor this variable whenever it calls a
399 # tool from the auxiliary directory. The problem is that $srcdir (and
400 # therefore $ac_aux_dir as well) can be either absolute or relative,
401 # depending on how configure is run. This is pretty annoying, since
402 # it makes $ac_aux_dir quite unusable in subdirectories: in the top
403 # source directory, any form will work fine, but in subdirectories a
404 # relative path needs to be adjusted first.
406 # $ac_aux_dir/missing
407 # fails when called from a subdirectory if $ac_aux_dir is relative
408 # $top_srcdir/$ac_aux_dir/missing
409 # fails if $ac_aux_dir is absolute,
410 # fails when called from a subdirectory in a VPATH build with
411 # a relative $ac_aux_dir
413 # The reason of the latter failure is that $top_srcdir and $ac_aux_dir
414 # are both prefixed by $srcdir. In an in-source build this is usually
415 # harmless because $srcdir is `.', but things will broke when you
416 # start a VPATH build or use an absolute $srcdir.
418 # So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
419 # iff we strip the leading $srcdir from $ac_aux_dir. That would be:
420 # am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
421 # and then we would define $MISSING as
422 # MISSING="\${SHELL} $am_aux_dir/missing"
423 # This will work as long as MISSING is not called from configure, because
424 # unfortunately $(top_srcdir) has no meaning in configure.
425 # However there are other variables, like CC, which are often used in
426 # configure, and could therefore not use this "fixed" $ac_aux_dir.
428 # Another solution, used here, is to always expand $ac_aux_dir to an
429 # absolute PATH. The drawback is that using absolute paths prevent a
430 # configured tree to be moved without reconfiguration.
432 # Rely on autoconf to set up CDPATH properly.
435 AC_DEFUN([AM_AUX_DIR_EXPAND], [
436 # expand $ac_aux_dir to an absolute path
437 am_aux_dir=`cd $ac_aux_dir && pwd`
442 # Define $install_sh.
444 # Copyright 2001 Free Software Foundation, Inc.
446 # This program is free software; you can redistribute it and/or modify
447 # it under the terms of the GNU General Public License as published by
448 # the Free Software Foundation; either version 2, or (at your option)
451 # This program is distributed in the hope that it will be useful,
452 # but WITHOUT ANY WARRANTY; without even the implied warranty of
453 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
454 # GNU General Public License for more details.
456 # You should have received a copy of the GNU General Public License
457 # along with this program; if not, write to the Free Software
458 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
461 AC_DEFUN([AM_PROG_INSTALL_SH],
462 [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
463 install_sh=${install_sh-"$am_aux_dir/install-sh"}
464 AC_SUBST(install_sh)])
466 # AM_PROG_INSTALL_STRIP
468 # Copyright 2001 Free Software Foundation, Inc.
470 # This program is free software; you can redistribute it and/or modify
471 # it under the terms of the GNU General Public License as published by
472 # the Free Software Foundation; either version 2, or (at your option)
475 # This program is distributed in the hope that it will be useful,
476 # but WITHOUT ANY WARRANTY; without even the implied warranty of
477 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
478 # GNU General Public License for more details.
480 # You should have received a copy of the GNU General Public License
481 # along with this program; if not, write to the Free Software
482 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
485 # One issue with vendor `install' (even GNU) is that you can't
486 # specify the program used to strip binaries. This is especially
487 # annoying in cross-compiling environments, where the build's strip
488 # is unlikely to handle the host's binaries.
489 # Fortunately install-sh will honor a STRIPPROG variable, so we
490 # always use install-sh in `make install-strip', and initialize
491 # STRIPPROG with the value of the STRIP variable (set by the user).
492 AC_DEFUN([AM_PROG_INSTALL_STRIP],
493 [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
494 # Installed binaries are usually stripped using `strip' when the user
495 # run `make install-strip'. However `strip' might not be the right
496 # tool to use in cross-compilation environments, therefore Automake
497 # will honor the `STRIP' environment variable to overrule this program.
498 dnl Don't test for $cross_compiling = yes, because it might be `maybe'.
499 if test "$cross_compiling" != no; then
500 AC_CHECK_TOOL([STRIP], [strip], :)
502 INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s"
503 AC_SUBST([INSTALL_STRIP_PROGRAM])])
505 # serial 4 -*- Autoconf -*-
507 # Copyright 1999, 2000, 2001 Free Software Foundation, Inc.
509 # This program is free software; you can redistribute it and/or modify
510 # it under the terms of the GNU General Public License as published by
511 # the Free Software Foundation; either version 2, or (at your option)
514 # This program is distributed in the hope that it will be useful,
515 # but WITHOUT ANY WARRANTY; without even the implied warranty of
516 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
517 # GNU General Public License for more details.
519 # You should have received a copy of the GNU General Public License
520 # along with this program; if not, write to the Free Software
521 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
525 # There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
526 # written in clear, in which case automake, when reading aclocal.m4,
527 # will think it sees a *use*, and therefore will trigger all it's
528 # C support machinery. Also note that it means that autoscan, seeing
529 # CC etc. in the Makefile, will ask for an AC_PROG_CC use...
533 # _AM_DEPENDENCIES(NAME)
534 # ----------------------
535 # See how the compiler implements dependency checking.
536 # NAME is "CC", "CXX", "GCJ", or "OBJC".
537 # We try a few techniques and use that to set a single cache variable.
539 # We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
540 # modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
541 # dependency, and given that the user is not expected to run this macro,
542 # just rely on AC_PROG_CC.
543 AC_DEFUN([_AM_DEPENDENCIES],
544 [AC_REQUIRE([AM_SET_DEPDIR])dnl
545 AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
546 AC_REQUIRE([AM_MAKE_INCLUDE])dnl
547 AC_REQUIRE([AM_DEP_TRACK])dnl
549 ifelse([$1], CC, [depcc="$CC" am_compiler_list=],
550 [$1], CXX, [depcc="$CXX" am_compiler_list=],
551 [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc']
552 [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'],
553 [depcc="$$1" am_compiler_list=])
555 AC_CACHE_CHECK([dependency style of $depcc],
556 [am_cv_$1_dependencies_compiler_type],
557 [if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
558 # We make a subdir and do the tests there. Otherwise we can end up
559 # making bogus files that we don't know about and never remove. For
560 # instance it was reported that on HP-UX the gcc test will end up
561 # making a dummy file named `D' -- because `-MD' means `put the output
564 # Copy depcomp to subdir because otherwise we won't find it if we're
565 # using a relative directory.
566 cp "$am_depcomp" conftest.dir
569 am_cv_$1_dependencies_compiler_type=none
570 if test "$am_compiler_list" = ""; then
571 am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
573 for depmode in $am_compiler_list; do
574 # We need to recreate these files for each test, as the compiler may
575 # overwrite some of them when testing with obscure command lines.
576 # This happens at least with the AIX C compiler.
577 echo '#include "conftest.h"' > conftest.c
578 echo 'int i;' > conftest.h
579 echo "${am__include} ${am__quote}conftest.Po${am__quote}" > confmf
583 # after this tag, mechanisms are not by side-effect, so they'll
584 # only be used when explicitly requested
585 if test "x$enable_dependency_tracking" = xyes; then
593 # We check with `-c' and `-o' for the sake of the "dashmstdout"
594 # mode. It turns out that the SunPro C++ compiler does not properly
595 # handle `-M -o', and we need to detect this.
596 if depmode=$depmode \
597 source=conftest.c object=conftest.o \
598 depfile=conftest.Po tmpdepfile=conftest.TPo \
599 $SHELL ./depcomp $depcc -c conftest.c -o conftest.o >/dev/null 2>&1 &&
600 grep conftest.h conftest.Po > /dev/null 2>&1 &&
601 ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
602 am_cv_$1_dependencies_compiler_type=$depmode
610 am_cv_$1_dependencies_compiler_type=none
613 AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
619 # Choose a directory name for dependency files.
620 # This macro is AC_REQUIREd in _AM_DEPENDENCIES
621 AC_DEFUN([AM_SET_DEPDIR],
622 [rm -f .deps 2>/dev/null
623 mkdir .deps 2>/dev/null
624 if test -d .deps; then
627 # MS-DOS does not allow filenames that begin with a dot.
630 rmdir .deps 2>/dev/null
637 AC_DEFUN([AM_DEP_TRACK],
638 [AC_ARG_ENABLE(dependency-tracking,
639 [ --disable-dependency-tracking Speeds up one-time builds
640 --enable-dependency-tracking Do not reject slow dependency extractors])
641 if test "x$enable_dependency_tracking" != xno; then
642 am_depcomp="$ac_aux_dir/depcomp"
645 AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
646 AC_SUBST([AMDEPBACKSLASH])
649 # Generate code to set up dependency tracking. -*- Autoconf -*-
651 # Copyright 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
653 # This program is free software; you can redistribute it and/or modify
654 # it under the terms of the GNU General Public License as published by
655 # the Free Software Foundation; either version 2, or (at your option)
658 # This program is distributed in the hope that it will be useful,
659 # but WITHOUT ANY WARRANTY; without even the implied warranty of
660 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
661 # GNU General Public License for more details.
663 # You should have received a copy of the GNU General Public License
664 # along with this program; if not, write to the Free Software
665 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
670 # _AM_OUTPUT_DEPENDENCY_COMMANDS
671 # ------------------------------
672 AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
673 [for mf in $CONFIG_FILES; do
674 # Strip MF so we end up with the name of the file.
675 mf=`echo "$mf" | sed -e 's/:.*$//'`
676 if (sed 1q $mf | fgrep 'generated by automake') > /dev/null 2>&1; then
677 dirpart=`AS_DIRNAME("$mf")`
681 grep '^DEP_FILES *= *[[^ @%:@]]' < "$mf" > /dev/null || continue
682 # Extract the definition of DEP_FILES from the Makefile without
684 DEPDIR=`sed -n -e '/^DEPDIR = / s///p' < "$mf"`
685 test -z "$DEPDIR" && continue
686 # When using ansi2knr, U may be empty or an underscore; expand it
687 U=`sed -n -e '/^U = / s///p' < "$mf"`
688 test -d "$dirpart/$DEPDIR" || mkdir "$dirpart/$DEPDIR"
689 # We invoke sed twice because it is the simplest approach to
690 # changing $(DEPDIR) to its actual value in the expansion.
691 for file in `sed -n -e '
692 /^DEP_FILES = .*\\\\$/ {
701 /^DEP_FILES = / s/^DEP_FILES = //p' < "$mf" | \
702 sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
703 # Make sure the directory exists.
704 test -f "$dirpart/$file" && continue
705 fdir=`AS_DIRNAME(["$file"])`
706 AS_MKDIR_P([$dirpart/$fdir])
707 # echo "creating $dirpart/$file"
708 echo '# dummy' > "$dirpart/$file"
711 ])# _AM_OUTPUT_DEPENDENCY_COMMANDS
714 # AM_OUTPUT_DEPENDENCY_COMMANDS
715 # -----------------------------
716 # This macro should only be invoked once -- use via AC_REQUIRE.
718 # This code is only required when automatic dependency tracking
719 # is enabled. FIXME. This creates each `.P' file that we will
720 # need in order to bootstrap the dependency handling code.
721 AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
722 [AC_CONFIG_COMMANDS([depfiles],
723 [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
724 [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
727 # Copyright 2001 Free Software Foundation, Inc. -*- Autoconf -*-
729 # This program is free software; you can redistribute it and/or modify
730 # it under the terms of the GNU General Public License as published by
731 # the Free Software Foundation; either version 2, or (at your option)
734 # This program is distributed in the hope that it will be useful,
735 # but WITHOUT ANY WARRANTY; without even the implied warranty of
736 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
737 # GNU General Public License for more details.
739 # You should have received a copy of the GNU General Public License
740 # along with this program; if not, write to the Free Software
741 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
748 # Check to see how make treats includes.
749 AC_DEFUN([AM_MAKE_INCLUDE],
750 [am_make=${MAKE-make}
751 cat > confinc << 'END'
755 # If we don't find an include directive, just comment out the code.
756 AC_MSG_CHECKING([for style of include used by $am_make])
760 # First try GNU make style include.
761 echo "include confinc" > confmf
762 # We grep out `Entering directory' and `Leaving directory'
763 # messages which can occur if `w' ends up in MAKEFLAGS.
764 # In particular we don't look at `^make:' because GNU make might
765 # be invoked under some other name (usually "gmake"), in which
766 # case it prints its new name instead of `make'.
767 if test "`$am_make -s -f confmf 2> /dev/null | fgrep -v 'ing directory'`" = "done"; then
772 # Now try BSD make style include.
773 if test "$am__include" = "#"; then
774 echo '.include "confinc"' > confmf
775 if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
781 AC_SUBST(am__include)
783 AC_MSG_RESULT($_am_result)
787 # AM_CONDITIONAL -*- Autoconf -*-
789 # Copyright 1997, 2000, 2001 Free Software Foundation, Inc.
791 # This program is free software; you can redistribute it and/or modify
792 # it under the terms of the GNU General Public License as published by
793 # the Free Software Foundation; either version 2, or (at your option)
796 # This program is distributed in the hope that it will be useful,
797 # but WITHOUT ANY WARRANTY; without even the implied warranty of
798 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
799 # GNU General Public License for more details.
801 # You should have received a copy of the GNU General Public License
802 # along with this program; if not, write to the Free Software
803 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
810 # AM_CONDITIONAL(NAME, SHELL-CONDITION)
811 # -------------------------------------
812 # Define a conditional.
813 AC_DEFUN([AM_CONDITIONAL],
814 [ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])],
815 [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
825 AC_CONFIG_COMMANDS_PRE(
826 [if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
827 AC_MSG_ERROR([conditional \"$1\" was never defined.
828 Usually this means the macro was only invoked conditionally.])
831 # isc-posix.m4 serial 1 (gettext-0.10.40)
832 dnl Copyright (C) 1995-2002 Free Software Foundation, Inc.
833 dnl This file is free software, distributed under the terms of the GNU
834 dnl General Public License. As a special exception to the GNU General
835 dnl Public License, this file may be distributed as part of a program
836 dnl that contains a configuration script generated by Autoconf, under
837 dnl the same distribution terms as the rest of that program.
839 # This test replaces the one in autoconf.
840 # Currently this macro should have the same name as the autoconf macro
841 # because gettext's gettext.m4 (distributed in the automake package)
842 # still uses it. Otherwise, the use in gettext.m4 makes autoheader
843 # give these diagnostics:
844 # configure.in:556: AC_TRY_COMPILE was called before AC_ISC_POSIX
845 # configure.in:556: AC_TRY_RUN was called before AC_ISC_POSIX
847 undefine([AC_ISC_POSIX])
849 AC_DEFUN([AC_ISC_POSIX],
851 dnl This test replaces the obsolescent AC_ISC_POSIX kludge.
852 AC_CHECK_LIB(cposix, strerror, [LIBS="$LIBS -lcposix"])
857 # Copyright 1996, 1997, 1999, 2000, 2001 Free Software Foundation, Inc.
859 # This program is free software; you can redistribute it and/or modify
860 # it under the terms of the GNU General Public License as published by
861 # the Free Software Foundation; either version 2, or (at your option)
864 # This program is distributed in the hope that it will be useful,
865 # but WITHOUT ANY WARRANTY; without even the implied warranty of
866 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
867 # GNU General Public License for more details.
869 # You should have received a copy of the GNU General Public License
870 # along with this program; if not, write to the Free Software
871 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
876 # @defmac AC_PROG_CC_STDC
877 # @maindex PROG_CC_STDC
879 # If the C compiler in not in ANSI C mode by default, try to add an option
880 # to output variable @code{CC} to make it so. This macro tries various
881 # options that select ANSI C on some system or another. It considers the
882 # compiler to be in ANSI C mode if it handles function prototypes correctly.
884 # If you use this macro, you should check after calling it whether the C
885 # compiler has been set to accept ANSI C; if not, the shell variable
886 # @code{am_cv_prog_cc_stdc} is set to @samp{no}. If you wrote your source
887 # code in ANSI C, you can make an un-ANSIfied copy of it by using the
888 # program @code{ansi2knr}, which comes with Ghostscript.
891 AC_DEFUN([AM_PROG_CC_STDC],
892 [AC_REQUIRE([AC_PROG_CC])
893 AC_BEFORE([$0], [AC_C_INLINE])
894 AC_BEFORE([$0], [AC_C_CONST])
895 dnl Force this before AC_PROG_CPP. Some cpp's, eg on HPUX, require
896 dnl a magic option to avoid problems with ANSI preprocessor commands
898 dnl FIXME: can't do this because then AC_AIX won't work due to a
899 dnl circular dependency.
900 dnl AC_BEFORE([$0], [AC_PROG_CPP])
901 AC_MSG_CHECKING([for ${CC-cc} option to accept ANSI C])
902 AC_CACHE_VAL(am_cv_prog_cc_stdc,
903 [am_cv_prog_cc_stdc=no
905 # Don't try gcc -ansi; that turns off useful extensions and
906 # breaks some systems' header files.
908 # Ultrix and OSF/1 -std1
909 # HP-UX 10.20 and later -Ae
910 # HP-UX older versions -Aa -D_HPUX_SOURCE
911 # SVR4 -Xc -D__EXTENSIONS__
912 for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
914 CC="$ac_save_CC $ac_arg"
918 #include <sys/types.h>
919 #include <sys/stat.h>
920 /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */
921 struct buf { int x; };
922 FILE * (*rcsopen) (struct buf *, struct stat *, int);
923 static char *e (p, i)
929 static char *f (char * (*g) (char **, int), char **p, ...)
934 s = g (p, va_arg (v,int));
938 int test (int i, double x);
939 struct s1 {int (*f) (int a);};
940 struct s2 {int (*f) (double a);};
941 int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
945 return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1];
947 [am_cv_prog_cc_stdc="$ac_arg"; break])
951 if test -z "$am_cv_prog_cc_stdc"; then
952 AC_MSG_RESULT([none needed])
954 AC_MSG_RESULT([$am_cv_prog_cc_stdc])
956 case "x$am_cv_prog_cc_stdc" in
958 *) CC="$CC $am_cv_prog_cc_stdc" ;;
963 # Make sure _GNU_SOURCE is defined where necessary: as early as possible
964 # for configure-time tests, as well as for every source file that includes
969 AC_DEFUN([AC__GNU_SOURCE],
971 # Make sure that _GNU_SOURCE is defined for all subsequent
972 # configure-time compile tests.
973 # This definition must be emitted (into confdefs.h) before any
974 # test that involves compilation.
975 cat >>confdefs.h <<\EOF
981 # Emit this code into config.h.in.
982 # The ifndef is to avoid redefinition warnings.
983 AH_VERBATIM([_GNU_SOURCE], [#ifndef _GNU_SOURCE
988 # Check for variable-length arrays.
994 # Copyright (C) 2001 Free Software Foundation, Inc.
996 # This program is free software; you can redistribute it and/or modify
997 # it under the terms of the GNU General Public License as published by
998 # the Free Software Foundation; either version 2, or (at your option)
1001 # This program is distributed in the hope that it will be useful,
1002 # but WITHOUT ANY WARRANTY; without even the implied warranty of
1003 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1004 # GNU General Public License for more details.
1006 # You should have received a copy of the GNU General Public License
1007 # along with this program; if not, write to the Free Software
1008 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
1011 AC_DEFUN([AC_C_VARARRAYS],
1013 AC_CACHE_CHECK([for variable-length arrays],
1017 [static int x; char a[++x]; a[sizeof a - 1] = 0; return a[0];],
1018 ac_cv_c_vararrays=yes,
1019 ac_cv_c_vararrays=no)])
1020 if test $ac_cv_c_vararrays = yes; then
1021 AC_DEFINE(HAVE_C_VARARRAYS, 1,
1022 [Define to 1 if C supports variable-length arrays.])
1026 # Check for stdbool.h that conforms to C99.
1028 # Copyright (C) 2002 Free Software Foundation, Inc.
1030 # This program is free software; you can redistribute it and/or modify
1031 # it under the terms of the GNU General Public License as published by
1032 # the Free Software Foundation; either version 2, or (at your option)
1033 # any later version.
1035 # This program is distributed in the hope that it will be useful,
1036 # but WITHOUT ANY WARRANTY; without even the implied warranty of
1037 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1038 # GNU General Public License for more details.
1040 # You should have received a copy of the GNU General Public License
1041 # along with this program; if not, write to the Free Software
1042 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
1045 AC_DEFUN([AC_HEADER_STDBOOL],
1046 [AC_CACHE_CHECK([for stdbool.h that conforms to C99],
1047 [ac_cv_header_stdbool_h],
1050 #include <stdbool.h>
1052 "error: bool is not defined"
1055 "error: false is not defined"
1058 "error: false is not defined"
1060 #ifndef __bool_true_false_are_defined
1061 "error: __bool_true_false_are_defined is not defined"
1064 struct s { _Bool s: 1; _Bool t; } s;
1066 char a[true == 1 ? 1 : -1];
1067 char b[false == 0 ? 1 : -1];
1068 char c[__bool_true_false_are_defined == 1 ? 1 : -1];
1069 char d[(bool) -0.5 == true ? 1 : -1];
1070 char e[(bool) &s == true ? 1 : -1];
1071 char f[(_Bool) -0.0 == false ? 1 : -1];
1073 char h[sizeof (_Bool)];
1076 [ return !a + !b + !c + !d + !e + !f + !g + !h + !i; ],
1077 [ac_cv_header_stdbool_h=yes],
1078 [ac_cv_header_stdbool_h=no])])
1079 if test $ac_cv_header_stdbool_h = yes; then
1080 AC_DEFINE(HAVE_STDBOOL_H, 1, [Define to 1 if stdbool.h conforms to C99.])
1085 dnl From Paul Eggert.
1089 # Define intmax_t to long or long long if <inttypes.h> doesn't define.
1091 AC_DEFUN([jm_AC_TYPE_INTMAX_T],
1093 AC_REQUIRE([jm_AC_TYPE_LONG_LONG])
1094 AC_CHECK_TYPE(intmax_t, ,
1095 [test $ac_cv_type_long_long = yes \
1096 && ac_type='long long' \
1098 AC_DEFINE_UNQUOTED(intmax_t, $ac_type,
1099 [Define to widest signed type if <inttypes.h> doesn't define.])])
1102 # Define uintmax_t to unsigned long or unsigned long long
1103 # if <inttypes.h> doesn't define.
1105 AC_DEFUN([jm_AC_TYPE_UINTMAX_T],
1107 AC_REQUIRE([jm_AC_TYPE_UNSIGNED_LONG_LONG])
1108 AC_CHECK_TYPE(uintmax_t, ,
1109 [test $ac_cv_type_unsigned_long_long = yes \
1110 && ac_type='unsigned long long' \
1111 || ac_type='unsigned long'
1112 AC_DEFINE_UNQUOTED(uintmax_t, $ac_type,
1113 [Define to widest unsigned type if <inttypes.h> doesn't define.])])
1118 dnl From Paul Eggert.
1120 # Define HAVE_LONG_LONG if 'long long' works.
1122 AC_DEFUN([jm_AC_TYPE_LONG_LONG],
1124 AC_CACHE_CHECK([for long long], ac_cv_type_long_long,
1125 [AC_TRY_LINK([long long ll = 1; int i = 63;],
1126 [long long llmax = (long long) -1;
1127 return ll << i | ll >> i | llmax / ll | llmax % ll;],
1128 ac_cv_type_long_long=yes,
1129 ac_cv_type_long_long=no)])
1130 if test $ac_cv_type_long_long = yes; then
1131 AC_DEFINE(HAVE_LONG_LONG, 1,
1132 [Define if you have the long long type.])
1136 # Define HAVE_UNSIGNED_LONG_LONG if 'unsigned long long' works.
1138 AC_DEFUN([jm_AC_TYPE_UNSIGNED_LONG_LONG],
1140 AC_CACHE_CHECK([for unsigned long long], ac_cv_type_unsigned_long_long,
1141 [AC_TRY_LINK([unsigned long long ull = 1; int i = 63;],
1142 [unsigned long long ullmax = (unsigned long long) -1;
1143 return ull << i | ull >> i | ullmax / ull | ullmax % ull;],
1144 ac_cv_type_unsigned_long_long=yes,
1145 ac_cv_type_unsigned_long_long=no)])
1146 if test $ac_cv_type_unsigned_long_long = yes; then
1147 AC_DEFINE(HAVE_UNSIGNED_LONG_LONG, 1,
1148 [Define if you have the unsigned long long type.])
1152 # gettext.m4 serial 13 (gettext-0.11.1)
1153 dnl Copyright (C) 1995-2002 Free Software Foundation, Inc.
1154 dnl This file is free software, distributed under the terms of the GNU
1155 dnl General Public License. As a special exception to the GNU General
1156 dnl Public License, this file may be distributed as part of a program
1157 dnl that contains a configuration script generated by Autoconf, under
1158 dnl the same distribution terms as the rest of that program.
1160 dnl This file can can be used in projects which are not available under
1161 dnl the GNU General Public License or the GNU Library General Public
1162 dnl License but which still want to provide support for the GNU gettext
1164 dnl Please note that the actual code of the GNU gettext library is covered
1165 dnl by the GNU Library General Public License, and the rest of the GNU
1166 dnl gettext package package is covered by the GNU General Public License.
1167 dnl They are *not* in the public domain.
1170 dnl Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
1171 dnl Bruno Haible <haible@clisp.cons.org>, 2000-2002.
1173 dnl Macro to add for using GNU gettext.
1175 dnl Usage: AM_GNU_GETTEXT([INTLSYMBOL], [NEEDSYMBOL], [INTLDIR]).
1176 dnl INTLSYMBOL can be one of 'external', 'no-libtool', 'use-libtool'. The
1177 dnl default (if it is not specified or empty) is 'no-libtool'.
1178 dnl INTLSYMBOL should be 'external' for packages with no intl directory,
1179 dnl and 'no-libtool' or 'use-libtool' for packages with an intl directory.
1180 dnl If INTLSYMBOL is 'use-libtool', then a libtool library
1181 dnl $(top_builddir)/intl/libintl.la will be created (shared and/or static,
1182 dnl depending on --{enable,disable}-{shared,static} and on the presence of
1183 dnl AM-DISABLE-SHARED). If INTLSYMBOL is 'no-libtool', a static library
1184 dnl $(top_builddir)/intl/libintl.a will be created.
1185 dnl If NEEDSYMBOL is specified and is 'need-ngettext', then GNU gettext
1186 dnl implementations (in libc or libintl) without the ngettext() function
1187 dnl will be ignored.
1188 dnl INTLDIR is used to find the intl libraries. If empty,
1189 dnl the value `$(top_builddir)/intl/' is used.
1191 dnl The result of the configuration is one of three cases:
1192 dnl 1) GNU gettext, as included in the intl subdirectory, will be compiled
1194 dnl Catalog format: GNU --> install in $(datadir)
1195 dnl Catalog extension: .mo after installation, .gmo in source tree
1196 dnl 2) GNU gettext has been found in the system's C library.
1197 dnl Catalog format: GNU --> install in $(datadir)
1198 dnl Catalog extension: .mo after installation, .gmo in source tree
1199 dnl 3) No internationalization, always use English msgid.
1200 dnl Catalog format: none
1201 dnl Catalog extension: none
1202 dnl If INTLSYMBOL is 'external', only cases 2 and 3 can occur.
1203 dnl The use of .gmo is historical (it was needed to avoid overwriting the
1204 dnl GNU format catalogs when building on a platform with an X/Open gettext),
1205 dnl but we keep it in order not to force irrelevant filename changes on the
1208 AC_DEFUN([AM_GNU_GETTEXT],
1210 dnl Argument checking.
1211 ifelse([$1], [], , [ifelse([$1], [external], , [ifelse([$1], [no-libtool], , [ifelse([$1], [use-libtool], ,
1212 [errprint([ERROR: invalid first argument to AM_GNU_GETTEXT
1214 ifelse([$2], [], , [ifelse([$2], [need-ngettext], ,
1215 [errprint([ERROR: invalid second argument to AM_GNU_GETTEXT
1217 define(gt_included_intl, ifelse([$1], [external], [no], [yes]))
1218 define(gt_libtool_suffix_prefix, ifelse([$1], [use-libtool], [l], []))
1220 AC_REQUIRE([AM_PO_SUBDIRS])dnl
1221 ifelse(gt_included_intl, yes, [
1222 AC_REQUIRE([AM_INTL_SUBDIR])dnl
1225 dnl Prerequisites of AC_LIB_LINKFLAGS_BODY.
1226 AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
1227 AC_REQUIRE([AC_LIB_RPATH])
1229 AC_MSG_CHECKING([whether NLS is requested])
1230 dnl Default is enabled NLS
1232 [ --disable-nls do not use Native Language Support],
1233 USE_NLS=$enableval, USE_NLS=yes)
1234 AC_MSG_RESULT($USE_NLS)
1237 ifelse(gt_included_intl, yes, [
1238 BUILD_INCLUDED_LIBINTL=no
1239 USE_INCLUDED_LIBINTL=no
1245 dnl If we use NLS figure out what method
1246 if test "$USE_NLS" = "yes"; then
1247 gt_use_preinstalled_gnugettext=no
1248 ifelse(gt_included_intl, yes, [
1249 AC_MSG_CHECKING([whether included gettext is requested])
1250 AC_ARG_WITH(included-gettext,
1251 [ --with-included-gettext use the GNU gettext library included here],
1252 nls_cv_force_use_gnu_gettext=$withval,
1253 nls_cv_force_use_gnu_gettext=no)
1254 AC_MSG_RESULT($nls_cv_force_use_gnu_gettext)
1256 nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext"
1257 if test "$nls_cv_force_use_gnu_gettext" != "yes"; then
1259 dnl User does not insist on using GNU NLS library. Figure out what
1260 dnl to use. If GNU gettext is available we use this. Else we have
1261 dnl to fall back to GNU NLS library.
1263 dnl Add a version number to the cache macros.
1264 define([gt_api_version], ifelse([$2], [need-ngettext], 2, 1))
1265 define([gt_cv_func_gnugettext_libc], [gt_cv_func_gnugettext]gt_api_version[_libc])
1266 define([gt_cv_func_gnugettext_libintl], [gt_cv_func_gnugettext]gt_api_version[_libintl])
1268 AC_CACHE_CHECK([for GNU gettext in libc], gt_cv_func_gnugettext_libc,
1269 [AC_TRY_LINK([#include <libintl.h>
1270 extern int _nl_msg_cat_cntr;
1271 extern int *_nl_domain_bindings;],
1272 [bindtextdomain ("", "");
1273 return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_domain_bindings],
1274 gt_cv_func_gnugettext_libc=yes,
1275 gt_cv_func_gnugettext_libc=no)])
1277 if test "$gt_cv_func_gnugettext_libc" != "yes"; then
1278 dnl Sometimes libintl requires libiconv, so first search for libiconv.
1279 ifelse(gt_included_intl, yes, , [
1282 dnl Search for libintl and define LIBINTL, LTLIBINTL and INCINTL
1283 dnl accordingly. Don't use AC_LIB_LINKFLAGS_BODY([intl],[iconv])
1284 dnl because that would add "-liconv" to LIBINTL and LTLIBINTL
1285 dnl even if libiconv doesn't exist.
1286 AC_LIB_LINKFLAGS_BODY([intl])
1287 AC_CACHE_CHECK([for GNU gettext in libintl],
1288 gt_cv_func_gnugettext_libintl,
1289 [gt_save_CPPFLAGS="$CPPFLAGS"
1290 CPPFLAGS="$CPPFLAGS $INCINTL"
1291 gt_save_LIBS="$LIBS"
1292 LIBS="$LIBS $LIBINTL"
1293 dnl Now see whether libintl exists and does not depend on libiconv.
1294 AC_TRY_LINK([#include <libintl.h>
1295 extern int _nl_msg_cat_cntr;
1296 extern int *_nl_domain_bindings;
1301 const char *_nl_expand_alias ();],
1302 [bindtextdomain ("", "");
1303 return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_domain_bindings + *_nl_expand_alias (0)],
1304 gt_cv_func_gnugettext_libintl=yes,
1305 gt_cv_func_gnugettext_libintl=no)
1306 dnl Now see whether libintl exists and depends on libiconv.
1307 if test "$gt_cv_func_gnugettext_libintl" != yes && test -n "$LIBICONV"; then
1308 LIBS="$LIBS $LIBICONV"
1309 AC_TRY_LINK([#include <libintl.h>
1310 extern int _nl_msg_cat_cntr;
1311 extern int *_nl_domain_bindings;
1316 const char *_nl_expand_alias ();],
1317 [bindtextdomain ("", "");
1318 return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_domain_bindings + *_nl_expand_alias (0)],
1319 [LIBINTL="$LIBINTL $LIBICONV"
1320 LTLIBINTL="$LTLIBINTL $LTLIBICONV"
1321 gt_cv_func_gnugettext_libintl=yes
1324 CPPFLAGS="$gt_save_CPPFLAGS"
1325 LIBS="$gt_save_LIBS"])
1328 dnl If an already present or preinstalled GNU gettext() is found,
1329 dnl use it. But if this macro is used in GNU gettext, and GNU
1330 dnl gettext is already preinstalled in libintl, we update this
1331 dnl libintl. (Cf. the install rule in intl/Makefile.in.)
1332 if test "$gt_cv_func_gnugettext_libc" = "yes" \
1333 || { test "$gt_cv_func_gnugettext_libintl" = "yes" \
1334 && test "$PACKAGE" != gettext; }; then
1335 gt_use_preinstalled_gnugettext=yes
1337 dnl Reset the values set by searching for libintl.
1343 ifelse(gt_included_intl, yes, [
1344 if test "$gt_use_preinstalled_gnugettext" != "yes"; then
1345 dnl GNU gettext is not found in the C library.
1346 dnl Fall back on included GNU gettext library.
1347 nls_cv_use_gnu_gettext=yes
1351 if test "$nls_cv_use_gnu_gettext" = "yes"; then
1352 dnl Mark actions used to generate GNU NLS library.
1353 INTLOBJS="\$(GETTOBJS)"
1354 BUILD_INCLUDED_LIBINTL=yes
1355 USE_INCLUDED_LIBINTL=yes
1356 LIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LIBICONV"
1357 LTLIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LTLIBICONV"
1358 LIBS=`echo " $LIBS " | sed -e 's/ -lintl / /' -e 's/^ //' -e 's/ $//'`
1361 if test "$gt_use_preinstalled_gnugettext" = "yes" \
1362 || test "$nls_cv_use_gnu_gettext" = "yes"; then
1363 dnl Mark actions to use GNU gettext tools.
1368 if test "$gt_use_preinstalled_gnugettext" = "yes" \
1369 || test "$nls_cv_use_gnu_gettext" = "yes"; then
1370 AC_DEFINE(ENABLE_NLS, 1,
1371 [Define to 1 if translation of program messages to the user's native language
1378 if test "$USE_NLS" = "yes"; then
1380 if test "$gt_use_preinstalled_gnugettext" = "yes"; then
1381 if test "$gt_cv_func_gnugettext_libintl" = "yes"; then
1382 AC_MSG_CHECKING([how to link with libintl])
1383 AC_MSG_RESULT([$LIBINTL])
1384 AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCINTL])
1387 dnl For backward compatibility. Some packages may be using this.
1388 AC_DEFINE(HAVE_GETTEXT, 1,
1389 [Define if the GNU gettext() function is already present or preinstalled.])
1390 AC_DEFINE(HAVE_DCGETTEXT, 1,
1391 [Define if the GNU dcgettext() function is already present or preinstalled.])
1394 dnl We need to process the po/ directory.
1398 ifelse(gt_included_intl, yes, [
1399 dnl If this is used in GNU gettext we have to set BUILD_INCLUDED_LIBINTL
1400 dnl to 'yes' because some of the testsuite requires it.
1401 if test "$PACKAGE" = gettext; then
1402 BUILD_INCLUDED_LIBINTL=yes
1405 dnl Make all variables we use known to autoconf.
1406 AC_SUBST(BUILD_INCLUDED_LIBINTL)
1407 AC_SUBST(USE_INCLUDED_LIBINTL)
1411 dnl For backward compatibility. Some configure.ins may be using this.
1413 nls_cv_header_libgt=
1415 dnl For backward compatibility. Some Makefiles may be using this.
1417 AC_SUBST(DATADIRNAME)
1419 dnl For backward compatibility. Some Makefiles may be using this.
1421 AC_SUBST(INSTOBJEXT)
1423 dnl For backward compatibility. Some Makefiles may be using this.
1427 dnl Enable libtool support if the surrounding package wishes it.
1428 INTL_LIBTOOL_SUFFIX_PREFIX=gt_libtool_suffix_prefix
1429 AC_SUBST(INTL_LIBTOOL_SUFFIX_PREFIX)
1432 dnl For backward compatibility. Some Makefiles may be using this.
1436 dnl Make all documented variables known to autoconf.
1443 dnl Checks for all prerequisites of the po subdirectory,
1444 dnl except for USE_NLS.
1445 AC_DEFUN([AM_PO_SUBDIRS],
1447 AC_REQUIRE([AC_PROG_MAKE_SET])dnl
1448 AC_REQUIRE([AC_PROG_INSTALL])dnl
1449 AC_REQUIRE([AM_MKINSTALLDIRS])dnl
1451 dnl Perform the following tests also if --disable-nls has been given,
1452 dnl because they are needed for "make dist" to work.
1454 dnl Search for GNU msgfmt in the PATH.
1455 dnl The first test excludes Solaris msgfmt and early GNU msgfmt versions.
1456 dnl The second test excludes FreeBSD msgfmt.
1457 AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
1458 [$ac_dir/$ac_word --statistics /dev/null >/dev/null 2>&1 &&
1459 (if $ac_dir/$ac_word --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi)],
1461 AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
1463 dnl Search for GNU xgettext 0.11 or newer in the PATH.
1464 dnl The first test excludes Solaris xgettext and early GNU xgettext versions.
1465 dnl The second test excludes FreeBSD xgettext.
1466 AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
1467 [$ac_dir/$ac_word --omit-header --copyright-holder= /dev/null >/dev/null 2>&1 &&
1468 (if $ac_dir/$ac_word --omit-header --copyright-holder= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi)],
1470 dnl Remove leftover from FreeBSD xgettext call.
1473 dnl Search for GNU msgmerge 0.11 or newer in the PATH.
1474 AM_PATH_PROG_WITH_TEST(MSGMERGE, msgmerge,
1475 [$ac_dir/$ac_word --update -q /dev/null /dev/null >/dev/null 2>&1], :)
1477 dnl This could go away some day; the PATH_PROG_WITH_TEST already does it.
1478 dnl Test whether we really found GNU msgfmt.
1479 if test "$GMSGFMT" != ":"; then
1480 dnl If it is no GNU msgfmt we define it as : so that the
1481 dnl Makefiles still can work.
1482 if $GMSGFMT --statistics /dev/null >/dev/null 2>&1 &&
1483 (if $GMSGFMT --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then
1486 GMSGFMT=`echo "$GMSGFMT" | sed -e 's,^.*/,,'`
1488 [found $GMSGFMT program is not GNU msgfmt; ignore it])
1493 dnl This could go away some day; the PATH_PROG_WITH_TEST already does it.
1494 dnl Test whether we really found GNU xgettext.
1495 if test "$XGETTEXT" != ":"; then
1496 dnl If it is no GNU xgettext we define it as : so that the
1497 dnl Makefiles still can work.
1498 if $XGETTEXT --omit-header --copyright-holder= /dev/null >/dev/null 2>&1 &&
1499 (if $XGETTEXT --omit-header --copyright-holder= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then
1503 [found xgettext program is not GNU xgettext; ignore it])
1506 dnl Remove leftover from FreeBSD xgettext call.
1510 AC_OUTPUT_COMMANDS([
1511 for ac_file in $CONFIG_FILES; do
1512 # Support "outfile[:infile[:infile...]]"
1514 *:*) ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
1516 # PO directories have a Makefile.in generated from Makefile.in.in.
1517 case "$ac_file" in */Makefile.in)
1518 # Adjust a relative srcdir.
1519 ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'`
1520 ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`"
1521 ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'`
1522 # In autoconf-2.13 it is called $ac_given_srcdir.
1523 # In autoconf-2.50 it is called $srcdir.
1524 test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir"
1525 case "$ac_given_srcdir" in
1526 .) top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;;
1527 /*) top_srcdir="$ac_given_srcdir" ;;
1528 *) top_srcdir="$ac_dots$ac_given_srcdir" ;;
1530 if test -f "$ac_given_srcdir/$ac_dir/POTFILES.in"; then
1531 rm -f "$ac_dir/POTFILES"
1532 test -n "$as_me" && echo "$as_me: creating $ac_dir/POTFILES" || echo "creating $ac_dir/POTFILES"
1533 cat "$ac_given_srcdir/$ac_dir/POTFILES.in" | sed -e "/^#/d" -e "/^[ ]*\$/d" -e "s,.*, $top_srcdir/& \\\\," | sed -e "\$s/\(.*\) \\\\/\1/" > "$ac_dir/POTFILES"
1534 # ALL_LINGUAS, POFILES, GMOFILES, UPDATEPOFILES, DUMMYPOFILES depend
1535 # on $ac_dir but don't depend on user-specified configuration
1537 if test -f "$ac_given_srcdir/$ac_dir/LINGUAS"; then
1538 # The LINGUAS file contains the set of available languages.
1539 if test -n "$ALL_LINGUAS"; then
1540 test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete"
1542 ALL_LINGUAS_=`sed -e "/^#/d" "$ac_given_srcdir/$ac_dir/LINGUAS"`
1543 # Hide the ALL_LINGUAS assigment from automake.
1544 eval 'ALL_LINGUAS''=$ALL_LINGUAS_'
1546 case "$ac_given_srcdir" in
1548 *) srcdirpre='$(srcdir)/' ;;
1554 for lang in $ALL_LINGUAS; do
1555 POFILES="$POFILES $srcdirpre$lang.po"
1556 GMOFILES="$GMOFILES $srcdirpre$lang.gmo"
1557 UPDATEPOFILES="$UPDATEPOFILES $lang.po-update"
1558 DUMMYPOFILES="$DUMMYPOFILES $lang.nop"
1560 # CATALOGS depends on both $ac_dir and the user's LINGUAS
1561 # environment variable.
1563 if test -n "$ALL_LINGUAS"; then
1564 for presentlang in $ALL_LINGUAS; do
1566 if test "%UNSET%" != "$LINGUAS"; then
1567 desiredlanguages="$LINGUAS"
1569 desiredlanguages="$ALL_LINGUAS"
1571 for desiredlang in $desiredlanguages; do
1572 # Use the presentlang catalog if desiredlang is
1573 # a. equal to presentlang, or
1574 # b. a variant of presentlang (because in this case,
1575 # presentlang can be used as a fallback for messages
1576 # which are not translated in the desiredlang catalog).
1577 case "$desiredlang" in
1578 "$presentlang"*) useit=yes;;
1581 if test $useit = yes; then
1582 INST_LINGUAS="$INST_LINGUAS $presentlang"
1587 if test -n "$INST_LINGUAS"; then
1588 for lang in $INST_LINGUAS; do
1589 CATALOGS="$CATALOGS $lang.gmo"
1592 test -n "$as_me" && echo "$as_me: creating $ac_dir/Makefile" || echo "creating $ac_dir/Makefile"
1593 sed -e "/^POTFILES =/r $ac_dir/POTFILES" -e "/^# Makevars/r $ac_given_srcdir/$ac_dir/Makevars" -e "s|@POFILES@|$POFILES|g" -e "s|@GMOFILES@|$GMOFILES|g" -e "s|@UPDATEPOFILES@|$UPDATEPOFILES|g" -e "s|@DUMMYPOFILES@|$DUMMYPOFILES|g" -e "s|@CATALOGS@|$CATALOGS|g" "$ac_dir/Makefile.in" > "$ac_dir/Makefile"
1594 for f in "$ac_given_srcdir/$ac_dir"/Rules-*; do
1595 if test -f "$f"; then
1597 *.orig | *.bak | *~) ;;
1598 *) cat "$f" >> "$ac_dir/Makefile" ;;
1606 [# Capture the value of obsolete $ALL_LINGUAS because we need it to compute
1607 # POFILES, GMOFILES, UPDATEPOFILES, DUMMYPOFILES, CATALOGS. But hide it
1609 eval 'ALL_LINGUAS''="$ALL_LINGUAS"'
1610 # Capture the value of LINGUAS because we need it to compute CATALOGS.
1611 LINGUAS="${LINGUAS-%UNSET%}"
1616 dnl Checks for all prerequisites of the intl subdirectory,
1617 dnl except for INTL_LIBTOOL_SUFFIX_PREFIX (and possibly LIBTOOL), INTLOBJS,
1618 dnl USE_INCLUDED_LIBINTL, BUILD_INCLUDED_LIBINTL.
1619 AC_DEFUN([AM_INTL_SUBDIR],
1621 AC_REQUIRE([AC_PROG_INSTALL])dnl
1622 AC_REQUIRE([AM_MKINSTALLDIRS])dnl
1623 AC_REQUIRE([AC_PROG_CC])dnl
1624 AC_REQUIRE([AC_CANONICAL_HOST])dnl
1625 AC_REQUIRE([AC_PROG_RANLIB])dnl
1626 AC_REQUIRE([AC_ISC_POSIX])dnl
1627 AC_REQUIRE([AC_HEADER_STDC])dnl
1628 AC_REQUIRE([AC_C_CONST])dnl
1629 AC_REQUIRE([AC_C_INLINE])dnl
1630 AC_REQUIRE([AC_TYPE_OFF_T])dnl
1631 AC_REQUIRE([AC_TYPE_SIZE_T])dnl
1632 AC_REQUIRE([AC_FUNC_ALLOCA])dnl
1633 AC_REQUIRE([AC_FUNC_MMAP])dnl
1634 AC_REQUIRE([jm_GLIBC21])dnl
1636 AC_CHECK_HEADERS([argz.h limits.h locale.h nl_types.h malloc.h stddef.h \
1637 stdlib.h string.h unistd.h sys/param.h])
1638 AC_CHECK_FUNCS([feof_unlocked fgets_unlocked getc_unlocked getcwd getegid \
1639 geteuid getgid getuid mempcpy munmap putenv setenv setlocale stpcpy \
1640 strcasecmp strdup strtoul tsearch __argz_count __argz_stringify __argz_next])
1646 dnl intl/plural.c is generated from intl/plural.y. It requires bison,
1647 dnl because plural.y uses bison specific features. It requires at least
1648 dnl bison-1.26 because earlier versions generate a plural.c that doesn't
1650 dnl bison is only needed for the maintainer (who touches plural.y). But in
1651 dnl order to avoid separate Makefiles or --enable-maintainer-mode, we put
1652 dnl the rule in general Makefile. Now, some people carelessly touch the
1653 dnl files or have a broken "make" program, hence the plural.c rule will
1654 dnl sometimes fire. To avoid an error, defines BISON to ":" if it is not
1655 dnl present or too old.
1656 AC_CHECK_PROGS([INTLBISON], [bison])
1657 if test -z "$INTLBISON"; then
1660 dnl Found it, now check the version.
1661 AC_MSG_CHECKING([version of bison])
1662 changequote(<<,>>)dnl
1663 ac_prog_version=`$INTLBISON --version 2>&1 | sed -n 's/^.*GNU Bison.* \([0-9]*\.[0-9.]*\).*$/\1/p'`
1664 case $ac_prog_version in
1665 '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;;
1666 1.2[6-9]* | 1.[3-9][0-9]* | [2-9].*)
1668 ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;;
1669 *) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;;
1671 AC_MSG_RESULT([$ac_prog_version])
1673 if test $ac_verc_fail = yes; then
1679 AC_DEFUN([AM_MKINSTALLDIRS],
1681 dnl If the AC_CONFIG_AUX_DIR macro for autoconf is used we possibly
1682 dnl find the mkinstalldirs script in another subdir but $(top_srcdir).
1683 dnl Try to locate is.
1685 if test -n "$ac_aux_dir"; then
1686 MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs"
1688 if test -z "$MKINSTALLDIRS"; then
1689 MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs"
1691 AC_SUBST(MKINSTALLDIRS)
1694 # lib-prefix.m4 serial 1 (gettext-0.11)
1695 dnl Copyright (C) 2001-2002 Free Software Foundation, Inc.
1696 dnl This file is free software, distributed under the terms of the GNU
1697 dnl General Public License. As a special exception to the GNU General
1698 dnl Public License, this file may be distributed as part of a program
1699 dnl that contains a configuration script generated by Autoconf, under
1700 dnl the same distribution terms as the rest of that program.
1702 dnl From Bruno Haible.
1704 dnl AC_LIB_PREFIX adds to the CPPFLAGS and LDFLAGS the flags that are needed
1705 dnl to access previously installed libraries. The basic assumption is that
1706 dnl a user will want packages to use other packages he previously installed
1707 dnl with the same --prefix option.
1708 dnl This macro is not needed if only AC_LIB_LINKFLAGS is used to locate
1709 dnl libraries, but is otherwise very convenient.
1710 AC_DEFUN([AC_LIB_PREFIX],
1712 AC_BEFORE([$0], [AC_LIB_LINKFLAGS])
1713 AC_REQUIRE([AC_PROG_CC])
1714 AC_REQUIRE([AC_CANONICAL_HOST])
1715 AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
1716 dnl By default, look in $includedir and $libdir.
1718 AC_LIB_WITH_FINAL_PREFIX([
1719 eval additional_includedir=\"$includedir\"
1720 eval additional_libdir=\"$libdir\"
1722 AC_ARG_WITH([lib-prefix],
1723 [ --with-lib-prefix[=DIR] search for libraries in DIR/include and DIR/lib
1724 --without-lib-prefix don't search for libraries in includedir and libdir],
1726 if test "X$withval" = "Xno"; then
1729 if test "X$withval" = "X"; then
1730 AC_LIB_WITH_FINAL_PREFIX([
1731 eval additional_includedir=\"$includedir\"
1732 eval additional_libdir=\"$libdir\"
1735 additional_includedir="$withval/include"
1736 additional_libdir="$withval/lib"
1740 if test $use_additional = yes; then
1741 dnl Potentially add $additional_includedir to $CPPFLAGS.
1742 dnl But don't add it
1743 dnl 1. if it's the standard /usr/include,
1744 dnl 2. if it's already present in $CPPFLAGS,
1745 dnl 3. if it's /usr/local/include and we are using GCC on Linux,
1746 dnl 4. if it doesn't exist as a directory.
1747 if test "X$additional_includedir" != "X/usr/include"; then
1749 for x in $CPPFLAGS; do
1750 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
1751 if test "X$x" = "X-I$additional_includedir"; then
1756 if test -z "$haveit"; then
1757 if test "X$additional_includedir" = "X/usr/local/include"; then
1758 if test -n "$GCC"; then
1760 linux*) haveit=yes;;
1764 if test -z "$haveit"; then
1765 if test -d "$additional_includedir"; then
1766 dnl Really add $additional_includedir to $CPPFLAGS.
1767 CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }-I$additional_includedir"
1772 dnl Potentially add $additional_libdir to $LDFLAGS.
1773 dnl But don't add it
1774 dnl 1. if it's the standard /usr/lib,
1775 dnl 2. if it's already present in $LDFLAGS,
1776 dnl 3. if it's /usr/local/lib and we are using GCC on Linux,
1777 dnl 4. if it doesn't exist as a directory.
1778 if test "X$additional_libdir" != "X/usr/lib"; then
1780 for x in $LDFLAGS; do
1781 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
1782 if test "X$x" = "X-L$additional_libdir"; then
1787 if test -z "$haveit"; then
1788 if test "X$additional_libdir" = "X/usr/local/lib"; then
1789 if test -n "$GCC"; then
1791 linux*) haveit=yes;;
1795 if test -z "$haveit"; then
1796 if test -d "$additional_libdir"; then
1797 dnl Really add $additional_libdir to $LDFLAGS.
1798 LDFLAGS="${LDFLAGS}${LDFLAGS:+ }-L$additional_libdir"
1806 dnl AC_LIB_PREPARE_PREFIX creates variables acl_final_prefix,
1807 dnl acl_final_exec_prefix, containing the values to which $prefix and
1808 dnl $exec_prefix will expand at the end of the configure script.
1809 AC_DEFUN([AC_LIB_PREPARE_PREFIX],
1811 dnl Unfortunately, prefix and exec_prefix get only finally determined
1812 dnl at the end of configure.
1813 if test "X$prefix" = "XNONE"; then
1814 acl_final_prefix="$ac_default_prefix"
1816 acl_final_prefix="$prefix"
1818 if test "X$exec_prefix" = "XNONE"; then
1819 acl_final_exec_prefix='${prefix}'
1821 acl_final_exec_prefix="$exec_prefix"
1823 acl_save_prefix="$prefix"
1824 prefix="$acl_final_prefix"
1825 eval acl_final_exec_prefix=\"$acl_final_exec_prefix\"
1826 prefix="$acl_save_prefix"
1829 dnl AC_LIB_WITH_FINAL_PREFIX([statement]) evaluates statement, with the
1830 dnl variables prefix and exec_prefix bound to the values they will have
1831 dnl at the end of the configure script.
1832 AC_DEFUN([AC_LIB_WITH_FINAL_PREFIX],
1834 acl_save_prefix="$prefix"
1835 prefix="$acl_final_prefix"
1836 acl_save_exec_prefix="$exec_prefix"
1837 exec_prefix="$acl_final_exec_prefix"
1839 exec_prefix="$acl_save_exec_prefix"
1840 prefix="$acl_save_prefix"
1843 # lib-link.m4 serial 1 (gettext-0.11)
1844 dnl Copyright (C) 2001-2002 Free Software Foundation, Inc.
1845 dnl This file is free software, distributed under the terms of the GNU
1846 dnl General Public License. As a special exception to the GNU General
1847 dnl Public License, this file may be distributed as part of a program
1848 dnl that contains a configuration script generated by Autoconf, under
1849 dnl the same distribution terms as the rest of that program.
1851 dnl From Bruno Haible.
1853 dnl AC_LIB_LINKFLAGS(name [, dependencies]) searches for libname and
1854 dnl the libraries corresponding to explicit and implicit dependencies.
1855 dnl Sets and AC_SUBSTs the LIB${NAME} and LTLIB${NAME} variables and
1856 dnl augments the CPPFLAGS variable.
1857 AC_DEFUN([AC_LIB_LINKFLAGS],
1859 AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
1860 AC_REQUIRE([AC_LIB_RPATH])
1861 define([Name],[translit([$1],[./-], [___])])
1862 define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
1863 [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
1864 AC_CACHE_CHECK([how to link with lib[]$1], [ac_cv_lib[]Name[]_libs], [
1865 AC_LIB_LINKFLAGS_BODY([$1], [$2])
1866 ac_cv_lib[]Name[]_libs="$LIB[]NAME"
1867 ac_cv_lib[]Name[]_ltlibs="$LTLIB[]NAME"
1868 ac_cv_lib[]Name[]_cppflags="$INC[]NAME"
1870 LIB[]NAME="$ac_cv_lib[]Name[]_libs"
1871 LTLIB[]NAME="$ac_cv_lib[]Name[]_ltlibs"
1872 INC[]NAME="$ac_cv_lib[]Name[]_cppflags"
1873 AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
1875 AC_SUBST([LTLIB]NAME)
1876 dnl Also set HAVE_LIB[]NAME so that AC_LIB_HAVE_LINKFLAGS can reuse the
1877 dnl results of this search when this library appears as a dependency.
1883 dnl AC_LIB_HAVE_LINKFLAGS(name, dependencies, includes, testcode)
1884 dnl searches for libname and the libraries corresponding to explicit and
1885 dnl implicit dependencies, together with the specified include files and
1886 dnl the ability to compile and link the specified testcode. If found, it
1887 dnl sets and AC_SUBSTs HAVE_LIB${NAME}=yes and the LIB${NAME} and
1888 dnl LTLIB${NAME} variables and augments the CPPFLAGS variable, and
1889 dnl #defines HAVE_LIB${NAME} to 1. Otherwise, it sets and AC_SUBSTs
1890 dnl HAVE_LIB${NAME}=no and LIB${NAME} and LTLIB${NAME} to empty.
1891 AC_DEFUN([AC_LIB_HAVE_LINKFLAGS],
1893 AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
1894 AC_REQUIRE([AC_LIB_RPATH])
1895 define([Name],[translit([$1],[./-], [___])])
1896 define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
1897 [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
1899 dnl Search for lib[]Name and define LIB[]NAME, LTLIB[]NAME and INC[]NAME
1901 AC_LIB_LINKFLAGS_BODY([$1], [$2])
1903 dnl Add $INC[]NAME to CPPFLAGS before performing the following checks,
1904 dnl because if the user has installed lib[]Name and not disabled its use
1905 dnl via --without-lib[]Name-prefix, he wants to use it.
1906 ac_save_CPPFLAGS="$CPPFLAGS"
1907 AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
1909 AC_CACHE_CHECK([for lib[]$1], [ac_cv_lib[]Name], [
1910 ac_save_LIBS="$LIBS"
1911 LIBS="$LIBS $LIB[]NAME"
1912 AC_TRY_LINK([$3], [$4], [ac_cv_lib[]Name=yes], [ac_cv_lib[]Name=no])
1913 LIBS="$ac_save_LIBS"
1915 if test "$ac_cv_lib[]Name" = yes; then
1917 AC_DEFINE([HAVE_LIB]NAME, 1, [Define if you have the $1 library.])
1918 AC_MSG_CHECKING([how to link with lib[]$1])
1919 AC_MSG_RESULT([$LIB[]NAME])
1922 dnl If $LIB[]NAME didn't lead to a usable library, we don't need
1923 dnl $INC[]NAME either.
1924 CPPFLAGS="$ac_save_CPPFLAGS"
1928 AC_SUBST([HAVE_LIB]NAME)
1930 AC_SUBST([LTLIB]NAME)
1935 dnl Determine the platform dependent parameters needed to use rpath:
1936 dnl libext, shlibext, hardcode_libdir_flag_spec, hardcode_libdir_separator,
1937 dnl hardcode_direct, hardcode_minus_L,
1938 dnl sys_lib_search_path_spec, sys_lib_dlsearch_path_spec.
1939 AC_DEFUN([AC_LIB_RPATH],
1941 AC_REQUIRE([AC_PROG_CC]) dnl we use $CC, $GCC, $LDFLAGS
1942 AC_REQUIRE([AC_LIB_PROG_LD]) dnl we use $LD, $with_gnu_ld
1943 AC_REQUIRE([AC_CANONICAL_HOST]) dnl we use $host
1944 AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT]) dnl we use $ac_aux_dir
1945 AC_CACHE_CHECK([for shared library run path origin], acl_cv_rpath, [
1946 CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \
1947 ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh
1953 libext="$acl_cv_libext"
1954 shlibext="$acl_cv_shlibext"
1955 hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec"
1956 hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator"
1957 hardcode_direct="$acl_cv_hardcode_direct"
1958 hardcode_minus_L="$acl_cv_hardcode_minus_L"
1959 sys_lib_search_path_spec="$acl_cv_sys_lib_search_path_spec"
1960 sys_lib_dlsearch_path_spec="$acl_cv_sys_lib_dlsearch_path_spec"
1963 dnl AC_LIB_LINKFLAGS_BODY(name [, dependencies]) searches for libname and
1964 dnl the libraries corresponding to explicit and implicit dependencies.
1965 dnl Sets the LIB${NAME}, LTLIB${NAME} and INC${NAME} variables.
1966 AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
1968 define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
1969 [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
1970 dnl By default, look in $includedir and $libdir.
1972 AC_LIB_WITH_FINAL_PREFIX([
1973 eval additional_includedir=\"$includedir\"
1974 eval additional_libdir=\"$libdir\"
1976 AC_ARG_WITH([lib$1-prefix],
1977 [ --with-lib$1-prefix[=DIR] search for lib$1 in DIR/include and DIR/lib
1978 --without-lib$1-prefix don't search for lib$1 in includedir and libdir],
1980 if test "X$withval" = "Xno"; then
1983 if test "X$withval" = "X"; then
1984 AC_LIB_WITH_FINAL_PREFIX([
1985 eval additional_includedir=\"$includedir\"
1986 eval additional_libdir=\"$libdir\"
1989 additional_includedir="$withval/include"
1990 additional_libdir="$withval/lib"
1994 dnl Search the library and its dependencies in $additional_libdir and
1995 dnl $LDFLAGS. Using breadth-first-seach.
2001 names_already_handled=
2002 names_next_round='$1 $2'
2003 while test -n "$names_next_round"; do
2004 names_this_round="$names_next_round"
2006 for name in $names_this_round; do
2008 for n in $names_already_handled; do
2009 if test "$n" = "$name"; then
2014 if test -z "$already_handled"; then
2015 names_already_handled="$names_already_handled $name"
2016 dnl See if it was already located by an earlier AC_LIB_LINKFLAGS
2017 dnl or AC_LIB_HAVE_LINKFLAGS call.
2018 uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'`
2019 eval value=\"\$HAVE_LIB$uppername\"
2020 if test -n "$value"; then
2021 if test "$value" = yes; then
2022 eval value=\"\$LIB$uppername\"
2023 test -z "$value" || LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$value"
2024 eval value=\"\$LTLIB$uppername\"
2025 test -z "$value" || LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$value"
2027 dnl An earlier call to AC_LIB_HAVE_LINKFLAGS has determined
2028 dnl that this library doesn't exist. So just drop it.
2032 dnl Search the library lib$name in $additional_libdir and $LDFLAGS
2033 dnl and the already constructed $LIBNAME/$LTLIBNAME.
2038 if test $use_additional = yes; then
2039 if test -n "$shlibext" && test -f "$additional_libdir/lib$name.$shlibext"; then
2040 found_dir="$additional_libdir"
2041 found_so="$additional_libdir/lib$name.$shlibext"
2042 if test -f "$additional_libdir/lib$name.la"; then
2043 found_la="$additional_libdir/lib$name.la"
2046 if test -f "$additional_libdir/lib$name.$libext"; then
2047 found_dir="$additional_libdir"
2048 found_a="$additional_libdir/lib$name.$libext"
2049 if test -f "$additional_libdir/lib$name.la"; then
2050 found_la="$additional_libdir/lib$name.la"
2055 if test "X$found_dir" = "X"; then
2056 for x in $LDFLAGS $LTLIB[]NAME; do
2057 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
2060 dir=`echo "X$x" | sed -e 's/^X-L//'`
2061 if test -n "$shlibext" && test -f "$dir/lib$name.$shlibext"; then
2063 found_so="$dir/lib$name.$shlibext"
2064 if test -f "$dir/lib$name.la"; then
2065 found_la="$dir/lib$name.la"
2068 if test -f "$dir/lib$name.$libext"; then
2070 found_a="$dir/lib$name.$libext"
2071 if test -f "$dir/lib$name.la"; then
2072 found_la="$dir/lib$name.la"
2078 if test "X$found_dir" != "X"; then
2083 if test "X$found_dir" != "X"; then
2084 dnl Found the library.
2085 LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$found_dir -l$name"
2086 if test "X$found_so" != "X"; then
2087 dnl Linking with a shared library. We attempt to hardcode its
2088 dnl directory into the executable's runpath, unless it's the
2089 dnl standard /usr/lib.
2090 if test "X$found_dir" = "X/usr/lib"; then
2091 dnl No hardcoding is needed.
2092 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
2094 dnl Use an explicit option to hardcode DIR into the resulting
2096 dnl Potentially add DIR to ltrpathdirs.
2097 dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
2099 for x in $ltrpathdirs; do
2100 if test "X$x" = "X$found_dir"; then
2105 if test -z "$haveit"; then
2106 ltrpathdirs="$ltrpathdirs $found_dir"
2108 dnl The hardcoding into $LIBNAME is system dependent.
2109 if test "$hardcode_direct" = yes; then
2110 dnl Using DIR/libNAME.so during linking hardcodes DIR into the
2111 dnl resulting binary.
2112 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
2114 if test -n "$hardcode_libdir_flag_spec" && test "$hardcode_minus_L" = no; then
2115 dnl Use an explicit option to hardcode DIR into the resulting
2117 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
2118 dnl Potentially add DIR to rpathdirs.
2119 dnl The rpathdirs will be appended to $LIBNAME at the end.
2121 for x in $rpathdirs; do
2122 if test "X$x" = "X$found_dir"; then
2127 if test -z "$haveit"; then
2128 rpathdirs="$rpathdirs $found_dir"
2131 dnl Rely on "-L$found_dir".
2132 dnl But don't add it if it's already contained in the LDFLAGS
2133 dnl or the already constructed $LIBNAME
2135 for x in $LDFLAGS $LIB[]NAME; do
2136 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
2137 if test "X$x" = "X-L$found_dir"; then
2142 if test -z "$haveit"; then
2143 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir"
2145 if test "$hardcode_minus_L" != no; then
2146 dnl FIXME: Not sure whether we should use
2147 dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
2149 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
2151 dnl We cannot use $hardcode_runpath_var and LD_RUN_PATH
2152 dnl here, because this doesn't fit in flags passed to the
2153 dnl compiler. So give up. No hardcoding. This affects only
2154 dnl very old systems.
2155 dnl FIXME: Not sure whether we should use
2156 dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
2158 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"
2164 if test "X$found_a" != "X"; then
2165 dnl Linking with a static library.
2166 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_a"
2168 dnl We shouldn't come here, but anyway it's good to have a
2170 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir -l$name"
2173 dnl Assume the include files are nearby.
2174 additional_includedir=
2175 case "$found_dir" in
2177 basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e 's,/lib/*$,,'`
2178 additional_includedir="$basedir/include"
2181 if test "X$additional_includedir" != "X"; then
2182 dnl Potentially add $additional_includedir to $INCNAME.
2183 dnl But don't add it
2184 dnl 1. if it's the standard /usr/include,
2185 dnl 2. if it's /usr/local/include and we are using GCC on Linux,
2186 dnl 3. if it's already present in $CPPFLAGS or the already
2187 dnl constructed $INCNAME,
2188 dnl 4. if it doesn't exist as a directory.
2189 if test "X$additional_includedir" != "X/usr/include"; then
2191 if test "X$additional_includedir" = "X/usr/local/include"; then
2192 if test -n "$GCC"; then
2194 linux*) haveit=yes;;
2198 if test -z "$haveit"; then
2199 for x in $CPPFLAGS $INC[]NAME; do
2200 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
2201 if test "X$x" = "X-I$additional_includedir"; then
2206 if test -z "$haveit"; then
2207 if test -d "$additional_includedir"; then
2208 dnl Really add $additional_includedir to $INCNAME.
2209 INC[]NAME="${INC[]NAME}${INC[]NAME:+ }-I$additional_includedir"
2215 dnl Look for dependencies.
2216 if test -n "$found_la"; then
2217 dnl Read the .la file. It defines the variables
2218 dnl dlname, library_names, old_library, dependency_libs, current,
2219 dnl age, revision, installed, dlopen, dlpreopen, libdir.
2220 save_libdir="$libdir"
2222 */* | *\\*) . "$found_la" ;;
2223 *) . "./$found_la" ;;
2225 libdir="$save_libdir"
2226 dnl We use only dependency_libs.
2227 for dep in $dependency_libs; do
2230 additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'`
2231 dnl Potentially add $additional_libdir to $LIBNAME and $LTLIBNAME.
2232 dnl But don't add it
2233 dnl 1. if it's the standard /usr/lib,
2234 dnl 2. if it's /usr/local/lib and we are using GCC on Linux,
2235 dnl 3. if it's already present in $LDFLAGS or the already
2236 dnl constructed $LIBNAME,
2237 dnl 4. if it doesn't exist as a directory.
2238 if test "X$additional_libdir" != "X/usr/lib"; then
2240 if test "X$additional_libdir" = "X/usr/local/lib"; then
2241 if test -n "$GCC"; then
2243 linux*) haveit=yes;;
2247 if test -z "$haveit"; then
2249 for x in $LDFLAGS $LIB[]NAME; do
2250 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
2251 if test "X$x" = "X-L$additional_libdir"; then
2256 if test -z "$haveit"; then
2257 if test -d "$additional_libdir"; then
2258 dnl Really add $additional_libdir to $LIBNAME.
2259 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$additional_libdir"
2263 for x in $LDFLAGS $LTLIB[]NAME; do
2264 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
2265 if test "X$x" = "X-L$additional_libdir"; then
2270 if test -z "$haveit"; then
2271 if test -d "$additional_libdir"; then
2272 dnl Really add $additional_libdir to $LTLIBNAME.
2273 LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$additional_libdir"
2280 dnl Handle this in the next round.
2281 names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'`
2284 dnl Handle this in the next round. Throw away the .la's
2285 dnl directory; it is already contained in a preceding -L
2287 names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'`
2290 dnl Most likely an immediate library name.
2291 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$dep"
2292 LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$dep"
2298 dnl Didn't find the library; assume it is in the system directories
2299 dnl known to the linker and runtime loader. (All the system
2300 dnl directories known to the linker should also be known to the
2301 dnl runtime loader, otherwise the system is severely misconfigured.)
2302 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"
2303 LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-l$name"
2309 if test "X$rpathdirs" != "X"; then
2310 if test -n "$hardcode_libdir_separator"; then
2311 dnl Weird platform: only the last -rpath option counts, the user must
2312 dnl pass all path elements in one option. We can arrange that for a
2313 dnl single library, but not when more than one $LIBNAMEs are used.
2315 for found_dir in $rpathdirs; do
2316 alldirs="${alldirs}${alldirs:+$hardcode_libdir_separator}$found_dir"
2318 dnl Note: hardcode_libdir_flag_spec uses $libdir and $wl.
2319 acl_save_libdir="$libdir"
2321 eval flag=\"$hardcode_libdir_flag_spec\"
2322 libdir="$acl_save_libdir"
2323 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
2325 dnl The -rpath options are cumulative.
2326 for found_dir in $rpathdirs; do
2327 acl_save_libdir="$libdir"
2329 eval flag=\"$hardcode_libdir_flag_spec\"
2330 libdir="$acl_save_libdir"
2331 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
2335 if test "X$ltrpathdirs" != "X"; then
2336 dnl When using libtool, the option that works for both libraries and
2337 dnl executables is -R. The -R options are cumulative.
2338 for found_dir in $ltrpathdirs; do
2339 LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-R$found_dir"
2344 dnl AC_LIB_APPENDTOVAR(VAR, CONTENTS) appends the elements of CONTENTS to VAR,
2345 dnl unless already present in VAR.
2346 dnl Works only for CPPFLAGS, not for LIB* variables because that sometimes
2347 dnl contains two or three consecutive elements that belong together.
2348 AC_DEFUN([AC_LIB_APPENDTOVAR],
2350 for element in [$2]; do
2353 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
2354 if test "X$x" = "X$element"; then
2359 if test -z "$haveit"; then
2360 [$1]="${[$1]}${[$1]:+ }$element"
2365 # lib-ld.m4 serial 1 (gettext-0.11)
2366 dnl Copyright (C) 1996-2002 Free Software Foundation, Inc.
2367 dnl This file is free software, distributed under the terms of the GNU
2368 dnl General Public License. As a special exception to the GNU General
2369 dnl Public License, this file may be distributed as part of a program
2370 dnl that contains a configuration script generated by Autoconf, under
2371 dnl the same distribution terms as the rest of that program.
2373 dnl Subroutines of libtool.m4,
2374 dnl with replacements s/AC_/AC_LIB/ and s/lt_cv/acl_cv/ to avoid collision
2375 dnl with libtool.m4.
2377 dnl From libtool-1.4. Sets the variable with_gnu_ld to yes or no.
2378 AC_DEFUN([AC_LIB_PROG_LD_GNU],
2379 [AC_CACHE_CHECK([if the linker ($LD) is GNU ld], acl_cv_prog_gnu_ld,
2380 [# I'd rather use --version here, but apparently some GNU ld's only accept -v.
2381 if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
2382 acl_cv_prog_gnu_ld=yes
2384 acl_cv_prog_gnu_ld=no
2386 with_gnu_ld=$acl_cv_prog_gnu_ld
2389 dnl From libtool-1.4. Sets the variable LD.
2390 AC_DEFUN([AC_LIB_PROG_LD],
2391 [AC_ARG_WITH(gnu-ld,
2392 [ --with-gnu-ld assume the C compiler uses GNU ld [default=no]],
2393 test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
2394 AC_REQUIRE([AC_PROG_CC])dnl
2395 AC_REQUIRE([AC_CANONICAL_HOST])dnl
2397 if test "$GCC" = yes; then
2398 # Check if gcc -print-prog-name=ld gives a path.
2399 AC_MSG_CHECKING([for ld used by GCC])
2402 # gcc leaves a trailing carriage return which upsets mingw
2403 ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
2405 ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
2408 # Accept absolute paths.
2409 [[\\/]* | [A-Za-z]:[\\/]*)]
2410 [re_direlt='/[^/][^/]*/\.\./']
2411 # Canonicalize the path of ld
2412 ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
2413 while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
2414 ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
2416 test -z "$LD" && LD="$ac_prog"
2419 # If it fails, then pretend we aren't using GCC.
2423 # If it is relative, then search for the first ld in PATH.
2427 elif test "$with_gnu_ld" = yes; then
2428 AC_MSG_CHECKING([for GNU ld])
2430 AC_MSG_CHECKING([for non-GNU ld])
2432 AC_CACHE_VAL(acl_cv_path_LD,
2433 [if test -z "$LD"; then
2434 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
2435 for ac_dir in $PATH; do
2436 test -z "$ac_dir" && ac_dir=.
2437 if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
2438 acl_cv_path_LD="$ac_dir/$ac_prog"
2439 # Check to see if the program is GNU ld. I'd rather use --version,
2440 # but apparently some GNU ld's only accept -v.
2441 # Break only if it was the GNU/non-GNU ld that we prefer.
2442 if "$acl_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
2443 test "$with_gnu_ld" != no && break
2445 test "$with_gnu_ld" != yes && break
2451 acl_cv_path_LD="$LD" # Let the user override the test with a path.
2453 LD="$acl_cv_path_LD"
2454 if test -n "$LD"; then
2459 test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
2463 # iconv.m4 serial AM3 (gettext-0.11)
2464 dnl Copyright (C) 2000-2002 Free Software Foundation, Inc.
2465 dnl This file is free software, distributed under the terms of the GNU
2466 dnl General Public License. As a special exception to the GNU General
2467 dnl Public License, this file may be distributed as part of a program
2468 dnl that contains a configuration script generated by Autoconf, under
2469 dnl the same distribution terms as the rest of that program.
2471 dnl From Bruno Haible.
2473 AC_DEFUN([AM_ICONV_LINK],
2475 dnl Some systems have iconv in libc, some have it in libiconv (OSF/1 and
2476 dnl those with the standalone portable GNU libiconv installed).
2478 dnl Prerequisites of AC_LIB_LINKFLAGS_BODY.
2479 AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
2480 AC_REQUIRE([AC_LIB_RPATH])
2482 dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV
2484 AC_LIB_LINKFLAGS_BODY([iconv])
2486 dnl Add $INCICONV to CPPFLAGS before performing the following checks,
2487 dnl because if the user has installed libiconv and not disabled its use
2488 dnl via --without-libiconv-prefix, he wants to use it. The first
2489 dnl AC_TRY_LINK will then fail, the second AC_TRY_LINK will succeed.
2490 am_save_CPPFLAGS="$CPPFLAGS"
2491 AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCICONV])
2493 AC_CACHE_CHECK(for iconv, am_cv_func_iconv, [
2494 am_cv_func_iconv="no, consider installing GNU libiconv"
2496 AC_TRY_LINK([#include <stdlib.h>
2497 #include <iconv.h>],
2498 [iconv_t cd = iconv_open("","");
2499 iconv(cd,NULL,NULL,NULL,NULL);
2501 am_cv_func_iconv=yes)
2502 if test "$am_cv_func_iconv" != yes; then
2503 am_save_LIBS="$LIBS"
2504 LIBS="$LIBS $LIBICONV"
2505 AC_TRY_LINK([#include <stdlib.h>
2506 #include <iconv.h>],
2507 [iconv_t cd = iconv_open("","");
2508 iconv(cd,NULL,NULL,NULL,NULL);
2511 am_cv_func_iconv=yes)
2512 LIBS="$am_save_LIBS"
2515 if test "$am_cv_func_iconv" = yes; then
2516 AC_DEFINE(HAVE_ICONV, 1, [Define if you have the iconv() function.])
2518 if test "$am_cv_lib_iconv" = yes; then
2519 AC_MSG_CHECKING([how to link with libiconv])
2520 AC_MSG_RESULT([$LIBICONV])
2522 dnl If $LIBICONV didn't lead to a usable library, we don't need $INCICONV
2524 CPPFLAGS="$am_save_CPPFLAGS"
2529 AC_SUBST(LTLIBICONV)
2532 AC_DEFUN([AM_ICONV],
2534 AC_REQUIRE([AM_ICONV_LINK])
2535 if test "$am_cv_func_iconv" = yes; then
2536 AC_MSG_CHECKING([for iconv declaration])
2537 AC_CACHE_VAL(am_cv_proto_iconv, [
2545 #if defined(__STDC__) || defined(__cplusplus)
2546 size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
2550 ], [], am_cv_proto_iconv_arg1="", am_cv_proto_iconv_arg1="const")
2551 am_cv_proto_iconv="extern size_t iconv (iconv_t cd, $am_cv_proto_iconv_arg1 char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);"])
2552 am_cv_proto_iconv=`echo "[$]am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'`
2553 AC_MSG_RESULT([$]{ac_t:-
2554 }[$]am_cv_proto_iconv)
2555 AC_DEFINE_UNQUOTED(ICONV_CONST, $am_cv_proto_iconv_arg1,
2556 [Define as const if the declaration of iconv() needs const.])
2560 # progtest.m4 serial 2 (gettext-0.10.40)
2561 dnl Copyright (C) 1996-2002 Free Software Foundation, Inc.
2562 dnl This file is free software, distributed under the terms of the GNU
2563 dnl General Public License. As a special exception to the GNU General
2564 dnl Public License, this file may be distributed as part of a program
2565 dnl that contains a configuration script generated by Autoconf, under
2566 dnl the same distribution terms as the rest of that program.
2568 dnl This file can can be used in projects which are not available under
2569 dnl the GNU General Public License or the GNU Library General Public
2570 dnl License but which still want to provide support for the GNU gettext
2572 dnl Please note that the actual code of the GNU gettext library is covered
2573 dnl by the GNU Library General Public License, and the rest of the GNU
2574 dnl gettext package package is covered by the GNU General Public License.
2575 dnl They are *not* in the public domain.
2578 dnl Ulrich Drepper <drepper@cygnus.com>, 1996.
2580 # Search path for a program which passes the given test.
2582 dnl AM_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR,
2583 dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
2584 AC_DEFUN([AM_PATH_PROG_WITH_TEST],
2585 [# Extract the first word of "$2", so it can be a program name with args.
2586 set dummy $2; ac_word=[$]2
2587 AC_MSG_CHECKING([for $ac_word])
2588 AC_CACHE_VAL(ac_cv_path_$1,
2591 ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
2594 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
2595 for ac_dir in ifelse([$5], , $PATH, [$5]); do
2596 test -z "$ac_dir" && ac_dir=.
2597 if test -f $ac_dir/$ac_word; then
2599 ac_cv_path_$1="$ac_dir/$ac_word"
2605 dnl If no 4th arg is given, leave the cache variable unset,
2606 dnl so AC_PATH_PROGS will keep looking.
2607 ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
2612 if test ifelse([$4], , [-n "[$]$1"], ["[$]$1" != "$4"]); then
2613 AC_MSG_RESULT([$]$1)
2620 # glibc21.m4 serial 2 (fileutils-4.1.3, gettext-0.10.40)
2621 dnl Copyright (C) 2000-2002 Free Software Foundation, Inc.
2622 dnl This file is free software, distributed under the terms of the GNU
2623 dnl General Public License. As a special exception to the GNU General
2624 dnl Public License, this file may be distributed as part of a program
2625 dnl that contains a configuration script generated by Autoconf, under
2626 dnl the same distribution terms as the rest of that program.
2628 # Test for the GNU C Library, version 2.1 or newer.
2629 # From Bruno Haible.
2631 AC_DEFUN([jm_GLIBC21],
2633 AC_CACHE_CHECK(whether we are using the GNU C Library 2.1 or newer,
2634 ac_cv_gnu_library_2_1,
2635 [AC_EGREP_CPP([Lucky GNU user],
2637 #include <features.h>
2638 #ifdef __GNU_LIBRARY__
2639 #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1) || (__GLIBC__ > 2)
2644 ac_cv_gnu_library_2_1=yes,
2645 ac_cv_gnu_library_2_1=no)
2649 GLIBC21="$ac_cv_gnu_library_2_1"
2653 # codeset.m4 serial AM1 (gettext-0.10.40)
2654 dnl Copyright (C) 2000-2002 Free Software Foundation, Inc.
2655 dnl This file is free software, distributed under the terms of the GNU
2656 dnl General Public License. As a special exception to the GNU General
2657 dnl Public License, this file may be distributed as part of a program
2658 dnl that contains a configuration script generated by Autoconf, under
2659 dnl the same distribution terms as the rest of that program.
2661 dnl From Bruno Haible.
2663 AC_DEFUN([AM_LANGINFO_CODESET],
2665 AC_CACHE_CHECK([for nl_langinfo and CODESET], am_cv_langinfo_codeset,
2666 [AC_TRY_LINK([#include <langinfo.h>],
2667 [char* cs = nl_langinfo(CODESET);],
2668 am_cv_langinfo_codeset=yes,
2669 am_cv_langinfo_codeset=no)
2671 if test $am_cv_langinfo_codeset = yes; then
2672 AC_DEFINE(HAVE_LANGINFO_CODESET, 1,
2673 [Define if you have <langinfo.h> and nl_langinfo(CODESET).])
2677 # lcmessage.m4 serial 2 (gettext-0.10.40)
2678 dnl Copyright (C) 1995-2002 Free Software Foundation, Inc.
2679 dnl This file is free software, distributed under the terms of the GNU
2680 dnl General Public License. As a special exception to the GNU General
2681 dnl Public License, this file may be distributed as part of a program
2682 dnl that contains a configuration script generated by Autoconf, under
2683 dnl the same distribution terms as the rest of that program.
2685 dnl This file can can be used in projects which are not available under
2686 dnl the GNU General Public License or the GNU Library General Public
2687 dnl License but which still want to provide support for the GNU gettext
2689 dnl Please note that the actual code of the GNU gettext library is covered
2690 dnl by the GNU Library General Public License, and the rest of the GNU
2691 dnl gettext package package is covered by the GNU General Public License.
2692 dnl They are *not* in the public domain.
2695 dnl Ulrich Drepper <drepper@cygnus.com>, 1995.
2697 # Check whether LC_MESSAGES is available in <locale.h>.
2699 AC_DEFUN([AM_LC_MESSAGES],
2700 [if test $ac_cv_header_locale_h = yes; then
2701 AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES,
2702 [AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
2703 am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)])
2704 if test $am_cv_val_LC_MESSAGES = yes; then
2705 AC_DEFINE(HAVE_LC_MESSAGES, 1,
2706 [Define if your <locale.h> file defines LC_MESSAGES.])
2712 dnl From Paul Eggert.
2714 # Define ST_MTIM_NSEC to be the nanoseconds member of struct stat's st_mtim,
2717 AC_DEFUN([AC_STRUCT_ST_MTIM_NSEC],
2718 [AC_CACHE_CHECK([for nanoseconds member of struct stat.st_mtim],
2719 ac_cv_struct_st_mtim_nsec,
2720 [ac_save_CPPFLAGS="$CPPFLAGS"
2721 ac_cv_struct_st_mtim_nsec=no
2722 # tv_nsec -- the usual case
2723 # _tv_nsec -- Solaris 2.6, if
2724 # (defined _XOPEN_SOURCE && _XOPEN_SOURCE_EXTENDED == 1
2725 # && !defined __EXTENSIONS__)
2726 # st__tim.tv_nsec -- UnixWare 2.1.2
2727 for ac_val in tv_nsec _tv_nsec st__tim.tv_nsec; do
2728 CPPFLAGS="$ac_save_CPPFLAGS -DST_MTIM_NSEC=$ac_val"
2729 AC_TRY_COMPILE([#include <sys/types.h>
2730 #include <sys/stat.h>], [struct stat s; s.st_mtim.ST_MTIM_NSEC;],
2731 [ac_cv_struct_st_mtim_nsec=$ac_val; break])
2733 CPPFLAGS="$ac_save_CPPFLAGS"])
2735 if test $ac_cv_struct_st_mtim_nsec != no; then
2736 AC_DEFINE_UNQUOTED(ST_MTIM_NSEC, $ac_cv_struct_st_mtim_nsec,
2737 [Define to be the nanoseconds member of struct stat's st_mtim,
2743 #serial 7 -*- autoconf -*-
2745 dnl From Jim Meyering.
2747 dnl See if the glibc *_unlocked I/O macros are available.
2748 dnl Use only those *_unlocked macros that are declared.
2751 AC_DEFUN([jm_FUNC_GLIBC_UNLOCKED_IO],
2753 [clearerr_unlocked, feof_unlocked, ferror_unlocked,
2754 fflush_unlocked, fgets_unlocked, fputc_unlocked, fputs_unlocked,
2755 fread_unlocked, fwrite_unlocked, getc_unlocked,
2756 getchar_unlocked, putc_unlocked, putchar_unlocked])])
2760 dnl This macro is intended to be used solely in this file.
2761 dnl These are the prerequisite macros for GNU's strftime.c replacement.
2762 AC_DEFUN([_jm_STRFTIME_PREREQS],
2764 dnl strftime.c uses localtime_r and the underyling system strftime
2766 AC_CHECK_FUNCS(localtime_r strftime)
2768 AC_CHECK_HEADERS(limits.h)
2769 AC_CHECK_FUNCS(bcopy tzset mempcpy memcpy memset)
2771 # This defines (or not) HAVE_TZNAME and HAVE_TM_ZONE.
2774 AC_CHECK_FUNCS(mblen mbrlen)
2776 AC_CHECK_MEMBER([struct tm.tm_gmtoff],
2777 [AC_DEFINE(HAVE_TM_GMTOFF, 1,
2778 [Define if struct tm has the tm_gmtoff member.])],
2780 [#include <time.h>])
2783 dnl From Jim Meyering.
2785 AC_DEFUN([jm_FUNC_GNU_STRFTIME],
2786 [AC_REQUIRE([AC_HEADER_TIME])dnl
2788 _jm_STRFTIME_PREREQS
2790 AC_REQUIRE([AC_C_CONST])dnl
2791 AC_REQUIRE([AC_HEADER_STDC])dnl
2792 AC_CHECK_HEADERS(sys/time.h)
2793 AC_DEFINE([my_strftime], [nstrftime],
2794 [Define to the name of the strftime replacement function.])
2797 AC_DEFUN([jm_FUNC_STRFTIME],
2799 _jm_STRFTIME_PREREQS
2804 dnl From Jim Meyering.
2805 dnl Determine whether malloc accepts 0 as its argument.
2806 dnl If it doesn't, arrange to use the replacement function.
2809 AC_DEFUN([jm_FUNC_MALLOC],
2811 dnl xmalloc.c requires that this symbol be defined so it doesn't
2812 dnl mistakenly use a broken malloc -- as it might if this test were omitted.
2813 AC_DEFINE(HAVE_DONE_WORKING_MALLOC_CHECK, 1,
2814 [Define if the malloc check has been performed. ])
2816 AC_CACHE_CHECK([for working malloc], jm_cv_func_working_malloc,
2822 exit (malloc (0) ? 0 : 1);
2825 jm_cv_func_working_malloc=yes,
2826 jm_cv_func_working_malloc=no,
2827 dnl When crosscompiling, assume malloc is broken.
2828 jm_cv_func_working_malloc=no)
2830 if test $jm_cv_func_working_malloc = no; then
2832 AC_DEFINE(malloc, rpl_malloc,
2833 [Define to rpl_malloc if the replacement function should be used.])
2839 dnl From Jim Meyering.
2840 dnl Determine whether realloc works when both arguments are 0.
2841 dnl If it doesn't, arrange to use the replacement function.
2844 AC_DEFUN([jm_FUNC_REALLOC],
2846 dnl xmalloc.c requires that this symbol be defined so it doesn't
2847 dnl mistakenly use a broken realloc -- as it might if this test were omitted.
2848 AC_DEFINE(HAVE_DONE_WORKING_REALLOC_CHECK, 1,
2849 [Define if the realloc check has been performed. ])
2851 AC_CACHE_CHECK([for working realloc], jm_cv_func_working_realloc,
2857 exit (realloc (0, 0) ? 0 : 1);
2860 jm_cv_func_working_realloc=yes,
2861 jm_cv_func_working_realloc=no,
2862 dnl When crosscompiling, assume realloc is broken.
2863 jm_cv_func_working_realloc=no)
2865 if test $jm_cv_func_working_realloc = no; then
2867 AC_DEFINE(realloc, rpl_realloc,
2868 [Define to rpl_realloc if the replacement function should be used.])
2872 # Check prerequisites for compiling lib/c-stack.c.
2874 # Copyright (C) 2002 Free Software Foundation, Inc.
2876 # This program is free software; you can redistribute it and/or modify
2877 # it under the terms of the GNU General Public License as published by
2878 # the Free Software Foundation; either version 2, or (at your option)
2879 # any later version.
2881 # This program is distributed in the hope that it will be useful,
2882 # but WITHOUT ANY WARRANTY; without even the implied warranty of
2883 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2884 # GNU General Public License for more details.
2886 # You should have received a copy of the GNU General Public License
2887 # along with this program; if not, write to the Free Software
2888 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
2891 AC_DEFUN([AC_SYS_XSI_STACK_OVERFLOW_HEURISTIC],
2892 [# for STACK_DIRECTION
2893 AC_REQUIRE([AC_FUNC_ALLOCA])
2895 AC_CACHE_CHECK([for working C stack overflow detection],
2896 ac_cv_sys_xsi_stack_overflow_heuristic,
2900 #include <ucontext.h>
2904 char buffer[SIGSTKSZ];
2908 } alternate_signal_stack;
2911 # define find_stack_direction(ptr) STACK_DIRECTION
2914 find_stack_direction (char const *addr)
2917 return (! addr ? find_stack_direction (&dummy)
2918 : addr < &dummy ? 1 : -1);
2923 segv_handler (int signo, siginfo_t *info, void *context)
2925 if (0 < info->si_code)
2927 ucontext_t const *user_context = context;
2928 char const *stack_min = user_context->uc_stack.ss_sp;
2929 size_t stack_size = user_context->uc_stack.ss_size;
2930 char const *faulting_address = info->si_addr;
2931 size_t s = faulting_address - stack_min;
2932 size_t page_size = sysconf (_SC_PAGESIZE);
2933 if (find_stack_direction (0) < 0)
2935 if (s < stack_size + page_size)
2943 c_stack_action (void)
2946 struct sigaction act;
2950 st.ss_sp = alternate_signal_stack.buffer;
2951 st.ss_size = sizeof alternate_signal_stack.buffer;
2952 r = sigaltstack (&st, 0);
2956 sigemptyset (&act.sa_mask);
2957 act.sa_flags = SA_NODEFER | SA_ONSTACK | SA_RESETHAND | SA_SIGINFO;
2958 act.sa_sigaction = segv_handler;
2959 return sigaction (SIGSEGV, &act, 0);
2967 return *p + recurse (array);
2974 return recurse ("\1");
2977 [ac_cv_sys_xsi_stack_overflow_heuristic=yes],
2978 [ac_cv_sys_xsi_stack_overflow_heuristic=no],
2979 [ac_cv_sys_xsi_stack_overflow_heuristic=cross-compiling])])
2981 if test $ac_cv_sys_xsi_stack_overflow_heuristic = yes; then
2982 AC_DEFINE(HAVE_XSI_STACK_OVERFLOW_HEURISTIC, 1,
2983 [Define to 1 if extending the stack slightly past the limit causes
2984 a SIGSEGV, and an alternate stack can be established with sigaltstack,
2985 and the signal handler is passed a context that specifies the
2986 run time stack. This behavior is defined by POSIX 1003.1-2001
2987 with the X/Open System Interface (XSI) option
2988 and is a standardized way to implement a SEGV-based stack
2989 overflow detection heuristic.])
2993 AC_DEFUN([jm_PREREQ_C_STACK],
2994 [AC_REQUIRE([jm_AC_TYPE_UINTMAX_T])
2995 AC_REQUIRE([AC_SYS_XSI_STACK_OVERFLOW_HEURISTIC])
2997 # for STACK_DIRECTION
2998 AC_REQUIRE([AC_FUNC_ALLOCA])
3000 AC_CHECK_HEADERS(unistd.h)
3002 AC_CHECK_TYPES([siginfo_t, stack_t], , , [#include <signal.h>])])
3006 dnl FIXME: put these prerequisite-only *.m4 files in a separate
3007 dnl directory -- otherwise, they'll conflict with existing files.
3009 dnl These are the prerequisite macros for GNU's error.c file.
3010 AC_DEFUN([jm_PREREQ_ERROR],
3012 AC_CHECK_FUNCS(strerror vprintf doprnt)
3013 AC_CHECK_DECLS([strerror])
3020 dnl These are the prerequisite macros for files in the lib/
3021 dnl directories of the fileutils, sh-utils, and textutils packages.
3023 AC_DEFUN([jm_PREREQ],
3026 jm_PREREQ_CANON_HOST
3030 jm_PREREQ_GETPAGESIZE
3031 jm_PREREQ_HARD_LOCALE
3041 jm_PREREQ_TEMPNAME # called by mkstemp
3046 AC_DEFUN([jm_PREREQ_ADDEXT],
3049 AC_SYS_LONG_FILE_NAMES
3050 AC_CHECK_FUNCS(pathconf)
3051 AC_CHECK_HEADERS(limits.h string.h unistd.h)
3054 AC_DEFUN([jm_PREREQ_CANON_HOST],
3056 dnl Add any libraries as early as possible.
3057 dnl In particular, inet_ntoa needs -lnsl at least on Solaris5.5.1,
3058 dnl so we have to add -lnsl to LIBS before checking for that function.
3059 AC_SEARCH_LIBS(gethostbyname, [inet nsl])
3061 dnl These come from -lnsl on Solaris5.5.1.
3062 AC_CHECK_FUNCS(gethostbyname gethostbyaddr inet_ntoa)
3064 AC_CHECK_FUNCS(gethostbyname gethostbyaddr inet_ntoa)
3065 AC_CHECK_HEADERS(unistd.h string.h netdb.h sys/socket.h \
3066 netinet/in.h arpa/inet.h)
3069 AC_DEFUN([jm_PREREQ_DIRNAME],
3072 AC_CHECK_HEADERS(string.h)
3075 AC_DEFUN([jm_PREREQ_EXCLUDE],
3081 AC_DEFUN([jm_PREREQ_GETPAGESIZE],
3083 AC_CHECK_FUNCS(getpagesize)
3084 AC_CHECK_HEADERS(OS.h unistd.h)
3087 AC_DEFUN([jm_PREREQ_HARD_LOCALE],
3090 AC_CHECK_FUNCS(setlocale)
3091 AC_CHECK_HEADERS(locale.h stdlib.h string.h)
3094 AC_DEFUN([jm_PREREQ_HASH],
3096 AC_CHECK_HEADERS(stdlib.h)
3098 AC_REQUIRE([jm_CHECK_DECLS])
3101 # If you use human.c, you need the following files:
3102 # inttypes.m4 ulonglong.m4
3103 AC_DEFUN([jm_PREREQ_HUMAN],
3105 AC_CHECK_HEADERS(limits.h stdlib.h string.h)
3106 AC_CHECK_DECLS([getenv])
3107 AC_REQUIRE([jm_AC_TYPE_UINTMAX_T])
3110 AC_DEFUN([jm_PREREQ_MEMCHR],
3112 AC_CHECK_HEADERS(limits.h stdlib.h bp-sym.h)
3115 AC_DEFUN([jm_PREREQ_PHYSMEM],
3117 AC_CHECK_HEADERS(sys/pstat.h unistd.h)
3118 AC_CHECK_FUNCS(pstat_getstatic pstat_getdynamic)
3121 AC_DEFUN([jm_PREREQ_POSIXVER],
3123 AC_CHECK_HEADERS(unistd.h)
3124 AC_CHECK_DECLS([getenv])
3127 AC_DEFUN([jm_PREREQ_QUOTEARG],
3129 AC_CHECK_FUNCS(isascii iswprint)
3131 AC_CHECK_HEADERS(limits.h stddef.h stdlib.h string.h wchar.h wctype.h)
3138 AC_DEFUN([jm_PREREQ_REGEX],
3140 dnl FIXME: Maybe provide a btowc replacement someday: solaris-2.5.1 lacks it.
3141 dnl FIXME: Check for wctype and iswctype, and and add -lw if necessary
3143 AC_CHECK_FUNCS(bzero bcopy isascii btowc)
3144 AC_CHECK_HEADERS(alloca.h libintl.h wctype.h wchar.h)
3149 AC_DEFUN([jm_PREREQ_TEMPNAME],
3153 AC_CHECK_HEADERS(fcntl.h sys/time.h stdint.h unistd.h)
3154 AC_CHECK_FUNCS(__secure_getenv gettimeofday)
3155 AC_CHECK_DECLS([getenv])
3158 AC_DEFUN([jm_PREREQ_XGETCWD],
3161 AC_CHECK_HEADERS(limits.h stdlib.h sys/param.h unistd.h)
3162 AC_CHECK_FUNCS(getcwd)
3166 AC_DEFUN([jm_PREREQ_XREADLINK],
3169 AC_CHECK_HEADERS(limits.h stdlib.h sys/types.h unistd.h)
3174 dnl This is just a wrapper function to encapsulate this kludge.
3175 dnl Putting it in a separate file like this helps share it between
3176 dnl different packages.
3177 AC_DEFUN([jm_CHECK_DECLS],
3179 AC_REQUIRE([_jm_DECL_HEADERS])
3180 AC_REQUIRE([AC_HEADER_TIME])
3184 # if !STDC_HEADERS && HAVE_MEMORY_H
3185 # include <memory.h>
3187 # include <string.h>
3190 # include <strings.h>
3194 # include <stdlib.h>
3197 # include <unistd.h>
3200 #include <sys/types.h>
3201 #if TIME_WITH_SYS_TIME
3202 # include <sys/time.h>
3205 # if HAVE_SYS_TIME_H
3206 # include <sys/time.h>
3246 ttyname], , , $headers)
3249 dnl FIXME: when autoconf has support for it.
3250 dnl This is a little helper so we can require these header checks.
3251 AC_DEFUN([_jm_DECL_HEADERS],
3253 AC_REQUIRE([AC_HEADER_STDC])
3254 AC_CHECK_HEADERS(grp.h memory.h pwd.h string.h strings.h stdlib.h \
3255 unistd.h sys/time.h utmp.h utmpx.h)
3260 dnl From Paul Eggert
3262 AC_DEFUN([jm_FUNC_MBRTOWC],
3264 AC_CACHE_CHECK([whether mbrtowc and mbstate_t are properly declared],
3267 [#include <wchar.h>],
3268 [mbstate_t state; return ! (sizeof state && mbrtowc);],
3269 jm_cv_func_mbrtowc=yes,
3270 jm_cv_func_mbrtowc=no)])
3271 if test $jm_cv_func_mbrtowc = yes; then
3272 AC_DEFINE(HAVE_MBRTOWC, 1,
3273 [Define to 1 if mbrtowc and mbstate_t are properly declared.])
3279 dnl From Paul Eggert.
3281 AC_DEFUN([AC_C_BACKSLASH_A],
3283 AC_CACHE_CHECK([whether backslash-a works in strings], ac_cv_c_backslash_a,
3289 char buf['\a' == 'a' ? -1 : 1];
3291 return buf[0] != "\a"[0];
3293 ac_cv_c_backslash_a=yes,
3294 ac_cv_c_backslash_a=no)])
3295 if test $ac_cv_c_backslash_a = yes; then
3296 AC_DEFINE(HAVE_C_BACKSLASH_A, 1,
3297 [Define if backslash-a works in C strings.])
3305 # BeOS 5 has <wchar.h> but does not define mbstate_t,
3306 # so you can't declare an object of that type.
3307 # Check for this incompatibility with Standard C.
3309 # Include stdlib.h first, because otherwise this test would fail on Linux
3310 # (at least glibc-2.1.3) because the "_XOPEN_SOURCE 500" definition elicits
3311 # a syntax error in wchar.h due to the use of undefined __int32_t.
3313 AC_DEFUN([AC_MBSTATE_T],
3315 AC_CHECK_HEADERS(stdlib.h)
3317 AC_CACHE_CHECK([for mbstate_t], ac_cv_type_mbstate_t,
3320 # include <stdlib.h>
3322 #include <wchar.h>],
3323 [mbstate_t x; return sizeof x;],
3324 ac_cv_type_mbstate_t=yes,
3325 ac_cv_type_mbstate_t=no)])
3326 if test $ac_cv_type_mbstate_t = no; then
3327 AC_DEFINE(mbstate_t, int,
3328 [Define to a type if <wchar.h> does not define.])
3332 # Copyright 1996, 1997, 1998, 2000, 2001 Free Software Foundation, Inc.
3334 # This program is free software; you can redistribute it and/or modify
3335 # it under the terms of the GNU General Public License as published by
3336 # the Free Software Foundation; either version 2, or (at your option)
3337 # any later version.
3339 # This program is distributed in the hope that it will be useful,
3340 # but WITHOUT ANY WARRANTY; without even the implied warranty of
3341 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
3342 # GNU General Public License for more details.
3344 # You should have received a copy of the GNU General Public License
3345 # along with this program; if not, write to the Free Software
3346 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
3351 AC_DEFUN([AM_C_PROTOTYPES],
3352 [AC_REQUIRE([AM_PROG_CC_STDC])
3353 AC_REQUIRE([AC_PROG_CPP])
3354 AC_MSG_CHECKING([for function prototypes])
3355 if test "$am_cv_prog_cc_stdc" != no; then
3357 AC_DEFINE(PROTOTYPES,1,[Define if compiler has function prototypes])
3361 U=_ ANSI2KNR=./ansi2knr
3363 # Ensure some checks needed by ansi2knr itself.
3365 AC_CHECK_HEADERS(string.h)
3367 AC_SUBST(ANSI2KNR)dnl
3372 # autoconf tests required for use of xstrtoumax.c
3374 AC_DEFUN([jm_AC_PREREQ_XSTRTOUMAX],
3376 AC_REQUIRE([jm_AC_TYPE_INTMAX_T])
3377 AC_REQUIRE([jm_AC_TYPE_UINTMAX_T])
3378 AC_REQUIRE([jm_AC_TYPE_LONG_LONG])
3379 AC_REQUIRE([jm_AC_TYPE_UNSIGNED_LONG_LONG])
3380 AC_CHECK_DECLS([strtol, strtoul, strtoull, strtoimax, strtoumax])
3381 AC_CHECK_HEADERS(limits.h stdlib.h inttypes.h)
3383 AC_CACHE_CHECK([whether <inttypes.h> defines strtoumax as a macro],
3384 jm_cv_func_strtoumax_macro,
3385 AC_EGREP_CPP([inttypes_h_defines_strtoumax], [#include <inttypes.h>
3387 inttypes_h_defines_strtoumax
3389 jm_cv_func_strtoumax_macro=yes,
3390 jm_cv_func_strtoumax_macro=no))
3392 if test "$jm_cv_func_strtoumax_macro" != yes; then
3393 AC_REPLACE_FUNCS(strtoumax)
3396 dnl Only the replacement strtoumax invokes strtoul and strtoull,
3397 dnl so we need the replacements only if strtoumax does not exist.
3398 case "$jm_cv_func_strtoumax_macro,$ac_cv_func_strtoumax" in
3400 AC_REPLACE_FUNCS(strtoul)
3402 dnl We don't need (and can't compile) the replacement strtoull
3403 dnl unless the type `unsigned long long' exists.
3404 if test "$ac_cv_type_unsigned_long_long" = yes; then
3405 AC_REPLACE_FUNCS(strtoull)
3411 # Check for fnmatch.
3413 # This is a modified version of autoconf's AC_FUNC_FNMATCH;
3414 # it also checks for FNM_CASEFOLD or FNM_IGNORECASE.
3416 # Copyright (C) 2000, 2001 Free Software Foundation, Inc.
3418 # This program is free software; you can redistribute it and/or modify
3419 # it under the terms of the GNU General Public License as published by
3420 # the Free Software Foundation; either version 2, or (at your option)
3421 # any later version.
3423 # This program is distributed in the hope that it will be useful,
3424 # but WITHOUT ANY WARRANTY; without even the implied warranty of
3425 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
3426 # GNU General Public License for more details.
3428 # You should have received a copy of the GNU General Public License
3429 # along with this program; if not, write to the Free Software
3430 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
3435 # We look for fnmatch.h to avoid that the test fails in C++.
3436 AC_DEFUN([AC_FUNC_FNMATCH],
3437 [AC_CACHE_CHECK([for working GNU-style fnmatch],
3438 [ac_cv_func_fnmatch_works],
3439 # Some versions of Solaris, SCO, and the GNU C Library
3440 # have a broken or incompatible fnmatch.
3441 # So we run a test program. If we are cross-compiling, take no chance.
3442 # Thanks to John Oleynick, Franc,ois Pinard, and Paul Eggert for this test.
3443 [AC_RUN_IFELSE([AC_LANG_PROGRAM([@%:@include <fnmatch.h>],
3444 [exit (fnmatch ("a*", "abc", 0) != 0
3445 || fnmatch ("xxXX", "xXxX", FNM_CASEFOLD) != 0
3446 || fnmatch ("d*/*1", "d/s/1", FNM_FILE_NAME) != FNM_NOMATCH
3447 || fnmatch ("*", "x", FNM_FILE_NAME | FNM_LEADING_DIR) != 0
3448 || fnmatch ("x*", "x/y/z", FNM_FILE_NAME | FNM_LEADING_DIR) != 0
3449 || fnmatch ("*c*", "c/x", FNM_FILE_NAME | FNM_LEADING_DIR) != 0);])],
3450 [ac_cv_func_fnmatch_works=yes],
3451 [ac_cv_func_fnmatch_works=no],
3452 [ac_cv_func_fnmatch_works=no])])
3453 if test $ac_cv_func_fnmatch_works = yes; then
3454 AC_DEFINE(HAVE_FNMATCH, 1,
3455 [Define to 1 if your system has a working `fnmatch' function.])
3461 dnl Initially derived from code in GNU grep.
3462 dnl Mostly written by Jim Meyering.
3464 dnl Usage: jm_INCLUDED_REGEX([lib/regex.c])
3466 AC_DEFUN([jm_INCLUDED_REGEX],
3468 dnl Even packages that don't use regex.c can use this macro.
3469 dnl Of course, for them it doesn't do anything.
3471 # Assume we'll default to using the included regex.c.
3472 ac_use_included_regex=yes
3474 # However, if the system regex support is good enough that it passes the
3475 # the following run test, then default to *not* using the included regex.c.
3476 # If cross compiling, assume the test would fail and use the included
3477 # regex.c. The first failing regular expression is from `Spencer ere
3478 # test #75' in grep-2.3.
3479 AC_CACHE_CHECK([for working re_compile_pattern],
3480 jm_cv_func_working_re_compile_pattern,
3487 static struct re_pattern_buffer regex;
3489 struct re_registers regs;
3490 re_set_syntax (RE_SYNTAX_POSIX_EGREP);
3491 [s = re_compile_pattern ("a[[:@:>@:]]b\n", 9, ®ex);]
3492 /* This should fail with _Invalid character class name_ error. */
3496 /* This should succeed, but doesn't for e.g. glibc-2.1.3. */
3497 s = re_compile_pattern ("{1", 2, ®ex);
3502 /* The following example is derived from a problem report
3503 against gawk from Jorge Stolfi <stolfi@ic.unicamp.br>. */
3504 s = re_compile_pattern ("[[anĂ¹]]*n", 7, ®ex);
3508 /* This should match, but doesn't for e.g. glibc-2.2.1. */
3509 if (re_match (®ex, "an", 2, 0, ®s) != 2)
3515 jm_cv_func_working_re_compile_pattern=yes,
3516 jm_cv_func_working_re_compile_pattern=no,
3517 dnl When crosscompiling, assume it's broken.
3518 jm_cv_func_working_re_compile_pattern=no))
3519 if test $jm_cv_func_working_re_compile_pattern = yes; then
3520 ac_use_included_regex=no
3523 test -n "$1" || AC_MSG_ERROR([missing argument])
3524 m4_syscmd([test -f $1])
3525 ifelse(m4_sysval, 0,
3527 AC_ARG_WITH(included-regex,
3528 [ --without-included-regex don't compile regex; this is the default on
3529 systems with version 2 of the GNU C library
3530 (use with caution on other system)],
3531 jm_with_regex=$withval,
3532 jm_with_regex=$ac_use_included_regex)
3533 if test "$jm_with_regex" = yes; then
3543 # Define some macros required for proper operation of code in lib/*.c
3544 # on MSDOS/Windows systems.
3546 # From Jim Meyering.
3548 AC_DEFUN([jm_AC_DOS],
3550 AC_CACHE_CHECK([whether system is Windows or MSDOS], [ac_cv_win_or_dos],
3553 [#if !defined _WIN32 && !defined __WIN32__ && !defined __MSDOS__
3554 neither MSDOS nor Windows
3556 [ac_cv_win_or_dos=yes],
3557 [ac_cv_win_or_dos=no])
3560 if test x"$ac_cv_win_or_dos" = xyes; then
3561 ac_fs_accepts_drive_letter_prefix=1
3562 ac_fs_backslash_is_file_name_separator=1
3564 ac_fs_accepts_drive_letter_prefix=0
3565 ac_fs_backslash_is_file_name_separator=0
3568 AH_VERBATIM(FILESYSTEM_PREFIX_LEN,
3569 [#if FILESYSTEM_ACCEPTS_DRIVE_LETTER_PREFIX
3570 # define FILESYSTEM_PREFIX_LEN(Filename) \
3571 ((Filename)[0] && (Filename)[1] == ':' ? 2 : 0)
3573 # define FILESYSTEM_PREFIX_LEN(Filename) 0
3576 AC_DEFINE_UNQUOTED([FILESYSTEM_ACCEPTS_DRIVE_LETTER_PREFIX],
3577 $ac_fs_accepts_drive_letter_prefix,
3578 [Define on systems for which file names may have a so-called
3579 `drive letter' prefix, define this to compute the length of that
3580 prefix, including the colon.])
3582 AH_VERBATIM(ISSLASH,
3583 [#if FILESYSTEM_BACKSLASH_IS_FILE_NAME_SEPARATOR
3584 # define ISSLASH(C) ((C) == '/' || (C) == '\\')
3586 # define ISSLASH(C) ((C) == '/')
3589 AC_DEFINE_UNQUOTED([FILESYSTEM_BACKSLASH_IS_FILE_NAME_SEPARATOR],
3590 $ac_fs_backslash_is_file_name_separator,
3591 [Define if the backslash character may also serve as a file name
3592 component separator.])
3595 # Check for setmode, DOS style.
3597 # Copyright (C) 2001, 2002 Free Software Foundation, Inc.
3599 # This program is free software; you can redistribute it and/or modify
3600 # it under the terms of the GNU General Public License as published by
3601 # the Free Software Foundation; either version 2, or (at your option)
3602 # any later version.
3604 # This program is distributed in the hope that it will be useful,
3605 # but WITHOUT ANY WARRANTY; without even the implied warranty of
3606 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
3607 # GNU General Public License for more details.
3609 # You should have received a copy of the GNU General Public License
3610 # along with this program; if not, write to the Free Software
3611 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
3614 AC_DEFUN([AC_FUNC_SETMODE_DOS],
3615 [AC_CHECK_HEADERS(fcntl.h unistd.h)
3616 AC_CACHE_CHECK([for DOS-style setmode],
3617 [ac_cv_func_setmode_dos],
3624 # include <unistd.h>
3626 [int ret = setmode && setmode (1, O_BINARY);],
3627 [ac_cv_func_setmode_dos=yes],
3628 [ac_cv_func_setmode_dos=no])])
3629 if test $ac_cv_func_setmode_dos = yes; then
3630 AC_DEFINE(HAVE_SETMODE_DOS, 1,
3631 [Define to 1 if you have the DOS-style `setmode' function.])