1 # aclocal.m4 generated automatically by aclocal 1.5a
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])
161 # Copyright 1997, 1999, 2000, 2001 Free Software Foundation, Inc.
163 # This program is free software; you can redistribute it and/or modify
164 # it under the terms of the GNU General Public License as published by
165 # the Free Software Foundation; either version 2, or (at your option)
168 # This program is distributed in the hope that it will be useful,
169 # but WITHOUT ANY WARRANTY; without even the implied warranty of
170 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
171 # GNU General Public License for more details.
173 # You should have received a copy of the GNU General Public License
174 # along with this program; if not, write to the Free Software
175 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
180 # AM_MISSING_PROG(NAME, PROGRAM)
181 # ------------------------------
182 AC_DEFUN([AM_MISSING_PROG],
183 [AC_REQUIRE([AM_MISSING_HAS_RUN])
184 $1=${$1-"${am_missing_run}$2"}
190 # Define MISSING if not defined so far and test if it supports --run.
191 # If it does, set am_missing_run to use it, otherwise, to nothing.
192 AC_DEFUN([AM_MISSING_HAS_RUN],
193 [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
194 test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
195 # Use eval to expand $SHELL
196 if eval "$MISSING --run true"; then
197 am_missing_run="$MISSING --run "
201 AC_MSG_WARN([${am_backtick}missing' script is too old or missing])
207 # Copyright 2001 Free Software Foundation, Inc.
209 # This program is free software; you can redistribute it and/or modify
210 # it under the terms of the GNU General Public License as published by
211 # the Free Software Foundation; either version 2, or (at your option)
214 # This program is distributed in the hope that it will be useful,
215 # but WITHOUT ANY WARRANTY; without even the implied warranty of
216 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
217 # GNU General Public License for more details.
219 # You should have received a copy of the GNU General Public License
220 # along with this program; if not, write to the Free Software
221 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
224 # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
225 # $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to
226 # `$srcdir', `$srcdir/..', or `$srcdir/../..'.
228 # Of course, Automake must honor this variable whenever it calls a
229 # tool from the auxiliary directory. The problem is that $srcdir (and
230 # therefore $ac_aux_dir as well) can be either absolute or relative,
231 # depending on how configure is run. This is pretty annoying, since
232 # it makes $ac_aux_dir quite unusable in subdirectories: in the top
233 # source directory, any form will work fine, but in subdirectories a
234 # relative path needs to be adjusted first.
236 # $ac_aux_dir/missing
237 # fails when called from a subdirectory if $ac_aux_dir is relative
238 # $top_srcdir/$ac_aux_dir/missing
239 # fails if $ac_aux_dir is absolute,
240 # fails when called from a subdirectory in a VPATH build with
241 # a relative $ac_aux_dir
243 # The reason of the latter failure is that $top_srcdir and $ac_aux_dir
244 # are both prefixed by $srcdir. In an in-source build this is usually
245 # harmless because $srcdir is `.', but things will broke when you
246 # start a VPATH build or use an absolute $srcdir.
248 # So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
249 # iff we strip the leading $srcdir from $ac_aux_dir. That would be:
250 # am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
251 # and then we would define $MISSING as
252 # MISSING="\${SHELL} $am_aux_dir/missing"
253 # This will work as long as MISSING is not called from configure, because
254 # unfortunately $(top_srcdir) has no meaning in configure.
255 # However there are other variables, like CC, which are often used in
256 # configure, and could therefore not use this "fixed" $ac_aux_dir.
258 # Another solution, used here, is to always expand $ac_aux_dir to an
259 # absolute PATH. The drawback is that using absolute paths prevent a
260 # configured tree to be moved without reconfiguration.
262 # Rely on autoconf to set up CDPATH properly.
265 AC_DEFUN([AM_AUX_DIR_EXPAND], [
266 # expand $ac_aux_dir to an absolute path
267 am_aux_dir=`cd $ac_aux_dir && pwd`
272 # Define $install_sh.
274 # Copyright 2001 Free Software Foundation, Inc.
276 # This program is free software; you can redistribute it and/or modify
277 # it under the terms of the GNU General Public License as published by
278 # the Free Software Foundation; either version 2, or (at your option)
281 # This program is distributed in the hope that it will be useful,
282 # but WITHOUT ANY WARRANTY; without even the implied warranty of
283 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
284 # GNU General Public License for more details.
286 # You should have received a copy of the GNU General Public License
287 # along with this program; if not, write to the Free Software
288 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
291 AC_DEFUN([AM_PROG_INSTALL_SH],
292 [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
293 install_sh=${install_sh-"$am_aux_dir/install-sh"}
294 AC_SUBST(install_sh)])
296 # AM_PROG_INSTALL_STRIP
298 # Copyright 2001 Free Software Foundation, Inc.
300 # This program is free software; you can redistribute it and/or modify
301 # it under the terms of the GNU General Public License as published by
302 # the Free Software Foundation; either version 2, or (at your option)
305 # This program is distributed in the hope that it will be useful,
306 # but WITHOUT ANY WARRANTY; without even the implied warranty of
307 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
308 # GNU General Public License for more details.
310 # You should have received a copy of the GNU General Public License
311 # along with this program; if not, write to the Free Software
312 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
315 # One issue with vendor `install' (even GNU) is that you can't
316 # specify the program used to strip binaries. This is especially
317 # annoying in cross-compiling environments, where the build's strip
318 # is unlikely to handle the host's binaries.
319 # Fortunately install-sh will honor a STRIPPROG variable, so we
320 # always use install-sh in `make install-strip', and initialize
321 # STRIPPROG with the value of the STRIP variable (set by the user).
322 AC_DEFUN([AM_PROG_INSTALL_STRIP],
323 [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
324 INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s"
325 AC_SUBST([INSTALL_STRIP_PROGRAM])])
327 # serial 4 -*- Autoconf -*-
329 # Copyright 1999, 2000, 2001 Free Software Foundation, Inc.
331 # This program is free software; you can redistribute it and/or modify
332 # it under the terms of the GNU General Public License as published by
333 # the Free Software Foundation; either version 2, or (at your option)
336 # This program is distributed in the hope that it will be useful,
337 # but WITHOUT ANY WARRANTY; without even the implied warranty of
338 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
339 # GNU General Public License for more details.
341 # You should have received a copy of the GNU General Public License
342 # along with this program; if not, write to the Free Software
343 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
347 # There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
348 # written in clear, in which case automake, when reading aclocal.m4,
349 # will think it sees a *use*, and therefore will trigger all it's
350 # C support machinery. Also note that it means that autoscan, seeing
351 # CC etc. in the Makefile, will ask for an AC_PROG_CC use...
355 # _AM_DEPENDENCIES(NAME)
356 # ---------------------
357 # See how the compiler implements dependency checking.
358 # NAME is "CC", "CXX" or "OBJC".
359 # We try a few techniques and use that to set a single cache variable.
361 # We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
362 # modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
363 # dependency, and given that the user is not expected to run this macro,
364 # just rely on AC_PROG_CC.
365 AC_DEFUN([_AM_DEPENDENCIES],
366 [AC_REQUIRE([AM_SET_DEPDIR])dnl
367 AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
368 AC_REQUIRE([AM_MAKE_INCLUDE])dnl
369 AC_REQUIRE([AM_DEP_TRACK])dnl
371 ifelse([$1], CC, [depcc="$CC" am_compiler_list=],
372 [$1], CXX, [depcc="$CXX" am_compiler_list=],
373 [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc']
374 [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'],
375 [depcc="$$1" am_compiler_list=])
377 AC_CACHE_CHECK([dependency style of $depcc],
378 [am_cv_$1_dependencies_compiler_type],
379 [if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
380 # We make a subdir and do the tests there. Otherwise we can end up
381 # making bogus files that we don't know about and never remove. For
382 # instance it was reported that on HP-UX the gcc test will end up
383 # making a dummy file named `D' -- because `-MD' means `put the output
386 # Copy depcomp to subdir because otherwise we won't find it if we're
387 # using a relative directory.
388 cp "$am_depcomp" conftest.dir
391 am_cv_$1_dependencies_compiler_type=none
392 if test "$am_compiler_list" = ""; then
393 am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
395 for depmode in $am_compiler_list; do
396 # We need to recreate these files for each test, as the compiler may
397 # overwrite some of them when testing with obscure command lines.
398 # This happens at least with the AIX C compiler.
399 echo '#include "conftest.h"' > conftest.c
400 echo 'int i;' > conftest.h
401 echo "${am__include} ${am__quote}conftest.Po${am__quote}" > confmf
405 # after this tag, mechanisms are not by side-effect, so they'll
406 # only be used when explicitly requested
407 if test "x$enable_dependency_tracking" = xyes; then
415 # We check with `-c' and `-o' for the sake of the "dashmstdout"
416 # mode. It turns out that the SunPro C++ compiler does not properly
417 # handle `-M -o', and we need to detect this.
418 if depmode=$depmode \
419 source=conftest.c object=conftest.o \
420 depfile=conftest.Po tmpdepfile=conftest.TPo \
421 $SHELL ./depcomp $depcc -c conftest.c -o conftest.o >/dev/null 2>&1 &&
422 grep conftest.h conftest.Po > /dev/null 2>&1 &&
423 ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
424 am_cv_$1_dependencies_compiler_type=$depmode
432 am_cv_$1_dependencies_compiler_type=none
435 $1DEPMODE="depmode=$am_cv_$1_dependencies_compiler_type"
436 AC_SUBST([$1DEPMODE])
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 pushdef([subst], defn([AC_SUBST]))
470 subst(AMDEPBACKSLASH)
474 # Generate code to set up dependency tracking.
476 # Copyright 1999, 2000, 2001 Free Software Foundation, Inc.
478 # This program is free software; you can redistribute it and/or modify
479 # it under the terms of the GNU General Public License as published by
480 # the Free Software Foundation; either version 2, or (at your option)
483 # This program is distributed in the hope that it will be useful,
484 # but WITHOUT ANY WARRANTY; without even the implied warranty of
485 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
486 # GNU General Public License for more details.
488 # You should have received a copy of the GNU General Public License
489 # along with this program; if not, write to the Free Software
490 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
493 # This macro should only be invoked once -- use via AC_REQUIRE.
495 # AM_OUTPUT_DEPENDENCY_COMMANDS
498 # This code is only required when automatic dependency tracking
499 # is enabled. FIXME. This creates each `.P' file that we will
500 # need in order to bootstrap the dependency handling code.
501 AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],[
503 test x"$AMDEP_TRUE" != x"" ||
504 for mf in $CONFIG_FILES; do
506 Makefile) dirpart=.;;
507 */Makefile) dirpart=`echo "$mf" | sed -e 's|/[^/]*$||'`;;
510 grep '^DEP_FILES *= *[^ #]' < "$mf" > /dev/null || continue
511 # Extract the definition of DEP_FILES from the Makefile without
513 DEPDIR=`sed -n -e '/^DEPDIR = / s///p' < "$mf"`
514 test -z "$DEPDIR" && continue
515 # When using ansi2knr, U may be empty or an underscore; expand it
516 U=`sed -n -e '/^U = / s///p' < "$mf"`
517 test -d "$dirpart/$DEPDIR" || mkdir "$dirpart/$DEPDIR"
518 # We invoke sed twice because it is the simplest approach to
519 # changing $(DEPDIR) to its actual value in the expansion.
520 for file in `sed -n -e '
521 /^DEP_FILES = .*\\\\$/ {
530 /^DEP_FILES = / s/^DEP_FILES = //p' < "$mf" | \
531 sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
532 # Make sure the directory exists.
533 test -f "$dirpart/$file" && continue
534 fdir=`echo "$file" | sed -e 's|/[^/]*$||'`
535 $ac_aux_dir/mkinstalldirs "$dirpart/$fdir" > /dev/null 2>&1
536 # echo "creating $dirpart/$file"
537 echo '# dummy' > "$dirpart/$file"
540 ], [AMDEP_TRUE="$AMDEP_TRUE"
541 ac_aux_dir="$ac_aux_dir"])])
545 # Check to see how make treats includes.
547 # Copyright 2001 Free Software Foundation, Inc.
549 # This program is free software; you can redistribute it and/or modify
550 # it under the terms of the GNU General Public License as published by
551 # the Free Software Foundation; either version 2, or (at your option)
554 # This program is distributed in the hope that it will be useful,
555 # but WITHOUT ANY WARRANTY; without even the implied warranty of
556 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
557 # GNU General Public License for more details.
559 # You should have received a copy of the GNU General Public License
560 # along with this program; if not, write to the Free Software
561 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
564 AC_DEFUN([AM_MAKE_INCLUDE],
565 [am_make=${MAKE-make}
566 cat > confinc << 'END'
570 # If we don't find an include directive, just comment out the code.
571 AC_MSG_CHECKING([for style of include used by $am_make])
575 # First try GNU make style include.
576 echo "include confinc" > confmf
577 # We grep out `Entering directory' and `Leaving directory'
578 # messages which can occur if `w' ends up in MAKEFLAGS.
579 # In particular we don't look at `^make:' because GNU make might
580 # be invoked under some other name (usually "gmake"), in which
581 # case it prints its new name instead of `make'.
582 if test "`$am_make -s -f confmf 2> /dev/null | fgrep -v 'ing directory'`" = "done"; then
587 # Now try BSD make style include.
588 if test "$am__include" = "#"; then
589 echo '.include "confinc"' > confmf
590 if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
596 AC_SUBST(am__include)
598 AC_MSG_RESULT($_am_result)
602 # AM_CONDITIONAL -*- Autoconf -*-
604 # Copyright 1997, 2000, 2001 Free Software Foundation, Inc.
606 # This program is free software; you can redistribute it and/or modify
607 # it under the terms of the GNU General Public License as published by
608 # the Free Software Foundation; either version 2, or (at your option)
611 # This program is distributed in the hope that it will be useful,
612 # but WITHOUT ANY WARRANTY; without even the implied warranty of
613 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
614 # GNU General Public License for more details.
616 # You should have received a copy of the GNU General Public License
617 # along with this program; if not, write to the Free Software
618 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
625 # AM_CONDITIONAL(NAME, SHELL-CONDITION)
626 # -------------------------------------
627 # Define a conditional.
628 AC_DEFUN([AM_CONDITIONAL],
629 [ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])],
630 [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
641 # Like AC_CONFIG_HEADER, but automatically create stamp file. -*- Autoconf -*-
643 # Copyright 1996, 1997, 2000, 2001 Free Software Foundation, Inc.
645 # This program is free software; you can redistribute it and/or modify
646 # it under the terms of the GNU General Public License as published by
647 # the Free Software Foundation; either version 2, or (at your option)
650 # This program is distributed in the hope that it will be useful,
651 # but WITHOUT ANY WARRANTY; without even the implied warranty of
652 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
653 # GNU General Public License for more details.
655 # You should have received a copy of the GNU General Public License
656 # along with this program; if not, write to the Free Software
657 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
662 # When config.status generates a header, we must update the stamp-h file.
663 # This file resides in the same directory as the config header
664 # that is generated. We must strip everything past the first ":",
665 # and everything past the last "/".
669 AC_DEFUN([AM_CONFIG_HEADER],
670 [dnl init our file count if it isn't already
671 m4_ifndef([_AM_Config_Header_Index], m4_define([_AM_Config_Header_Index], [0]))
672 dnl prepare to store our destination file list for use in config.status
673 AC_FOREACH([_AM_File], [$1],
674 [m4_pushdef([_AM_Dest], m4_patsubst(_AM_File, [:.*]))
675 m4_define([_AM_Config_Header_Index],
676 m4_incr(_AM_Config_Header_Index))
677 dnl and add it to the list of files AC keeps track of, along
679 AC_CONFIG_HEADERS(_AM_File,
680 [# update the timestamp
681 echo timestamp >"AS_ESCAPE(_AM_DIRNAME(]_AM_Dest[))/stamp-h]_AM_Config_Header_Index["
682 ][$2]m4_ifval([$3], [, [$3]]))
683 m4_popdef([_AM_Dest])])
684 ]) # AM_CONFIG_HEADER
688 # Like AS_DIRNAME, only do it during macro expansion
689 AC_DEFUN([_AM_DIRNAME],
690 [m4_if(regexp([$1], [^.*[^/]//*[^/][^/]*/*$]), -1,
691 m4_if(regexp([$1], [^//\([^/]\|$\)]), -1,
692 m4_if(regexp([$1], [^/.*]), -1,
694 patsubst([$1], [^\(/\).*], [\1])),
695 patsubst([$1], [^\(//\)\([^/].*\|$\)], [\1])),
696 patsubst([$1], [^\(.*[^/]\)//*[^/][^/]*/*$], [\1]))[]dnl
700 # This test replaces the one in autoconf.
701 # Currently this macro should have the same name as the autoconf macro
702 # because gettext's gettext.m4 (distributed in the automake package)
703 # still uses it. Otherwise, the use in gettext.m4 makes autoheader
704 # give these diagnostics:
705 # configure.in:556: AC_TRY_COMPILE was called before AC_ISC_POSIX
706 # configure.in:556: AC_TRY_RUN was called before AC_ISC_POSIX
708 undefine([AC_ISC_POSIX])
710 AC_DEFUN([AC_ISC_POSIX],
712 dnl This test replaces the obsolescent AC_ISC_POSIX kludge.
713 AC_CHECK_LIB(cposix, strerror, [LIBS="$LIBS -lcposix"])
718 # Copyright 1996, 1997, 1999, 2000, 2001 Free Software Foundation, Inc.
720 # This program is free software; you can redistribute it and/or modify
721 # it under the terms of the GNU General Public License as published by
722 # the Free Software Foundation; either version 2, or (at your option)
725 # This program is distributed in the hope that it will be useful,
726 # but WITHOUT ANY WARRANTY; without even the implied warranty of
727 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
728 # GNU General Public License for more details.
730 # You should have received a copy of the GNU General Public License
731 # along with this program; if not, write to the Free Software
732 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
737 # @defmac AC_PROG_CC_STDC
738 # @maindex PROG_CC_STDC
740 # If the C compiler in not in ANSI C mode by default, try to add an option
741 # to output variable @code{CC} to make it so. This macro tries various
742 # options that select ANSI C on some system or another. It considers the
743 # compiler to be in ANSI C mode if it handles function prototypes correctly.
745 # If you use this macro, you should check after calling it whether the C
746 # compiler has been set to accept ANSI C; if not, the shell variable
747 # @code{am_cv_prog_cc_stdc} is set to @samp{no}. If you wrote your source
748 # code in ANSI C, you can make an un-ANSIfied copy of it by using the
749 # program @code{ansi2knr}, which comes with Ghostscript.
752 AC_DEFUN([AM_PROG_CC_STDC],
753 [AC_REQUIRE([AC_PROG_CC])
754 AC_BEFORE([$0], [AC_C_INLINE])
755 AC_BEFORE([$0], [AC_C_CONST])
756 dnl Force this before AC_PROG_CPP. Some cpp's, eg on HPUX, require
757 dnl a magic option to avoid problems with ANSI preprocessor commands
759 dnl FIXME: can't do this because then AC_AIX won't work due to a
760 dnl circular dependency.
761 dnl AC_BEFORE([$0], [AC_PROG_CPP])
762 AC_MSG_CHECKING([for ${CC-cc} option to accept ANSI C])
763 AC_CACHE_VAL(am_cv_prog_cc_stdc,
764 [am_cv_prog_cc_stdc=no
766 # Don't try gcc -ansi; that turns off useful extensions and
767 # breaks some systems' header files.
769 # Ultrix and OSF/1 -std1
770 # HP-UX 10.20 and later -Ae
771 # HP-UX older versions -Aa -D_HPUX_SOURCE
772 # SVR4 -Xc -D__EXTENSIONS__
773 for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
775 CC="$ac_save_CC $ac_arg"
779 #include <sys/types.h>
780 #include <sys/stat.h>
781 /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */
782 struct buf { int x; };
783 FILE * (*rcsopen) (struct buf *, struct stat *, int);
784 static char *e (p, i)
790 static char *f (char * (*g) (char **, int), char **p, ...)
795 s = g (p, va_arg (v,int));
799 int test (int i, double x);
800 struct s1 {int (*f) (int a);};
801 struct s2 {int (*f) (double a);};
802 int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
806 return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1];
808 [am_cv_prog_cc_stdc="$ac_arg"; break])
812 if test -z "$am_cv_prog_cc_stdc"; then
813 AC_MSG_RESULT([none needed])
815 AC_MSG_RESULT([$am_cv_prog_cc_stdc])
817 case "x$am_cv_prog_cc_stdc" in
819 *) CC="$CC $am_cv_prog_cc_stdc" ;;
823 AC_DEFUN(BISON_WARNING,
824 [AC_MSG_CHECKING(whether compiler accepts $1)
825 AC_SUBST(WARNING_CFLAGS)
826 ac_save_CFLAGS="$CFLAGS"
830 WARNING_CFLAGS="$WARNING_CFLAGS $1"
833 CFLAGS="$ac_save_CFLAGS"])
836 # Copyright 1996, 1997, 1998, 2000, 2001 Free Software Foundation, Inc.
838 # This program is free software; you can redistribute it and/or modify
839 # it under the terms of the GNU General Public License as published by
840 # the Free Software Foundation; either version 2, or (at your option)
843 # This program is distributed in the hope that it will be useful,
844 # but WITHOUT ANY WARRANTY; without even the implied warranty of
845 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
846 # GNU General Public License for more details.
848 # You should have received a copy of the GNU General Public License
849 # along with this program; if not, write to the Free Software
850 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
855 AC_DEFUN([AM_C_PROTOTYPES],
856 [AC_REQUIRE([AM_PROG_CC_STDC])
857 AC_REQUIRE([AC_PROG_CPP])
858 AC_MSG_CHECKING([for function prototypes])
859 if test "$am_cv_prog_cc_stdc" != no; then
861 AC_DEFINE(PROTOTYPES,1,[Define if compiler has function prototypes])
865 U=_ ANSI2KNR=./ansi2knr
867 # Ensure some checks needed by ansi2knr itself.
869 AC_CHECK_HEADERS(string.h)
871 AC_SUBST(ANSI2KNR)dnl
876 dnl From Jim Meyering.
877 dnl Determine whether malloc accepts 0 as its argument.
878 dnl If it doesn't, arrange to use the replacement function.
881 AC_DEFUN(jm_FUNC_MALLOC,
883 dnl xmalloc.c requires that this symbol be defined so it doesn't
884 dnl mistakenly use a broken malloc -- as it might if this test were omitted.
885 AC_DEFINE_UNQUOTED(HAVE_DONE_WORKING_MALLOC_CHECK, 1,
886 [Define if the malloc check has been performed. ])
888 AC_CACHE_CHECK([for working malloc], jm_cv_func_working_malloc,
894 exit (malloc (0) ? 0 : 1);
897 jm_cv_func_working_malloc=yes,
898 jm_cv_func_working_malloc=no,
899 dnl When crosscompiling, assume malloc is broken.
900 jm_cv_func_working_malloc=no)
902 if test $jm_cv_func_working_malloc = no; then
904 LIBOBJS="$LIBOBJS malloc.$ac_objext"
905 AC_DEFINE_UNQUOTED(malloc, rpl_malloc,
906 [Define to rpl_malloc if the replacement function should be used.])
912 dnl From Jim Meyering.
913 dnl Determine whether realloc works when both arguments are 0.
914 dnl If it doesn't, arrange to use the replacement function.
917 AC_DEFUN(jm_FUNC_REALLOC,
919 dnl xmalloc.c requires that this symbol be defined so it doesn't
920 dnl mistakenly use a broken realloc -- as it might if this test were omitted.
921 AC_DEFINE_UNQUOTED(HAVE_DONE_WORKING_REALLOC_CHECK, 1,
922 [Define if the realloc check has been performed. ])
924 AC_CACHE_CHECK([for working realloc], jm_cv_func_working_realloc,
930 exit (realloc (0, 0) ? 0 : 1);
933 jm_cv_func_working_realloc=yes,
934 jm_cv_func_working_realloc=no,
935 dnl When crosscompiling, assume realloc is broken.
936 jm_cv_func_working_realloc=no)
938 if test $jm_cv_func_working_realloc = no; then
940 LIBOBJS="$LIBOBJS realloc.$ac_objext"
941 AC_DEFINE_UNQUOTED(realloc, rpl_realloc,
942 [Define to rpl_realloc if the replacement function should be used.])
948 dnl These are the prerequisite macros for files in the lib/
949 dnl directories of Bison.
951 AC_DEFUN([jm_PREREQ_QUOTEARG],
953 AC_CHECK_FUNCS(isascii iswprint mbsinit)
955 AC_CHECK_HEADERS(limits.h stddef.h stdlib.h string.h wchar.h wctype.h)
966 AC_DEFUN([jm_FUNC_MBRTOWC],
968 AC_CACHE_CHECK([whether mbrtowc and mbstate_t are properly declared],
971 [#include <wchar.h>],
972 [mbstate_t state; return ! (sizeof state && mbrtowc);],
973 jm_cv_func_mbrtowc=yes,
974 jm_cv_func_mbrtowc=no)])
975 if test $jm_cv_func_mbrtowc = yes; then
976 AC_DEFINE(HAVE_MBRTOWC, 1,
977 [Define to 1 if mbrtowc and mbstate_t are properly declared.])
983 dnl From Paul Eggert.
985 AC_DEFUN(AC_C_BACKSLASH_A,
987 AC_CACHE_CHECK([whether backslash-a works in strings], ac_cv_c_backslash_a,
993 char buf['\a' == 'a' ? -1 : 1];
995 return buf[0] != "\a"[0];
997 ac_cv_c_backslash_a=yes,
998 ac_cv_c_backslash_a=no)])
999 if test $ac_cv_c_backslash_a = yes; then
1000 AC_DEFINE(HAVE_C_BACKSLASH_A, 1,
1001 [Define if backslash-a works in C strings.])
1009 # BeOS 5 has <wchar.h> but does not define mbstate_t,
1010 # so you can't declare an object of that type.
1011 # Check for this incompatibility with Standard C.
1013 # Include stdlib.h first, because otherwise this test would fail on Linux
1014 # (at least glibc-2.1.3) because the "_XOPEN_SOURCE 500" definition elicits
1015 # a syntax error in wchar.h due to the use of undefined __int32_t.
1017 AC_DEFUN(AC_MBSTATE_T,
1019 AC_CHECK_HEADERS(stdlib.h)
1021 AC_CACHE_CHECK([for mbstate_t], ac_cv_type_mbstate_t,
1024 # include <stdlib.h>
1026 #include <wchar.h>],
1027 [mbstate_t x; return sizeof x;],
1028 ac_cv_type_mbstate_t=yes,
1029 ac_cv_type_mbstate_t=no)])
1030 if test $ac_cv_type_mbstate_t = no; then
1031 AC_DEFINE(mbstate_t, int,
1032 [Define to a type if <wchar.h> does not define.])
1037 dnl FIXME: put these prerequisite-only *.m4 files in a separate
1038 dnl directory -- otherwise, they'll conflict with existing files.
1040 dnl These are the prerequisite macros for GNU's error.c file.
1041 AC_DEFUN(jm_PREREQ_ERROR,
1043 AC_CHECK_FUNCS(strerror strerror_r vprintf doprnt)
1049 # Experimental replacement for the function in the latest CVS autoconf.
1050 # If the compile-test says strerror_r doesn't work, then resort to a
1051 # `run'-test that works on BeOS and segfaults on DEC Unix.
1052 # Use with the error.c file in ../lib.
1054 undefine([AC_FUNC_STRERROR_R])
1056 # AC_FUNC_STRERROR_R
1057 # ------------------
1058 AC_DEFUN([AC_FUNC_STRERROR_R],
1059 [AC_CHECK_DECLS([strerror_r])
1060 AC_CHECK_FUNCS([strerror_r])
1061 if test $ac_cv_func_strerror_r = yes; then
1062 AC_CHECK_HEADERS(string.h)
1063 AC_CACHE_CHECK([for working strerror_r],
1064 ac_cv_func_strerror_r_works,
1070 # include <string.h>
1075 char x = *strerror_r (0, buf, sizeof buf);
1077 ac_cv_func_strerror_r_works=yes,
1078 ac_cv_func_strerror_r_works=no
1080 if test $ac_cv_func_strerror_r_works = no; then
1081 # strerror_r seems not to work, but now we have to choose between
1082 # systems that have relatively inaccessible declarations for the
1083 # function. BeOS and DEC UNIX 4.0 fall in this category, but the
1084 # former has a strerror_r that returns char*, while the latter
1085 # has a strerror_r that returns `int'.
1086 # This test should segfault on the DEC system.
1090 # include <string.h>
1093 extern char *strerror_r ();
1099 char x = *strerror_r (0, buf, sizeof buf);
1100 exit (!isalpha (x));
1103 ac_cv_func_strerror_r_works=yes,
1104 ac_cv_func_strerror_r_works=no,
1105 ac_cv_func_strerror_r_works=no)
1108 if test $ac_cv_func_strerror_r_works = yes; then
1109 AC_DEFINE_UNQUOTED(HAVE_WORKING_STRERROR_R, 1,
1110 [Define to 1 if `strerror_r' returns a string.])
1113 ])# AC_FUNC_STRERROR_R
1118 AC_DEFUN([AM_WITH_DMALLOC],
1119 [AC_MSG_CHECKING([if malloc debugging is wanted])
1120 AC_ARG_WITH(dmalloc,
1121 [ --with-dmalloc use dmalloc, as in
1122 http://www.dmalloc.com/dmalloc.tar.gz],
1123 [if test "$withval" = yes; then
1125 AC_DEFINE(WITH_DMALLOC,1,
1126 [Define if using the dmalloc debugging malloc package])
1127 LIBS="$LIBS -ldmalloc"
1128 LDFLAGS="$LDFLAGS -g"
1131 fi], [AC_MSG_RESULT(no)])
1134 # Macro to add for using GNU gettext.
1135 # Ulrich Drepper <drepper@cygnus.com>, 1995.
1137 # This file can be copied and used freely without restrictions. It can
1138 # be used in projects which are not available under the GNU General Public
1139 # License but which still want to provide support for the GNU gettext
1141 # Please note that the actual code of GNU gettext is covered by the GNU
1142 # General Public License and is *not* in the public domain.
1146 dnl Usage: AM_WITH_NLS([TOOLSYMBOL], [NEEDSYMBOL], [LIBDIR]).
1147 dnl If TOOLSYMBOL is specified and is 'use-libtool', then a libtool library
1148 dnl $(top_builddir)/intl/libintl.la will be created (shared and/or static,
1149 dnl depending on --{enable,disable}-{shared,static} and on the presence of
1150 dnl AM-DISABLE-SHARED). Otherwise, a static library
1151 dnl $(top_builddir)/intl/libintl.a will be created.
1152 dnl If NEEDSYMBOL is specified and is 'need-ngettext', then GNU gettext
1153 dnl implementations (in libc or libintl) without the ngettext() function
1154 dnl will be ignored.
1155 dnl LIBDIR is used to find the intl libraries. If empty,
1156 dnl the value `$(top_builddir)/intl/' is used.
1158 dnl The result of the configuration is one of three cases:
1159 dnl 1) GNU gettext, as included in the intl subdirectory, will be compiled
1161 dnl Catalog format: GNU --> install in $(datadir)
1162 dnl Catalog extension: .mo after installation, .gmo in source tree
1163 dnl 2) GNU gettext has been found in the system's C library.
1164 dnl Catalog format: GNU --> install in $(datadir)
1165 dnl Catalog extension: .mo after installation, .gmo in source tree
1166 dnl 3) No internationalization, always use English msgid.
1167 dnl Catalog format: none
1168 dnl Catalog extension: none
1169 dnl The use of .gmo is historical (it was needed to avoid overwriting the
1170 dnl GNU format catalogs when building on a platform with an X/Open gettext),
1171 dnl but we keep it in order not to force irrelevant filename changes on the
1174 AC_DEFUN([AM_WITH_NLS],
1175 [AC_MSG_CHECKING([whether NLS is requested])
1176 dnl Default is enabled NLS
1178 [ --disable-nls do not use Native Language Support],
1179 USE_NLS=$enableval, USE_NLS=yes)
1180 AC_MSG_RESULT($USE_NLS)
1183 BUILD_INCLUDED_LIBINTL=no
1184 USE_INCLUDED_LIBINTL=no
1187 dnl If we use NLS figure out what method
1188 if test "$USE_NLS" = "yes"; then
1189 AC_DEFINE(ENABLE_NLS, 1,
1190 [Define to 1 if translation of program messages to the user's native language
1192 AC_MSG_CHECKING([whether included gettext is requested])
1193 AC_ARG_WITH(included-gettext,
1194 [ --with-included-gettext use the GNU gettext library included here],
1195 nls_cv_force_use_gnu_gettext=$withval,
1196 nls_cv_force_use_gnu_gettext=no)
1197 AC_MSG_RESULT($nls_cv_force_use_gnu_gettext)
1199 nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext"
1200 if test "$nls_cv_force_use_gnu_gettext" != "yes"; then
1201 dnl User does not insist on using GNU NLS library. Figure out what
1202 dnl to use. If GNU gettext is available we use this. Else we have
1203 dnl to fall back to GNU NLS library.
1206 dnl Add a version number to the cache macros.
1207 define(gt_cv_func_gnugettext_libc, [gt_cv_func_gnugettext]ifelse([$2], need-ngettext, 2, 1)[_libc])
1208 define(gt_cv_func_gnugettext_libintl, [gt_cv_func_gnugettext]ifelse([$2], need-ngettext, 2, 1)[_libintl])
1210 AC_CHECK_HEADER(libintl.h,
1211 [AC_CACHE_CHECK([for GNU gettext in libc], gt_cv_func_gnugettext_libc,
1212 [AC_TRY_LINK([#include <libintl.h>
1213 extern int _nl_msg_cat_cntr;],
1214 [bindtextdomain ("", "");
1215 return (int) gettext ("")]ifelse([$2], need-ngettext, [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr],
1216 gt_cv_func_gnugettext_libc=yes,
1217 gt_cv_func_gnugettext_libc=no)])
1219 if test "$gt_cv_func_gnugettext_libc" != "yes"; then
1220 AC_CACHE_CHECK([for GNU gettext in libintl],
1221 gt_cv_func_gnugettext_libintl,
1222 [gt_save_LIBS="$LIBS"
1223 LIBS="$LIBS -lintl $LIBICONV"
1224 AC_TRY_LINK([#include <libintl.h>
1225 extern int _nl_msg_cat_cntr;],
1226 [bindtextdomain ("", "");
1227 return (int) gettext ("")]ifelse([$2], need-ngettext, [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr],
1228 gt_cv_func_gnugettext_libintl=yes,
1229 gt_cv_func_gnugettext_libintl=no)
1230 LIBS="$gt_save_LIBS"])
1233 dnl If an already present or preinstalled GNU gettext() is found,
1234 dnl use it. But if this macro is used in GNU gettext, and GNU
1235 dnl gettext is already preinstalled in libintl, we update this
1236 dnl libintl. (Cf. the install rule in intl/Makefile.in.)
1237 if test "$gt_cv_func_gnugettext_libc" = "yes" \
1238 || { test "$gt_cv_func_gnugettext_libintl" = "yes" \
1239 && test "$PACKAGE" != gettext; }; then
1240 AC_DEFINE(HAVE_GETTEXT, 1,
1241 [Define if the GNU gettext() function is already present or preinstalled.])
1243 if test "$gt_cv_func_gnugettext_libintl" = "yes"; then
1244 dnl If iconv() is in a separate libiconv library, then anyone
1245 dnl linking with libintl{.a,.so} also needs to link with
1247 INTLLIBS="-lintl $LIBICONV"
1250 gt_save_LIBS="$LIBS"
1251 LIBS="$LIBS $INTLLIBS"
1252 AC_CHECK_FUNCS(dcgettext)
1253 LIBS="$gt_save_LIBS"
1255 dnl Search for GNU msgfmt in the PATH.
1256 AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
1257 [$ac_dir/$ac_word --statistics /dev/null >/dev/null 2>&1], :)
1258 AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
1260 dnl Search for GNU xgettext in the PATH.
1261 AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
1262 [$ac_dir/$ac_word --omit-header /dev/null >/dev/null 2>&1], :)
1268 if test "$CATOBJEXT" = "NONE"; then
1269 dnl GNU gettext is not found in the C library.
1270 dnl Fall back on GNU gettext library.
1271 nls_cv_use_gnu_gettext=yes
1275 if test "$nls_cv_use_gnu_gettext" = "yes"; then
1276 dnl Mark actions used to generate GNU NLS library.
1277 INTLOBJS="\$(GETTOBJS)"
1278 AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
1279 [$ac_dir/$ac_word --statistics /dev/null >/dev/null 2>&1], :)
1280 AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
1281 AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
1282 [$ac_dir/$ac_word --omit-header /dev/null >/dev/null 2>&1], :)
1284 BUILD_INCLUDED_LIBINTL=yes
1285 USE_INCLUDED_LIBINTL=yes
1287 INTLLIBS="ifelse([$3],[],\$(top_builddir)/intl,[$3])/libintl.ifelse([$1], use-libtool, [l], [])a $LIBICONV"
1288 LIBS=`echo " $LIBS " | sed -e 's/ -lintl / /' -e 's/^ //' -e 's/ $//'`
1291 dnl This could go away some day; the PATH_PROG_WITH_TEST already does it.
1292 dnl Test whether we really found GNU msgfmt.
1293 if test "$GMSGFMT" != ":"; then
1294 dnl If it is no GNU msgfmt we define it as : so that the
1295 dnl Makefiles still can work.
1296 if $GMSGFMT --statistics /dev/null >/dev/null 2>&1; then
1300 [found msgfmt program is not GNU msgfmt; ignore it])
1305 dnl This could go away some day; the PATH_PROG_WITH_TEST already does it.
1306 dnl Test whether we really found GNU xgettext.
1307 if test "$XGETTEXT" != ":"; then
1308 dnl If it is no GNU xgettext we define it as : so that the
1309 dnl Makefiles still can work.
1310 if $XGETTEXT --omit-header /dev/null >/dev/null 2>&1; then
1314 [found xgettext program is not GNU xgettext; ignore it])
1319 dnl We need to process the po/ directory.
1323 [for ac_file in $CONFIG_FILES; do
1324 # Support "outfile[:infile[:infile...]]"
1326 *:*) ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
1328 # PO directories have a Makefile.in generated from Makefile.in.in.
1329 case "$ac_file" in */Makefile.in)
1330 # Adjust a relative srcdir.
1331 ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'`
1332 ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`"
1333 ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'`
1334 # In autoconf-2.13 it is called $ac_given_srcdir.
1335 # In autoconf-2.50 it is called $srcdir.
1336 test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir"
1337 case "$ac_given_srcdir" in
1338 .) top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;;
1339 /*) top_srcdir="$ac_given_srcdir" ;;
1340 *) top_srcdir="$ac_dots$ac_given_srcdir" ;;
1342 if test -f "$ac_given_srcdir/$ac_dir/POTFILES.in"; then
1343 rm -f "$ac_dir/POTFILES"
1344 test -n "$as_me" && echo "$as_me: creating $ac_dir/POTFILES" || echo "creating $ac_dir/POTFILES"
1345 sed -e "/^#/d" -e "/^[ ]*\$/d" -e "s,.*, $top_srcdir/& \\\\," -e "\$s/\(.*\) \\\\/\1/" < "$ac_given_srcdir/$ac_dir/POTFILES.in" > "$ac_dir/POTFILES"
1346 test -n "$as_me" && echo "$as_me: creating $ac_dir/Makefile" || echo "creating $ac_dir/Makefile"
1347 sed -e "/POTFILES =/r $ac_dir/POTFILES" "$ac_dir/Makefile.in" > "$ac_dir/Makefile"
1354 dnl If this is used in GNU gettext we have to set BUILD_INCLUDED_LIBINTL
1355 dnl to 'yes' because some of the testsuite requires it.
1356 if test "$PACKAGE" = gettext; then
1357 BUILD_INCLUDED_LIBINTL=yes
1360 dnl intl/plural.c is generated from intl/plural.y. It requires bison,
1361 dnl because plural.y uses bison specific features. It requires at least
1362 dnl bison-1.26 because earlier versions generate a plural.c that doesn't
1364 dnl bison is only needed for the maintainer (who touches plural.y). But in
1365 dnl order to avoid separate Makefiles or --enable-maintainer-mode, we put
1366 dnl the rule in general Makefile. Now, some people carelessly touch the
1367 dnl files or have a broken "make" program, hence the plural.c rule will
1368 dnl sometimes fire. To avoid an error, defines BISON to ":" if it is not
1369 dnl present or too old.
1370 AC_CHECK_PROGS([INTLBISON], [bison])
1371 if test -z "$INTLBISON"; then
1374 dnl Found it, now check the version.
1375 AC_MSG_CHECKING([version of bison])
1376 changequote(<<,>>)dnl
1377 ac_prog_version=`$INTLBISON --version 2>&1 | sed -n 's/^.*GNU Bison .* \([0-9]*\.[0-9.]*\).*$/\1/p'`
1378 case $ac_prog_version in
1379 '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;;
1380 1.2[6-9]* | 1.[3-9][0-9]* | [2-9].*)
1382 ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;;
1383 *) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;;
1385 AC_MSG_RESULT([$ac_prog_version])
1387 if test $ac_verc_fail = yes; then
1391 dnl These rules are solely for the distribution goal. While doing this
1392 dnl we only have to keep exactly one list of the available catalogs
1393 dnl in configure.in.
1394 for lang in $ALL_LINGUAS; do
1395 GMOFILES="$GMOFILES $lang.gmo"
1396 POFILES="$POFILES $lang.po"
1399 dnl Make all variables we use known to autoconf.
1400 AC_SUBST(BUILD_INCLUDED_LIBINTL)
1401 AC_SUBST(USE_INCLUDED_LIBINTL)
1410 dnl For backward compatibility. Some configure.ins may be using this.
1412 nls_cv_header_libgt=
1414 dnl For backward compatibility. Some Makefiles may be using this.
1416 AC_SUBST(DATADIRNAME)
1418 dnl For backward compatibility. Some Makefiles may be using this.
1420 AC_SUBST(INSTOBJEXT)
1422 dnl For backward compatibility. Some Makefiles may be using this.
1427 dnl Usage: Just like AM_WITH_NLS, which see.
1428 AC_DEFUN([AM_GNU_GETTEXT],
1429 [AC_REQUIRE([AC_PROG_MAKE_SET])dnl
1430 AC_REQUIRE([AC_PROG_CC])dnl
1431 AC_REQUIRE([AC_CANONICAL_HOST])dnl
1432 AC_REQUIRE([AC_PROG_RANLIB])dnl
1433 AC_REQUIRE([AC_ISC_POSIX])dnl
1434 AC_REQUIRE([AC_HEADER_STDC])dnl
1435 AC_REQUIRE([AC_C_CONST])dnl
1436 AC_REQUIRE([AC_C_INLINE])dnl
1437 AC_REQUIRE([AC_TYPE_OFF_T])dnl
1438 AC_REQUIRE([AC_TYPE_SIZE_T])dnl
1439 AC_REQUIRE([AC_FUNC_ALLOCA])dnl
1440 AC_REQUIRE([AC_FUNC_MMAP])dnl
1441 AC_REQUIRE([jm_GLIBC21])dnl
1443 AC_CHECK_HEADERS([argz.h limits.h locale.h nl_types.h malloc.h stddef.h \
1444 stdlib.h string.h unistd.h sys/param.h])
1445 AC_CHECK_FUNCS([feof_unlocked fgets_unlocked getcwd getegid geteuid \
1446 getgid getuid mempcpy munmap putenv setenv setlocale stpcpy strchr strcasecmp \
1447 strdup strtoul tsearch __argz_count __argz_stringify __argz_next])
1452 AM_WITH_NLS([$1],[$2],[$3])
1454 if test "x$CATOBJEXT" != "x"; then
1455 if test "x$ALL_LINGUAS" = "x"; then
1458 AC_MSG_CHECKING(for catalogs to be installed)
1460 for presentlang in $ALL_LINGUAS; do
1462 for desiredlang in ${LINGUAS-$ALL_LINGUAS}; do
1463 # Use the presentlang catalog if desiredlang is
1464 # a. equal to presentlang, or
1465 # b. a variant of presentlang (because in this case,
1466 # presentlang can be used as a fallback for messages
1467 # which are not translated in the desiredlang catalog).
1468 case "$desiredlang" in
1469 "$presentlang"*) useit=yes;;
1472 if test $useit = yes; then
1473 NEW_LINGUAS="$NEW_LINGUAS $presentlang"
1476 LINGUAS=$NEW_LINGUAS
1477 AC_MSG_RESULT($LINGUAS)
1480 dnl Construct list of names of catalog files to be constructed.
1481 if test -n "$LINGUAS"; then
1482 for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done
1486 dnl If the AC_CONFIG_AUX_DIR macro for autoconf is used we possibly
1487 dnl find the mkinstalldirs script in another subdir but $(top_srcdir).
1488 dnl Try to locate is.
1490 if test -n "$ac_aux_dir"; then
1491 MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs"
1493 if test -z "$MKINSTALLDIRS"; then
1494 MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs"
1496 AC_SUBST(MKINSTALLDIRS)
1498 dnl Enable libtool support if the surrounding package wishes it.
1499 INTL_LIBTOOL_SUFFIX_PREFIX=ifelse([$1], use-libtool, [l], [])
1500 AC_SUBST(INTL_LIBTOOL_SUFFIX_PREFIX)
1503 # Search path for a program which passes the given test.
1504 # Ulrich Drepper <drepper@cygnus.com>, 1996.
1506 # This file can be copied and used freely without restrictions. It can
1507 # be used in projects which are not available under the GNU General Public
1508 # License but which still want to provide support for the GNU gettext
1510 # Please note that the actual code of GNU gettext is covered by the GNU
1511 # General Public License and is *not* in the public domain.
1515 dnl AM_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR,
1516 dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
1517 AC_DEFUN([AM_PATH_PROG_WITH_TEST],
1518 [# Extract the first word of "$2", so it can be a program name with args.
1519 set dummy $2; ac_word=[$]2
1520 AC_MSG_CHECKING([for $ac_word])
1521 AC_CACHE_VAL(ac_cv_path_$1,
1524 ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
1527 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
1528 for ac_dir in ifelse([$5], , $PATH, [$5]); do
1529 test -z "$ac_dir" && ac_dir=.
1530 if test -f $ac_dir/$ac_word; then
1532 ac_cv_path_$1="$ac_dir/$ac_word"
1538 dnl If no 4th arg is given, leave the cache variable unset,
1539 dnl so AC_PATH_PROGS will keep looking.
1540 ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
1545 if test ifelse([$4], , [-n "[$]$1"], ["[$]$1" != "$4"]); then
1546 AC_MSG_RESULT([$]$1)
1555 # Test for the GNU C Library, version 2.1 or newer.
1556 # From Bruno Haible.
1558 AC_DEFUN([jm_GLIBC21],
1560 AC_CACHE_CHECK(whether we are using the GNU C Library 2.1 or newer,
1561 ac_cv_gnu_library_2_1,
1562 [AC_EGREP_CPP([Lucky GNU user],
1564 #include <features.h>
1565 #ifdef __GNU_LIBRARY__
1566 #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1) || (__GLIBC__ > 2)
1571 ac_cv_gnu_library_2_1=yes,
1572 ac_cv_gnu_library_2_1=no)
1576 GLIBC21="$ac_cv_gnu_library_2_1"
1582 dnl From Bruno Haible.
1584 AC_DEFUN([AM_ICONV],
1586 dnl Some systems have iconv in libc, some have it in libiconv (OSF/1 and
1587 dnl those with the standalone portable GNU libiconv installed).
1589 AC_ARG_WITH([libiconv-prefix],
1590 [ --with-libiconv-prefix=DIR search for libiconv in DIR/include and DIR/lib], [
1591 for dir in `echo "$withval" | tr : ' '`; do
1592 if test -d $dir/include; then CPPFLAGS="$CPPFLAGS -I$dir/include"; fi
1593 if test -d $dir/lib; then LDFLAGS="$LDFLAGS -L$dir/lib"; fi
1597 AC_CACHE_CHECK(for iconv, am_cv_func_iconv, [
1598 am_cv_func_iconv="no, consider installing GNU libiconv"
1600 AC_TRY_LINK([#include <stdlib.h>
1601 #include <iconv.h>],
1602 [iconv_t cd = iconv_open("","");
1603 iconv(cd,NULL,NULL,NULL,NULL);
1605 am_cv_func_iconv=yes)
1606 if test "$am_cv_func_iconv" != yes; then
1607 am_save_LIBS="$LIBS"
1608 LIBS="$LIBS -liconv"
1609 AC_TRY_LINK([#include <stdlib.h>
1610 #include <iconv.h>],
1611 [iconv_t cd = iconv_open("","");
1612 iconv(cd,NULL,NULL,NULL,NULL);
1615 am_cv_func_iconv=yes)
1616 LIBS="$am_save_LIBS"
1619 if test "$am_cv_func_iconv" = yes; then
1620 AC_DEFINE(HAVE_ICONV, 1, [Define if you have the iconv() function.])
1621 AC_MSG_CHECKING([for iconv declaration])
1622 AC_CACHE_VAL(am_cv_proto_iconv, [
1630 #if defined(__STDC__) || defined(__cplusplus)
1631 size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
1635 ], [], am_cv_proto_iconv_arg1="", am_cv_proto_iconv_arg1="const")
1636 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);"])
1637 am_cv_proto_iconv=`echo "[$]am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'`
1638 AC_MSG_RESULT([$]{ac_t:-
1639 }[$]am_cv_proto_iconv)
1640 AC_DEFINE_UNQUOTED(ICONV_CONST, $am_cv_proto_iconv_arg1,
1641 [Define as const if the declaration of iconv() needs const.])
1644 if test "$am_cv_lib_iconv" = yes; then
1652 dnl From Bruno Haible.
1654 AC_DEFUN([AM_LANGINFO_CODESET],
1656 AC_CACHE_CHECK([for nl_langinfo and CODESET], am_cv_langinfo_codeset,
1657 [AC_TRY_LINK([#include <langinfo.h>],
1658 [char* cs = nl_langinfo(CODESET);],
1659 am_cv_langinfo_codeset=yes,
1660 am_cv_langinfo_codeset=no)
1662 if test $am_cv_langinfo_codeset = yes; then
1663 AC_DEFINE(HAVE_LANGINFO_CODESET, 1,
1664 [Define if you have <langinfo.h> and nl_langinfo(CODESET).])
1668 # Check whether LC_MESSAGES is available in <locale.h>.
1669 # Ulrich Drepper <drepper@cygnus.com>, 1995.
1671 # This file can be copied and used freely without restrictions. It can
1672 # be used in projects which are not available under the GNU General Public
1673 # License but which still want to provide support for the GNU gettext
1675 # Please note that the actual code of GNU gettext is covered by the GNU
1676 # General Public License and is *not* in the public domain.
1680 AC_DEFUN([AM_LC_MESSAGES],
1681 [if test $ac_cv_header_locale_h = yes; then
1682 AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES,
1683 [AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
1684 am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)])
1685 if test $am_cv_val_LC_MESSAGES = yes; then
1686 AC_DEFINE(HAVE_LC_MESSAGES, 1,
1687 [Define if your <locale.h> file defines LC_MESSAGES.])