1 # aclocal.m4 generated automatically by aclocal 1.5a -*- 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 "
203 AC_MSG_WARN([${am_backtick}missing' script is too old or missing])
209 # Copyright 2001 Free Software Foundation, Inc.
211 # This program is free software; you can redistribute it and/or modify
212 # it under the terms of the GNU General Public License as published by
213 # the Free Software Foundation; either version 2, or (at your option)
216 # This program is distributed in the hope that it will be useful,
217 # but WITHOUT ANY WARRANTY; without even the implied warranty of
218 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
219 # GNU General Public License for more details.
221 # You should have received a copy of the GNU General Public License
222 # along with this program; if not, write to the Free Software
223 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
226 # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
227 # $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to
228 # `$srcdir', `$srcdir/..', or `$srcdir/../..'.
230 # Of course, Automake must honor this variable whenever it calls a
231 # tool from the auxiliary directory. The problem is that $srcdir (and
232 # therefore $ac_aux_dir as well) can be either absolute or relative,
233 # depending on how configure is run. This is pretty annoying, since
234 # it makes $ac_aux_dir quite unusable in subdirectories: in the top
235 # source directory, any form will work fine, but in subdirectories a
236 # relative path needs to be adjusted first.
238 # $ac_aux_dir/missing
239 # fails when called from a subdirectory if $ac_aux_dir is relative
240 # $top_srcdir/$ac_aux_dir/missing
241 # fails if $ac_aux_dir is absolute,
242 # fails when called from a subdirectory in a VPATH build with
243 # a relative $ac_aux_dir
245 # The reason of the latter failure is that $top_srcdir and $ac_aux_dir
246 # are both prefixed by $srcdir. In an in-source build this is usually
247 # harmless because $srcdir is `.', but things will broke when you
248 # start a VPATH build or use an absolute $srcdir.
250 # So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
251 # iff we strip the leading $srcdir from $ac_aux_dir. That would be:
252 # am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
253 # and then we would define $MISSING as
254 # MISSING="\${SHELL} $am_aux_dir/missing"
255 # This will work as long as MISSING is not called from configure, because
256 # unfortunately $(top_srcdir) has no meaning in configure.
257 # However there are other variables, like CC, which are often used in
258 # configure, and could therefore not use this "fixed" $ac_aux_dir.
260 # Another solution, used here, is to always expand $ac_aux_dir to an
261 # absolute PATH. The drawback is that using absolute paths prevent a
262 # configured tree to be moved without reconfiguration.
264 # Rely on autoconf to set up CDPATH properly.
267 AC_DEFUN([AM_AUX_DIR_EXPAND], [
268 # expand $ac_aux_dir to an absolute path
269 am_aux_dir=`cd $ac_aux_dir && pwd`
274 # Define $install_sh.
276 # Copyright 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., 59 Temple Place - Suite 330, Boston, MA
293 AC_DEFUN([AM_PROG_INSTALL_SH],
294 [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
295 install_sh=${install_sh-"$am_aux_dir/install-sh"}
296 AC_SUBST(install_sh)])
298 # AM_PROG_INSTALL_STRIP
300 # Copyright 2001 Free Software Foundation, Inc.
302 # This program is free software; you can redistribute it and/or modify
303 # it under the terms of the GNU General Public License as published by
304 # the Free Software Foundation; either version 2, or (at your option)
307 # This program is distributed in the hope that it will be useful,
308 # but WITHOUT ANY WARRANTY; without even the implied warranty of
309 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
310 # GNU General Public License for more details.
312 # You should have received a copy of the GNU General Public License
313 # along with this program; if not, write to the Free Software
314 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
317 # One issue with vendor `install' (even GNU) is that you can't
318 # specify the program used to strip binaries. This is especially
319 # annoying in cross-compiling environments, where the build's strip
320 # is unlikely to handle the host's binaries.
321 # Fortunately install-sh will honor a STRIPPROG variable, so we
322 # always use install-sh in `make install-strip', and initialize
323 # STRIPPROG with the value of the STRIP variable (set by the user).
324 AC_DEFUN([AM_PROG_INSTALL_STRIP],
325 [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
326 INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s"
327 AC_SUBST([INSTALL_STRIP_PROGRAM])])
329 # serial 4 -*- Autoconf -*-
331 # Copyright 1999, 2000, 2001 Free Software Foundation, Inc.
333 # This program is free software; you can redistribute it and/or modify
334 # it under the terms of the GNU General Public License as published by
335 # the Free Software Foundation; either version 2, or (at your option)
338 # This program is distributed in the hope that it will be useful,
339 # but WITHOUT ANY WARRANTY; without even the implied warranty of
340 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
341 # GNU General Public License for more details.
343 # You should have received a copy of the GNU General Public License
344 # along with this program; if not, write to the Free Software
345 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
349 # There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
350 # written in clear, in which case automake, when reading aclocal.m4,
351 # will think it sees a *use*, and therefore will trigger all it's
352 # C support machinery. Also note that it means that autoscan, seeing
353 # CC etc. in the Makefile, will ask for an AC_PROG_CC use...
357 # _AM_DEPENDENCIES(NAME)
358 # ----------------------
359 # See how the compiler implements dependency checking.
360 # NAME is "CC", "CXX" or "OBJC".
361 # We try a few techniques and use that to set a single cache variable.
363 # We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
364 # modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
365 # dependency, and given that the user is not expected to run this macro,
366 # just rely on AC_PROG_CC.
367 AC_DEFUN([_AM_DEPENDENCIES],
368 [AC_REQUIRE([AM_SET_DEPDIR])dnl
369 AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
370 AC_REQUIRE([AM_MAKE_INCLUDE])dnl
371 AC_REQUIRE([AM_DEP_TRACK])dnl
373 ifelse([$1], CC, [depcc="$CC" am_compiler_list=],
374 [$1], CXX, [depcc="$CXX" am_compiler_list=],
375 [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc']
376 [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'],
377 [depcc="$$1" am_compiler_list=])
379 AC_CACHE_CHECK([dependency style of $depcc],
380 [am_cv_$1_dependencies_compiler_type],
381 [if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
382 # We make a subdir and do the tests there. Otherwise we can end up
383 # making bogus files that we don't know about and never remove. For
384 # instance it was reported that on HP-UX the gcc test will end up
385 # making a dummy file named `D' -- because `-MD' means `put the output
388 # Copy depcomp to subdir because otherwise we won't find it if we're
389 # using a relative directory.
390 cp "$am_depcomp" conftest.dir
393 am_cv_$1_dependencies_compiler_type=none
394 if test "$am_compiler_list" = ""; then
395 am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
397 for depmode in $am_compiler_list; do
398 # We need to recreate these files for each test, as the compiler may
399 # overwrite some of them when testing with obscure command lines.
400 # This happens at least with the AIX C compiler.
401 echo '#include "conftest.h"' > conftest.c
402 echo 'int i;' > conftest.h
403 echo "${am__include} ${am__quote}conftest.Po${am__quote}" > confmf
407 # after this tag, mechanisms are not by side-effect, so they'll
408 # only be used when explicitly requested
409 if test "x$enable_dependency_tracking" = xyes; then
417 # We check with `-c' and `-o' for the sake of the "dashmstdout"
418 # mode. It turns out that the SunPro C++ compiler does not properly
419 # handle `-M -o', and we need to detect this.
420 if depmode=$depmode \
421 source=conftest.c object=conftest.o \
422 depfile=conftest.Po tmpdepfile=conftest.TPo \
423 $SHELL ./depcomp $depcc -c conftest.c -o conftest.o >/dev/null 2>&1 &&
424 grep conftest.h conftest.Po > /dev/null 2>&1 &&
425 ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
426 am_cv_$1_dependencies_compiler_type=$depmode
434 am_cv_$1_dependencies_compiler_type=none
437 AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
443 # Choose a directory name for dependency files.
444 # This macro is AC_REQUIREd in _AM_DEPENDENCIES
445 AC_DEFUN([AM_SET_DEPDIR],
446 [rm -f .deps 2>/dev/null
447 mkdir .deps 2>/dev/null
448 if test -d .deps; then
451 # MS-DOS does not allow filenames that begin with a dot.
454 rmdir .deps 2>/dev/null
461 AC_DEFUN([AM_DEP_TRACK],
462 [AC_ARG_ENABLE(dependency-tracking,
463 [ --disable-dependency-tracking Speeds up one-time builds
464 --enable-dependency-tracking Do not reject slow dependency extractors])
465 if test "x$enable_dependency_tracking" != xno; then
466 am_depcomp="$ac_aux_dir/depcomp"
469 AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
470 AC_SUBST([AMDEPBACKSLASH])
473 # Generate code to set up dependency tracking. -*- Autoconf -*-
475 # Copyright 1999, 2000, 2001 Free Software Foundation, Inc.
477 # This program is free software; you can redistribute it and/or modify
478 # it under the terms of the GNU General Public License as published by
479 # the Free Software Foundation; either version 2, or (at your option)
482 # This program is distributed in the hope that it will be useful,
483 # but WITHOUT ANY WARRANTY; without even the implied warranty of
484 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
485 # GNU General Public License for more details.
487 # You should have received a copy of the GNU General Public License
488 # along with this program; if not, write to the Free Software
489 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
494 # _AM_OUTPUT_DEPENDENCY_COMMANDS
495 # ------------------------------
496 AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
497 [for mf in $CONFIG_FILES; do
499 Makefile) dirpart=.;;
500 */Makefile) dirpart=`AS_DIRNAME("$mf")`;;
503 grep '^DEP_FILES *= *[[^ @%:@]]' < "$mf" > /dev/null || continue
504 # Extract the definition of DEP_FILES from the Makefile without
506 DEPDIR=`sed -n -e '/^DEPDIR = / s///p' < "$mf"`
507 test -z "$DEPDIR" && continue
508 # When using ansi2knr, U may be empty or an underscore; expand it
509 U=`sed -n -e '/^U = / s///p' < "$mf"`
510 test -d "$dirpart/$DEPDIR" || mkdir "$dirpart/$DEPDIR"
511 # We invoke sed twice because it is the simplest approach to
512 # changing $(DEPDIR) to its actual value in the expansion.
513 for file in `sed -n -e '
514 /^DEP_FILES = .*\\\\$/ {
523 /^DEP_FILES = / s/^DEP_FILES = //p' < "$mf" | \
524 sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
525 # Make sure the directory exists.
526 test -f "$dirpart/$file" && continue
527 fdir=`AS_DIRNAME(["$file"])`
528 AS_MKDIR_P([$dirpart/$fdir])
529 # echo "creating $dirpart/$file"
530 echo '# dummy' > "$dirpart/$file"
533 ])# _AM_OUTPUT_DEPENDENCY_COMMANDS
536 # AM_OUTPUT_DEPENDENCY_COMMANDS
537 # -----------------------------
538 # This macro should only be invoked once -- use via AC_REQUIRE.
540 # This code is only required when automatic dependency tracking
541 # is enabled. FIXME. This creates each `.P' file that we will
542 # need in order to bootstrap the dependency handling code.
543 AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
544 [AC_CONFIG_COMMANDS([depfiles],
545 [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
546 [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
551 # Check to see how make treats includes.
553 # Copyright 2001 Free Software Foundation, Inc.
555 # This program is free software; you can redistribute it and/or modify
556 # it under the terms of the GNU General Public License as published by
557 # the Free Software Foundation; either version 2, or (at your option)
560 # This program is distributed in the hope that it will be useful,
561 # but WITHOUT ANY WARRANTY; without even the implied warranty of
562 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
563 # GNU General Public License for more details.
565 # You should have received a copy of the GNU General Public License
566 # along with this program; if not, write to the Free Software
567 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
570 AC_DEFUN([AM_MAKE_INCLUDE],
571 [am_make=${MAKE-make}
572 cat > confinc << 'END'
576 # If we don't find an include directive, just comment out the code.
577 AC_MSG_CHECKING([for style of include used by $am_make])
581 # First try GNU make style include.
582 echo "include confinc" > confmf
583 # We grep out `Entering directory' and `Leaving directory'
584 # messages which can occur if `w' ends up in MAKEFLAGS.
585 # In particular we don't look at `^make:' because GNU make might
586 # be invoked under some other name (usually "gmake"), in which
587 # case it prints its new name instead of `make'.
588 if test "`$am_make -s -f confmf 2> /dev/null | fgrep -v 'ing directory'`" = "done"; then
593 # Now try BSD make style include.
594 if test "$am__include" = "#"; then
595 echo '.include "confinc"' > confmf
596 if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
602 AC_SUBST(am__include)
604 AC_MSG_RESULT($_am_result)
608 # AM_CONDITIONAL -*- Autoconf -*-
610 # Copyright 1997, 2000, 2001 Free Software Foundation, Inc.
612 # This program is free software; you can redistribute it and/or modify
613 # it under the terms of the GNU General Public License as published by
614 # the Free Software Foundation; either version 2, or (at your option)
617 # This program is distributed in the hope that it will be useful,
618 # but WITHOUT ANY WARRANTY; without even the implied warranty of
619 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
620 # GNU General Public License for more details.
622 # You should have received a copy of the GNU General Public License
623 # along with this program; if not, write to the Free Software
624 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
631 # AM_CONDITIONAL(NAME, SHELL-CONDITION)
632 # -------------------------------------
633 # Define a conditional.
634 AC_DEFUN([AM_CONDITIONAL],
635 [ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])],
636 [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
647 # Like AC_CONFIG_HEADER, but automatically create stamp file. -*- Autoconf -*-
649 # Copyright 1996, 1997, 2000, 2001 Free Software Foundation, Inc.
651 # This program is free software; you can redistribute it and/or modify
652 # it under the terms of the GNU General Public License as published by
653 # the Free Software Foundation; either version 2, or (at your option)
656 # This program is distributed in the hope that it will be useful,
657 # but WITHOUT ANY WARRANTY; without even the implied warranty of
658 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
659 # GNU General Public License for more details.
661 # You should have received a copy of the GNU General Public License
662 # along with this program; if not, write to the Free Software
663 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
670 # When config.status generates a header, we must update the stamp-h file.
671 # This file resides in the same directory as the config header
672 # that is generated. We must strip everything past the first ":",
673 # and everything past the last "/".
677 # Like AS_DIRNAME, only do it during macro expansion
678 AC_DEFUN([_AM_DIRNAME],
679 [m4_if(regexp([$1], [^.*[^/]//*[^/][^/]*/*$]), -1,
680 m4_if(regexp([$1], [^//\([^/]\|$\)]), -1,
681 m4_if(regexp([$1], [^/.*]), -1,
683 patsubst([$1], [^\(/\).*], [\1])),
684 patsubst([$1], [^\(//\)\([^/].*\|$\)], [\1])),
685 patsubst([$1], [^\(.*[^/]\)//*[^/][^/]*/*$], [\1]))[]dnl
689 # The stamp files are numbered to have different names.
690 # We could number them on a directory basis, but that's additional
691 # complications, let's have a unique counter.
692 m4_define([_AM_STAMP_Count], [0])
697 # The name of the stamp file for HEADER.
698 AC_DEFUN([_AM_STAMP],
699 [m4_define([_AM_STAMP_Count], m4_incr(_AM_STAMP_Count))dnl
700 AS_ESCAPE(_AM_DIRNAME(patsubst([$1],
701 [:.*])))/stamp-h[]_AM_STAMP_Count])
704 # _AM_CONFIG_HEADER(HEADER[:SOURCES], COMMANDS, INIT-COMMANDS)
705 # ------------------------------------------------------------
706 # We used to try to get a real timestamp in stamp-h. But the fear is that
707 # that will cause unnecessary cvs conflicts.
708 AC_DEFUN([_AM_CONFIG_HEADER],
709 [# Add the stamp file to the list of files AC keeps track of,
710 # along with our hook.
711 AC_CONFIG_HEADERS([$1],
712 [# update the timestamp
713 echo 'timestamp for $1' >"_AM_STAMP([$1])"
716 ])# _AM_CONFIG_HEADER
719 # AM_CONFIG_HEADER(HEADER[:SOURCES]..., COMMANDS, INIT-COMMANDS)
720 # --------------------------------------------------------------
721 AC_DEFUN([AM_CONFIG_HEADER],
722 [AC_FOREACH([_AM_File], [$1], [_AM_CONFIG_HEADER(_AM_File, [$2], [$3])])
726 # This test replaces the one in autoconf.
727 # Currently this macro should have the same name as the autoconf macro
728 # because gettext's gettext.m4 (distributed in the automake package)
729 # still uses it. Otherwise, the use in gettext.m4 makes autoheader
730 # give these diagnostics:
731 # configure.in:556: AC_TRY_COMPILE was called before AC_ISC_POSIX
732 # configure.in:556: AC_TRY_RUN was called before AC_ISC_POSIX
734 undefine([AC_ISC_POSIX])
736 AC_DEFUN([AC_ISC_POSIX],
738 dnl This test replaces the obsolescent AC_ISC_POSIX kludge.
739 AC_CHECK_LIB(cposix, strerror, [LIBS="$LIBS -lcposix"])
744 # Copyright 1996, 1997, 1999, 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., 59 Temple Place - Suite 330, Boston, MA
763 # @defmac AC_PROG_CC_STDC
764 # @maindex PROG_CC_STDC
766 # If the C compiler in not in ANSI C mode by default, try to add an option
767 # to output variable @code{CC} to make it so. This macro tries various
768 # options that select ANSI C on some system or another. It considers the
769 # compiler to be in ANSI C mode if it handles function prototypes correctly.
771 # If you use this macro, you should check after calling it whether the C
772 # compiler has been set to accept ANSI C; if not, the shell variable
773 # @code{am_cv_prog_cc_stdc} is set to @samp{no}. If you wrote your source
774 # code in ANSI C, you can make an un-ANSIfied copy of it by using the
775 # program @code{ansi2knr}, which comes with Ghostscript.
778 AC_DEFUN([AM_PROG_CC_STDC],
779 [AC_REQUIRE([AC_PROG_CC])
780 AC_BEFORE([$0], [AC_C_INLINE])
781 AC_BEFORE([$0], [AC_C_CONST])
782 dnl Force this before AC_PROG_CPP. Some cpp's, eg on HPUX, require
783 dnl a magic option to avoid problems with ANSI preprocessor commands
785 dnl FIXME: can't do this because then AC_AIX won't work due to a
786 dnl circular dependency.
787 dnl AC_BEFORE([$0], [AC_PROG_CPP])
788 AC_MSG_CHECKING([for ${CC-cc} option to accept ANSI C])
789 AC_CACHE_VAL(am_cv_prog_cc_stdc,
790 [am_cv_prog_cc_stdc=no
792 # Don't try gcc -ansi; that turns off useful extensions and
793 # breaks some systems' header files.
795 # Ultrix and OSF/1 -std1
796 # HP-UX 10.20 and later -Ae
797 # HP-UX older versions -Aa -D_HPUX_SOURCE
798 # SVR4 -Xc -D__EXTENSIONS__
799 for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
801 CC="$ac_save_CC $ac_arg"
805 #include <sys/types.h>
806 #include <sys/stat.h>
807 /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */
808 struct buf { int x; };
809 FILE * (*rcsopen) (struct buf *, struct stat *, int);
810 static char *e (p, i)
816 static char *f (char * (*g) (char **, int), char **p, ...)
821 s = g (p, va_arg (v,int));
825 int test (int i, double x);
826 struct s1 {int (*f) (int a);};
827 struct s2 {int (*f) (double a);};
828 int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
832 return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1];
834 [am_cv_prog_cc_stdc="$ac_arg"; break])
838 if test -z "$am_cv_prog_cc_stdc"; then
839 AC_MSG_RESULT([none needed])
841 AC_MSG_RESULT([$am_cv_prog_cc_stdc])
843 case "x$am_cv_prog_cc_stdc" in
845 *) CC="$CC $am_cv_prog_cc_stdc" ;;
849 AC_DEFUN(BISON_WARNING,
850 [AC_MSG_CHECKING(whether compiler accepts $1)
851 AC_SUBST(WARNING_CFLAGS)
852 ac_save_CFLAGS="$CFLAGS"
856 WARNING_CFLAGS="$WARNING_CFLAGS $1"
859 CFLAGS="$ac_save_CFLAGS"])
862 # Copyright 1996, 1997, 1998, 2000, 2001 Free Software Foundation, Inc.
864 # This program is free software; you can redistribute it and/or modify
865 # it under the terms of the GNU General Public License as published by
866 # the Free Software Foundation; either version 2, or (at your option)
869 # This program is distributed in the hope that it will be useful,
870 # but WITHOUT ANY WARRANTY; without even the implied warranty of
871 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
872 # GNU General Public License for more details.
874 # You should have received a copy of the GNU General Public License
875 # along with this program; if not, write to the Free Software
876 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
881 AC_DEFUN([AM_C_PROTOTYPES],
882 [AC_REQUIRE([AM_PROG_CC_STDC])
883 AC_REQUIRE([AC_PROG_CPP])
884 AC_MSG_CHECKING([for function prototypes])
885 if test "$am_cv_prog_cc_stdc" != no; then
887 AC_DEFINE(PROTOTYPES,1,[Define if compiler has function prototypes])
891 U=_ ANSI2KNR=./ansi2knr
893 # Ensure some checks needed by ansi2knr itself.
895 AC_CHECK_HEADERS(string.h)
897 AC_SUBST(ANSI2KNR)dnl
902 dnl From Jim Meyering.
903 dnl Determine whether malloc accepts 0 as its argument.
904 dnl If it doesn't, arrange to use the replacement function.
907 AC_DEFUN([jm_FUNC_MALLOC],
909 dnl xmalloc.c requires that this symbol be defined so it doesn't
910 dnl mistakenly use a broken malloc -- as it might if this test were omitted.
911 AC_DEFINE(HAVE_DONE_WORKING_MALLOC_CHECK, 1,
912 [Define if the malloc check has been performed. ])
914 AC_CACHE_CHECK([for working malloc], jm_cv_func_working_malloc,
920 exit (malloc (0) ? 0 : 1);
923 jm_cv_func_working_malloc=yes,
924 jm_cv_func_working_malloc=no,
925 dnl When crosscompiling, assume malloc is broken.
926 jm_cv_func_working_malloc=no)
928 if test $jm_cv_func_working_malloc = no; then
930 AC_DEFINE(malloc, rpl_malloc,
931 [Define to rpl_malloc if the replacement function should be used.])
937 dnl From Jim Meyering.
938 dnl Determine whether realloc works when both arguments are 0.
939 dnl If it doesn't, arrange to use the replacement function.
942 AC_DEFUN([jm_FUNC_REALLOC],
944 dnl xmalloc.c requires that this symbol be defined so it doesn't
945 dnl mistakenly use a broken realloc -- as it might if this test were omitted.
946 AC_DEFINE(HAVE_DONE_WORKING_REALLOC_CHECK, 1,
947 [Define if the realloc check has been performed. ])
949 AC_CACHE_CHECK([for working realloc], jm_cv_func_working_realloc,
955 exit (realloc (0, 0) ? 0 : 1);
958 jm_cv_func_working_realloc=yes,
959 jm_cv_func_working_realloc=no,
960 dnl When crosscompiling, assume realloc is broken.
961 jm_cv_func_working_realloc=no)
963 if test $jm_cv_func_working_realloc = no; then
965 AC_DEFINE(realloc, rpl_realloc,
966 [Define to rpl_realloc if the replacement function should be used.])
972 dnl These are the prerequisite macros for files in the lib/
973 dnl directories of Bison.
975 AC_DEFUN([jm_PREREQ_QUOTEARG],
977 AC_CHECK_FUNCS(isascii iswprint mbsinit)
979 AC_CHECK_HEADERS(limits.h stddef.h stdlib.h string.h wchar.h wctype.h)
990 AC_DEFUN([jm_FUNC_MBRTOWC],
992 AC_CACHE_CHECK([whether mbrtowc and mbstate_t are properly declared],
995 [#include <wchar.h>],
996 [mbstate_t state; return ! (sizeof state && mbrtowc);],
997 jm_cv_func_mbrtowc=yes,
998 jm_cv_func_mbrtowc=no)])
999 if test $jm_cv_func_mbrtowc = yes; then
1000 AC_DEFINE(HAVE_MBRTOWC, 1,
1001 [Define to 1 if mbrtowc and mbstate_t are properly declared.])
1007 dnl From Paul Eggert.
1009 AC_DEFUN([AC_C_BACKSLASH_A],
1011 AC_CACHE_CHECK([whether backslash-a works in strings], ac_cv_c_backslash_a,
1017 char buf['\a' == 'a' ? -1 : 1];
1019 return buf[0] != "\a"[0];
1021 ac_cv_c_backslash_a=yes,
1022 ac_cv_c_backslash_a=no)])
1023 if test $ac_cv_c_backslash_a = yes; then
1024 AC_DEFINE(HAVE_C_BACKSLASH_A, 1,
1025 [Define if backslash-a works in C strings.])
1033 # BeOS 5 has <wchar.h> but does not define mbstate_t,
1034 # so you can't declare an object of that type.
1035 # Check for this incompatibility with Standard C.
1037 # Include stdlib.h first, because otherwise this test would fail on Linux
1038 # (at least glibc-2.1.3) because the "_XOPEN_SOURCE 500" definition elicits
1039 # a syntax error in wchar.h due to the use of undefined __int32_t.
1041 AC_DEFUN([AC_MBSTATE_T],
1043 AC_CHECK_HEADERS(stdlib.h)
1045 AC_CACHE_CHECK([for mbstate_t], ac_cv_type_mbstate_t,
1048 # include <stdlib.h>
1050 #include <wchar.h>],
1051 [mbstate_t x; return sizeof x;],
1052 ac_cv_type_mbstate_t=yes,
1053 ac_cv_type_mbstate_t=no)])
1054 if test $ac_cv_type_mbstate_t = no; then
1055 AC_DEFINE(mbstate_t, int,
1056 [Define to a type if <wchar.h> does not define.])
1061 dnl FIXME: put these prerequisite-only *.m4 files in a separate
1062 dnl directory -- otherwise, they'll conflict with existing files.
1064 dnl These are the prerequisite macros for GNU's error.c file.
1065 AC_DEFUN([jm_PREREQ_ERROR],
1067 AC_CHECK_FUNCS(strerror vprintf doprnt)
1068 AC_CHECK_DECLS([strerror])
1074 # Experimental replacement for the function in the latest CVS autoconf.
1075 # Use with the error.c file in ../lib.
1077 # Copyright 2001 Free Software Foundation, Inc.
1079 # This program is free software; you can redistribute it and/or modify
1080 # it under the terms of the GNU General Public License as published by
1081 # the Free Software Foundation; either version 2, or (at your option)
1082 # any later version.
1084 # This program is distributed in the hope that it will be useful,
1085 # but WITHOUT ANY WARRANTY; without even the implied warranty of
1086 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1087 # GNU General Public License for more details.
1089 # You should have received a copy of the GNU General Public License
1090 # along with this program; if not, write to the Free Software Foundation,
1091 # Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
1093 undefine([AC_FUNC_STRERROR_R])
1095 # AC_FUNC_STRERROR_R
1096 # ------------------
1097 AC_DEFUN([AC_FUNC_STRERROR_R],
1098 [AC_CHECK_DECLS([strerror_r])
1099 AC_CHECK_FUNCS([strerror_r])
1100 AC_CACHE_CHECK([whether strerror_r returns char *],
1101 ac_cv_func_strerror_r_char_p,
1103 ac_cv_func_strerror_r_char_p=no
1104 if test $ac_cv_have_decl_strerror_r = yes; then
1105 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([AC_INCLUDES_DEFAULT],
1108 char x = *strerror_r (0, buf, sizeof buf);
1109 char *p = strerror_r (0, buf, sizeof buf);
1111 ac_cv_func_strerror_r_char_p=yes)
1113 # strerror_r is not declared. Choose between
1114 # systems that have relatively inaccessible declarations for the
1115 # function. BeOS and DEC UNIX 4.0 fall in this category, but the
1116 # former has a strerror_r that returns char*, while the latter
1117 # has a strerror_r that returns `int'.
1118 # This test should segfault on the DEC system.
1119 AC_RUN_IFELSE([AC_LANG_PROGRAM([AC_INCLUDES_DEFAULT
1120 extern char *strerror_r ();],
1122 char x = *strerror_r (0, buf, sizeof buf);
1123 exit (!isalpha (x));]])],
1124 ac_cv_func_strerror_r_char_p=yes, , :)
1127 if test $ac_cv_func_strerror_r_char_p = yes; then
1128 AC_DEFINE([STRERROR_R_CHAR_P], 1,
1129 [Define to 1 if strerror_r returns char *.])
1131 ])# AC_FUNC_STRERROR_R
1136 AC_DEFUN([AM_WITH_DMALLOC],
1137 [AC_MSG_CHECKING([if malloc debugging is wanted])
1138 AC_ARG_WITH(dmalloc,
1139 [ --with-dmalloc use dmalloc, as in
1140 http://www.dmalloc.com/dmalloc.tar.gz],
1141 [if test "$withval" = yes; then
1143 AC_DEFINE(WITH_DMALLOC,1,
1144 [Define if using the dmalloc debugging malloc package])
1145 LIBS="$LIBS -ldmalloc"
1146 LDFLAGS="$LDFLAGS -g"
1149 fi], [AC_MSG_RESULT(no)])
1152 # Macro to add for using GNU gettext.
1153 # Ulrich Drepper <drepper@cygnus.com>, 1995.
1155 # This file can be copied and used freely without restrictions. It can
1156 # be used in projects which are not available under the GNU General Public
1157 # License or the GNU Library General Public License but which still want
1158 # to provide support for the GNU gettext functionality.
1159 # Please note that the actual code of the GNU gettext library is covered
1160 # by the GNU Library General Public License, and the rest of the GNU
1161 # gettext package package is covered by the GNU General Public License.
1162 # They are *not* in the public domain.
1166 dnl Usage: AM_WITH_NLS([TOOLSYMBOL], [NEEDSYMBOL], [LIBDIR]).
1167 dnl If TOOLSYMBOL is specified and is 'use-libtool', then a libtool library
1168 dnl $(top_builddir)/intl/libintl.la will be created (shared and/or static,
1169 dnl depending on --{enable,disable}-{shared,static} and on the presence of
1170 dnl AM-DISABLE-SHARED). Otherwise, a static library
1171 dnl $(top_builddir)/intl/libintl.a will be created.
1172 dnl If NEEDSYMBOL is specified and is 'need-ngettext', then GNU gettext
1173 dnl implementations (in libc or libintl) without the ngettext() function
1174 dnl will be ignored.
1175 dnl LIBDIR is used to find the intl libraries. If empty,
1176 dnl the value `$(top_builddir)/intl/' is used.
1178 dnl The result of the configuration is one of three cases:
1179 dnl 1) GNU gettext, as included in the intl subdirectory, will be compiled
1181 dnl Catalog format: GNU --> install in $(datadir)
1182 dnl Catalog extension: .mo after installation, .gmo in source tree
1183 dnl 2) GNU gettext has been found in the system's C library.
1184 dnl Catalog format: GNU --> install in $(datadir)
1185 dnl Catalog extension: .mo after installation, .gmo in source tree
1186 dnl 3) No internationalization, always use English msgid.
1187 dnl Catalog format: none
1188 dnl Catalog extension: none
1189 dnl The use of .gmo is historical (it was needed to avoid overwriting the
1190 dnl GNU format catalogs when building on a platform with an X/Open gettext),
1191 dnl but we keep it in order not to force irrelevant filename changes on the
1194 AC_DEFUN([AM_WITH_NLS],
1195 [AC_MSG_CHECKING([whether NLS is requested])
1196 dnl Default is enabled NLS
1198 [ --disable-nls do not use Native Language Support],
1199 USE_NLS=$enableval, USE_NLS=yes)
1200 AC_MSG_RESULT($USE_NLS)
1203 BUILD_INCLUDED_LIBINTL=no
1204 USE_INCLUDED_LIBINTL=no
1207 dnl If we use NLS figure out what method
1208 if test "$USE_NLS" = "yes"; then
1209 AC_DEFINE(ENABLE_NLS, 1,
1210 [Define to 1 if translation of program messages to the user's native language
1212 AC_MSG_CHECKING([whether included gettext is requested])
1213 AC_ARG_WITH(included-gettext,
1214 [ --with-included-gettext use the GNU gettext library included here],
1215 nls_cv_force_use_gnu_gettext=$withval,
1216 nls_cv_force_use_gnu_gettext=no)
1217 AC_MSG_RESULT($nls_cv_force_use_gnu_gettext)
1219 nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext"
1220 if test "$nls_cv_force_use_gnu_gettext" != "yes"; then
1221 dnl User does not insist on using GNU NLS library. Figure out what
1222 dnl to use. If GNU gettext is available we use this. Else we have
1223 dnl to fall back to GNU NLS library.
1226 dnl Add a version number to the cache macros.
1227 define(gt_cv_func_gnugettext_libc, [gt_cv_func_gnugettext]ifelse([$2], need-ngettext, 2, 1)[_libc])
1228 define(gt_cv_func_gnugettext_libintl, [gt_cv_func_gnugettext]ifelse([$2], need-ngettext, 2, 1)[_libintl])
1230 AC_CHECK_HEADER(libintl.h,
1231 [AC_CACHE_CHECK([for GNU gettext in libc], gt_cv_func_gnugettext_libc,
1232 [AC_TRY_LINK([#include <libintl.h>
1233 extern int _nl_msg_cat_cntr;],
1234 [bindtextdomain ("", "");
1235 return (int) gettext ("")]ifelse([$2], need-ngettext, [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr],
1236 gt_cv_func_gnugettext_libc=yes,
1237 gt_cv_func_gnugettext_libc=no)])
1239 if test "$gt_cv_func_gnugettext_libc" != "yes"; then
1240 AC_CACHE_CHECK([for GNU gettext in libintl],
1241 gt_cv_func_gnugettext_libintl,
1242 [gt_save_LIBS="$LIBS"
1243 LIBS="$LIBS -lintl $LIBICONV"
1244 AC_TRY_LINK([#include <libintl.h>
1245 extern int _nl_msg_cat_cntr;],
1246 [bindtextdomain ("", "");
1247 return (int) gettext ("")]ifelse([$2], need-ngettext, [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr],
1248 gt_cv_func_gnugettext_libintl=yes,
1249 gt_cv_func_gnugettext_libintl=no)
1250 LIBS="$gt_save_LIBS"])
1253 dnl If an already present or preinstalled GNU gettext() is found,
1254 dnl use it. But if this macro is used in GNU gettext, and GNU
1255 dnl gettext is already preinstalled in libintl, we update this
1256 dnl libintl. (Cf. the install rule in intl/Makefile.in.)
1257 if test "$gt_cv_func_gnugettext_libc" = "yes" \
1258 || { test "$gt_cv_func_gnugettext_libintl" = "yes" \
1259 && test "$PACKAGE" != gettext; }; then
1260 AC_DEFINE(HAVE_GETTEXT, 1,
1261 [Define if the GNU gettext() function is already present or preinstalled.])
1263 if test "$gt_cv_func_gnugettext_libintl" = "yes"; then
1264 dnl If iconv() is in a separate libiconv library, then anyone
1265 dnl linking with libintl{.a,.so} also needs to link with
1267 INTLLIBS="-lintl $LIBICONV"
1270 gt_save_LIBS="$LIBS"
1271 LIBS="$LIBS $INTLLIBS"
1272 AC_CHECK_FUNCS(dcgettext)
1273 LIBS="$gt_save_LIBS"
1275 dnl Search for GNU msgfmt in the PATH.
1276 AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
1277 [$ac_dir/$ac_word --statistics /dev/null >/dev/null 2>&1], :)
1278 AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
1280 dnl Search for GNU xgettext in the PATH.
1281 AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
1282 [$ac_dir/$ac_word --omit-header /dev/null >/dev/null 2>&1], :)
1288 if test "$CATOBJEXT" = "NONE"; then
1289 dnl GNU gettext is not found in the C library.
1290 dnl Fall back on GNU gettext library.
1291 nls_cv_use_gnu_gettext=yes
1295 if test "$nls_cv_use_gnu_gettext" = "yes"; then
1296 dnl Mark actions used to generate GNU NLS library.
1297 INTLOBJS="\$(GETTOBJS)"
1298 AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
1299 [$ac_dir/$ac_word --statistics /dev/null >/dev/null 2>&1], :)
1300 AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
1301 AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
1302 [$ac_dir/$ac_word --omit-header /dev/null >/dev/null 2>&1], :)
1304 BUILD_INCLUDED_LIBINTL=yes
1305 USE_INCLUDED_LIBINTL=yes
1307 INTLLIBS="ifelse([$3],[],\$(top_builddir)/intl,[$3])/libintl.ifelse([$1], use-libtool, [l], [])a $LIBICONV"
1308 LIBS=`echo " $LIBS " | sed -e 's/ -lintl / /' -e 's/^ //' -e 's/ $//'`
1311 dnl This could go away some day; the PATH_PROG_WITH_TEST already does it.
1312 dnl Test whether we really found GNU msgfmt.
1313 if test "$GMSGFMT" != ":"; then
1314 dnl If it is no GNU msgfmt we define it as : so that the
1315 dnl Makefiles still can work.
1316 if $GMSGFMT --statistics /dev/null >/dev/null 2>&1; then
1320 [found msgfmt program is not GNU msgfmt; ignore it])
1325 dnl This could go away some day; the PATH_PROG_WITH_TEST already does it.
1326 dnl Test whether we really found GNU xgettext.
1327 if test "$XGETTEXT" != ":"; then
1328 dnl If it is no GNU xgettext we define it as : so that the
1329 dnl Makefiles still can work.
1330 if $XGETTEXT --omit-header /dev/null >/dev/null 2>&1; then
1334 [found xgettext program is not GNU xgettext; ignore it])
1339 dnl We need to process the po/ directory.
1343 [for ac_file in $CONFIG_FILES; do
1344 # Support "outfile[:infile[:infile...]]"
1346 *:*) ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
1348 # PO directories have a Makefile.in generated from Makefile.in.in.
1349 case "$ac_file" in */Makefile.in)
1350 # Adjust a relative srcdir.
1351 ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'`
1352 ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`"
1353 ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'`
1354 # In autoconf-2.13 it is called $ac_given_srcdir.
1355 # In autoconf-2.50 it is called $srcdir.
1356 test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir"
1357 case "$ac_given_srcdir" in
1358 .) top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;;
1359 /*) top_srcdir="$ac_given_srcdir" ;;
1360 *) top_srcdir="$ac_dots$ac_given_srcdir" ;;
1362 if test -f "$ac_given_srcdir/$ac_dir/POTFILES.in"; then
1363 rm -f "$ac_dir/POTFILES"
1364 test -n "$as_me" && echo "$as_me: creating $ac_dir/POTFILES" || echo "creating $ac_dir/POTFILES"
1365 sed -e "/^#/d" -e "/^[ ]*\$/d" -e "s,.*, $top_srcdir/& \\\\," -e "\$s/\(.*\) \\\\/\1/" < "$ac_given_srcdir/$ac_dir/POTFILES.in" > "$ac_dir/POTFILES"
1366 test -n "$as_me" && echo "$as_me: creating $ac_dir/Makefile" || echo "creating $ac_dir/Makefile"
1367 sed -e "/POTFILES =/r $ac_dir/POTFILES" "$ac_dir/Makefile.in" > "$ac_dir/Makefile"
1374 dnl If this is used in GNU gettext we have to set BUILD_INCLUDED_LIBINTL
1375 dnl to 'yes' because some of the testsuite requires it.
1376 if test "$PACKAGE" = gettext; then
1377 BUILD_INCLUDED_LIBINTL=yes
1380 dnl intl/plural.c is generated from intl/plural.y. It requires bison,
1381 dnl because plural.y uses bison specific features. It requires at least
1382 dnl bison-1.26 because earlier versions generate a plural.c that doesn't
1384 dnl bison is only needed for the maintainer (who touches plural.y). But in
1385 dnl order to avoid separate Makefiles or --enable-maintainer-mode, we put
1386 dnl the rule in general Makefile. Now, some people carelessly touch the
1387 dnl files or have a broken "make" program, hence the plural.c rule will
1388 dnl sometimes fire. To avoid an error, defines BISON to ":" if it is not
1389 dnl present or too old.
1390 AC_CHECK_PROGS([INTLBISON], [bison])
1391 if test -z "$INTLBISON"; then
1394 dnl Found it, now check the version.
1395 AC_MSG_CHECKING([version of bison])
1396 changequote(<<,>>)dnl
1397 ac_prog_version=`$INTLBISON --version 2>&1 | sed -n 's/^.*GNU Bison.* \([0-9]*\.[0-9.]*\).*$/\1/p'`
1398 case $ac_prog_version in
1399 '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;;
1400 1.2[6-9]* | 1.[3-9][0-9]* | [2-9].*)
1402 ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;;
1403 *) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;;
1405 AC_MSG_RESULT([$ac_prog_version])
1407 if test $ac_verc_fail = yes; then
1411 dnl These rules are solely for the distribution goal. While doing this
1412 dnl we only have to keep exactly one list of the available catalogs
1413 dnl in configure.in.
1414 for lang in $ALL_LINGUAS; do
1415 GMOFILES="$GMOFILES $lang.gmo"
1416 POFILES="$POFILES $lang.po"
1419 dnl Make all variables we use known to autoconf.
1420 AC_SUBST(BUILD_INCLUDED_LIBINTL)
1421 AC_SUBST(USE_INCLUDED_LIBINTL)
1430 dnl For backward compatibility. Some configure.ins may be using this.
1432 nls_cv_header_libgt=
1434 dnl For backward compatibility. Some Makefiles may be using this.
1436 AC_SUBST(DATADIRNAME)
1438 dnl For backward compatibility. Some Makefiles may be using this.
1440 AC_SUBST(INSTOBJEXT)
1442 dnl For backward compatibility. Some Makefiles may be using this.
1447 dnl Usage: Just like AM_WITH_NLS, which see.
1448 AC_DEFUN([AM_GNU_GETTEXT],
1449 [AC_REQUIRE([AC_PROG_MAKE_SET])dnl
1450 AC_REQUIRE([AC_PROG_CC])dnl
1451 AC_REQUIRE([AC_CANONICAL_HOST])dnl
1452 AC_REQUIRE([AC_PROG_RANLIB])dnl
1453 AC_REQUIRE([AC_ISC_POSIX])dnl
1454 AC_REQUIRE([AC_HEADER_STDC])dnl
1455 AC_REQUIRE([AC_C_CONST])dnl
1456 AC_REQUIRE([AC_C_INLINE])dnl
1457 AC_REQUIRE([AC_TYPE_OFF_T])dnl
1458 AC_REQUIRE([AC_TYPE_SIZE_T])dnl
1459 AC_REQUIRE([AC_FUNC_ALLOCA])dnl
1460 AC_REQUIRE([AC_FUNC_MMAP])dnl
1461 AC_REQUIRE([jm_GLIBC21])dnl
1463 AC_CHECK_HEADERS([argz.h limits.h locale.h nl_types.h malloc.h stddef.h \
1464 stdlib.h string.h unistd.h sys/param.h])
1465 AC_CHECK_FUNCS([feof_unlocked fgets_unlocked getcwd getegid geteuid \
1466 getgid getuid mempcpy munmap putenv setenv setlocale stpcpy strchr strcasecmp \
1467 strdup strtoul tsearch __argz_count __argz_stringify __argz_next])
1472 AM_WITH_NLS([$1],[$2],[$3])
1474 if test "x$CATOBJEXT" != "x"; then
1475 if test "x$ALL_LINGUAS" = "x"; then
1478 AC_MSG_CHECKING(for catalogs to be installed)
1480 for presentlang in $ALL_LINGUAS; do
1482 for desiredlang in ${LINGUAS-$ALL_LINGUAS}; do
1483 # Use the presentlang catalog if desiredlang is
1484 # a. equal to presentlang, or
1485 # b. a variant of presentlang (because in this case,
1486 # presentlang can be used as a fallback for messages
1487 # which are not translated in the desiredlang catalog).
1488 case "$desiredlang" in
1489 "$presentlang"*) useit=yes;;
1492 if test $useit = yes; then
1493 NEW_LINGUAS="$NEW_LINGUAS $presentlang"
1496 LINGUAS=$NEW_LINGUAS
1497 AC_MSG_RESULT($LINGUAS)
1500 dnl Construct list of names of catalog files to be constructed.
1501 if test -n "$LINGUAS"; then
1502 for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done
1506 dnl If the AC_CONFIG_AUX_DIR macro for autoconf is used we possibly
1507 dnl find the mkinstalldirs script in another subdir but $(top_srcdir).
1508 dnl Try to locate is.
1510 if test -n "$ac_aux_dir"; then
1511 MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs"
1513 if test -z "$MKINSTALLDIRS"; then
1514 MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs"
1516 AC_SUBST(MKINSTALLDIRS)
1518 dnl Enable libtool support if the surrounding package wishes it.
1519 INTL_LIBTOOL_SUFFIX_PREFIX=ifelse([$1], use-libtool, [l], [])
1520 AC_SUBST(INTL_LIBTOOL_SUFFIX_PREFIX)
1523 # Search path for a program which passes the given test.
1524 # Ulrich Drepper <drepper@cygnus.com>, 1996.
1526 # This file can be copied and used freely without restrictions. It can
1527 # be used in projects which are not available under the GNU General Public
1528 # License or the GNU Library General Public License but which still want
1529 # to provide support for the GNU gettext functionality.
1530 # Please note that the actual code of the GNU gettext library is covered
1531 # by the GNU Library General Public License, and the rest of the GNU
1532 # gettext package package is covered by the GNU General Public License.
1533 # They are *not* in the public domain.
1537 dnl AM_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR,
1538 dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
1539 AC_DEFUN([AM_PATH_PROG_WITH_TEST],
1540 [# Extract the first word of "$2", so it can be a program name with args.
1541 set dummy $2; ac_word=[$]2
1542 AC_MSG_CHECKING([for $ac_word])
1543 AC_CACHE_VAL(ac_cv_path_$1,
1546 ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
1549 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
1550 for ac_dir in ifelse([$5], , $PATH, [$5]); do
1551 test -z "$ac_dir" && ac_dir=.
1552 if test -f $ac_dir/$ac_word; then
1554 ac_cv_path_$1="$ac_dir/$ac_word"
1560 dnl If no 4th arg is given, leave the cache variable unset,
1561 dnl so AC_PATH_PROGS will keep looking.
1562 ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
1567 if test ifelse([$4], , [-n "[$]$1"], ["[$]$1" != "$4"]); then
1568 AC_MSG_RESULT([$]$1)
1577 # Test for the GNU C Library, version 2.1 or newer.
1578 # From Bruno Haible.
1580 AC_DEFUN([jm_GLIBC21],
1582 AC_CACHE_CHECK(whether we are using the GNU C Library 2.1 or newer,
1583 ac_cv_gnu_library_2_1,
1584 [AC_EGREP_CPP([Lucky GNU user],
1586 #include <features.h>
1587 #ifdef __GNU_LIBRARY__
1588 #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1) || (__GLIBC__ > 2)
1593 ac_cv_gnu_library_2_1=yes,
1594 ac_cv_gnu_library_2_1=no)
1598 GLIBC21="$ac_cv_gnu_library_2_1"
1604 dnl From Bruno Haible.
1606 AC_DEFUN([AM_ICONV],
1608 dnl Some systems have iconv in libc, some have it in libiconv (OSF/1 and
1609 dnl those with the standalone portable GNU libiconv installed).
1611 AC_ARG_WITH([libiconv-prefix],
1612 [ --with-libiconv-prefix=DIR search for libiconv in DIR/include and DIR/lib], [
1613 for dir in `echo "$withval" | tr : ' '`; do
1614 if test -d $dir/include; then CPPFLAGS="$CPPFLAGS -I$dir/include"; fi
1615 if test -d $dir/lib; then LDFLAGS="$LDFLAGS -L$dir/lib"; fi
1619 AC_CACHE_CHECK(for iconv, am_cv_func_iconv, [
1620 am_cv_func_iconv="no, consider installing GNU libiconv"
1622 AC_TRY_LINK([#include <stdlib.h>
1623 #include <iconv.h>],
1624 [iconv_t cd = iconv_open("","");
1625 iconv(cd,NULL,NULL,NULL,NULL);
1627 am_cv_func_iconv=yes)
1628 if test "$am_cv_func_iconv" != yes; then
1629 am_save_LIBS="$LIBS"
1630 LIBS="$LIBS -liconv"
1631 AC_TRY_LINK([#include <stdlib.h>
1632 #include <iconv.h>],
1633 [iconv_t cd = iconv_open("","");
1634 iconv(cd,NULL,NULL,NULL,NULL);
1637 am_cv_func_iconv=yes)
1638 LIBS="$am_save_LIBS"
1641 if test "$am_cv_func_iconv" = yes; then
1642 AC_DEFINE(HAVE_ICONV, 1, [Define if you have the iconv() function.])
1643 AC_MSG_CHECKING([for iconv declaration])
1644 AC_CACHE_VAL(am_cv_proto_iconv, [
1652 #if defined(__STDC__) || defined(__cplusplus)
1653 size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
1657 ], [], am_cv_proto_iconv_arg1="", am_cv_proto_iconv_arg1="const")
1658 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);"])
1659 am_cv_proto_iconv=`echo "[$]am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'`
1660 AC_MSG_RESULT([$]{ac_t:-
1661 }[$]am_cv_proto_iconv)
1662 AC_DEFINE_UNQUOTED(ICONV_CONST, $am_cv_proto_iconv_arg1,
1663 [Define as const if the declaration of iconv() needs const.])
1666 if test "$am_cv_lib_iconv" = yes; then
1674 dnl From Bruno Haible.
1676 AC_DEFUN([AM_LANGINFO_CODESET],
1678 AC_CACHE_CHECK([for nl_langinfo and CODESET], am_cv_langinfo_codeset,
1679 [AC_TRY_LINK([#include <langinfo.h>],
1680 [char* cs = nl_langinfo(CODESET);],
1681 am_cv_langinfo_codeset=yes,
1682 am_cv_langinfo_codeset=no)
1684 if test $am_cv_langinfo_codeset = yes; then
1685 AC_DEFINE(HAVE_LANGINFO_CODESET, 1,
1686 [Define if you have <langinfo.h> and nl_langinfo(CODESET).])
1690 # Check whether LC_MESSAGES is available in <locale.h>.
1691 # Ulrich Drepper <drepper@cygnus.com>, 1995.
1693 # This file can be copied and used freely without restrictions. It can
1694 # be used in projects which are not available under the GNU General Public
1695 # License or the GNU Library General Public License but which still want
1696 # to provide support for the GNU gettext functionality.
1697 # Please note that the actual code of the GNU gettext library is covered
1698 # by the GNU Library General Public License, and the rest of the GNU
1699 # gettext package package is covered by the GNU General Public License.
1700 # They are *not* in the public domain.
1704 AC_DEFUN([AM_LC_MESSAGES],
1705 [if test $ac_cv_header_locale_h = yes; then
1706 AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES,
1707 [AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
1708 am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)])
1709 if test $am_cv_val_LC_MESSAGES = yes; then
1710 AC_DEFINE(HAVE_LC_MESSAGES, 1,
1711 [Define if your <locale.h> file defines LC_MESSAGES.])