1 # generated automatically by aclocal 1.7 -*- Autoconf -*-
3 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002
4 # Free Software Foundation, Inc.
5 # This file is free software; the Free Software Foundation
6 # gives unlimited permission to copy and/or distribute it,
7 # with or without modifications, as long as this notice is preserved.
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY, to the extent permitted by law; without
11 # even the implied warranty of MERCHANTABILITY or FITNESS FOR A
14 # Do all the work for Automake. -*- Autoconf -*-
16 # This macro actually does too much some checks are only needed if
17 # your package does certain things. But this isn't really a big deal.
19 # Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002
20 # Free Software Foundation, Inc.
22 # This program is free software; you can redistribute it and/or modify
23 # it under the terms of the GNU General Public License as published by
24 # the Free Software Foundation; either version 2, or (at your option)
27 # This program is distributed in the hope that it will be useful,
28 # but WITHOUT ANY WARRANTY; without even the implied warranty of
29 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
30 # GNU General Public License for more details.
32 # You should have received a copy of the GNU General Public License
33 # along with this program; if not, write to the Free Software
34 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
39 # There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
40 # written in clear, in which case automake, when reading aclocal.m4,
41 # will think it sees a *use*, and therefore will trigger all it's
42 # C support machinery. Also note that it means that autoscan, seeing
43 # CC etc. in the Makefile, will ask for an AC_PROG_CC use...
48 # Autoconf 2.50 wants to disallow AM_ names. We explicitly allow
49 # the ones we care about.
50 m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
52 # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
53 # AM_INIT_AUTOMAKE([OPTIONS])
54 # -----------------------------------------------
55 # The call with PACKAGE and VERSION arguments is the old style
56 # call (pre autoconf-2.50), which is being phased out. PACKAGE
57 # and VERSION should now be passed to AC_INIT and removed from
58 # the call to AM_INIT_AUTOMAKE.
59 # We support both call styles for the transition. After
60 # the next Automake release, Autoconf can make the AC_INIT
61 # arguments mandatory, and then we can depend on a new Autoconf
62 # release and drop the old call support.
63 AC_DEFUN([AM_INIT_AUTOMAKE],
64 [AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
65 AC_REQUIRE([AC_PROG_INSTALL])dnl
66 # test to see if srcdir already configured
67 if test "`cd $srcdir && pwd`" != "`pwd`" &&
68 test -f $srcdir/config.status; then
69 AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
72 # test whether we have cygpath
73 if test -z "$CYGPATH_W"; then
74 if (cygpath --version) >/dev/null 2>/dev/null; then
75 CYGPATH_W='cygpath -w'
82 # Define the identity of the package.
83 dnl Distinguish between old-style and new-style calls.
85 [m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
86 AC_SUBST([PACKAGE], [$1])dnl
87 AC_SUBST([VERSION], [$2])],
88 [_AM_SET_OPTIONS([$1])dnl
89 AC_SUBST([PACKAGE], [AC_PACKAGE_TARNAME])dnl
90 AC_SUBST([VERSION], [AC_PACKAGE_VERSION])])dnl
92 _AM_IF_OPTION([no-define],,
93 [AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
94 AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
96 # Some tools Automake needs.
97 AC_REQUIRE([AM_SANITY_CHECK])dnl
98 AC_REQUIRE([AC_ARG_PROGRAM])dnl
99 AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
100 AM_MISSING_PROG(AUTOCONF, autoconf)
101 AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
102 AM_MISSING_PROG(AUTOHEADER, autoheader)
103 AM_MISSING_PROG(MAKEINFO, makeinfo)
104 AM_MISSING_PROG(AMTAR, tar)
106 AM_PROG_INSTALL_STRIP
107 # We need awk for the "check" target. The system "awk" is bad on
109 AC_REQUIRE([AC_PROG_AWK])dnl
110 AC_REQUIRE([AC_PROG_MAKE_SET])dnl
112 _AM_IF_OPTION([no-dependencies],,
113 [AC_PROVIDE_IFELSE([AC_PROG_CC],
114 [_AM_DEPENDENCIES(CC)],
115 [define([AC_PROG_CC],
116 defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
117 AC_PROVIDE_IFELSE([AC_PROG_CXX],
118 [_AM_DEPENDENCIES(CXX)],
119 [define([AC_PROG_CXX],
120 defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
125 # When config.status generates a header, we must update the stamp-h file.
126 # This file resides in the same directory as the config header
127 # that is generated. The stamp files are numbered to have different names.
129 # Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
130 # loop where config.status creates the headers, so we can generate
131 # our stamp files there.
132 AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
133 [_am_stamp_count=`expr ${_am_stamp_count-0} + 1`
134 echo "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count])
136 # Copyright 2002 Free Software Foundation, Inc.
138 # This program is free software; you can redistribute it and/or modify
139 # it under the terms of the GNU General Public License as published by
140 # the Free Software Foundation; either version 2, or (at your option)
143 # This program is distributed in the hope that it will be useful,
144 # but WITHOUT ANY WARRANTY; without even the implied warranty of
145 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
146 # GNU General Public License for more details.
148 # You should have received a copy of the GNU General Public License
149 # along with this program; if not, write to the Free Software
150 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
152 # AM_AUTOMAKE_VERSION(VERSION)
153 # ----------------------------
154 # Automake X.Y traces this macro to ensure aclocal.m4 has been
155 # generated from the m4 files accompanying Automake X.Y.
156 AC_DEFUN([AM_AUTOMAKE_VERSION],[am__api_version="1.7"])
158 # AM_SET_CURRENT_AUTOMAKE_VERSION
159 # -------------------------------
160 # Call AM_AUTOMAKE_VERSION so it can be traced.
161 # This function is AC_REQUIREd by AC_INIT_AUTOMAKE.
162 AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
163 [AM_AUTOMAKE_VERSION([1.7])])
165 # Helper functions for option handling. -*- Autoconf -*-
167 # Copyright 2001, 2002 Free Software Foundation, Inc.
169 # This program is free software; you can redistribute it and/or modify
170 # it under the terms of the GNU General Public License as published by
171 # the Free Software Foundation; either version 2, or (at your option)
174 # This program is distributed in the hope that it will be useful,
175 # but WITHOUT ANY WARRANTY; without even the implied warranty of
176 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
177 # GNU General Public License for more details.
179 # You should have received a copy of the GNU General Public License
180 # along with this program; if not, write to the Free Software
181 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
186 # _AM_MANGLE_OPTION(NAME)
187 # -----------------------
188 AC_DEFUN([_AM_MANGLE_OPTION],
189 [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
191 # _AM_SET_OPTION(NAME)
192 # ------------------------------
193 # Set option NAME. Presently that only means defining a flag for this option.
194 AC_DEFUN([_AM_SET_OPTION],
195 [m4_define(_AM_MANGLE_OPTION([$1]), 1)])
197 # _AM_SET_OPTIONS(OPTIONS)
198 # ----------------------------------
199 # OPTIONS is a space-separated list of Automake options.
200 AC_DEFUN([_AM_SET_OPTIONS],
201 [AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
203 # _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
204 # -------------------------------------------
205 # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
206 AC_DEFUN([_AM_IF_OPTION],
207 [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
210 # Check to make sure that the build environment is sane.
213 # Copyright 1996, 1997, 2000, 2001 Free Software Foundation, Inc.
215 # This program is free software; you can redistribute it and/or modify
216 # it under the terms of the GNU General Public License as published by
217 # the Free Software Foundation; either version 2, or (at your option)
220 # This program is distributed in the hope that it will be useful,
221 # but WITHOUT ANY WARRANTY; without even the implied warranty of
222 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
223 # GNU General Public License for more details.
225 # You should have received a copy of the GNU General Public License
226 # along with this program; if not, write to the Free Software
227 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
234 AC_DEFUN([AM_SANITY_CHECK],
235 [AC_MSG_CHECKING([whether build environment is sane])
238 echo timestamp > conftest.file
239 # Do `set' in a subshell so we don't clobber the current shell's
240 # arguments. Must try -L first in case configure is actually a
241 # symlink; some systems play weird games with the mod time of symlinks
242 # (eg FreeBSD returns the mod time of the symlink's containing
245 set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
246 if test "$[*]" = "X"; then
248 set X `ls -t $srcdir/configure conftest.file`
251 if test "$[*]" != "X $srcdir/configure conftest.file" \
252 && test "$[*]" != "X conftest.file $srcdir/configure"; then
254 # If neither matched, then we have a broken ls. This can happen
255 # if, for instance, CONFIG_SHELL is bash and it inherits a
256 # broken ls alias from the environment. This has actually
257 # happened. Such a system could not be considered "sane".
258 AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
259 alias in your environment])
262 test "$[2]" = conftest.file
268 AC_MSG_ERROR([newly created file is older than distributed files!
269 Check your system clock])
276 # Copyright 1997, 1999, 2000, 2001 Free Software Foundation, Inc.
278 # This program is free software; you can redistribute it and/or modify
279 # it under the terms of the GNU General Public License as published by
280 # the Free Software Foundation; either version 2, or (at your option)
283 # This program is distributed in the hope that it will be useful,
284 # but WITHOUT ANY WARRANTY; without even the implied warranty of
285 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
286 # GNU General Public License for more details.
288 # You should have received a copy of the GNU General Public License
289 # along with this program; if not, write to the Free Software
290 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
295 # AM_MISSING_PROG(NAME, PROGRAM)
296 # ------------------------------
297 AC_DEFUN([AM_MISSING_PROG],
298 [AC_REQUIRE([AM_MISSING_HAS_RUN])
299 $1=${$1-"${am_missing_run}$2"}
305 # Define MISSING if not defined so far and test if it supports --run.
306 # If it does, set am_missing_run to use it, otherwise, to nothing.
307 AC_DEFUN([AM_MISSING_HAS_RUN],
308 [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
309 test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
310 # Use eval to expand $SHELL
311 if eval "$MISSING --run true"; then
312 am_missing_run="$MISSING --run "
315 AC_MSG_WARN([`missing' script is too old or missing])
321 # Copyright 2001 Free Software Foundation, Inc.
323 # This program is free software; you can redistribute it and/or modify
324 # it under the terms of the GNU General Public License as published by
325 # the Free Software Foundation; either version 2, or (at your option)
328 # This program is distributed in the hope that it will be useful,
329 # but WITHOUT ANY WARRANTY; without even the implied warranty of
330 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
331 # GNU General Public License for more details.
333 # You should have received a copy of the GNU General Public License
334 # along with this program; if not, write to the Free Software
335 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
338 # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
339 # $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to
340 # `$srcdir', `$srcdir/..', or `$srcdir/../..'.
342 # Of course, Automake must honor this variable whenever it calls a
343 # tool from the auxiliary directory. The problem is that $srcdir (and
344 # therefore $ac_aux_dir as well) can be either absolute or relative,
345 # depending on how configure is run. This is pretty annoying, since
346 # it makes $ac_aux_dir quite unusable in subdirectories: in the top
347 # source directory, any form will work fine, but in subdirectories a
348 # relative path needs to be adjusted first.
350 # $ac_aux_dir/missing
351 # fails when called from a subdirectory if $ac_aux_dir is relative
352 # $top_srcdir/$ac_aux_dir/missing
353 # fails if $ac_aux_dir is absolute,
354 # fails when called from a subdirectory in a VPATH build with
355 # a relative $ac_aux_dir
357 # The reason of the latter failure is that $top_srcdir and $ac_aux_dir
358 # are both prefixed by $srcdir. In an in-source build this is usually
359 # harmless because $srcdir is `.', but things will broke when you
360 # start a VPATH build or use an absolute $srcdir.
362 # So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
363 # iff we strip the leading $srcdir from $ac_aux_dir. That would be:
364 # am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
365 # and then we would define $MISSING as
366 # MISSING="\${SHELL} $am_aux_dir/missing"
367 # This will work as long as MISSING is not called from configure, because
368 # unfortunately $(top_srcdir) has no meaning in configure.
369 # However there are other variables, like CC, which are often used in
370 # configure, and could therefore not use this "fixed" $ac_aux_dir.
372 # Another solution, used here, is to always expand $ac_aux_dir to an
373 # absolute PATH. The drawback is that using absolute paths prevent a
374 # configured tree to be moved without reconfiguration.
376 # Rely on autoconf to set up CDPATH properly.
379 AC_DEFUN([AM_AUX_DIR_EXPAND], [
380 # expand $ac_aux_dir to an absolute path
381 am_aux_dir=`cd $ac_aux_dir && pwd`
386 # Define $install_sh.
388 # Copyright 2001 Free Software Foundation, Inc.
390 # This program is free software; you can redistribute it and/or modify
391 # it under the terms of the GNU General Public License as published by
392 # the Free Software Foundation; either version 2, or (at your option)
395 # This program is distributed in the hope that it will be useful,
396 # but WITHOUT ANY WARRANTY; without even the implied warranty of
397 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
398 # GNU General Public License for more details.
400 # You should have received a copy of the GNU General Public License
401 # along with this program; if not, write to the Free Software
402 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
405 AC_DEFUN([AM_PROG_INSTALL_SH],
406 [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
407 install_sh=${install_sh-"$am_aux_dir/install-sh"}
408 AC_SUBST(install_sh)])
410 # AM_PROG_INSTALL_STRIP
412 # Copyright 2001 Free Software Foundation, Inc.
414 # This program is free software; you can redistribute it and/or modify
415 # it under the terms of the GNU General Public License as published by
416 # the Free Software Foundation; either version 2, or (at your option)
419 # This program is distributed in the hope that it will be useful,
420 # but WITHOUT ANY WARRANTY; without even the implied warranty of
421 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
422 # GNU General Public License for more details.
424 # You should have received a copy of the GNU General Public License
425 # along with this program; if not, write to the Free Software
426 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
429 # One issue with vendor `install' (even GNU) is that you can't
430 # specify the program used to strip binaries. This is especially
431 # annoying in cross-compiling environments, where the build's strip
432 # is unlikely to handle the host's binaries.
433 # Fortunately install-sh will honor a STRIPPROG variable, so we
434 # always use install-sh in `make install-strip', and initialize
435 # STRIPPROG with the value of the STRIP variable (set by the user).
436 AC_DEFUN([AM_PROG_INSTALL_STRIP],
437 [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
438 # Installed binaries are usually stripped using `strip' when the user
439 # run `make install-strip'. However `strip' might not be the right
440 # tool to use in cross-compilation environments, therefore Automake
441 # will honor the `STRIP' environment variable to overrule this program.
442 dnl Don't test for $cross_compiling = yes, because it might be `maybe'.
443 if test "$cross_compiling" != no; then
444 AC_CHECK_TOOL([STRIP], [strip], :)
446 INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s"
447 AC_SUBST([INSTALL_STRIP_PROGRAM])])
449 # serial 4 -*- Autoconf -*-
451 # Copyright 1999, 2000, 2001 Free Software Foundation, Inc.
453 # This program is free software; you can redistribute it and/or modify
454 # it under the terms of the GNU General Public License as published by
455 # the Free Software Foundation; either version 2, or (at your option)
458 # This program is distributed in the hope that it will be useful,
459 # but WITHOUT ANY WARRANTY; without even the implied warranty of
460 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
461 # GNU General Public License for more details.
463 # You should have received a copy of the GNU General Public License
464 # along with this program; if not, write to the Free Software
465 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
469 # There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
470 # written in clear, in which case automake, when reading aclocal.m4,
471 # will think it sees a *use*, and therefore will trigger all it's
472 # C support machinery. Also note that it means that autoscan, seeing
473 # CC etc. in the Makefile, will ask for an AC_PROG_CC use...
477 # _AM_DEPENDENCIES(NAME)
478 # ----------------------
479 # See how the compiler implements dependency checking.
480 # NAME is "CC", "CXX", "GCJ", or "OBJC".
481 # We try a few techniques and use that to set a single cache variable.
483 # We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
484 # modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
485 # dependency, and given that the user is not expected to run this macro,
486 # just rely on AC_PROG_CC.
487 AC_DEFUN([_AM_DEPENDENCIES],
488 [AC_REQUIRE([AM_SET_DEPDIR])dnl
489 AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
490 AC_REQUIRE([AM_MAKE_INCLUDE])dnl
491 AC_REQUIRE([AM_DEP_TRACK])dnl
493 ifelse([$1], CC, [depcc="$CC" am_compiler_list=],
494 [$1], CXX, [depcc="$CXX" am_compiler_list=],
495 [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
496 [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'],
497 [depcc="$$1" am_compiler_list=])
499 AC_CACHE_CHECK([dependency style of $depcc],
500 [am_cv_$1_dependencies_compiler_type],
501 [if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
502 # We make a subdir and do the tests there. Otherwise we can end up
503 # making bogus files that we don't know about and never remove. For
504 # instance it was reported that on HP-UX the gcc test will end up
505 # making a dummy file named `D' -- because `-MD' means `put the output
508 # Copy depcomp to subdir because otherwise we won't find it if we're
509 # using a relative directory.
510 cp "$am_depcomp" conftest.dir
513 am_cv_$1_dependencies_compiler_type=none
514 if test "$am_compiler_list" = ""; then
515 am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
517 for depmode in $am_compiler_list; do
518 # We need to recreate these files for each test, as the compiler may
519 # overwrite some of them when testing with obscure command lines.
520 # This happens at least with the AIX C compiler.
521 echo '#include "conftest.h"' > conftest.c
522 echo 'int i;' > conftest.h
523 echo "${am__include} ${am__quote}conftest.Po${am__quote}" > confmf
527 # after this tag, mechanisms are not by side-effect, so they'll
528 # only be used when explicitly requested
529 if test "x$enable_dependency_tracking" = xyes; then
537 # We check with `-c' and `-o' for the sake of the "dashmstdout"
538 # mode. It turns out that the SunPro C++ compiler does not properly
539 # handle `-M -o', and we need to detect this.
540 if depmode=$depmode \
541 source=conftest.c object=conftest.o \
542 depfile=conftest.Po tmpdepfile=conftest.TPo \
543 $SHELL ./depcomp $depcc -c conftest.c -o conftest.o >/dev/null 2>&1 &&
544 grep conftest.h conftest.Po > /dev/null 2>&1 &&
545 ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
546 am_cv_$1_dependencies_compiler_type=$depmode
554 am_cv_$1_dependencies_compiler_type=none
557 AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
558 AM_CONDITIONAL([am__fastdep$1], [
559 test "x$enable_dependency_tracking" != xno \
560 && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
566 # Choose a directory name for dependency files.
567 # This macro is AC_REQUIREd in _AM_DEPENDENCIES
568 AC_DEFUN([AM_SET_DEPDIR],
569 [rm -f .deps 2>/dev/null
570 mkdir .deps 2>/dev/null
571 if test -d .deps; then
574 # MS-DOS does not allow filenames that begin with a dot.
577 rmdir .deps 2>/dev/null
584 AC_DEFUN([AM_DEP_TRACK],
585 [AC_ARG_ENABLE(dependency-tracking,
586 [ --disable-dependency-tracking Speeds up one-time builds
587 --enable-dependency-tracking Do not reject slow dependency extractors])
588 if test "x$enable_dependency_tracking" != xno; then
589 am_depcomp="$ac_aux_dir/depcomp"
592 AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
593 AC_SUBST([AMDEPBACKSLASH])
596 # Generate code to set up dependency tracking. -*- Autoconf -*-
598 # Copyright 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
600 # This program is free software; you can redistribute it and/or modify
601 # it under the terms of the GNU General Public License as published by
602 # the Free Software Foundation; either version 2, or (at your option)
605 # This program is distributed in the hope that it will be useful,
606 # but WITHOUT ANY WARRANTY; without even the implied warranty of
607 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
608 # GNU General Public License for more details.
610 # You should have received a copy of the GNU General Public License
611 # along with this program; if not, write to the Free Software
612 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
617 # _AM_OUTPUT_DEPENDENCY_COMMANDS
618 # ------------------------------
619 AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
620 [for mf in $CONFIG_FILES; do
621 # Strip MF so we end up with the name of the file.
622 mf=`echo "$mf" | sed -e 's/:.*$//'`
623 # Check whether this is an Automake generated Makefile or not.
624 # We used to match only the files named `Makefile.in', but
625 # some people rename them; so instead we look at the file content.
626 # Grep'ing the first line is not enough: some people post-process
627 # each Makefile.in and add a new line on top of each file to say so.
628 # So let's grep whole file.
629 if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then
630 dirpart=`AS_DIRNAME("$mf")`
634 grep '^DEP_FILES *= *[[^ @%:@]]' < "$mf" > /dev/null || continue
635 # Extract the definition of DEP_FILES from the Makefile without
637 DEPDIR=`sed -n -e '/^DEPDIR = / s///p' < "$mf"`
638 test -z "$DEPDIR" && continue
639 # When using ansi2knr, U may be empty or an underscore; expand it
640 U=`sed -n -e '/^U = / s///p' < "$mf"`
641 test -d "$dirpart/$DEPDIR" || mkdir "$dirpart/$DEPDIR"
642 # We invoke sed twice because it is the simplest approach to
643 # changing $(DEPDIR) to its actual value in the expansion.
644 for file in `sed -n -e '
645 /^DEP_FILES = .*\\\\$/ {
654 /^DEP_FILES = / s/^DEP_FILES = //p' < "$mf" | \
655 sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
656 # Make sure the directory exists.
657 test -f "$dirpart/$file" && continue
658 fdir=`AS_DIRNAME(["$file"])`
659 AS_MKDIR_P([$dirpart/$fdir])
660 # echo "creating $dirpart/$file"
661 echo '# dummy' > "$dirpart/$file"
664 ])# _AM_OUTPUT_DEPENDENCY_COMMANDS
667 # AM_OUTPUT_DEPENDENCY_COMMANDS
668 # -----------------------------
669 # This macro should only be invoked once -- use via AC_REQUIRE.
671 # This code is only required when automatic dependency tracking
672 # is enabled. FIXME. This creates each `.P' file that we will
673 # need in order to bootstrap the dependency handling code.
674 AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
675 [AC_CONFIG_COMMANDS([depfiles],
676 [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
677 [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
680 # Check to see how 'make' treats includes. -*- Autoconf -*-
682 # Copyright (C) 2001, 2002 Free Software Foundation, Inc.
684 # This program is free software; you can redistribute it and/or modify
685 # it under the terms of the GNU General Public License as published by
686 # the Free Software Foundation; either version 2, or (at your option)
689 # This program is distributed in the hope that it will be useful,
690 # but WITHOUT ANY WARRANTY; without even the implied warranty of
691 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
692 # GNU General Public License for more details.
694 # You should have received a copy of the GNU General Public License
695 # along with this program; if not, write to the Free Software
696 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
703 # Check to see how make treats includes.
704 AC_DEFUN([AM_MAKE_INCLUDE],
705 [am_make=${MAKE-make}
706 cat > confinc << 'END'
710 # If we don't find an include directive, just comment out the code.
711 AC_MSG_CHECKING([for style of include used by $am_make])
715 # First try GNU make style include.
716 echo "include confinc" > confmf
717 # We grep out `Entering directory' and `Leaving directory'
718 # messages which can occur if `w' ends up in MAKEFLAGS.
719 # In particular we don't look at `^make:' because GNU make might
720 # be invoked under some other name (usually "gmake"), in which
721 # case it prints its new name instead of `make'.
722 if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then
727 # Now try BSD make style include.
728 if test "$am__include" = "#"; then
729 echo '.include "confinc"' > confmf
730 if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
736 AC_SUBST(am__include)
738 AC_MSG_RESULT($_am_result)
742 # AM_CONDITIONAL -*- Autoconf -*-
744 # Copyright 1997, 2000, 2001 Free Software Foundation, Inc.
746 # This program is free software; you can redistribute it and/or modify
747 # it under the terms of the GNU General Public License as published by
748 # the Free Software Foundation; either version 2, or (at your option)
751 # This program is distributed in the hope that it will be useful,
752 # but WITHOUT ANY WARRANTY; without even the implied warranty of
753 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
754 # GNU General Public License for more details.
756 # You should have received a copy of the GNU General Public License
757 # along with this program; if not, write to the Free Software
758 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
765 # AM_CONDITIONAL(NAME, SHELL-CONDITION)
766 # -------------------------------------
767 # Define a conditional.
768 AC_DEFUN([AM_CONDITIONAL],
769 [ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])],
770 [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
780 AC_CONFIG_COMMANDS_PRE(
781 [if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
782 AC_MSG_ERROR([conditional "$1" was never defined.
783 Usually this means the macro was only invoked conditionally.])
786 # Like AC_CONFIG_HEADER, but automatically create stamp file. -*- Autoconf -*-
788 # Copyright 1996, 1997, 2000, 2001 Free Software Foundation, Inc.
790 # This program is free software; you can redistribute it and/or modify
791 # it under the terms of the GNU General Public License as published by
792 # the Free Software Foundation; either version 2, or (at your option)
795 # This program is distributed in the hope that it will be useful,
796 # but WITHOUT ANY WARRANTY; without even the implied warranty of
797 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
798 # GNU General Public License for more details.
800 # You should have received a copy of the GNU General Public License
801 # along with this program; if not, write to the Free Software
802 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
809 # AM_CONFIG_HEADER is obsolete. It has been replaced by AC_CONFIG_HEADERS.
810 AU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)])
812 # isc-posix.m4 serial 2 (gettext-0.11.2)
813 dnl Copyright (C) 1995-2002 Free Software Foundation, Inc.
814 dnl This file is free software, distributed under the terms of the GNU
815 dnl General Public License. As a special exception to the GNU General
816 dnl Public License, this file may be distributed as part of a program
817 dnl that contains a configuration script generated by Autoconf, under
818 dnl the same distribution terms as the rest of that program.
820 # This file is not needed with autoconf-2.53 and newer. Remove it in 2005.
822 # This test replaces the one in autoconf.
823 # Currently this macro should have the same name as the autoconf macro
824 # because gettext's gettext.m4 (distributed in the automake package)
825 # still uses it. Otherwise, the use in gettext.m4 makes autoheader
826 # give these diagnostics:
827 # configure.in:556: AC_TRY_COMPILE was called before AC_ISC_POSIX
828 # configure.in:556: AC_TRY_RUN was called before AC_ISC_POSIX
830 undefine([AC_ISC_POSIX])
832 AC_DEFUN([AC_ISC_POSIX],
834 dnl This test replaces the obsolescent AC_ISC_POSIX kludge.
835 AC_CHECK_LIB(cposix, strerror, [LIBS="$LIBS -lcposix"])
840 # Copyright 1996, 1997, 1998, 2000, 2001, 2002 Free Software Foundation, Inc.
842 # This program is free software; you can redistribute it and/or modify
843 # it under the terms of the GNU General Public License as published by
844 # the Free Software Foundation; either version 2, or (at your option)
847 # This program is distributed in the hope that it will be useful,
848 # but WITHOUT ANY WARRANTY; without even the implied warranty of
849 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
850 # GNU General Public License for more details.
852 # You should have received a copy of the GNU General Public License
853 # along with this program; if not, write to the Free Software
854 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
859 AC_DEFUN([AM_C_PROTOTYPES],
860 [AC_REQUIRE([AM_PROG_CC_STDC])
861 AC_REQUIRE([AC_PROG_CPP])
862 AC_MSG_CHECKING([for function prototypes])
863 if test "$am_cv_prog_cc_stdc" != no; then
865 AC_DEFINE(PROTOTYPES,1,[Define if compiler has function prototypes])
869 U=_ ANSI2KNR=./ansi2knr
871 # Ensure some checks needed by ansi2knr itself.
873 AC_CHECK_HEADERS(string.h)
875 AC_SUBST(ANSI2KNR)dnl
878 AU_DEFUN([fp_C_PROTOTYPES], [AM_C_PROTOTYPES])
881 # Copyright 1996, 1997, 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
883 # This program is free software; you can redistribute it and/or modify
884 # it under the terms of the GNU General Public License as published by
885 # the Free Software Foundation; either version 2, or (at your option)
888 # This program is distributed in the hope that it will be useful,
889 # but WITHOUT ANY WARRANTY; without even the implied warranty of
890 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
891 # GNU General Public License for more details.
893 # You should have received a copy of the GNU General Public License
894 # along with this program; if not, write to the Free Software
895 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
900 # @defmac AC_PROG_CC_STDC
901 # @maindex PROG_CC_STDC
903 # If the C compiler in not in ANSI C mode by default, try to add an option
904 # to output variable @code{CC} to make it so. This macro tries various
905 # options that select ANSI C on some system or another. It considers the
906 # compiler to be in ANSI C mode if it handles function prototypes correctly.
908 # If you use this macro, you should check after calling it whether the C
909 # compiler has been set to accept ANSI C; if not, the shell variable
910 # @code{am_cv_prog_cc_stdc} is set to @samp{no}. If you wrote your source
911 # code in ANSI C, you can make an un-ANSIfied copy of it by using the
912 # program @code{ansi2knr}, which comes with Ghostscript.
915 AC_DEFUN([AM_PROG_CC_STDC],
916 [AC_REQUIRE([AC_PROG_CC])
917 AC_BEFORE([$0], [AC_C_INLINE])
918 AC_BEFORE([$0], [AC_C_CONST])
919 dnl Force this before AC_PROG_CPP. Some cpp's, eg on HPUX, require
920 dnl a magic option to avoid problems with ANSI preprocessor commands
922 dnl FIXME: can't do this because then AC_AIX won't work due to a
923 dnl circular dependency.
924 dnl AC_BEFORE([$0], [AC_PROG_CPP])
925 AC_MSG_CHECKING([for ${CC-cc} option to accept ANSI C])
926 AC_CACHE_VAL(am_cv_prog_cc_stdc,
927 [am_cv_prog_cc_stdc=no
929 # Don't try gcc -ansi; that turns off useful extensions and
930 # breaks some systems' header files.
932 # Ultrix and OSF/1 -std1
933 # HP-UX 10.20 and later -Ae
934 # HP-UX older versions -Aa -D_HPUX_SOURCE
935 # SVR4 -Xc -D__EXTENSIONS__
936 for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
938 CC="$ac_save_CC $ac_arg"
942 #include <sys/types.h>
943 #include <sys/stat.h>
944 /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */
945 struct buf { int x; };
946 FILE * (*rcsopen) (struct buf *, struct stat *, int);
947 static char *e (p, i)
953 static char *f (char * (*g) (char **, int), char **p, ...)
958 s = g (p, va_arg (v,int));
962 int test (int i, double x);
963 struct s1 {int (*f) (int a);};
964 struct s2 {int (*f) (double a);};
965 int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
969 return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1];
971 [am_cv_prog_cc_stdc="$ac_arg"; break])
975 if test -z "$am_cv_prog_cc_stdc"; then
976 AC_MSG_RESULT([none needed])
978 AC_MSG_RESULT([$am_cv_prog_cc_stdc])
980 case "x$am_cv_prog_cc_stdc" in
982 *) CC="$CC $am_cv_prog_cc_stdc" ;;
986 AU_DEFUN([fp_PROG_CC_STDC], [AM_PROG_CC_STDC])
989 # Copyright 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
991 # This program is free software; you can redistribute it and/or modify
992 # it under the terms of the GNU General Public License as published by
993 # the Free Software Foundation; either version 2, or (at your option)
996 # This program is distributed in the hope that it will be useful,
997 # but WITHOUT ANY WARRANTY; without even the implied warranty of
998 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
999 # GNU General Public License for more details.
1001 # You should have received a copy of the GNU General Public License
1002 # along with this program; if not, write to the Free Software
1003 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
1012 # Autoconf leaves LEX=: if lex or flex can't be found. Change that to a
1013 # "missing" invocation, for better error output.
1014 AC_DEFUN([AM_PROG_LEX],
1015 [AC_REQUIRE([AM_MISSING_HAS_RUN])dnl
1016 AC_REQUIRE([AC_PROG_LEX])dnl
1017 if test "$LEX" = :; then
1018 LEX=${am_missing_run}flex
1021 # gettext.m4 serial 17 (gettext-0.11.5)
1022 dnl Copyright (C) 1995-2002 Free Software Foundation, Inc.
1023 dnl This file is free software, distributed under the terms of the GNU
1024 dnl General Public License. As a special exception to the GNU General
1025 dnl Public License, this file may be distributed as part of a program
1026 dnl that contains a configuration script generated by Autoconf, under
1027 dnl the same distribution terms as the rest of that program.
1029 dnl This file can can be used in projects which are not available under
1030 dnl the GNU General Public License or the GNU Library General Public
1031 dnl License but which still want to provide support for the GNU gettext
1033 dnl Please note that the actual code of the GNU gettext library is covered
1034 dnl by the GNU Library General Public License, and the rest of the GNU
1035 dnl gettext package package is covered by the GNU General Public License.
1036 dnl They are *not* in the public domain.
1039 dnl Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
1040 dnl Bruno Haible <haible@clisp.cons.org>, 2000-2002.
1042 dnl Macro to add for using GNU gettext.
1044 dnl Usage: AM_GNU_GETTEXT([INTLSYMBOL], [NEEDSYMBOL], [INTLDIR]).
1045 dnl INTLSYMBOL can be one of 'external', 'no-libtool', 'use-libtool'. The
1046 dnl default (if it is not specified or empty) is 'no-libtool'.
1047 dnl INTLSYMBOL should be 'external' for packages with no intl directory,
1048 dnl and 'no-libtool' or 'use-libtool' for packages with an intl directory.
1049 dnl If INTLSYMBOL is 'use-libtool', then a libtool library
1050 dnl $(top_builddir)/intl/libintl.la will be created (shared and/or static,
1051 dnl depending on --{enable,disable}-{shared,static} and on the presence of
1052 dnl AM-DISABLE-SHARED). If INTLSYMBOL is 'no-libtool', a static library
1053 dnl $(top_builddir)/intl/libintl.a will be created.
1054 dnl If NEEDSYMBOL is specified and is 'need-ngettext', then GNU gettext
1055 dnl implementations (in libc or libintl) without the ngettext() function
1056 dnl will be ignored. If NEEDSYMBOL is specified and is
1057 dnl 'need-formatstring-macros', then GNU gettext implementations that don't
1058 dnl support the ISO C 99 <inttypes.h> formatstring macros will be ignored.
1059 dnl INTLDIR is used to find the intl libraries. If empty,
1060 dnl the value `$(top_builddir)/intl/' is used.
1062 dnl The result of the configuration is one of three cases:
1063 dnl 1) GNU gettext, as included in the intl subdirectory, will be compiled
1065 dnl Catalog format: GNU --> install in $(datadir)
1066 dnl Catalog extension: .mo after installation, .gmo in source tree
1067 dnl 2) GNU gettext has been found in the system's C library.
1068 dnl Catalog format: GNU --> install in $(datadir)
1069 dnl Catalog extension: .mo after installation, .gmo in source tree
1070 dnl 3) No internationalization, always use English msgid.
1071 dnl Catalog format: none
1072 dnl Catalog extension: none
1073 dnl If INTLSYMBOL is 'external', only cases 2 and 3 can occur.
1074 dnl The use of .gmo is historical (it was needed to avoid overwriting the
1075 dnl GNU format catalogs when building on a platform with an X/Open gettext),
1076 dnl but we keep it in order not to force irrelevant filename changes on the
1079 AC_DEFUN([AM_GNU_GETTEXT],
1081 dnl Argument checking.
1082 ifelse([$1], [], , [ifelse([$1], [external], , [ifelse([$1], [no-libtool], , [ifelse([$1], [use-libtool], ,
1083 [errprint([ERROR: invalid first argument to AM_GNU_GETTEXT
1085 ifelse([$2], [], , [ifelse([$2], [need-ngettext], , [ifelse([$2], [need-formatstring-macros], ,
1086 [errprint([ERROR: invalid second argument to AM_GNU_GETTEXT
1088 define(gt_included_intl, ifelse([$1], [external], [no], [yes]))
1089 define(gt_libtool_suffix_prefix, ifelse([$1], [use-libtool], [l], []))
1091 AC_REQUIRE([AM_PO_SUBDIRS])dnl
1092 ifelse(gt_included_intl, yes, [
1093 AC_REQUIRE([AM_INTL_SUBDIR])dnl
1096 dnl Prerequisites of AC_LIB_LINKFLAGS_BODY.
1097 AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
1098 AC_REQUIRE([AC_LIB_RPATH])
1100 dnl Sometimes libintl requires libiconv, so first search for libiconv.
1101 dnl Ideally we would do this search only after the
1102 dnl if test "$USE_NLS" = "yes"; then
1103 dnl if test "$gt_cv_func_gnugettext_libc" != "yes"; then
1104 dnl tests. But if configure.in invokes AM_ICONV after AM_GNU_GETTEXT
1105 dnl the configure script would need to contain the same shell code
1106 dnl again, outside any 'if'. There are two solutions:
1107 dnl - Invoke AM_ICONV_LINKFLAGS_BODY here, outside any 'if'.
1108 dnl - Control the expansions in more detail using AC_PROVIDE_IFELSE.
1109 dnl Since AC_PROVIDE_IFELSE is only in autoconf >= 2.52 and not
1110 dnl documented, we avoid it.
1111 ifelse(gt_included_intl, yes, , [
1112 AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY])
1115 AC_MSG_CHECKING([whether NLS is requested])
1116 dnl Default is enabled NLS
1118 [ --disable-nls do not use Native Language Support],
1119 USE_NLS=$enableval, USE_NLS=yes)
1120 AC_MSG_RESULT($USE_NLS)
1123 ifelse(gt_included_intl, yes, [
1124 BUILD_INCLUDED_LIBINTL=no
1125 USE_INCLUDED_LIBINTL=no
1131 dnl If we use NLS figure out what method
1132 if test "$USE_NLS" = "yes"; then
1133 gt_use_preinstalled_gnugettext=no
1134 ifelse(gt_included_intl, yes, [
1135 AC_MSG_CHECKING([whether included gettext is requested])
1136 AC_ARG_WITH(included-gettext,
1137 [ --with-included-gettext use the GNU gettext library included here],
1138 nls_cv_force_use_gnu_gettext=$withval,
1139 nls_cv_force_use_gnu_gettext=no)
1140 AC_MSG_RESULT($nls_cv_force_use_gnu_gettext)
1142 nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext"
1143 if test "$nls_cv_force_use_gnu_gettext" != "yes"; then
1145 dnl User does not insist on using GNU NLS library. Figure out what
1146 dnl to use. If GNU gettext is available we use this. Else we have
1147 dnl to fall back to GNU NLS library.
1149 dnl Add a version number to the cache macros.
1150 define([gt_api_version], ifelse([$2], [need-formatstring-macros], 3, ifelse([$2], [need-ngettext], 2, 1)))
1151 define([gt_cv_func_gnugettext_libc], [gt_cv_func_gnugettext]gt_api_version[_libc])
1152 define([gt_cv_func_gnugettext_libintl], [gt_cv_func_gnugettext]gt_api_version[_libintl])
1154 AC_CACHE_CHECK([for GNU gettext in libc], gt_cv_func_gnugettext_libc,
1155 [AC_TRY_LINK([#include <libintl.h>
1156 ]ifelse([$2], [need-formatstring-macros],
1157 [#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
1158 #define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1)
1161 typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1];
1163 ], [])[extern int _nl_msg_cat_cntr;
1164 extern int *_nl_domain_bindings;],
1165 [bindtextdomain ("", "");
1166 return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_domain_bindings],
1167 gt_cv_func_gnugettext_libc=yes,
1168 gt_cv_func_gnugettext_libc=no)])
1170 if test "$gt_cv_func_gnugettext_libc" != "yes"; then
1171 dnl Sometimes libintl requires libiconv, so first search for libiconv.
1172 ifelse(gt_included_intl, yes, , [
1175 dnl Search for libintl and define LIBINTL, LTLIBINTL and INCINTL
1176 dnl accordingly. Don't use AC_LIB_LINKFLAGS_BODY([intl],[iconv])
1177 dnl because that would add "-liconv" to LIBINTL and LTLIBINTL
1178 dnl even if libiconv doesn't exist.
1179 AC_LIB_LINKFLAGS_BODY([intl])
1180 AC_CACHE_CHECK([for GNU gettext in libintl],
1181 gt_cv_func_gnugettext_libintl,
1182 [gt_save_CPPFLAGS="$CPPFLAGS"
1183 CPPFLAGS="$CPPFLAGS $INCINTL"
1184 gt_save_LIBS="$LIBS"
1185 LIBS="$LIBS $LIBINTL"
1186 dnl Now see whether libintl exists and does not depend on libiconv.
1187 AC_TRY_LINK([#include <libintl.h>
1188 ]ifelse([$2], [need-formatstring-macros],
1189 [#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
1190 #define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1)
1193 typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1];
1195 ], [])[extern int _nl_msg_cat_cntr;
1200 const char *_nl_expand_alias ();],
1201 [bindtextdomain ("", "");
1202 return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_expand_alias (0)],
1203 gt_cv_func_gnugettext_libintl=yes,
1204 gt_cv_func_gnugettext_libintl=no)
1205 dnl Now see whether libintl exists and depends on libiconv.
1206 if test "$gt_cv_func_gnugettext_libintl" != yes && test -n "$LIBICONV"; then
1207 LIBS="$LIBS $LIBICONV"
1208 AC_TRY_LINK([#include <libintl.h>
1209 ]ifelse([$2], [need-formatstring-macros],
1210 [#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
1211 #define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1)
1214 typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1];
1216 ], [])[extern int _nl_msg_cat_cntr;
1221 const char *_nl_expand_alias ();],
1222 [bindtextdomain ("", "");
1223 return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_expand_alias (0)],
1224 [LIBINTL="$LIBINTL $LIBICONV"
1225 LTLIBINTL="$LTLIBINTL $LTLIBICONV"
1226 gt_cv_func_gnugettext_libintl=yes
1229 CPPFLAGS="$gt_save_CPPFLAGS"
1230 LIBS="$gt_save_LIBS"])
1233 dnl If an already present or preinstalled GNU gettext() is found,
1234 dnl use it. But if this macro is used in GNU gettext, and GNU
1235 dnl gettext is already preinstalled in libintl, we update this
1236 dnl libintl. (Cf. the install rule in intl/Makefile.in.)
1237 if test "$gt_cv_func_gnugettext_libc" = "yes" \
1238 || { test "$gt_cv_func_gnugettext_libintl" = "yes" \
1239 && test "$PACKAGE" != gettext; }; then
1240 gt_use_preinstalled_gnugettext=yes
1242 dnl Reset the values set by searching for libintl.
1248 ifelse(gt_included_intl, yes, [
1249 if test "$gt_use_preinstalled_gnugettext" != "yes"; then
1250 dnl GNU gettext is not found in the C library.
1251 dnl Fall back on included GNU gettext library.
1252 nls_cv_use_gnu_gettext=yes
1256 if test "$nls_cv_use_gnu_gettext" = "yes"; then
1257 dnl Mark actions used to generate GNU NLS library.
1258 INTLOBJS="\$(GETTOBJS)"
1259 BUILD_INCLUDED_LIBINTL=yes
1260 USE_INCLUDED_LIBINTL=yes
1261 LIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LIBICONV"
1262 LTLIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LTLIBICONV"
1263 LIBS=`echo " $LIBS " | sed -e 's/ -lintl / /' -e 's/^ //' -e 's/ $//'`
1266 if test "$gt_use_preinstalled_gnugettext" = "yes" \
1267 || test "$nls_cv_use_gnu_gettext" = "yes"; then
1268 dnl Mark actions to use GNU gettext tools.
1273 if test "$gt_use_preinstalled_gnugettext" = "yes" \
1274 || test "$nls_cv_use_gnu_gettext" = "yes"; then
1275 AC_DEFINE(ENABLE_NLS, 1,
1276 [Define to 1 if translation of program messages to the user's native language
1283 if test "$USE_NLS" = "yes"; then
1285 if test "$gt_use_preinstalled_gnugettext" = "yes"; then
1286 if test "$gt_cv_func_gnugettext_libintl" = "yes"; then
1287 AC_MSG_CHECKING([how to link with libintl])
1288 AC_MSG_RESULT([$LIBINTL])
1289 AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCINTL])
1292 dnl For backward compatibility. Some packages may be using this.
1293 AC_DEFINE(HAVE_GETTEXT, 1,
1294 [Define if the GNU gettext() function is already present or preinstalled.])
1295 AC_DEFINE(HAVE_DCGETTEXT, 1,
1296 [Define if the GNU dcgettext() function is already present or preinstalled.])
1299 dnl We need to process the po/ directory.
1303 ifelse(gt_included_intl, yes, [
1304 dnl If this is used in GNU gettext we have to set BUILD_INCLUDED_LIBINTL
1305 dnl to 'yes' because some of the testsuite requires it.
1306 if test "$PACKAGE" = gettext; then
1307 BUILD_INCLUDED_LIBINTL=yes
1310 dnl Make all variables we use known to autoconf.
1311 AC_SUBST(BUILD_INCLUDED_LIBINTL)
1312 AC_SUBST(USE_INCLUDED_LIBINTL)
1316 dnl For backward compatibility. Some configure.ins may be using this.
1318 nls_cv_header_libgt=
1320 dnl For backward compatibility. Some Makefiles may be using this.
1322 AC_SUBST(DATADIRNAME)
1324 dnl For backward compatibility. Some Makefiles may be using this.
1326 AC_SUBST(INSTOBJEXT)
1328 dnl For backward compatibility. Some Makefiles may be using this.
1332 dnl Enable libtool support if the surrounding package wishes it.
1333 INTL_LIBTOOL_SUFFIX_PREFIX=gt_libtool_suffix_prefix
1334 AC_SUBST(INTL_LIBTOOL_SUFFIX_PREFIX)
1337 dnl For backward compatibility. Some Makefiles may be using this.
1341 dnl Make all documented variables known to autoconf.
1348 dnl Checks for all prerequisites of the po subdirectory,
1349 dnl except for USE_NLS.
1350 AC_DEFUN([AM_PO_SUBDIRS],
1352 AC_REQUIRE([AC_PROG_MAKE_SET])dnl
1353 AC_REQUIRE([AC_PROG_INSTALL])dnl
1354 AC_REQUIRE([AM_MKINSTALLDIRS])dnl
1356 dnl Perform the following tests also if --disable-nls has been given,
1357 dnl because they are needed for "make dist" to work.
1359 dnl Search for GNU msgfmt in the PATH.
1360 dnl The first test excludes Solaris msgfmt and early GNU msgfmt versions.
1361 dnl The second test excludes FreeBSD msgfmt.
1362 AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
1363 [$ac_dir/$ac_word --statistics /dev/null >/dev/null 2>&1 &&
1364 (if $ac_dir/$ac_word --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi)],
1366 AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
1368 dnl Search for GNU xgettext 0.11 or newer in the PATH.
1369 dnl The first test excludes Solaris xgettext and early GNU xgettext versions.
1370 dnl The second test excludes FreeBSD xgettext.
1371 AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
1372 [$ac_dir/$ac_word --omit-header --copyright-holder= /dev/null >/dev/null 2>&1 &&
1373 (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)],
1375 dnl Remove leftover from FreeBSD xgettext call.
1378 dnl Search for GNU msgmerge 0.11 or newer in the PATH.
1379 AM_PATH_PROG_WITH_TEST(MSGMERGE, msgmerge,
1380 [$ac_dir/$ac_word --update -q /dev/null /dev/null >/dev/null 2>&1], :)
1382 dnl This could go away some day; the PATH_PROG_WITH_TEST already does it.
1383 dnl Test whether we really found GNU msgfmt.
1384 if test "$GMSGFMT" != ":"; then
1385 dnl If it is no GNU msgfmt we define it as : so that the
1386 dnl Makefiles still can work.
1387 if $GMSGFMT --statistics /dev/null >/dev/null 2>&1 &&
1388 (if $GMSGFMT --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then
1391 GMSGFMT=`echo "$GMSGFMT" | sed -e 's,^.*/,,'`
1393 [found $GMSGFMT program is not GNU msgfmt; ignore it])
1398 dnl This could go away some day; the PATH_PROG_WITH_TEST already does it.
1399 dnl Test whether we really found GNU xgettext.
1400 if test "$XGETTEXT" != ":"; then
1401 dnl If it is no GNU xgettext we define it as : so that the
1402 dnl Makefiles still can work.
1403 if $XGETTEXT --omit-header --copyright-holder= /dev/null >/dev/null 2>&1 &&
1404 (if $XGETTEXT --omit-header --copyright-holder= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then
1408 [found xgettext program is not GNU xgettext; ignore it])
1411 dnl Remove leftover from FreeBSD xgettext call.
1415 AC_OUTPUT_COMMANDS([
1416 for ac_file in $CONFIG_FILES; do
1417 # Support "outfile[:infile[:infile...]]"
1419 *:*) ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
1421 # PO directories have a Makefile.in generated from Makefile.in.in.
1422 case "$ac_file" in */Makefile.in)
1423 # Adjust a relative srcdir.
1424 ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'`
1425 ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`"
1426 ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'`
1427 # In autoconf-2.13 it is called $ac_given_srcdir.
1428 # In autoconf-2.50 it is called $srcdir.
1429 test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir"
1430 case "$ac_given_srcdir" in
1431 .) top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;;
1432 /*) top_srcdir="$ac_given_srcdir" ;;
1433 *) top_srcdir="$ac_dots$ac_given_srcdir" ;;
1435 if test -f "$ac_given_srcdir/$ac_dir/POTFILES.in"; then
1436 rm -f "$ac_dir/POTFILES"
1437 test -n "$as_me" && echo "$as_me: creating $ac_dir/POTFILES" || echo "creating $ac_dir/POTFILES"
1438 cat "$ac_given_srcdir/$ac_dir/POTFILES.in" | sed -e "/^#/d" -e "/^[ ]*\$/d" -e "s,.*, $top_srcdir/& \\\\," | sed -e "\$s/\(.*\) \\\\/\1/" > "$ac_dir/POTFILES"
1439 # ALL_LINGUAS, POFILES, GMOFILES, UPDATEPOFILES, DUMMYPOFILES depend
1440 # on $ac_dir but don't depend on user-specified configuration
1442 if test -f "$ac_given_srcdir/$ac_dir/LINGUAS"; then
1443 # The LINGUAS file contains the set of available languages.
1444 if test -n "$ALL_LINGUAS"; then
1445 test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete"
1447 ALL_LINGUAS_=`sed -e "/^#/d" "$ac_given_srcdir/$ac_dir/LINGUAS"`
1448 # Hide the ALL_LINGUAS assigment from automake.
1449 eval 'ALL_LINGUAS''=$ALL_LINGUAS_'
1451 case "$ac_given_srcdir" in
1453 *) srcdirpre='$(srcdir)/' ;;
1459 for lang in $ALL_LINGUAS; do
1460 POFILES="$POFILES $srcdirpre$lang.po"
1461 GMOFILES="$GMOFILES $srcdirpre$lang.gmo"
1462 UPDATEPOFILES="$UPDATEPOFILES $lang.po-update"
1463 DUMMYPOFILES="$DUMMYPOFILES $lang.nop"
1465 # CATALOGS depends on both $ac_dir and the user's LINGUAS
1466 # environment variable.
1468 if test -n "$ALL_LINGUAS"; then
1469 for presentlang in $ALL_LINGUAS; do
1471 if test "%UNSET%" != "$LINGUAS"; then
1472 desiredlanguages="$LINGUAS"
1474 desiredlanguages="$ALL_LINGUAS"
1476 for desiredlang in $desiredlanguages; do
1477 # Use the presentlang catalog if desiredlang is
1478 # a. equal to presentlang, or
1479 # b. a variant of presentlang (because in this case,
1480 # presentlang can be used as a fallback for messages
1481 # which are not translated in the desiredlang catalog).
1482 case "$desiredlang" in
1483 "$presentlang"*) useit=yes;;
1486 if test $useit = yes; then
1487 INST_LINGUAS="$INST_LINGUAS $presentlang"
1492 if test -n "$INST_LINGUAS"; then
1493 for lang in $INST_LINGUAS; do
1494 CATALOGS="$CATALOGS $lang.gmo"
1497 test -n "$as_me" && echo "$as_me: creating $ac_dir/Makefile" || echo "creating $ac_dir/Makefile"
1498 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"
1499 for f in "$ac_given_srcdir/$ac_dir"/Rules-*; do
1500 if test -f "$f"; then
1502 *.orig | *.bak | *~) ;;
1503 *) cat "$f" >> "$ac_dir/Makefile" ;;
1511 [# Capture the value of obsolete ALL_LINGUAS because we need it to compute
1512 # POFILES, GMOFILES, UPDATEPOFILES, DUMMYPOFILES, CATALOGS. But hide it
1514 eval 'ALL_LINGUAS''="$ALL_LINGUAS"'
1515 # Capture the value of LINGUAS because we need it to compute CATALOGS.
1516 LINGUAS="${LINGUAS-%UNSET%}"
1521 dnl Checks for all prerequisites of the intl subdirectory,
1522 dnl except for INTL_LIBTOOL_SUFFIX_PREFIX (and possibly LIBTOOL), INTLOBJS,
1523 dnl USE_INCLUDED_LIBINTL, BUILD_INCLUDED_LIBINTL.
1524 AC_DEFUN([AM_INTL_SUBDIR],
1526 AC_REQUIRE([AC_PROG_INSTALL])dnl
1527 AC_REQUIRE([AM_MKINSTALLDIRS])dnl
1528 AC_REQUIRE([AC_PROG_CC])dnl
1529 AC_REQUIRE([AC_CANONICAL_HOST])dnl
1530 AC_REQUIRE([AC_PROG_RANLIB])dnl
1531 AC_REQUIRE([AC_ISC_POSIX])dnl
1532 AC_REQUIRE([AC_HEADER_STDC])dnl
1533 AC_REQUIRE([AC_C_CONST])dnl
1534 AC_REQUIRE([AC_C_INLINE])dnl
1535 AC_REQUIRE([AC_TYPE_OFF_T])dnl
1536 AC_REQUIRE([AC_TYPE_SIZE_T])dnl
1537 AC_REQUIRE([AC_FUNC_ALLOCA])dnl
1538 AC_REQUIRE([AC_FUNC_MMAP])dnl
1539 AC_REQUIRE([jm_GLIBC21])dnl
1540 AC_REQUIRE([gt_INTDIV0])dnl
1541 AC_REQUIRE([jm_AC_TYPE_UINTMAX_T])dnl
1542 AC_REQUIRE([gt_HEADER_INTTYPES_H])dnl
1543 AC_REQUIRE([gt_INTTYPES_PRI])dnl
1545 AC_CHECK_HEADERS([argz.h limits.h locale.h nl_types.h malloc.h stddef.h \
1546 stdlib.h string.h unistd.h sys/param.h])
1547 AC_CHECK_FUNCS([feof_unlocked fgets_unlocked getc_unlocked getcwd getegid \
1548 geteuid getgid getuid mempcpy munmap putenv setenv setlocale stpcpy \
1549 strcasecmp strdup strtoul tsearch __argz_count __argz_stringify __argz_next])
1553 if test $ac_cv_header_locale_h = yes; then
1557 dnl intl/plural.c is generated from intl/plural.y. It requires bison,
1558 dnl because plural.y uses bison specific features. It requires at least
1559 dnl bison-1.26 because earlier versions generate a plural.c that doesn't
1561 dnl bison is only needed for the maintainer (who touches plural.y). But in
1562 dnl order to avoid separate Makefiles or --enable-maintainer-mode, we put
1563 dnl the rule in general Makefile. Now, some people carelessly touch the
1564 dnl files or have a broken "make" program, hence the plural.c rule will
1565 dnl sometimes fire. To avoid an error, defines BISON to ":" if it is not
1566 dnl present or too old.
1567 AC_CHECK_PROGS([INTLBISON], [bison])
1568 if test -z "$INTLBISON"; then
1571 dnl Found it, now check the version.
1572 AC_MSG_CHECKING([version of bison])
1573 changequote(<<,>>)dnl
1574 ac_prog_version=`$INTLBISON --version 2>&1 | sed -n 's/^.*GNU Bison.* \([0-9]*\.[0-9.]*\).*$/\1/p'`
1575 case $ac_prog_version in
1576 '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;;
1577 1.2[6-9]* | 1.[3-9][0-9]* | [2-9].*)
1579 ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;;
1580 *) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;;
1582 AC_MSG_RESULT([$ac_prog_version])
1584 if test $ac_verc_fail = yes; then
1590 AC_DEFUN([AM_MKINSTALLDIRS],
1592 dnl If the AC_CONFIG_AUX_DIR macro for autoconf is used we possibly
1593 dnl find the mkinstalldirs script in another subdir but $(top_srcdir).
1594 dnl Try to locate is.
1596 if test -n "$ac_aux_dir"; then
1597 MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs"
1599 if test -z "$MKINSTALLDIRS"; then
1600 MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs"
1602 AC_SUBST(MKINSTALLDIRS)
1606 dnl Usage: AM_GNU_GETTEXT_VERSION([gettext-version])
1607 AC_DEFUN([AM_GNU_GETTEXT_VERSION], [])
1609 # lib-prefix.m4 serial 1 (gettext-0.11)
1610 dnl Copyright (C) 2001-2002 Free Software Foundation, Inc.
1611 dnl This file is free software, distributed under the terms of the GNU
1612 dnl General Public License. As a special exception to the GNU General
1613 dnl Public License, this file may be distributed as part of a program
1614 dnl that contains a configuration script generated by Autoconf, under
1615 dnl the same distribution terms as the rest of that program.
1617 dnl From Bruno Haible.
1619 dnl AC_LIB_PREFIX adds to the CPPFLAGS and LDFLAGS the flags that are needed
1620 dnl to access previously installed libraries. The basic assumption is that
1621 dnl a user will want packages to use other packages he previously installed
1622 dnl with the same --prefix option.
1623 dnl This macro is not needed if only AC_LIB_LINKFLAGS is used to locate
1624 dnl libraries, but is otherwise very convenient.
1625 AC_DEFUN([AC_LIB_PREFIX],
1627 AC_BEFORE([$0], [AC_LIB_LINKFLAGS])
1628 AC_REQUIRE([AC_PROG_CC])
1629 AC_REQUIRE([AC_CANONICAL_HOST])
1630 AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
1631 dnl By default, look in $includedir and $libdir.
1633 AC_LIB_WITH_FINAL_PREFIX([
1634 eval additional_includedir=\"$includedir\"
1635 eval additional_libdir=\"$libdir\"
1637 AC_ARG_WITH([lib-prefix],
1638 [ --with-lib-prefix[=DIR] search for libraries in DIR/include and DIR/lib
1639 --without-lib-prefix don't search for libraries in includedir and libdir],
1641 if test "X$withval" = "Xno"; then
1644 if test "X$withval" = "X"; then
1645 AC_LIB_WITH_FINAL_PREFIX([
1646 eval additional_includedir=\"$includedir\"
1647 eval additional_libdir=\"$libdir\"
1650 additional_includedir="$withval/include"
1651 additional_libdir="$withval/lib"
1655 if test $use_additional = yes; then
1656 dnl Potentially add $additional_includedir to $CPPFLAGS.
1657 dnl But don't add it
1658 dnl 1. if it's the standard /usr/include,
1659 dnl 2. if it's already present in $CPPFLAGS,
1660 dnl 3. if it's /usr/local/include and we are using GCC on Linux,
1661 dnl 4. if it doesn't exist as a directory.
1662 if test "X$additional_includedir" != "X/usr/include"; then
1664 for x in $CPPFLAGS; do
1665 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
1666 if test "X$x" = "X-I$additional_includedir"; then
1671 if test -z "$haveit"; then
1672 if test "X$additional_includedir" = "X/usr/local/include"; then
1673 if test -n "$GCC"; then
1675 linux*) haveit=yes;;
1679 if test -z "$haveit"; then
1680 if test -d "$additional_includedir"; then
1681 dnl Really add $additional_includedir to $CPPFLAGS.
1682 CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }-I$additional_includedir"
1687 dnl Potentially add $additional_libdir to $LDFLAGS.
1688 dnl But don't add it
1689 dnl 1. if it's the standard /usr/lib,
1690 dnl 2. if it's already present in $LDFLAGS,
1691 dnl 3. if it's /usr/local/lib and we are using GCC on Linux,
1692 dnl 4. if it doesn't exist as a directory.
1693 if test "X$additional_libdir" != "X/usr/lib"; then
1695 for x in $LDFLAGS; do
1696 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
1697 if test "X$x" = "X-L$additional_libdir"; then
1702 if test -z "$haveit"; then
1703 if test "X$additional_libdir" = "X/usr/local/lib"; then
1704 if test -n "$GCC"; then
1706 linux*) haveit=yes;;
1710 if test -z "$haveit"; then
1711 if test -d "$additional_libdir"; then
1712 dnl Really add $additional_libdir to $LDFLAGS.
1713 LDFLAGS="${LDFLAGS}${LDFLAGS:+ }-L$additional_libdir"
1721 dnl AC_LIB_PREPARE_PREFIX creates variables acl_final_prefix,
1722 dnl acl_final_exec_prefix, containing the values to which $prefix and
1723 dnl $exec_prefix will expand at the end of the configure script.
1724 AC_DEFUN([AC_LIB_PREPARE_PREFIX],
1726 dnl Unfortunately, prefix and exec_prefix get only finally determined
1727 dnl at the end of configure.
1728 if test "X$prefix" = "XNONE"; then
1729 acl_final_prefix="$ac_default_prefix"
1731 acl_final_prefix="$prefix"
1733 if test "X$exec_prefix" = "XNONE"; then
1734 acl_final_exec_prefix='${prefix}'
1736 acl_final_exec_prefix="$exec_prefix"
1738 acl_save_prefix="$prefix"
1739 prefix="$acl_final_prefix"
1740 eval acl_final_exec_prefix=\"$acl_final_exec_prefix\"
1741 prefix="$acl_save_prefix"
1744 dnl AC_LIB_WITH_FINAL_PREFIX([statement]) evaluates statement, with the
1745 dnl variables prefix and exec_prefix bound to the values they will have
1746 dnl at the end of the configure script.
1747 AC_DEFUN([AC_LIB_WITH_FINAL_PREFIX],
1749 acl_save_prefix="$prefix"
1750 prefix="$acl_final_prefix"
1751 acl_save_exec_prefix="$exec_prefix"
1752 exec_prefix="$acl_final_exec_prefix"
1754 exec_prefix="$acl_save_exec_prefix"
1755 prefix="$acl_save_prefix"
1758 # lib-link.m4 serial 3 (gettext-0.11.3)
1759 dnl Copyright (C) 2001-2002 Free Software Foundation, Inc.
1760 dnl This file is free software, distributed under the terms of the GNU
1761 dnl General Public License. As a special exception to the GNU General
1762 dnl Public License, this file may be distributed as part of a program
1763 dnl that contains a configuration script generated by Autoconf, under
1764 dnl the same distribution terms as the rest of that program.
1766 dnl From Bruno Haible.
1768 dnl AC_LIB_LINKFLAGS(name [, dependencies]) searches for libname and
1769 dnl the libraries corresponding to explicit and implicit dependencies.
1770 dnl Sets and AC_SUBSTs the LIB${NAME} and LTLIB${NAME} variables and
1771 dnl augments the CPPFLAGS variable.
1772 AC_DEFUN([AC_LIB_LINKFLAGS],
1774 AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
1775 AC_REQUIRE([AC_LIB_RPATH])
1776 define([Name],[translit([$1],[./-], [___])])
1777 define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
1778 [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
1779 AC_CACHE_CHECK([how to link with lib[]$1], [ac_cv_lib[]Name[]_libs], [
1780 AC_LIB_LINKFLAGS_BODY([$1], [$2])
1781 ac_cv_lib[]Name[]_libs="$LIB[]NAME"
1782 ac_cv_lib[]Name[]_ltlibs="$LTLIB[]NAME"
1783 ac_cv_lib[]Name[]_cppflags="$INC[]NAME"
1785 LIB[]NAME="$ac_cv_lib[]Name[]_libs"
1786 LTLIB[]NAME="$ac_cv_lib[]Name[]_ltlibs"
1787 INC[]NAME="$ac_cv_lib[]Name[]_cppflags"
1788 AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
1790 AC_SUBST([LTLIB]NAME)
1791 dnl Also set HAVE_LIB[]NAME so that AC_LIB_HAVE_LINKFLAGS can reuse the
1792 dnl results of this search when this library appears as a dependency.
1798 dnl AC_LIB_HAVE_LINKFLAGS(name, dependencies, includes, testcode)
1799 dnl searches for libname and the libraries corresponding to explicit and
1800 dnl implicit dependencies, together with the specified include files and
1801 dnl the ability to compile and link the specified testcode. If found, it
1802 dnl sets and AC_SUBSTs HAVE_LIB${NAME}=yes and the LIB${NAME} and
1803 dnl LTLIB${NAME} variables and augments the CPPFLAGS variable, and
1804 dnl #defines HAVE_LIB${NAME} to 1. Otherwise, it sets and AC_SUBSTs
1805 dnl HAVE_LIB${NAME}=no and LIB${NAME} and LTLIB${NAME} to empty.
1806 AC_DEFUN([AC_LIB_HAVE_LINKFLAGS],
1808 AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
1809 AC_REQUIRE([AC_LIB_RPATH])
1810 define([Name],[translit([$1],[./-], [___])])
1811 define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
1812 [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
1814 dnl Search for lib[]Name and define LIB[]NAME, LTLIB[]NAME and INC[]NAME
1816 AC_LIB_LINKFLAGS_BODY([$1], [$2])
1818 dnl Add $INC[]NAME to CPPFLAGS before performing the following checks,
1819 dnl because if the user has installed lib[]Name and not disabled its use
1820 dnl via --without-lib[]Name-prefix, he wants to use it.
1821 ac_save_CPPFLAGS="$CPPFLAGS"
1822 AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
1824 AC_CACHE_CHECK([for lib[]$1], [ac_cv_lib[]Name], [
1825 ac_save_LIBS="$LIBS"
1826 LIBS="$LIBS $LIB[]NAME"
1827 AC_TRY_LINK([$3], [$4], [ac_cv_lib[]Name=yes], [ac_cv_lib[]Name=no])
1828 LIBS="$ac_save_LIBS"
1830 if test "$ac_cv_lib[]Name" = yes; then
1832 AC_DEFINE([HAVE_LIB]NAME, 1, [Define if you have the $1 library.])
1833 AC_MSG_CHECKING([how to link with lib[]$1])
1834 AC_MSG_RESULT([$LIB[]NAME])
1837 dnl If $LIB[]NAME didn't lead to a usable library, we don't need
1838 dnl $INC[]NAME either.
1839 CPPFLAGS="$ac_save_CPPFLAGS"
1843 AC_SUBST([HAVE_LIB]NAME)
1845 AC_SUBST([LTLIB]NAME)
1850 dnl Determine the platform dependent parameters needed to use rpath:
1851 dnl libext, shlibext, hardcode_libdir_flag_spec, hardcode_libdir_separator,
1852 dnl hardcode_direct, hardcode_minus_L,
1853 dnl sys_lib_search_path_spec, sys_lib_dlsearch_path_spec.
1854 AC_DEFUN([AC_LIB_RPATH],
1856 AC_REQUIRE([AC_PROG_CC]) dnl we use $CC, $GCC, $LDFLAGS
1857 AC_REQUIRE([AC_LIB_PROG_LD]) dnl we use $LD, $with_gnu_ld
1858 AC_REQUIRE([AC_CANONICAL_HOST]) dnl we use $host
1859 AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT]) dnl we use $ac_aux_dir
1860 AC_CACHE_CHECK([for shared library run path origin], acl_cv_rpath, [
1861 CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \
1862 ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh
1868 libext="$acl_cv_libext"
1869 shlibext="$acl_cv_shlibext"
1870 hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec"
1871 hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator"
1872 hardcode_direct="$acl_cv_hardcode_direct"
1873 hardcode_minus_L="$acl_cv_hardcode_minus_L"
1874 sys_lib_search_path_spec="$acl_cv_sys_lib_search_path_spec"
1875 sys_lib_dlsearch_path_spec="$acl_cv_sys_lib_dlsearch_path_spec"
1876 dnl Determine whether the user wants rpath handling at all.
1877 AC_ARG_ENABLE(rpath,
1878 [ --disable-rpath do not hardcode runtime library paths],
1879 :, enable_rpath=yes)
1882 dnl AC_LIB_LINKFLAGS_BODY(name [, dependencies]) searches for libname and
1883 dnl the libraries corresponding to explicit and implicit dependencies.
1884 dnl Sets the LIB${NAME}, LTLIB${NAME} and INC${NAME} variables.
1885 AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
1887 define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
1888 [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
1889 dnl By default, look in $includedir and $libdir.
1891 AC_LIB_WITH_FINAL_PREFIX([
1892 eval additional_includedir=\"$includedir\"
1893 eval additional_libdir=\"$libdir\"
1895 AC_ARG_WITH([lib$1-prefix],
1896 [ --with-lib$1-prefix[=DIR] search for lib$1 in DIR/include and DIR/lib
1897 --without-lib$1-prefix don't search for lib$1 in includedir and libdir],
1899 if test "X$withval" = "Xno"; then
1902 if test "X$withval" = "X"; then
1903 AC_LIB_WITH_FINAL_PREFIX([
1904 eval additional_includedir=\"$includedir\"
1905 eval additional_libdir=\"$libdir\"
1908 additional_includedir="$withval/include"
1909 additional_libdir="$withval/lib"
1913 dnl Search the library and its dependencies in $additional_libdir and
1914 dnl $LDFLAGS. Using breadth-first-seach.
1920 names_already_handled=
1921 names_next_round='$1 $2'
1922 while test -n "$names_next_round"; do
1923 names_this_round="$names_next_round"
1925 for name in $names_this_round; do
1927 for n in $names_already_handled; do
1928 if test "$n" = "$name"; then
1933 if test -z "$already_handled"; then
1934 names_already_handled="$names_already_handled $name"
1935 dnl See if it was already located by an earlier AC_LIB_LINKFLAGS
1936 dnl or AC_LIB_HAVE_LINKFLAGS call.
1937 uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'`
1938 eval value=\"\$HAVE_LIB$uppername\"
1939 if test -n "$value"; then
1940 if test "$value" = yes; then
1941 eval value=\"\$LIB$uppername\"
1942 test -z "$value" || LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$value"
1943 eval value=\"\$LTLIB$uppername\"
1944 test -z "$value" || LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$value"
1946 dnl An earlier call to AC_LIB_HAVE_LINKFLAGS has determined
1947 dnl that this library doesn't exist. So just drop it.
1951 dnl Search the library lib$name in $additional_libdir and $LDFLAGS
1952 dnl and the already constructed $LIBNAME/$LTLIBNAME.
1957 if test $use_additional = yes; then
1958 if test -n "$shlibext" && test -f "$additional_libdir/lib$name.$shlibext"; then
1959 found_dir="$additional_libdir"
1960 found_so="$additional_libdir/lib$name.$shlibext"
1961 if test -f "$additional_libdir/lib$name.la"; then
1962 found_la="$additional_libdir/lib$name.la"
1965 if test -f "$additional_libdir/lib$name.$libext"; then
1966 found_dir="$additional_libdir"
1967 found_a="$additional_libdir/lib$name.$libext"
1968 if test -f "$additional_libdir/lib$name.la"; then
1969 found_la="$additional_libdir/lib$name.la"
1974 if test "X$found_dir" = "X"; then
1975 for x in $LDFLAGS $LTLIB[]NAME; do
1976 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
1979 dir=`echo "X$x" | sed -e 's/^X-L//'`
1980 if test -n "$shlibext" && test -f "$dir/lib$name.$shlibext"; then
1982 found_so="$dir/lib$name.$shlibext"
1983 if test -f "$dir/lib$name.la"; then
1984 found_la="$dir/lib$name.la"
1987 if test -f "$dir/lib$name.$libext"; then
1989 found_a="$dir/lib$name.$libext"
1990 if test -f "$dir/lib$name.la"; then
1991 found_la="$dir/lib$name.la"
1997 if test "X$found_dir" != "X"; then
2002 if test "X$found_dir" != "X"; then
2003 dnl Found the library.
2004 LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$found_dir -l$name"
2005 if test "X$found_so" != "X"; then
2006 dnl Linking with a shared library. We attempt to hardcode its
2007 dnl directory into the executable's runpath, unless it's the
2008 dnl standard /usr/lib.
2009 if test "$enable_rpath" = no || test "X$found_dir" = "X/usr/lib"; then
2010 dnl No hardcoding is needed.
2011 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
2013 dnl Use an explicit option to hardcode DIR into the resulting
2015 dnl Potentially add DIR to ltrpathdirs.
2016 dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
2018 for x in $ltrpathdirs; do
2019 if test "X$x" = "X$found_dir"; then
2024 if test -z "$haveit"; then
2025 ltrpathdirs="$ltrpathdirs $found_dir"
2027 dnl The hardcoding into $LIBNAME is system dependent.
2028 if test "$hardcode_direct" = yes; then
2029 dnl Using DIR/libNAME.so during linking hardcodes DIR into the
2030 dnl resulting binary.
2031 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
2033 if test -n "$hardcode_libdir_flag_spec" && test "$hardcode_minus_L" = no; then
2034 dnl Use an explicit option to hardcode DIR into the resulting
2036 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
2037 dnl Potentially add DIR to rpathdirs.
2038 dnl The rpathdirs will be appended to $LIBNAME at the end.
2040 for x in $rpathdirs; do
2041 if test "X$x" = "X$found_dir"; then
2046 if test -z "$haveit"; then
2047 rpathdirs="$rpathdirs $found_dir"
2050 dnl Rely on "-L$found_dir".
2051 dnl But don't add it if it's already contained in the LDFLAGS
2052 dnl or the already constructed $LIBNAME
2054 for x in $LDFLAGS $LIB[]NAME; do
2055 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
2056 if test "X$x" = "X-L$found_dir"; then
2061 if test -z "$haveit"; then
2062 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir"
2064 if test "$hardcode_minus_L" != no; then
2065 dnl FIXME: Not sure whether we should use
2066 dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
2068 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
2070 dnl We cannot use $hardcode_runpath_var and LD_RUN_PATH
2071 dnl here, because this doesn't fit in flags passed to the
2072 dnl compiler. So give up. No hardcoding. This affects only
2073 dnl very old systems.
2074 dnl FIXME: Not sure whether we should use
2075 dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
2077 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"
2083 if test "X$found_a" != "X"; then
2084 dnl Linking with a static library.
2085 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_a"
2087 dnl We shouldn't come here, but anyway it's good to have a
2089 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir -l$name"
2092 dnl Assume the include files are nearby.
2093 additional_includedir=
2094 case "$found_dir" in
2096 basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e 's,/lib/*$,,'`
2097 additional_includedir="$basedir/include"
2100 if test "X$additional_includedir" != "X"; then
2101 dnl Potentially add $additional_includedir to $INCNAME.
2102 dnl But don't add it
2103 dnl 1. if it's the standard /usr/include,
2104 dnl 2. if it's /usr/local/include and we are using GCC on Linux,
2105 dnl 3. if it's already present in $CPPFLAGS or the already
2106 dnl constructed $INCNAME,
2107 dnl 4. if it doesn't exist as a directory.
2108 if test "X$additional_includedir" != "X/usr/include"; then
2110 if test "X$additional_includedir" = "X/usr/local/include"; then
2111 if test -n "$GCC"; then
2113 linux*) haveit=yes;;
2117 if test -z "$haveit"; then
2118 for x in $CPPFLAGS $INC[]NAME; do
2119 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
2120 if test "X$x" = "X-I$additional_includedir"; then
2125 if test -z "$haveit"; then
2126 if test -d "$additional_includedir"; then
2127 dnl Really add $additional_includedir to $INCNAME.
2128 INC[]NAME="${INC[]NAME}${INC[]NAME:+ }-I$additional_includedir"
2134 dnl Look for dependencies.
2135 if test -n "$found_la"; then
2136 dnl Read the .la file. It defines the variables
2137 dnl dlname, library_names, old_library, dependency_libs, current,
2138 dnl age, revision, installed, dlopen, dlpreopen, libdir.
2139 save_libdir="$libdir"
2141 */* | *\\*) . "$found_la" ;;
2142 *) . "./$found_la" ;;
2144 libdir="$save_libdir"
2145 dnl We use only dependency_libs.
2146 for dep in $dependency_libs; do
2149 additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'`
2150 dnl Potentially add $additional_libdir to $LIBNAME and $LTLIBNAME.
2151 dnl But don't add it
2152 dnl 1. if it's the standard /usr/lib,
2153 dnl 2. if it's /usr/local/lib and we are using GCC on Linux,
2154 dnl 3. if it's already present in $LDFLAGS or the already
2155 dnl constructed $LIBNAME,
2156 dnl 4. if it doesn't exist as a directory.
2157 if test "X$additional_libdir" != "X/usr/lib"; then
2159 if test "X$additional_libdir" = "X/usr/local/lib"; then
2160 if test -n "$GCC"; then
2162 linux*) haveit=yes;;
2166 if test -z "$haveit"; then
2168 for x in $LDFLAGS $LIB[]NAME; do
2169 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
2170 if test "X$x" = "X-L$additional_libdir"; then
2175 if test -z "$haveit"; then
2176 if test -d "$additional_libdir"; then
2177 dnl Really add $additional_libdir to $LIBNAME.
2178 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$additional_libdir"
2182 for x in $LDFLAGS $LTLIB[]NAME; do
2183 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
2184 if test "X$x" = "X-L$additional_libdir"; then
2189 if test -z "$haveit"; then
2190 if test -d "$additional_libdir"; then
2191 dnl Really add $additional_libdir to $LTLIBNAME.
2192 LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$additional_libdir"
2199 dir=`echo "X$dep" | sed -e 's/^X-R//'`
2200 if test "$enable_rpath" != no; then
2201 dnl Potentially add DIR to rpathdirs.
2202 dnl The rpathdirs will be appended to $LIBNAME at the end.
2204 for x in $rpathdirs; do
2205 if test "X$x" = "X$dir"; then
2210 if test -z "$haveit"; then
2211 rpathdirs="$rpathdirs $dir"
2213 dnl Potentially add DIR to ltrpathdirs.
2214 dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
2216 for x in $ltrpathdirs; do
2217 if test "X$x" = "X$dir"; then
2222 if test -z "$haveit"; then
2223 ltrpathdirs="$ltrpathdirs $dir"
2228 dnl Handle this in the next round.
2229 names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'`
2232 dnl Handle this in the next round. Throw away the .la's
2233 dnl directory; it is already contained in a preceding -L
2235 names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'`
2238 dnl Most likely an immediate library name.
2239 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$dep"
2240 LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$dep"
2246 dnl Didn't find the library; assume it is in the system directories
2247 dnl known to the linker and runtime loader. (All the system
2248 dnl directories known to the linker should also be known to the
2249 dnl runtime loader, otherwise the system is severely misconfigured.)
2250 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"
2251 LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-l$name"
2257 if test "X$rpathdirs" != "X"; then
2258 if test -n "$hardcode_libdir_separator"; then
2259 dnl Weird platform: only the last -rpath option counts, the user must
2260 dnl pass all path elements in one option. We can arrange that for a
2261 dnl single library, but not when more than one $LIBNAMEs are used.
2263 for found_dir in $rpathdirs; do
2264 alldirs="${alldirs}${alldirs:+$hardcode_libdir_separator}$found_dir"
2266 dnl Note: hardcode_libdir_flag_spec uses $libdir and $wl.
2267 acl_save_libdir="$libdir"
2269 eval flag=\"$hardcode_libdir_flag_spec\"
2270 libdir="$acl_save_libdir"
2271 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
2273 dnl The -rpath options are cumulative.
2274 for found_dir in $rpathdirs; do
2275 acl_save_libdir="$libdir"
2277 eval flag=\"$hardcode_libdir_flag_spec\"
2278 libdir="$acl_save_libdir"
2279 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
2283 if test "X$ltrpathdirs" != "X"; then
2284 dnl When using libtool, the option that works for both libraries and
2285 dnl executables is -R. The -R options are cumulative.
2286 for found_dir in $ltrpathdirs; do
2287 LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-R$found_dir"
2292 dnl AC_LIB_APPENDTOVAR(VAR, CONTENTS) appends the elements of CONTENTS to VAR,
2293 dnl unless already present in VAR.
2294 dnl Works only for CPPFLAGS, not for LIB* variables because that sometimes
2295 dnl contains two or three consecutive elements that belong together.
2296 AC_DEFUN([AC_LIB_APPENDTOVAR],
2298 for element in [$2]; do
2301 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
2302 if test "X$x" = "X$element"; then
2307 if test -z "$haveit"; then
2308 [$1]="${[$1]}${[$1]:+ }$element"
2313 # lib-ld.m4 serial 1 (gettext-0.11)
2314 dnl Copyright (C) 1996-2002 Free Software Foundation, Inc.
2315 dnl This file is free software, distributed under the terms of the GNU
2316 dnl General Public License. As a special exception to the GNU General
2317 dnl Public License, this file may be distributed as part of a program
2318 dnl that contains a configuration script generated by Autoconf, under
2319 dnl the same distribution terms as the rest of that program.
2321 dnl Subroutines of libtool.m4,
2322 dnl with replacements s/AC_/AC_LIB/ and s/lt_cv/acl_cv/ to avoid collision
2323 dnl with libtool.m4.
2325 dnl From libtool-1.4. Sets the variable with_gnu_ld to yes or no.
2326 AC_DEFUN([AC_LIB_PROG_LD_GNU],
2327 [AC_CACHE_CHECK([if the linker ($LD) is GNU ld], acl_cv_prog_gnu_ld,
2328 [# I'd rather use --version here, but apparently some GNU ld's only accept -v.
2329 if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
2330 acl_cv_prog_gnu_ld=yes
2332 acl_cv_prog_gnu_ld=no
2334 with_gnu_ld=$acl_cv_prog_gnu_ld
2337 dnl From libtool-1.4. Sets the variable LD.
2338 AC_DEFUN([AC_LIB_PROG_LD],
2339 [AC_ARG_WITH(gnu-ld,
2340 [ --with-gnu-ld assume the C compiler uses GNU ld [default=no]],
2341 test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
2342 AC_REQUIRE([AC_PROG_CC])dnl
2343 AC_REQUIRE([AC_CANONICAL_HOST])dnl
2345 if test "$GCC" = yes; then
2346 # Check if gcc -print-prog-name=ld gives a path.
2347 AC_MSG_CHECKING([for ld used by GCC])
2350 # gcc leaves a trailing carriage return which upsets mingw
2351 ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
2353 ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
2356 # Accept absolute paths.
2357 [[\\/]* | [A-Za-z]:[\\/]*)]
2358 [re_direlt='/[^/][^/]*/\.\./']
2359 # Canonicalize the path of ld
2360 ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
2361 while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
2362 ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
2364 test -z "$LD" && LD="$ac_prog"
2367 # If it fails, then pretend we aren't using GCC.
2371 # If it is relative, then search for the first ld in PATH.
2375 elif test "$with_gnu_ld" = yes; then
2376 AC_MSG_CHECKING([for GNU ld])
2378 AC_MSG_CHECKING([for non-GNU ld])
2380 AC_CACHE_VAL(acl_cv_path_LD,
2381 [if test -z "$LD"; then
2382 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
2383 for ac_dir in $PATH; do
2384 test -z "$ac_dir" && ac_dir=.
2385 if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
2386 acl_cv_path_LD="$ac_dir/$ac_prog"
2387 # Check to see if the program is GNU ld. I'd rather use --version,
2388 # but apparently some GNU ld's only accept -v.
2389 # Break only if it was the GNU/non-GNU ld that we prefer.
2390 if "$acl_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
2391 test "$with_gnu_ld" != no && break
2393 test "$with_gnu_ld" != yes && break
2399 acl_cv_path_LD="$LD" # Let the user override the test with a path.
2401 LD="$acl_cv_path_LD"
2402 if test -n "$LD"; then
2407 test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
2411 # iconv.m4 serial AM4 (gettext-0.11.3)
2412 dnl Copyright (C) 2000-2002 Free Software Foundation, Inc.
2413 dnl This file is free software, distributed under the terms of the GNU
2414 dnl General Public License. As a special exception to the GNU General
2415 dnl Public License, this file may be distributed as part of a program
2416 dnl that contains a configuration script generated by Autoconf, under
2417 dnl the same distribution terms as the rest of that program.
2419 dnl From Bruno Haible.
2421 AC_DEFUN([AM_ICONV_LINKFLAGS_BODY],
2423 dnl Prerequisites of AC_LIB_LINKFLAGS_BODY.
2424 AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
2425 AC_REQUIRE([AC_LIB_RPATH])
2427 dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV
2429 AC_LIB_LINKFLAGS_BODY([iconv])
2432 AC_DEFUN([AM_ICONV_LINK],
2434 dnl Some systems have iconv in libc, some have it in libiconv (OSF/1 and
2435 dnl those with the standalone portable GNU libiconv installed).
2437 dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV
2439 AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY])
2441 dnl Add $INCICONV to CPPFLAGS before performing the following checks,
2442 dnl because if the user has installed libiconv and not disabled its use
2443 dnl via --without-libiconv-prefix, he wants to use it. The first
2444 dnl AC_TRY_LINK will then fail, the second AC_TRY_LINK will succeed.
2445 am_save_CPPFLAGS="$CPPFLAGS"
2446 AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCICONV])
2448 AC_CACHE_CHECK(for iconv, am_cv_func_iconv, [
2449 am_cv_func_iconv="no, consider installing GNU libiconv"
2451 AC_TRY_LINK([#include <stdlib.h>
2452 #include <iconv.h>],
2453 [iconv_t cd = iconv_open("","");
2454 iconv(cd,NULL,NULL,NULL,NULL);
2456 am_cv_func_iconv=yes)
2457 if test "$am_cv_func_iconv" != yes; then
2458 am_save_LIBS="$LIBS"
2459 LIBS="$LIBS $LIBICONV"
2460 AC_TRY_LINK([#include <stdlib.h>
2461 #include <iconv.h>],
2462 [iconv_t cd = iconv_open("","");
2463 iconv(cd,NULL,NULL,NULL,NULL);
2466 am_cv_func_iconv=yes)
2467 LIBS="$am_save_LIBS"
2470 if test "$am_cv_func_iconv" = yes; then
2471 AC_DEFINE(HAVE_ICONV, 1, [Define if you have the iconv() function.])
2473 if test "$am_cv_lib_iconv" = yes; then
2474 AC_MSG_CHECKING([how to link with libiconv])
2475 AC_MSG_RESULT([$LIBICONV])
2477 dnl If $LIBICONV didn't lead to a usable library, we don't need $INCICONV
2479 CPPFLAGS="$am_save_CPPFLAGS"
2484 AC_SUBST(LTLIBICONV)
2487 AC_DEFUN([AM_ICONV],
2490 if test "$am_cv_func_iconv" = yes; then
2491 AC_MSG_CHECKING([for iconv declaration])
2492 AC_CACHE_VAL(am_cv_proto_iconv, [
2500 #if defined(__STDC__) || defined(__cplusplus)
2501 size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
2505 ], [], am_cv_proto_iconv_arg1="", am_cv_proto_iconv_arg1="const")
2506 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);"])
2507 am_cv_proto_iconv=`echo "[$]am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'`
2508 AC_MSG_RESULT([$]{ac_t:-
2509 }[$]am_cv_proto_iconv)
2510 AC_DEFINE_UNQUOTED(ICONV_CONST, $am_cv_proto_iconv_arg1,
2511 [Define as const if the declaration of iconv() needs const.])
2515 # progtest.m4 serial 2 (gettext-0.10.40)
2516 dnl Copyright (C) 1996-2002 Free Software Foundation, Inc.
2517 dnl This file is free software, distributed under the terms of the GNU
2518 dnl General Public License. As a special exception to the GNU General
2519 dnl Public License, this file may be distributed as part of a program
2520 dnl that contains a configuration script generated by Autoconf, under
2521 dnl the same distribution terms as the rest of that program.
2523 dnl This file can can be used in projects which are not available under
2524 dnl the GNU General Public License or the GNU Library General Public
2525 dnl License but which still want to provide support for the GNU gettext
2527 dnl Please note that the actual code of the GNU gettext library is covered
2528 dnl by the GNU Library General Public License, and the rest of the GNU
2529 dnl gettext package package is covered by the GNU General Public License.
2530 dnl They are *not* in the public domain.
2533 dnl Ulrich Drepper <drepper@cygnus.com>, 1996.
2535 # Search path for a program which passes the given test.
2537 dnl AM_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR,
2538 dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
2539 AC_DEFUN([AM_PATH_PROG_WITH_TEST],
2540 [# Extract the first word of "$2", so it can be a program name with args.
2541 set dummy $2; ac_word=[$]2
2542 AC_MSG_CHECKING([for $ac_word])
2543 AC_CACHE_VAL(ac_cv_path_$1,
2546 ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
2549 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
2550 for ac_dir in ifelse([$5], , $PATH, [$5]); do
2551 test -z "$ac_dir" && ac_dir=.
2552 if test -f $ac_dir/$ac_word; then
2554 ac_cv_path_$1="$ac_dir/$ac_word"
2560 dnl If no 4th arg is given, leave the cache variable unset,
2561 dnl so AC_PATH_PROGS will keep looking.
2562 ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
2567 if test ifelse([$4], , [-n "[$]$1"], ["[$]$1" != "$4"]); then
2568 AC_MSG_RESULT([$]$1)
2575 # glibc21.m4 serial 2 (fileutils-4.1.3, gettext-0.10.40)
2576 dnl Copyright (C) 2000-2002 Free Software Foundation, Inc.
2577 dnl This file is free software, distributed under the terms of the GNU
2578 dnl General Public License. As a special exception to the GNU General
2579 dnl Public License, this file may be distributed as part of a program
2580 dnl that contains a configuration script generated by Autoconf, under
2581 dnl the same distribution terms as the rest of that program.
2583 # Test for the GNU C Library, version 2.1 or newer.
2584 # From Bruno Haible.
2586 AC_DEFUN([jm_GLIBC21],
2588 AC_CACHE_CHECK(whether we are using the GNU C Library 2.1 or newer,
2589 ac_cv_gnu_library_2_1,
2590 [AC_EGREP_CPP([Lucky GNU user],
2592 #include <features.h>
2593 #ifdef __GNU_LIBRARY__
2594 #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1) || (__GLIBC__ > 2)
2599 ac_cv_gnu_library_2_1=yes,
2600 ac_cv_gnu_library_2_1=no)
2604 GLIBC21="$ac_cv_gnu_library_2_1"
2608 # intdiv0.m4 serial 1 (gettext-0.11.3)
2609 dnl Copyright (C) 2002 Free Software Foundation, Inc.
2610 dnl This file is free software, distributed under the terms of the GNU
2611 dnl General Public License. As a special exception to the GNU General
2612 dnl Public License, this file may be distributed as part of a program
2613 dnl that contains a configuration script generated by Autoconf, under
2614 dnl the same distribution terms as the rest of that program.
2616 dnl From Bruno Haible.
2618 AC_DEFUN([gt_INTDIV0],
2620 AC_REQUIRE([AC_PROG_CC])dnl
2621 AC_REQUIRE([AC_CANONICAL_HOST])dnl
2623 AC_CACHE_CHECK([whether integer division by zero raises SIGFPE],
2624 gt_cv_int_divbyzero_sigfpe,
2632 sigfpe_handler (int sig)
2634 sigfpe_handler (sig) int sig;
2637 /* Exit with code 0 if SIGFPE, with code 1 if any other signal. */
2638 exit (sig != SIGFPE);
2648 signal (SIGFPE, sigfpe_handler);
2649 /* IRIX and AIX (when "xlc -qcheck" is used) yield signal SIGTRAP. */
2650 #if (defined (__sgi) || defined (_AIX)) && defined (SIGTRAP)
2651 signal (SIGTRAP, sigfpe_handler);
2653 /* Linux/SPARC yields signal SIGILL. */
2654 #if defined (__sparc__) && defined (__linux__)
2655 signal (SIGILL, sigfpe_handler);
2662 ], gt_cv_int_divbyzero_sigfpe=yes, gt_cv_int_divbyzero_sigfpe=no,
2664 # Guess based on the CPU.
2666 alpha* | i[34567]86 | m68k | s390*)
2667 gt_cv_int_divbyzero_sigfpe="guessing yes";;
2669 gt_cv_int_divbyzero_sigfpe="guessing no";;
2673 case "$gt_cv_int_divbyzero_sigfpe" in
2677 AC_DEFINE_UNQUOTED(INTDIV0_RAISES_SIGFPE, $value,
2678 [Define if integer division by zero raises signal SIGFPE.])
2681 # uintmax_t.m4 serial 6 (gettext-0.11)
2682 dnl Copyright (C) 1997-2002 Free Software Foundation, Inc.
2683 dnl This file is free software, distributed under the terms of the GNU
2684 dnl General Public License. As a special exception to the GNU General
2685 dnl Public License, this file may be distributed as part of a program
2686 dnl that contains a configuration script generated by Autoconf, under
2687 dnl the same distribution terms as the rest of that program.
2689 dnl From Paul Eggert.
2693 # Define uintmax_t to `unsigned long' or `unsigned long long'
2694 # if <inttypes.h> does not exist.
2696 AC_DEFUN([jm_AC_TYPE_UINTMAX_T],
2698 AC_REQUIRE([jm_AC_HEADER_INTTYPES_H])
2699 AC_REQUIRE([jm_AC_HEADER_STDINT_H])
2700 if test $jm_ac_cv_header_inttypes_h = no && test $jm_ac_cv_header_stdint_h = no; then
2701 AC_REQUIRE([jm_AC_TYPE_UNSIGNED_LONG_LONG])
2702 test $ac_cv_type_unsigned_long_long = yes \
2703 && ac_type='unsigned long long' \
2704 || ac_type='unsigned long'
2705 AC_DEFINE_UNQUOTED(uintmax_t, $ac_type,
2706 [Define to unsigned long or unsigned long long
2707 if <inttypes.h> and <stdint.h> don't define.])
2711 # inttypes_h.m4 serial 4 (gettext-0.11.4)
2712 dnl Copyright (C) 1997-2002 Free Software Foundation, Inc.
2713 dnl This file is free software, distributed under the terms of the GNU
2714 dnl General Public License. As a special exception to the GNU General
2715 dnl Public License, this file may be distributed as part of a program
2716 dnl that contains a configuration script generated by Autoconf, under
2717 dnl the same distribution terms as the rest of that program.
2719 dnl From Paul Eggert.
2721 # Define HAVE_INTTYPES_H_WITH_UINTMAX if <inttypes.h> exists,
2722 # doesn't clash with <sys/types.h>, and declares uintmax_t.
2724 AC_DEFUN([jm_AC_HEADER_INTTYPES_H],
2726 AC_CACHE_CHECK([for inttypes.h], jm_ac_cv_header_inttypes_h,
2728 [#include <sys/types.h>
2729 #include <inttypes.h>],
2730 [uintmax_t i = (uintmax_t) -1;],
2731 jm_ac_cv_header_inttypes_h=yes,
2732 jm_ac_cv_header_inttypes_h=no)])
2733 if test $jm_ac_cv_header_inttypes_h = yes; then
2734 AC_DEFINE_UNQUOTED(HAVE_INTTYPES_H_WITH_UINTMAX, 1,
2735 [Define if <inttypes.h> exists, doesn't clash with <sys/types.h>,
2736 and declares uintmax_t. ])
2740 # stdint_h.m4 serial 2 (gettext-0.11.4)
2741 dnl Copyright (C) 1997-2002 Free Software Foundation, Inc.
2742 dnl This file is free software, distributed under the terms of the GNU
2743 dnl General Public License. As a special exception to the GNU General
2744 dnl Public License, this file may be distributed as part of a program
2745 dnl that contains a configuration script generated by Autoconf, under
2746 dnl the same distribution terms as the rest of that program.
2748 dnl From Paul Eggert.
2750 # Define HAVE_STDINT_H_WITH_UINTMAX if <stdint.h> exists,
2751 # doesn't clash with <sys/types.h>, and declares uintmax_t.
2753 AC_DEFUN([jm_AC_HEADER_STDINT_H],
2755 AC_CACHE_CHECK([for stdint.h], jm_ac_cv_header_stdint_h,
2757 [#include <sys/types.h>
2758 #include <stdint.h>],
2759 [uintmax_t i = (uintmax_t) -1;],
2760 jm_ac_cv_header_stdint_h=yes,
2761 jm_ac_cv_header_stdint_h=no)])
2762 if test $jm_ac_cv_header_stdint_h = yes; then
2763 AC_DEFINE_UNQUOTED(HAVE_STDINT_H_WITH_UINTMAX, 1,
2764 [Define if <stdint.h> exists, doesn't clash with <sys/types.h>,
2765 and declares uintmax_t. ])
2769 # ulonglong.m4 serial 2 (fileutils-4.0.32, gettext-0.10.40)
2770 dnl Copyright (C) 1999-2002 Free Software Foundation, Inc.
2771 dnl This file is free software, distributed under the terms of the GNU
2772 dnl General Public License. As a special exception to the GNU General
2773 dnl Public License, this file may be distributed as part of a program
2774 dnl that contains a configuration script generated by Autoconf, under
2775 dnl the same distribution terms as the rest of that program.
2777 dnl From Paul Eggert.
2779 AC_DEFUN([jm_AC_TYPE_UNSIGNED_LONG_LONG],
2781 AC_CACHE_CHECK([for unsigned long long], ac_cv_type_unsigned_long_long,
2782 [AC_TRY_LINK([unsigned long long ull = 1; int i = 63;],
2783 [unsigned long long ullmax = (unsigned long long) -1;
2784 return ull << i | ull >> i | ullmax / ull | ullmax % ull;],
2785 ac_cv_type_unsigned_long_long=yes,
2786 ac_cv_type_unsigned_long_long=no)])
2787 if test $ac_cv_type_unsigned_long_long = yes; then
2788 AC_DEFINE(HAVE_UNSIGNED_LONG_LONG, 1,
2789 [Define if you have the unsigned long long type.])
2793 # inttypes.m4 serial 1 (gettext-0.11.4)
2794 dnl Copyright (C) 1997-2002 Free Software Foundation, Inc.
2795 dnl This file is free software, distributed under the terms of the GNU
2796 dnl General Public License. As a special exception to the GNU General
2797 dnl Public License, this file may be distributed as part of a program
2798 dnl that contains a configuration script generated by Autoconf, under
2799 dnl the same distribution terms as the rest of that program.
2801 dnl From Paul Eggert.
2803 # Define HAVE_INTTYPES_H if <inttypes.h> exists and doesn't clash with
2806 AC_DEFUN([gt_HEADER_INTTYPES_H],
2808 AC_CACHE_CHECK([for inttypes.h], gt_cv_header_inttypes_h,
2811 [#include <sys/types.h>
2812 #include <inttypes.h>],
2813 [], gt_cv_header_inttypes_h=yes, gt_cv_header_inttypes_h=no)
2815 if test $gt_cv_header_inttypes_h = yes; then
2816 AC_DEFINE_UNQUOTED(HAVE_INTTYPES_H, 1,
2817 [Define if <inttypes.h> exists and doesn't clash with <sys/types.h>.])
2821 # inttypes-pri.m4 serial 1 (gettext-0.11.4)
2822 dnl Copyright (C) 1997-2002 Free Software Foundation, Inc.
2823 dnl This file is free software, distributed under the terms of the GNU
2824 dnl General Public License. As a special exception to the GNU General
2825 dnl Public License, this file may be distributed as part of a program
2826 dnl that contains a configuration script generated by Autoconf, under
2827 dnl the same distribution terms as the rest of that program.
2829 dnl From Bruno Haible.
2831 # Define PRI_MACROS_BROKEN if <inttypes.h> exists and defines the PRI*
2832 # macros to non-string values. This is the case on AIX 4.3.3.
2834 AC_DEFUN([gt_INTTYPES_PRI],
2836 AC_REQUIRE([gt_HEADER_INTTYPES_H])
2837 if test $gt_cv_header_inttypes_h = yes; then
2838 AC_CACHE_CHECK([whether the inttypes.h PRIxNN macros are broken],
2839 gt_cv_inttypes_pri_broken,
2841 AC_TRY_COMPILE([#include <inttypes.h>
2845 ], [], gt_cv_inttypes_pri_broken=no, gt_cv_inttypes_pri_broken=yes)
2848 if test "$gt_cv_inttypes_pri_broken" = yes; then
2849 AC_DEFINE_UNQUOTED(PRI_MACROS_BROKEN, 1,
2850 [Define if <inttypes.h> exists and defines unusable PRI* macros.])
2854 # codeset.m4 serial AM1 (gettext-0.10.40)
2855 dnl Copyright (C) 2000-2002 Free Software Foundation, Inc.
2856 dnl This file is free software, distributed under the terms of the GNU
2857 dnl General Public License. As a special exception to the GNU General
2858 dnl Public License, this file may be distributed as part of a program
2859 dnl that contains a configuration script generated by Autoconf, under
2860 dnl the same distribution terms as the rest of that program.
2862 dnl From Bruno Haible.
2864 AC_DEFUN([AM_LANGINFO_CODESET],
2866 AC_CACHE_CHECK([for nl_langinfo and CODESET], am_cv_langinfo_codeset,
2867 [AC_TRY_LINK([#include <langinfo.h>],
2868 [char* cs = nl_langinfo(CODESET);],
2869 am_cv_langinfo_codeset=yes,
2870 am_cv_langinfo_codeset=no)
2872 if test $am_cv_langinfo_codeset = yes; then
2873 AC_DEFINE(HAVE_LANGINFO_CODESET, 1,
2874 [Define if you have <langinfo.h> and nl_langinfo(CODESET).])
2878 # lcmessage.m4 serial 3 (gettext-0.11.3)
2879 dnl Copyright (C) 1995-2002 Free Software Foundation, Inc.
2880 dnl This file is free software, distributed under the terms of the GNU
2881 dnl General Public License. As a special exception to the GNU General
2882 dnl Public License, this file may be distributed as part of a program
2883 dnl that contains a configuration script generated by Autoconf, under
2884 dnl the same distribution terms as the rest of that program.
2886 dnl This file can can be used in projects which are not available under
2887 dnl the GNU General Public License or the GNU Library General Public
2888 dnl License but which still want to provide support for the GNU gettext
2890 dnl Please note that the actual code of the GNU gettext library is covered
2891 dnl by the GNU Library General Public License, and the rest of the GNU
2892 dnl gettext package package is covered by the GNU General Public License.
2893 dnl They are *not* in the public domain.
2896 dnl Ulrich Drepper <drepper@cygnus.com>, 1995.
2898 # Check whether LC_MESSAGES is available in <locale.h>.
2900 AC_DEFUN([AM_LC_MESSAGES],
2902 AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES,
2903 [AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
2904 am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)])
2905 if test $am_cv_val_LC_MESSAGES = yes; then
2906 AC_DEFINE(HAVE_LC_MESSAGES, 1,
2907 [Define if your <locale.h> file defines LC_MESSAGES.])