1 # aclocal.m4 generated automatically by aclocal 1.5c -*- Autoconf -*-
3 # Copyright 1996, 1997, 1998, 1999, 2000, 2001
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 Free Software Foundation, Inc.
21 # This program is free software; you can redistribute it and/or modify
22 # it under the terms of the GNU General Public License as published by
23 # the Free Software Foundation; either version 2, or (at your option)
26 # This program is distributed in the hope that it will be useful,
27 # but WITHOUT ANY WARRANTY; without even the implied warranty of
28 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
29 # GNU General Public License for more details.
31 # You should have received a copy of the GNU General Public License
32 # along with this program; if not, write to the Free Software
33 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
38 # There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
39 # written in clear, in which case automake, when reading aclocal.m4,
40 # will think it sees a *use*, and therefore will trigger all it's
41 # C support machinery. Also note that it means that autoscan, seeing
42 # CC etc. in the Makefile, will ask for an AC_PROG_CC use...
47 # Autoconf 2.50 wants to disallow AM_ names. We explicitly allow
48 # the ones we care about.
49 m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
51 # AM_INIT_AUTOMAKE(PACKAGE,VERSION, [NO-DEFINE])
52 # ----------------------------------------------
53 AC_DEFUN([AM_INIT_AUTOMAKE],
54 [AC_REQUIRE([AC_PROG_INSTALL])dnl
55 # test to see if srcdir already configured
56 if test "`cd $srcdir && pwd`" != "`pwd`" &&
57 test -f $srcdir/config.status; then
58 AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
61 # Define the identity of the package.
62 AC_SUBST([PACKAGE], [$1])dnl
63 AC_SUBST([VERSION], [$2])dnl
65 [AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
66 AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])
69 # Some tools Automake needs.
70 AC_REQUIRE([AM_SANITY_CHECK])dnl
71 AC_REQUIRE([AC_ARG_PROGRAM])dnl
72 AM_MISSING_PROG(ACLOCAL, aclocal)
73 AM_MISSING_PROG(AUTOCONF, autoconf)
74 AM_MISSING_PROG(AUTOMAKE, automake)
75 AM_MISSING_PROG(AUTOHEADER, autoheader)
76 AM_MISSING_PROG(MAKEINFO, makeinfo)
77 AM_MISSING_PROG(AMTAR, tar)
80 # We need awk for the "check" target. The system "awk" is bad on
82 AC_REQUIRE([AC_PROG_AWK])dnl
83 AC_REQUIRE([AC_PROG_MAKE_SET])dnl
84 AC_REQUIRE([AM_DEP_TRACK])dnl
85 AC_REQUIRE([AM_SET_DEPDIR])dnl
86 AC_PROVIDE_IFELSE([AC_PROG_][CC],
87 [_AM_DEPENDENCIES(CC)],
88 [define([AC_PROG_][CC],
89 defn([AC_PROG_][CC])[_AM_DEPENDENCIES(CC)])])dnl
90 AC_PROVIDE_IFELSE([AC_PROG_][CXX],
91 [_AM_DEPENDENCIES(CXX)],
92 [define([AC_PROG_][CXX],
93 defn([AC_PROG_][CXX])[_AM_DEPENDENCIES(CXX)])])dnl
97 # Check to make sure that the build environment is sane.
100 # Copyright 1996, 1997, 2000, 2001 Free Software Foundation, Inc.
102 # This program is free software; you can redistribute it and/or modify
103 # it under the terms of the GNU General Public License as published by
104 # the Free Software Foundation; either version 2, or (at your option)
107 # This program is distributed in the hope that it will be useful,
108 # but WITHOUT ANY WARRANTY; without even the implied warranty of
109 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
110 # GNU General Public License for more details.
112 # You should have received a copy of the GNU General Public License
113 # along with this program; if not, write to the Free Software
114 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
121 AC_DEFUN([AM_SANITY_CHECK],
122 [AC_MSG_CHECKING([whether build environment is sane])
125 echo timestamp > conftest.file
126 # Do `set' in a subshell so we don't clobber the current shell's
127 # arguments. Must try -L first in case configure is actually a
128 # symlink; some systems play weird games with the mod time of symlinks
129 # (eg FreeBSD returns the mod time of the symlink's containing
132 set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
133 if test "$[*]" = "X"; then
135 set X `ls -t $srcdir/configure conftest.file`
138 if test "$[*]" != "X $srcdir/configure conftest.file" \
139 && test "$[*]" != "X conftest.file $srcdir/configure"; then
141 # If neither matched, then we have a broken ls. This can happen
142 # if, for instance, CONFIG_SHELL is bash and it inherits a
143 # broken ls alias from the environment. This has actually
144 # happened. Such a system could not be considered "sane".
145 AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
146 alias in your environment])
149 test "$[2]" = conftest.file
155 AC_MSG_ERROR([newly created file is older than distributed files!
156 Check your system clock])
163 # Copyright 1997, 1999, 2000, 2001 Free Software Foundation, Inc.
165 # This program is free software; you can redistribute it and/or modify
166 # it under the terms of the GNU General Public License as published by
167 # the Free Software Foundation; either version 2, or (at your option)
170 # This program is distributed in the hope that it will be useful,
171 # but WITHOUT ANY WARRANTY; without even the implied warranty of
172 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
173 # GNU General Public License for more details.
175 # You should have received a copy of the GNU General Public License
176 # along with this program; if not, write to the Free Software
177 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
182 # AM_MISSING_PROG(NAME, PROGRAM)
183 # ------------------------------
184 AC_DEFUN([AM_MISSING_PROG],
185 [AC_REQUIRE([AM_MISSING_HAS_RUN])
186 $1=${$1-"${am_missing_run}$2"}
192 # Define MISSING if not defined so far and test if it supports --run.
193 # If it does, set am_missing_run to use it, otherwise, to nothing.
194 AC_DEFUN([AM_MISSING_HAS_RUN],
195 [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
196 test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
197 # Use eval to expand $SHELL
198 if eval "$MISSING --run true"; then
199 am_missing_run="$MISSING --run "
202 AC_MSG_WARN([`missing' script is too old or missing])
208 # Copyright 2001 Free Software Foundation, Inc.
210 # This program is free software; you can redistribute it and/or modify
211 # it under the terms of the GNU General Public License as published by
212 # the Free Software Foundation; either version 2, or (at your option)
215 # This program is distributed in the hope that it will be useful,
216 # but WITHOUT ANY WARRANTY; without even the implied warranty of
217 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
218 # GNU General Public License for more details.
220 # You should have received a copy of the GNU General Public License
221 # along with this program; if not, write to the Free Software
222 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
225 # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
226 # $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to
227 # `$srcdir', `$srcdir/..', or `$srcdir/../..'.
229 # Of course, Automake must honor this variable whenever it calls a
230 # tool from the auxiliary directory. The problem is that $srcdir (and
231 # therefore $ac_aux_dir as well) can be either absolute or relative,
232 # depending on how configure is run. This is pretty annoying, since
233 # it makes $ac_aux_dir quite unusable in subdirectories: in the top
234 # source directory, any form will work fine, but in subdirectories a
235 # relative path needs to be adjusted first.
237 # $ac_aux_dir/missing
238 # fails when called from a subdirectory if $ac_aux_dir is relative
239 # $top_srcdir/$ac_aux_dir/missing
240 # fails if $ac_aux_dir is absolute,
241 # fails when called from a subdirectory in a VPATH build with
242 # a relative $ac_aux_dir
244 # The reason of the latter failure is that $top_srcdir and $ac_aux_dir
245 # are both prefixed by $srcdir. In an in-source build this is usually
246 # harmless because $srcdir is `.', but things will broke when you
247 # start a VPATH build or use an absolute $srcdir.
249 # So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
250 # iff we strip the leading $srcdir from $ac_aux_dir. That would be:
251 # am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
252 # and then we would define $MISSING as
253 # MISSING="\${SHELL} $am_aux_dir/missing"
254 # This will work as long as MISSING is not called from configure, because
255 # unfortunately $(top_srcdir) has no meaning in configure.
256 # However there are other variables, like CC, which are often used in
257 # configure, and could therefore not use this "fixed" $ac_aux_dir.
259 # Another solution, used here, is to always expand $ac_aux_dir to an
260 # absolute PATH. The drawback is that using absolute paths prevent a
261 # configured tree to be moved without reconfiguration.
263 # Rely on autoconf to set up CDPATH properly.
266 AC_DEFUN([AM_AUX_DIR_EXPAND], [
267 # expand $ac_aux_dir to an absolute path
268 am_aux_dir=`cd $ac_aux_dir && pwd`
273 # Define $install_sh.
275 # Copyright 2001 Free Software Foundation, Inc.
277 # This program is free software; you can redistribute it and/or modify
278 # it under the terms of the GNU General Public License as published by
279 # the Free Software Foundation; either version 2, or (at your option)
282 # This program is distributed in the hope that it will be useful,
283 # but WITHOUT ANY WARRANTY; without even the implied warranty of
284 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
285 # GNU General Public License for more details.
287 # You should have received a copy of the GNU General Public License
288 # along with this program; if not, write to the Free Software
289 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
292 AC_DEFUN([AM_PROG_INSTALL_SH],
293 [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
294 install_sh=${install_sh-"$am_aux_dir/install-sh"}
295 AC_SUBST(install_sh)])
297 # AM_PROG_INSTALL_STRIP
299 # Copyright 2001 Free Software Foundation, Inc.
301 # This program is free software; you can redistribute it and/or modify
302 # it under the terms of the GNU General Public License as published by
303 # the Free Software Foundation; either version 2, or (at your option)
306 # This program is distributed in the hope that it will be useful,
307 # but WITHOUT ANY WARRANTY; without even the implied warranty of
308 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
309 # GNU General Public License for more details.
311 # You should have received a copy of the GNU General Public License
312 # along with this program; if not, write to the Free Software
313 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
316 # One issue with vendor `install' (even GNU) is that you can't
317 # specify the program used to strip binaries. This is especially
318 # annoying in cross-compiling environments, where the build's strip
319 # is unlikely to handle the host's binaries.
320 # Fortunately install-sh will honor a STRIPPROG variable, so we
321 # always use install-sh in `make install-strip', and initialize
322 # STRIPPROG with the value of the STRIP variable (set by the user).
323 AC_DEFUN([AM_PROG_INSTALL_STRIP],
324 [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
325 INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s"
326 AC_SUBST([INSTALL_STRIP_PROGRAM])])
328 # serial 4 -*- Autoconf -*-
330 # Copyright 1999, 2000, 2001 Free Software Foundation, Inc.
332 # This program is free software; you can redistribute it and/or modify
333 # it under the terms of the GNU General Public License as published by
334 # the Free Software Foundation; either version 2, or (at your option)
337 # This program is distributed in the hope that it will be useful,
338 # but WITHOUT ANY WARRANTY; without even the implied warranty of
339 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
340 # GNU General Public License for more details.
342 # You should have received a copy of the GNU General Public License
343 # along with this program; if not, write to the Free Software
344 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
348 # There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
349 # written in clear, in which case automake, when reading aclocal.m4,
350 # will think it sees a *use*, and therefore will trigger all it's
351 # C support machinery. Also note that it means that autoscan, seeing
352 # CC etc. in the Makefile, will ask for an AC_PROG_CC use...
356 # _AM_DEPENDENCIES(NAME)
357 # ----------------------
358 # See how the compiler implements dependency checking.
359 # NAME is "CC", "CXX" or "OBJC".
360 # We try a few techniques and use that to set a single cache variable.
362 # We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
363 # modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
364 # dependency, and given that the user is not expected to run this macro,
365 # just rely on AC_PROG_CC.
366 AC_DEFUN([_AM_DEPENDENCIES],
367 [AC_REQUIRE([AM_SET_DEPDIR])dnl
368 AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
369 AC_REQUIRE([AM_MAKE_INCLUDE])dnl
370 AC_REQUIRE([AM_DEP_TRACK])dnl
372 ifelse([$1], CC, [depcc="$CC" am_compiler_list=],
373 [$1], CXX, [depcc="$CXX" am_compiler_list=],
374 [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc']
375 [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'],
376 [depcc="$$1" am_compiler_list=])
378 AC_CACHE_CHECK([dependency style of $depcc],
379 [am_cv_$1_dependencies_compiler_type],
380 [if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
381 # We make a subdir and do the tests there. Otherwise we can end up
382 # making bogus files that we don't know about and never remove. For
383 # instance it was reported that on HP-UX the gcc test will end up
384 # making a dummy file named `D' -- because `-MD' means `put the output
387 # Copy depcomp to subdir because otherwise we won't find it if we're
388 # using a relative directory.
389 cp "$am_depcomp" conftest.dir
392 am_cv_$1_dependencies_compiler_type=none
393 if test "$am_compiler_list" = ""; then
394 am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
396 for depmode in $am_compiler_list; do
397 # We need to recreate these files for each test, as the compiler may
398 # overwrite some of them when testing with obscure command lines.
399 # This happens at least with the AIX C compiler.
400 echo '#include "conftest.h"' > conftest.c
401 echo 'int i;' > conftest.h
402 echo "${am__include} ${am__quote}conftest.Po${am__quote}" > confmf
406 # after this tag, mechanisms are not by side-effect, so they'll
407 # only be used when explicitly requested
408 if test "x$enable_dependency_tracking" = xyes; then
416 # We check with `-c' and `-o' for the sake of the "dashmstdout"
417 # mode. It turns out that the SunPro C++ compiler does not properly
418 # handle `-M -o', and we need to detect this.
419 if depmode=$depmode \
420 source=conftest.c object=conftest.o \
421 depfile=conftest.Po tmpdepfile=conftest.TPo \
422 $SHELL ./depcomp $depcc -c conftest.c -o conftest.o >/dev/null 2>&1 &&
423 grep conftest.h conftest.Po > /dev/null 2>&1 &&
424 ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
425 am_cv_$1_dependencies_compiler_type=$depmode
433 am_cv_$1_dependencies_compiler_type=none
436 AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
442 # Choose a directory name for dependency files.
443 # This macro is AC_REQUIREd in _AM_DEPENDENCIES
444 AC_DEFUN([AM_SET_DEPDIR],
445 [rm -f .deps 2>/dev/null
446 mkdir .deps 2>/dev/null
447 if test -d .deps; then
450 # MS-DOS does not allow filenames that begin with a dot.
453 rmdir .deps 2>/dev/null
460 AC_DEFUN([AM_DEP_TRACK],
461 [AC_ARG_ENABLE(dependency-tracking,
462 [ --disable-dependency-tracking Speeds up one-time builds
463 --enable-dependency-tracking Do not reject slow dependency extractors])
464 if test "x$enable_dependency_tracking" != xno; then
465 am_depcomp="$ac_aux_dir/depcomp"
468 AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
469 AC_SUBST([AMDEPBACKSLASH])
472 # Generate code to set up dependency tracking. -*- Autoconf -*-
474 # Copyright 1999, 2000, 2001 Free Software Foundation, Inc.
476 # This program is free software; you can redistribute it and/or modify
477 # it under the terms of the GNU General Public License as published by
478 # the Free Software Foundation; either version 2, or (at your option)
481 # This program is distributed in the hope that it will be useful,
482 # but WITHOUT ANY WARRANTY; without even the implied warranty of
483 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
484 # GNU General Public License for more details.
486 # You should have received a copy of the GNU General Public License
487 # along with this program; if not, write to the Free Software
488 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
493 # _AM_OUTPUT_DEPENDENCY_COMMANDS
494 # ------------------------------
495 AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
496 [for mf in $CONFIG_FILES; do
497 # Strip MF so we end up with the name of the file.
498 mf=`echo "$mf" | sed -e 's/:.*$//'`
499 if (head -1 $mf | fgrep 'generated by automake') > /dev/null 2>&1; then
500 dirpart=`AS_DIRNAME("$mf")`
504 grep '^DEP_FILES *= *[[^ @%:@]]' < "$mf" > /dev/null || continue
505 # Extract the definition of DEP_FILES from the Makefile without
507 DEPDIR=`sed -n -e '/^DEPDIR = / s///p' < "$mf"`
508 test -z "$DEPDIR" && continue
509 # When using ansi2knr, U may be empty or an underscore; expand it
510 U=`sed -n -e '/^U = / s///p' < "$mf"`
511 test -d "$dirpart/$DEPDIR" || mkdir "$dirpart/$DEPDIR"
512 # We invoke sed twice because it is the simplest approach to
513 # changing $(DEPDIR) to its actual value in the expansion.
514 for file in `sed -n -e '
515 /^DEP_FILES = .*\\\\$/ {
524 /^DEP_FILES = / s/^DEP_FILES = //p' < "$mf" | \
525 sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
526 # Make sure the directory exists.
527 test -f "$dirpart/$file" && continue
528 fdir=`AS_DIRNAME(["$file"])`
529 AS_MKDIR_P([$dirpart/$fdir])
530 # echo "creating $dirpart/$file"
531 echo '# dummy' > "$dirpart/$file"
534 ])# _AM_OUTPUT_DEPENDENCY_COMMANDS
537 # AM_OUTPUT_DEPENDENCY_COMMANDS
538 # -----------------------------
539 # This macro should only be invoked once -- use via AC_REQUIRE.
541 # This code is only required when automatic dependency tracking
542 # is enabled. FIXME. This creates each `.P' file that we will
543 # need in order to bootstrap the dependency handling code.
544 AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
545 [AC_CONFIG_COMMANDS([depfiles],
546 [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
547 [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
550 # Copyright 2001 Free Software Foundation, Inc. -*- Autoconf -*-
552 # This program is free software; you can redistribute it and/or modify
553 # it under the terms of the GNU General Public License as published by
554 # the Free Software Foundation; either version 2, or (at your option)
557 # This program is distributed in the hope that it will be useful,
558 # but WITHOUT ANY WARRANTY; without even the implied warranty of
559 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
560 # GNU General Public License for more details.
562 # You should have received a copy of the GNU General Public License
563 # along with this program; if not, write to the Free Software
564 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
571 # Check to see how make treats includes.
572 AC_DEFUN([AM_MAKE_INCLUDE],
573 [am_make=${MAKE-make}
574 cat > confinc << 'END'
578 # If we don't find an include directive, just comment out the code.
579 AC_MSG_CHECKING([for style of include used by $am_make])
583 # First try GNU make style include.
584 echo "include confinc" > confmf
585 # We grep out `Entering directory' and `Leaving directory'
586 # messages which can occur if `w' ends up in MAKEFLAGS.
587 # In particular we don't look at `^make:' because GNU make might
588 # be invoked under some other name (usually "gmake"), in which
589 # case it prints its new name instead of `make'.
590 if test "`$am_make -s -f confmf 2> /dev/null | fgrep -v 'ing directory'`" = "done"; then
595 # Now try BSD make style include.
596 if test "$am__include" = "#"; then
597 echo '.include "confinc"' > confmf
598 if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
604 AC_SUBST(am__include)
606 AC_MSG_RESULT($_am_result)
610 # AM_CONDITIONAL -*- Autoconf -*-
612 # Copyright 1997, 2000, 2001 Free Software Foundation, Inc.
614 # This program is free software; you can redistribute it and/or modify
615 # it under the terms of the GNU General Public License as published by
616 # the Free Software Foundation; either version 2, or (at your option)
619 # This program is distributed in the hope that it will be useful,
620 # but WITHOUT ANY WARRANTY; without even the implied warranty of
621 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
622 # GNU General Public License for more details.
624 # You should have received a copy of the GNU General Public License
625 # along with this program; if not, write to the Free Software
626 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
633 # AM_CONDITIONAL(NAME, SHELL-CONDITION)
634 # -------------------------------------
635 # Define a conditional.
636 AC_DEFUN([AM_CONDITIONAL],
637 [ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])],
638 [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
648 AC_CONFIG_COMMANDS_PRE(
649 [if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
650 AC_MSG_ERROR([conditional \"$1\" was never defined.
651 Usually this means the macro was only invoked conditionally.])
654 # Like AC_CONFIG_HEADER, but automatically create stamp file. -*- Autoconf -*-
656 # Copyright 1996, 1997, 2000, 2001 Free Software Foundation, Inc.
658 # This program is free software; you can redistribute it and/or modify
659 # it under the terms of the GNU General Public License as published by
660 # the Free Software Foundation; either version 2, or (at your option)
663 # This program is distributed in the hope that it will be useful,
664 # but WITHOUT ANY WARRANTY; without even the implied warranty of
665 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
666 # GNU General Public License for more details.
668 # You should have received a copy of the GNU General Public License
669 # along with this program; if not, write to the Free Software
670 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
677 # When config.status generates a header, we must update the stamp-h file.
678 # This file resides in the same directory as the config header
679 # that is generated. We must strip everything past the first ":",
680 # and everything past the last "/".
684 # Like AS_DIRNAME, only do it during macro expansion
685 AC_DEFUN([_AM_DIRNAME],
686 [m4_if(regexp([$1], [^.*[^/]//*[^/][^/]*/*$]), -1,
687 m4_if(regexp([$1], [^//\([^/]\|$\)]), -1,
688 m4_if(regexp([$1], [^/.*]), -1,
690 patsubst([$1], [^\(/\).*], [\1])),
691 patsubst([$1], [^\(//\)\([^/].*\|$\)], [\1])),
692 patsubst([$1], [^\(.*[^/]\)//*[^/][^/]*/*$], [\1]))[]dnl
696 # The stamp files are numbered to have different names.
697 # We could number them on a directory basis, but that's additional
698 # complications, let's have a unique counter.
699 m4_define([_AM_STAMP_Count], [0])
704 # The name of the stamp file for HEADER.
705 AC_DEFUN([_AM_STAMP],
706 [m4_define([_AM_STAMP_Count], m4_incr(_AM_STAMP_Count))dnl
707 AS_ESCAPE(_AM_DIRNAME(patsubst([$1],
708 [:.*])))/stamp-h[]_AM_STAMP_Count])
711 # _AM_CONFIG_HEADER(HEADER[:SOURCES], COMMANDS, INIT-COMMANDS)
712 # ------------------------------------------------------------
713 # We used to try to get a real timestamp in stamp-h. But the fear is that
714 # that will cause unnecessary cvs conflicts.
715 AC_DEFUN([_AM_CONFIG_HEADER],
716 [# Add the stamp file to the list of files AC keeps track of,
717 # along with our hook.
718 AC_CONFIG_HEADERS([$1],
719 [# update the timestamp
720 echo 'timestamp for $1' >"_AM_STAMP([$1])"
723 ])# _AM_CONFIG_HEADER
726 # AM_CONFIG_HEADER(HEADER[:SOURCES]..., COMMANDS, INIT-COMMANDS)
727 # --------------------------------------------------------------
728 AC_DEFUN([AM_CONFIG_HEADER],
729 [AC_FOREACH([_AM_File], [$1], [_AM_CONFIG_HEADER(_AM_File, [$2], [$3])])
733 # This test replaces the one in autoconf.
734 # Currently this macro should have the same name as the autoconf macro
735 # because gettext's gettext.m4 (distributed in the automake package)
736 # still uses it. Otherwise, the use in gettext.m4 makes autoheader
737 # give these diagnostics:
738 # configure.in:556: AC_TRY_COMPILE was called before AC_ISC_POSIX
739 # configure.in:556: AC_TRY_RUN was called before AC_ISC_POSIX
741 undefine([AC_ISC_POSIX])
743 AC_DEFUN([AC_ISC_POSIX],
745 dnl This test replaces the obsolescent AC_ISC_POSIX kludge.
746 AC_CHECK_LIB(cposix, strerror, [LIBS="$LIBS -lcposix"])
751 # Copyright 1996, 1997, 1999, 2000, 2001 Free Software Foundation, Inc.
753 # This program is free software; you can redistribute it and/or modify
754 # it under the terms of the GNU General Public License as published by
755 # the Free Software Foundation; either version 2, or (at your option)
758 # This program is distributed in the hope that it will be useful,
759 # but WITHOUT ANY WARRANTY; without even the implied warranty of
760 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
761 # GNU General Public License for more details.
763 # You should have received a copy of the GNU General Public License
764 # along with this program; if not, write to the Free Software
765 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
770 # @defmac AC_PROG_CC_STDC
771 # @maindex PROG_CC_STDC
773 # If the C compiler in not in ANSI C mode by default, try to add an option
774 # to output variable @code{CC} to make it so. This macro tries various
775 # options that select ANSI C on some system or another. It considers the
776 # compiler to be in ANSI C mode if it handles function prototypes correctly.
778 # If you use this macro, you should check after calling it whether the C
779 # compiler has been set to accept ANSI C; if not, the shell variable
780 # @code{am_cv_prog_cc_stdc} is set to @samp{no}. If you wrote your source
781 # code in ANSI C, you can make an un-ANSIfied copy of it by using the
782 # program @code{ansi2knr}, which comes with Ghostscript.
785 AC_DEFUN([AM_PROG_CC_STDC],
786 [AC_REQUIRE([AC_PROG_CC])
787 AC_BEFORE([$0], [AC_C_INLINE])
788 AC_BEFORE([$0], [AC_C_CONST])
789 dnl Force this before AC_PROG_CPP. Some cpp's, eg on HPUX, require
790 dnl a magic option to avoid problems with ANSI preprocessor commands
792 dnl FIXME: can't do this because then AC_AIX won't work due to a
793 dnl circular dependency.
794 dnl AC_BEFORE([$0], [AC_PROG_CPP])
795 AC_MSG_CHECKING([for ${CC-cc} option to accept ANSI C])
796 AC_CACHE_VAL(am_cv_prog_cc_stdc,
797 [am_cv_prog_cc_stdc=no
799 # Don't try gcc -ansi; that turns off useful extensions and
800 # breaks some systems' header files.
802 # Ultrix and OSF/1 -std1
803 # HP-UX 10.20 and later -Ae
804 # HP-UX older versions -Aa -D_HPUX_SOURCE
805 # SVR4 -Xc -D__EXTENSIONS__
806 for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
808 CC="$ac_save_CC $ac_arg"
812 #include <sys/types.h>
813 #include <sys/stat.h>
814 /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */
815 struct buf { int x; };
816 FILE * (*rcsopen) (struct buf *, struct stat *, int);
817 static char *e (p, i)
823 static char *f (char * (*g) (char **, int), char **p, ...)
828 s = g (p, va_arg (v,int));
832 int test (int i, double x);
833 struct s1 {int (*f) (int a);};
834 struct s2 {int (*f) (double a);};
835 int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
839 return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1];
841 [am_cv_prog_cc_stdc="$ac_arg"; break])
845 if test -z "$am_cv_prog_cc_stdc"; then
846 AC_MSG_RESULT([none needed])
848 AC_MSG_RESULT([$am_cv_prog_cc_stdc])
850 case "x$am_cv_prog_cc_stdc" in
852 *) CC="$CC $am_cv_prog_cc_stdc" ;;
856 AC_DEFUN(BISON_WARNING,
857 [AC_MSG_CHECKING(whether compiler accepts $1)
858 AC_SUBST(WARNING_CFLAGS)
859 ac_save_CFLAGS="$CFLAGS"
863 WARNING_CFLAGS="$WARNING_CFLAGS $1"
866 CFLAGS="$ac_save_CFLAGS"])
869 # Copyright 1996, 1997, 1998, 2000, 2001 Free Software Foundation, Inc.
871 # This program is free software; you can redistribute it and/or modify
872 # it under the terms of the GNU General Public License as published by
873 # the Free Software Foundation; either version 2, or (at your option)
876 # This program is distributed in the hope that it will be useful,
877 # but WITHOUT ANY WARRANTY; without even the implied warranty of
878 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
879 # GNU General Public License for more details.
881 # You should have received a copy of the GNU General Public License
882 # along with this program; if not, write to the Free Software
883 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
888 AC_DEFUN([AM_C_PROTOTYPES],
889 [AC_REQUIRE([AM_PROG_CC_STDC])
890 AC_REQUIRE([AC_PROG_CPP])
891 AC_MSG_CHECKING([for function prototypes])
892 if test "$am_cv_prog_cc_stdc" != no; then
894 AC_DEFINE(PROTOTYPES,1,[Define if compiler has function prototypes])
898 U=_ ANSI2KNR=./ansi2knr
900 # Ensure some checks needed by ansi2knr itself.
902 AC_CHECK_HEADERS(string.h)
904 AC_SUBST(ANSI2KNR)dnl
909 dnl From Jim Meyering.
910 dnl Determine whether malloc accepts 0 as its argument.
911 dnl If it doesn't, arrange to use the replacement function.
914 AC_DEFUN([jm_FUNC_MALLOC],
916 dnl xmalloc.c requires that this symbol be defined so it doesn't
917 dnl mistakenly use a broken malloc -- as it might if this test were omitted.
918 AC_DEFINE(HAVE_DONE_WORKING_MALLOC_CHECK, 1,
919 [Define if the malloc check has been performed. ])
921 AC_CACHE_CHECK([for working malloc], jm_cv_func_working_malloc,
927 exit (malloc (0) ? 0 : 1);
930 jm_cv_func_working_malloc=yes,
931 jm_cv_func_working_malloc=no,
932 dnl When crosscompiling, assume malloc is broken.
933 jm_cv_func_working_malloc=no)
935 if test $jm_cv_func_working_malloc = no; then
937 AC_DEFINE(malloc, rpl_malloc,
938 [Define to rpl_malloc if the replacement function should be used.])
944 dnl From Jim Meyering.
945 dnl Determine whether realloc works when both arguments are 0.
946 dnl If it doesn't, arrange to use the replacement function.
949 AC_DEFUN([jm_FUNC_REALLOC],
951 dnl xmalloc.c requires that this symbol be defined so it doesn't
952 dnl mistakenly use a broken realloc -- as it might if this test were omitted.
953 AC_DEFINE(HAVE_DONE_WORKING_REALLOC_CHECK, 1,
954 [Define if the realloc check has been performed. ])
956 AC_CACHE_CHECK([for working realloc], jm_cv_func_working_realloc,
962 exit (realloc (0, 0) ? 0 : 1);
965 jm_cv_func_working_realloc=yes,
966 jm_cv_func_working_realloc=no,
967 dnl When crosscompiling, assume realloc is broken.
968 jm_cv_func_working_realloc=no)
970 if test $jm_cv_func_working_realloc = no; then
972 AC_DEFINE(realloc, rpl_realloc,
973 [Define to rpl_realloc if the replacement function should be used.])
979 dnl These are the prerequisite macros for files in the lib/
980 dnl directories of Bison.
982 AC_DEFUN([jm_PREREQ_QUOTEARG],
984 AC_CHECK_FUNCS(isascii iswprint mbsinit)
986 AC_CHECK_HEADERS(limits.h stddef.h stdlib.h string.h wchar.h wctype.h)
997 AC_DEFUN([jm_FUNC_MBRTOWC],
999 AC_CACHE_CHECK([whether mbrtowc and mbstate_t are properly declared],
1002 [#include <wchar.h>],
1003 [mbstate_t state; return ! (sizeof state && mbrtowc);],
1004 jm_cv_func_mbrtowc=yes,
1005 jm_cv_func_mbrtowc=no)])
1006 if test $jm_cv_func_mbrtowc = yes; then
1007 AC_DEFINE(HAVE_MBRTOWC, 1,
1008 [Define to 1 if mbrtowc and mbstate_t are properly declared.])
1014 dnl From Paul Eggert.
1016 AC_DEFUN([AC_C_BACKSLASH_A],
1018 AC_CACHE_CHECK([whether backslash-a works in strings], ac_cv_c_backslash_a,
1024 char buf['\a' == 'a' ? -1 : 1];
1026 return buf[0] != "\a"[0];
1028 ac_cv_c_backslash_a=yes,
1029 ac_cv_c_backslash_a=no)])
1030 if test $ac_cv_c_backslash_a = yes; then
1031 AC_DEFINE(HAVE_C_BACKSLASH_A, 1,
1032 [Define if backslash-a works in C strings.])
1040 # BeOS 5 has <wchar.h> but does not define mbstate_t,
1041 # so you can't declare an object of that type.
1042 # Check for this incompatibility with Standard C.
1044 # Include stdlib.h first, because otherwise this test would fail on Linux
1045 # (at least glibc-2.1.3) because the "_XOPEN_SOURCE 500" definition elicits
1046 # a syntax error in wchar.h due to the use of undefined __int32_t.
1048 AC_DEFUN([AC_MBSTATE_T],
1050 AC_CHECK_HEADERS(stdlib.h)
1052 AC_CACHE_CHECK([for mbstate_t], ac_cv_type_mbstate_t,
1055 # include <stdlib.h>
1057 #include <wchar.h>],
1058 [mbstate_t x; return sizeof x;],
1059 ac_cv_type_mbstate_t=yes,
1060 ac_cv_type_mbstate_t=no)])
1061 if test $ac_cv_type_mbstate_t = no; then
1062 AC_DEFINE(mbstate_t, int,
1063 [Define to a type if <wchar.h> does not define.])
1068 dnl FIXME: put these prerequisite-only *.m4 files in a separate
1069 dnl directory -- otherwise, they'll conflict with existing files.
1071 dnl These are the prerequisite macros for GNU's error.c file.
1072 AC_DEFUN([jm_PREREQ_ERROR],
1074 AC_CHECK_FUNCS(strerror vprintf doprnt)
1075 AC_CHECK_DECLS([strerror])
1081 # Experimental replacement for the function in the latest CVS autoconf.
1082 # Use with the error.c file in ../lib.
1084 # Copyright 2001 Free Software Foundation, Inc.
1086 # This program is free software; you can redistribute it and/or modify
1087 # it under the terms of the GNU General Public License as published by
1088 # the Free Software Foundation; either version 2, or (at your option)
1089 # any later version.
1091 # This program is distributed in the hope that it will be useful,
1092 # but WITHOUT ANY WARRANTY; without even the implied warranty of
1093 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1094 # GNU General Public License for more details.
1096 # You should have received a copy of the GNU General Public License
1097 # along with this program; if not, write to the Free Software Foundation,
1098 # Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
1100 undefine([AC_FUNC_STRERROR_R])
1102 # AC_FUNC_STRERROR_R
1103 # ------------------
1104 AC_DEFUN([AC_FUNC_STRERROR_R],
1105 [AC_CHECK_DECLS([strerror_r])
1106 AC_CHECK_FUNCS([strerror_r])
1107 AC_CACHE_CHECK([whether strerror_r returns char *],
1108 ac_cv_func_strerror_r_char_p,
1110 ac_cv_func_strerror_r_char_p=no
1111 if test $ac_cv_have_decl_strerror_r = yes; then
1112 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([AC_INCLUDES_DEFAULT],
1115 char x = *strerror_r (0, buf, sizeof buf);
1116 char *p = strerror_r (0, buf, sizeof buf);
1118 ac_cv_func_strerror_r_char_p=yes)
1120 # strerror_r is not declared. Choose between
1121 # systems that have relatively inaccessible declarations for the
1122 # function. BeOS and DEC UNIX 4.0 fall in this category, but the
1123 # former has a strerror_r that returns char*, while the latter
1124 # has a strerror_r that returns `int'.
1125 # This test should segfault on the DEC system.
1126 AC_RUN_IFELSE([AC_LANG_PROGRAM([AC_INCLUDES_DEFAULT
1127 extern char *strerror_r ();],
1129 char x = *strerror_r (0, buf, sizeof buf);
1130 exit (!isalpha (x));]])],
1131 ac_cv_func_strerror_r_char_p=yes, , :)
1134 if test $ac_cv_func_strerror_r_char_p = yes; then
1135 AC_DEFINE([STRERROR_R_CHAR_P], 1,
1136 [Define to 1 if strerror_r returns char *.])
1138 ])# AC_FUNC_STRERROR_R
1143 AC_DEFUN([AM_WITH_DMALLOC],
1144 [AC_MSG_CHECKING([if malloc debugging is wanted])
1145 AC_ARG_WITH(dmalloc,
1146 [ --with-dmalloc use dmalloc, as in
1147 http://www.dmalloc.com/dmalloc.tar.gz],
1148 [if test "$withval" = yes; then
1150 AC_DEFINE(WITH_DMALLOC,1,
1151 [Define if using the dmalloc debugging malloc package])
1152 LIBS="$LIBS -ldmalloc"
1153 LDFLAGS="$LDFLAGS -g"
1156 fi], [AC_MSG_RESULT(no)])
1159 # Macro to add for using GNU gettext.
1160 # Ulrich Drepper <drepper@cygnus.com>, 1995.
1162 # This file can be copied and used freely without restrictions. It can
1163 # be used in projects which are not available under the GNU General Public
1164 # License or the GNU Library General Public License but which still want
1165 # to provide support for the GNU gettext functionality.
1166 # Please note that the actual code of the GNU gettext library is covered
1167 # by the GNU Library General Public License, and the rest of the GNU
1168 # gettext package package is covered by the GNU General Public License.
1169 # They are *not* in the public domain.
1173 dnl Usage: AM_WITH_NLS([TOOLSYMBOL], [NEEDSYMBOL], [LIBDIR]).
1174 dnl If TOOLSYMBOL is specified and is 'use-libtool', then a libtool library
1175 dnl $(top_builddir)/intl/libintl.la will be created (shared and/or static,
1176 dnl depending on --{enable,disable}-{shared,static} and on the presence of
1177 dnl AM-DISABLE-SHARED). Otherwise, a static library
1178 dnl $(top_builddir)/intl/libintl.a will be created.
1179 dnl If NEEDSYMBOL is specified and is 'need-ngettext', then GNU gettext
1180 dnl implementations (in libc or libintl) without the ngettext() function
1181 dnl will be ignored.
1182 dnl LIBDIR is used to find the intl libraries. If empty,
1183 dnl the value `$(top_builddir)/intl/' is used.
1185 dnl The result of the configuration is one of three cases:
1186 dnl 1) GNU gettext, as included in the intl subdirectory, will be compiled
1188 dnl Catalog format: GNU --> install in $(datadir)
1189 dnl Catalog extension: .mo after installation, .gmo in source tree
1190 dnl 2) GNU gettext has been found in the system's C library.
1191 dnl Catalog format: GNU --> install in $(datadir)
1192 dnl Catalog extension: .mo after installation, .gmo in source tree
1193 dnl 3) No internationalization, always use English msgid.
1194 dnl Catalog format: none
1195 dnl Catalog extension: none
1196 dnl The use of .gmo is historical (it was needed to avoid overwriting the
1197 dnl GNU format catalogs when building on a platform with an X/Open gettext),
1198 dnl but we keep it in order not to force irrelevant filename changes on the
1201 AC_DEFUN([AM_WITH_NLS],
1202 [AC_MSG_CHECKING([whether NLS is requested])
1203 dnl Default is enabled NLS
1205 [ --disable-nls do not use Native Language Support],
1206 USE_NLS=$enableval, USE_NLS=yes)
1207 AC_MSG_RESULT($USE_NLS)
1210 BUILD_INCLUDED_LIBINTL=no
1211 USE_INCLUDED_LIBINTL=no
1214 dnl If we use NLS figure out what method
1215 if test "$USE_NLS" = "yes"; then
1216 AC_DEFINE(ENABLE_NLS, 1,
1217 [Define to 1 if translation of program messages to the user's native language
1219 AC_MSG_CHECKING([whether included gettext is requested])
1220 AC_ARG_WITH(included-gettext,
1221 [ --with-included-gettext use the GNU gettext library included here],
1222 nls_cv_force_use_gnu_gettext=$withval,
1223 nls_cv_force_use_gnu_gettext=no)
1224 AC_MSG_RESULT($nls_cv_force_use_gnu_gettext)
1226 nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext"
1227 if test "$nls_cv_force_use_gnu_gettext" != "yes"; then
1228 dnl User does not insist on using GNU NLS library. Figure out what
1229 dnl to use. If GNU gettext is available we use this. Else we have
1230 dnl to fall back to GNU NLS library.
1233 dnl Add a version number to the cache macros.
1234 define(gt_cv_func_gnugettext_libc, [gt_cv_func_gnugettext]ifelse([$2], need-ngettext, 2, 1)[_libc])
1235 define(gt_cv_func_gnugettext_libintl, [gt_cv_func_gnugettext]ifelse([$2], need-ngettext, 2, 1)[_libintl])
1237 AC_CHECK_HEADER(libintl.h,
1238 [AC_CACHE_CHECK([for GNU gettext in libc], gt_cv_func_gnugettext_libc,
1239 [AC_TRY_LINK([#include <libintl.h>
1240 extern int _nl_msg_cat_cntr;],
1241 [bindtextdomain ("", "");
1242 return (int) gettext ("")]ifelse([$2], need-ngettext, [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr],
1243 gt_cv_func_gnugettext_libc=yes,
1244 gt_cv_func_gnugettext_libc=no)])
1246 if test "$gt_cv_func_gnugettext_libc" != "yes"; then
1247 AC_CACHE_CHECK([for GNU gettext in libintl],
1248 gt_cv_func_gnugettext_libintl,
1249 [gt_save_LIBS="$LIBS"
1250 LIBS="$LIBS -lintl $LIBICONV"
1251 AC_TRY_LINK([#include <libintl.h>
1252 extern int _nl_msg_cat_cntr;],
1253 [bindtextdomain ("", "");
1254 return (int) gettext ("")]ifelse([$2], need-ngettext, [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr],
1255 gt_cv_func_gnugettext_libintl=yes,
1256 gt_cv_func_gnugettext_libintl=no)
1257 LIBS="$gt_save_LIBS"])
1260 dnl If an already present or preinstalled GNU gettext() is found,
1261 dnl use it. But if this macro is used in GNU gettext, and GNU
1262 dnl gettext is already preinstalled in libintl, we update this
1263 dnl libintl. (Cf. the install rule in intl/Makefile.in.)
1264 if test "$gt_cv_func_gnugettext_libc" = "yes" \
1265 || { test "$gt_cv_func_gnugettext_libintl" = "yes" \
1266 && test "$PACKAGE" != gettext; }; then
1267 AC_DEFINE(HAVE_GETTEXT, 1,
1268 [Define if the GNU gettext() function is already present or preinstalled.])
1270 if test "$gt_cv_func_gnugettext_libintl" = "yes"; then
1271 dnl If iconv() is in a separate libiconv library, then anyone
1272 dnl linking with libintl{.a,.so} also needs to link with
1274 INTLLIBS="-lintl $LIBICONV"
1277 gt_save_LIBS="$LIBS"
1278 LIBS="$LIBS $INTLLIBS"
1279 AC_CHECK_FUNCS(dcgettext)
1280 LIBS="$gt_save_LIBS"
1282 dnl Search for GNU msgfmt in the PATH.
1283 AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
1284 [$ac_dir/$ac_word --statistics /dev/null >/dev/null 2>&1], :)
1285 AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
1287 dnl Search for GNU xgettext in the PATH.
1288 AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
1289 [$ac_dir/$ac_word --omit-header /dev/null >/dev/null 2>&1], :)
1295 if test "$CATOBJEXT" = "NONE"; then
1296 dnl GNU gettext is not found in the C library.
1297 dnl Fall back on GNU gettext library.
1298 nls_cv_use_gnu_gettext=yes
1302 if test "$nls_cv_use_gnu_gettext" = "yes"; then
1303 dnl Mark actions used to generate GNU NLS library.
1304 INTLOBJS="\$(GETTOBJS)"
1305 AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
1306 [$ac_dir/$ac_word --statistics /dev/null >/dev/null 2>&1], :)
1307 AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
1308 AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
1309 [$ac_dir/$ac_word --omit-header /dev/null >/dev/null 2>&1], :)
1311 BUILD_INCLUDED_LIBINTL=yes
1312 USE_INCLUDED_LIBINTL=yes
1314 INTLLIBS="ifelse([$3],[],\$(top_builddir)/intl,[$3])/libintl.ifelse([$1], use-libtool, [l], [])a $LIBICONV"
1315 LIBS=`echo " $LIBS " | sed -e 's/ -lintl / /' -e 's/^ //' -e 's/ $//'`
1318 dnl This could go away some day; the PATH_PROG_WITH_TEST already does it.
1319 dnl Test whether we really found GNU msgfmt.
1320 if test "$GMSGFMT" != ":"; then
1321 dnl If it is no GNU msgfmt we define it as : so that the
1322 dnl Makefiles still can work.
1323 if $GMSGFMT --statistics /dev/null >/dev/null 2>&1; then
1327 [found msgfmt program is not GNU msgfmt; ignore it])
1332 dnl This could go away some day; the PATH_PROG_WITH_TEST already does it.
1333 dnl Test whether we really found GNU xgettext.
1334 if test "$XGETTEXT" != ":"; then
1335 dnl If it is no GNU xgettext we define it as : so that the
1336 dnl Makefiles still can work.
1337 if $XGETTEXT --omit-header /dev/null >/dev/null 2>&1; then
1341 [found xgettext program is not GNU xgettext; ignore it])
1346 dnl We need to process the po/ directory.
1350 [for ac_file in $CONFIG_FILES; do
1351 # Support "outfile[:infile[:infile...]]"
1353 *:*) ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
1355 # PO directories have a Makefile.in generated from Makefile.in.in.
1356 case "$ac_file" in */Makefile.in)
1357 # Adjust a relative srcdir.
1358 ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'`
1359 ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`"
1360 ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'`
1361 # In autoconf-2.13 it is called $ac_given_srcdir.
1362 # In autoconf-2.50 it is called $srcdir.
1363 test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir"
1364 case "$ac_given_srcdir" in
1365 .) top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;;
1366 /*) top_srcdir="$ac_given_srcdir" ;;
1367 *) top_srcdir="$ac_dots$ac_given_srcdir" ;;
1369 if test -f "$ac_given_srcdir/$ac_dir/POTFILES.in"; then
1370 rm -f "$ac_dir/POTFILES"
1371 test -n "$as_me" && echo "$as_me: creating $ac_dir/POTFILES" || echo "creating $ac_dir/POTFILES"
1372 sed -e "/^#/d" -e "/^[ ]*\$/d" -e "s,.*, $top_srcdir/& \\\\," -e "\$s/\(.*\) \\\\/\1/" < "$ac_given_srcdir/$ac_dir/POTFILES.in" > "$ac_dir/POTFILES"
1373 test -n "$as_me" && echo "$as_me: creating $ac_dir/Makefile" || echo "creating $ac_dir/Makefile"
1374 sed -e "/POTFILES =/r $ac_dir/POTFILES" "$ac_dir/Makefile.in" > "$ac_dir/Makefile"
1381 dnl If this is used in GNU gettext we have to set BUILD_INCLUDED_LIBINTL
1382 dnl to 'yes' because some of the testsuite requires it.
1383 if test "$PACKAGE" = gettext; then
1384 BUILD_INCLUDED_LIBINTL=yes
1387 dnl intl/plural.c is generated from intl/plural.y. It requires bison,
1388 dnl because plural.y uses bison specific features. It requires at least
1389 dnl bison-1.26 because earlier versions generate a plural.c that doesn't
1391 dnl bison is only needed for the maintainer (who touches plural.y). But in
1392 dnl order to avoid separate Makefiles or --enable-maintainer-mode, we put
1393 dnl the rule in general Makefile. Now, some people carelessly touch the
1394 dnl files or have a broken "make" program, hence the plural.c rule will
1395 dnl sometimes fire. To avoid an error, defines BISON to ":" if it is not
1396 dnl present or too old.
1397 AC_CHECK_PROGS([INTLBISON], [bison])
1398 if test -z "$INTLBISON"; then
1401 dnl Found it, now check the version.
1402 AC_MSG_CHECKING([version of bison])
1403 changequote(<<,>>)dnl
1404 ac_prog_version=`$INTLBISON --version 2>&1 | sed -n 's/^.*GNU Bison.* \([0-9]*\.[0-9.]*\).*$/\1/p'`
1405 case $ac_prog_version in
1406 '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;;
1407 1.2[6-9]* | 1.[3-9][0-9]* | [2-9].*)
1409 ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;;
1410 *) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;;
1412 AC_MSG_RESULT([$ac_prog_version])
1414 if test $ac_verc_fail = yes; then
1418 dnl These rules are solely for the distribution goal. While doing this
1419 dnl we only have to keep exactly one list of the available catalogs
1420 dnl in configure.in.
1421 for lang in $ALL_LINGUAS; do
1422 GMOFILES="$GMOFILES $lang.gmo"
1423 POFILES="$POFILES $lang.po"
1426 dnl Make all variables we use known to autoconf.
1427 AC_SUBST(BUILD_INCLUDED_LIBINTL)
1428 AC_SUBST(USE_INCLUDED_LIBINTL)
1437 dnl For backward compatibility. Some configure.ins may be using this.
1439 nls_cv_header_libgt=
1441 dnl For backward compatibility. Some Makefiles may be using this.
1443 AC_SUBST(DATADIRNAME)
1445 dnl For backward compatibility. Some Makefiles may be using this.
1447 AC_SUBST(INSTOBJEXT)
1449 dnl For backward compatibility. Some Makefiles may be using this.
1454 dnl Usage: Just like AM_WITH_NLS, which see.
1455 AC_DEFUN([AM_GNU_GETTEXT],
1456 [AC_REQUIRE([AC_PROG_MAKE_SET])dnl
1457 AC_REQUIRE([AC_PROG_CC])dnl
1458 AC_REQUIRE([AC_CANONICAL_HOST])dnl
1459 AC_REQUIRE([AC_PROG_RANLIB])dnl
1460 AC_REQUIRE([AC_ISC_POSIX])dnl
1461 AC_REQUIRE([AC_HEADER_STDC])dnl
1462 AC_REQUIRE([AC_C_CONST])dnl
1463 AC_REQUIRE([AC_C_INLINE])dnl
1464 AC_REQUIRE([AC_TYPE_OFF_T])dnl
1465 AC_REQUIRE([AC_TYPE_SIZE_T])dnl
1466 AC_REQUIRE([AC_FUNC_ALLOCA])dnl
1467 AC_REQUIRE([AC_FUNC_MMAP])dnl
1468 AC_REQUIRE([jm_GLIBC21])dnl
1470 AC_CHECK_HEADERS([argz.h limits.h locale.h nl_types.h malloc.h stddef.h \
1471 stdlib.h string.h unistd.h sys/param.h])
1472 AC_CHECK_FUNCS([feof_unlocked fgets_unlocked getcwd getegid geteuid \
1473 getgid getuid mempcpy munmap putenv setenv setlocale stpcpy strchr strcasecmp \
1474 strdup strtoul tsearch __argz_count __argz_stringify __argz_next])
1479 AM_WITH_NLS([$1],[$2],[$3])
1481 if test "x$CATOBJEXT" != "x"; then
1482 if test "x$ALL_LINGUAS" = "x"; then
1485 AC_MSG_CHECKING(for catalogs to be installed)
1487 for presentlang in $ALL_LINGUAS; do
1489 for desiredlang in ${LINGUAS-$ALL_LINGUAS}; do
1490 # Use the presentlang catalog if desiredlang is
1491 # a. equal to presentlang, or
1492 # b. a variant of presentlang (because in this case,
1493 # presentlang can be used as a fallback for messages
1494 # which are not translated in the desiredlang catalog).
1495 case "$desiredlang" in
1496 "$presentlang"*) useit=yes;;
1499 if test $useit = yes; then
1500 NEW_LINGUAS="$NEW_LINGUAS $presentlang"
1503 LINGUAS=$NEW_LINGUAS
1504 AC_MSG_RESULT($LINGUAS)
1507 dnl Construct list of names of catalog files to be constructed.
1508 if test -n "$LINGUAS"; then
1509 for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done
1513 dnl If the AC_CONFIG_AUX_DIR macro for autoconf is used we possibly
1514 dnl find the mkinstalldirs script in another subdir but $(top_srcdir).
1515 dnl Try to locate is.
1517 if test -n "$ac_aux_dir"; then
1518 MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs"
1520 if test -z "$MKINSTALLDIRS"; then
1521 MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs"
1523 AC_SUBST(MKINSTALLDIRS)
1525 dnl Enable libtool support if the surrounding package wishes it.
1526 INTL_LIBTOOL_SUFFIX_PREFIX=ifelse([$1], use-libtool, [l], [])
1527 AC_SUBST(INTL_LIBTOOL_SUFFIX_PREFIX)
1530 # Search path for a program which passes the given test.
1531 # Ulrich Drepper <drepper@cygnus.com>, 1996.
1533 # This file can be copied and used freely without restrictions. It can
1534 # be used in projects which are not available under the GNU General Public
1535 # License or the GNU Library General Public License but which still want
1536 # to provide support for the GNU gettext functionality.
1537 # Please note that the actual code of the GNU gettext library is covered
1538 # by the GNU Library General Public License, and the rest of the GNU
1539 # gettext package package is covered by the GNU General Public License.
1540 # They are *not* in the public domain.
1544 dnl AM_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR,
1545 dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
1546 AC_DEFUN([AM_PATH_PROG_WITH_TEST],
1547 [# Extract the first word of "$2", so it can be a program name with args.
1548 set dummy $2; ac_word=[$]2
1549 AC_MSG_CHECKING([for $ac_word])
1550 AC_CACHE_VAL(ac_cv_path_$1,
1553 ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
1556 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
1557 for ac_dir in ifelse([$5], , $PATH, [$5]); do
1558 test -z "$ac_dir" && ac_dir=.
1559 if test -f $ac_dir/$ac_word; then
1561 ac_cv_path_$1="$ac_dir/$ac_word"
1567 dnl If no 4th arg is given, leave the cache variable unset,
1568 dnl so AC_PATH_PROGS will keep looking.
1569 ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
1574 if test ifelse([$4], , [-n "[$]$1"], ["[$]$1" != "$4"]); then
1575 AC_MSG_RESULT([$]$1)
1584 # Test for the GNU C Library, version 2.1 or newer.
1585 # From Bruno Haible.
1587 AC_DEFUN([jm_GLIBC21],
1589 AC_CACHE_CHECK(whether we are using the GNU C Library 2.1 or newer,
1590 ac_cv_gnu_library_2_1,
1591 [AC_EGREP_CPP([Lucky GNU user],
1593 #include <features.h>
1594 #ifdef __GNU_LIBRARY__
1595 #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1) || (__GLIBC__ > 2)
1600 ac_cv_gnu_library_2_1=yes,
1601 ac_cv_gnu_library_2_1=no)
1605 GLIBC21="$ac_cv_gnu_library_2_1"
1611 dnl From Bruno Haible.
1613 AC_DEFUN([AM_ICONV],
1615 dnl Some systems have iconv in libc, some have it in libiconv (OSF/1 and
1616 dnl those with the standalone portable GNU libiconv installed).
1618 AC_ARG_WITH([libiconv-prefix],
1619 [ --with-libiconv-prefix=DIR search for libiconv in DIR/include and DIR/lib], [
1620 for dir in `echo "$withval" | tr : ' '`; do
1621 if test -d $dir/include; then CPPFLAGS="$CPPFLAGS -I$dir/include"; fi
1622 if test -d $dir/lib; then LDFLAGS="$LDFLAGS -L$dir/lib"; fi
1626 AC_CACHE_CHECK(for iconv, am_cv_func_iconv, [
1627 am_cv_func_iconv="no, consider installing GNU libiconv"
1629 AC_TRY_LINK([#include <stdlib.h>
1630 #include <iconv.h>],
1631 [iconv_t cd = iconv_open("","");
1632 iconv(cd,NULL,NULL,NULL,NULL);
1634 am_cv_func_iconv=yes)
1635 if test "$am_cv_func_iconv" != yes; then
1636 am_save_LIBS="$LIBS"
1637 LIBS="$LIBS -liconv"
1638 AC_TRY_LINK([#include <stdlib.h>
1639 #include <iconv.h>],
1640 [iconv_t cd = iconv_open("","");
1641 iconv(cd,NULL,NULL,NULL,NULL);
1644 am_cv_func_iconv=yes)
1645 LIBS="$am_save_LIBS"
1648 if test "$am_cv_func_iconv" = yes; then
1649 AC_DEFINE(HAVE_ICONV, 1, [Define if you have the iconv() function.])
1650 AC_MSG_CHECKING([for iconv declaration])
1651 AC_CACHE_VAL(am_cv_proto_iconv, [
1659 #if defined(__STDC__) || defined(__cplusplus)
1660 size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
1664 ], [], am_cv_proto_iconv_arg1="", am_cv_proto_iconv_arg1="const")
1665 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);"])
1666 am_cv_proto_iconv=`echo "[$]am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'`
1667 AC_MSG_RESULT([$]{ac_t:-
1668 }[$]am_cv_proto_iconv)
1669 AC_DEFINE_UNQUOTED(ICONV_CONST, $am_cv_proto_iconv_arg1,
1670 [Define as const if the declaration of iconv() needs const.])
1673 if test "$am_cv_lib_iconv" = yes; then
1681 dnl From Bruno Haible.
1683 AC_DEFUN([AM_LANGINFO_CODESET],
1685 AC_CACHE_CHECK([for nl_langinfo and CODESET], am_cv_langinfo_codeset,
1686 [AC_TRY_LINK([#include <langinfo.h>],
1687 [char* cs = nl_langinfo(CODESET);],
1688 am_cv_langinfo_codeset=yes,
1689 am_cv_langinfo_codeset=no)
1691 if test $am_cv_langinfo_codeset = yes; then
1692 AC_DEFINE(HAVE_LANGINFO_CODESET, 1,
1693 [Define if you have <langinfo.h> and nl_langinfo(CODESET).])
1697 # Check whether LC_MESSAGES is available in <locale.h>.
1698 # Ulrich Drepper <drepper@cygnus.com>, 1995.
1700 # This file can be copied and used freely without restrictions. It can
1701 # be used in projects which are not available under the GNU General Public
1702 # License or the GNU Library General Public License but which still want
1703 # to provide support for the GNU gettext functionality.
1704 # Please note that the actual code of the GNU gettext library is covered
1705 # by the GNU Library General Public License, and the rest of the GNU
1706 # gettext package package is covered by the GNU General Public License.
1707 # They are *not* in the public domain.
1711 AC_DEFUN([AM_LC_MESSAGES],
1712 [if test $ac_cv_header_locale_h = yes; then
1713 AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES,
1714 [AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
1715 am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)])
1716 if test $am_cv_val_LC_MESSAGES = yes; then
1717 AC_DEFINE(HAVE_LC_MESSAGES, 1,
1718 [Define if your <locale.h> file defines LC_MESSAGES.])