1 # aclocal.m4 generated automatically by aclocal 1.5
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. This macro actually does too much --
15 # some checks are only needed if your package does certain things.
16 # But this isn't really a big deal.
20 # There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
21 # written in clear, in which case automake, when reading aclocal.m4,
22 # will think it sees a *use*, and therefore will trigger all it's
23 # C support machinery. Also note that it means that autoscan, seeing
24 # CC etc. in the Makefile, will ask for an AC_PROG_CC use...
27 # We require 2.13 because we rely on SHELL being computed by configure.
30 # AC_PROVIDE_IFELSE(MACRO-NAME, IF-PROVIDED, IF-NOT-PROVIDED)
31 # -----------------------------------------------------------
32 # If MACRO-NAME is provided do IF-PROVIDED, else IF-NOT-PROVIDED.
33 # The purpose of this macro is to provide the user with a means to
34 # check macros which are provided without letting her know how the
35 # information is coded.
36 # If this macro is not defined by Autoconf, define it here.
37 ifdef([AC_PROVIDE_IFELSE],
39 [define([AC_PROVIDE_IFELSE],
40 [ifdef([AC_PROVIDE_$1],
44 # AM_INIT_AUTOMAKE(PACKAGE,VERSION, [NO-DEFINE])
45 # ----------------------------------------------
46 AC_DEFUN([AM_INIT_AUTOMAKE],
47 [AC_REQUIRE([AC_PROG_INSTALL])dnl
48 # test to see if srcdir already configured
49 if test "`CDPATH=:; cd $srcdir && pwd`" != "`pwd`" &&
50 test -f $srcdir/config.status; then
51 AC_MSG_ERROR([source directory already configured; run \"make distclean\" there first])
54 # Define the identity of the package.
60 [AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
61 AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])
63 # Autoconf 2.50 wants to disallow AM_ names. We explicitly allow
64 # the ones we care about.
65 ifdef([m4_pattern_allow],
66 [m4_pattern_allow([^AM_[A-Z]+FLAGS])])dnl
68 # Autoconf 2.50 always computes EXEEXT. However we need to be
69 # compatible with 2.13, for now. So we always define EXEEXT, but we
72 # Similar for OBJEXT -- only we only use OBJEXT if the user actually
73 # requests that it be used. This is a bit dumb.
77 # Some tools Automake needs.
78 AC_REQUIRE([AM_SANITY_CHECK])dnl
79 AC_REQUIRE([AC_ARG_PROGRAM])dnl
80 AM_MISSING_PROG(ACLOCAL, aclocal)
81 AM_MISSING_PROG(AUTOCONF, autoconf)
82 AM_MISSING_PROG(AUTOMAKE, automake)
83 AM_MISSING_PROG(AUTOHEADER, autoheader)
84 AM_MISSING_PROG(MAKEINFO, makeinfo)
85 AM_MISSING_PROG(AMTAR, tar)
88 # We need awk for the "check" target. The system "awk" is bad on
90 AC_REQUIRE([AC_PROG_AWK])dnl
91 AC_REQUIRE([AC_PROG_MAKE_SET])dnl
92 AC_REQUIRE([AM_DEP_TRACK])dnl
93 AC_REQUIRE([AM_SET_DEPDIR])dnl
94 AC_PROVIDE_IFELSE([AC_PROG_][CC],
95 [_AM_DEPENDENCIES(CC)],
96 [define([AC_PROG_][CC],
97 defn([AC_PROG_][CC])[_AM_DEPENDENCIES(CC)])])dnl
98 AC_PROVIDE_IFELSE([AC_PROG_][CXX],
99 [_AM_DEPENDENCIES(CXX)],
100 [define([AC_PROG_][CXX],
101 defn([AC_PROG_][CXX])[_AM_DEPENDENCIES(CXX)])])dnl
105 # Check to make sure that the build environment is sane.
112 AC_DEFUN([AM_SANITY_CHECK],
113 [AC_MSG_CHECKING([whether build environment is sane])
116 echo timestamp > conftest.file
117 # Do `set' in a subshell so we don't clobber the current shell's
118 # arguments. Must try -L first in case configure is actually a
119 # symlink; some systems play weird games with the mod time of symlinks
120 # (eg FreeBSD returns the mod time of the symlink's containing
123 set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
124 if test "$[*]" = "X"; then
126 set X `ls -t $srcdir/configure conftest.file`
129 if test "$[*]" != "X $srcdir/configure conftest.file" \
130 && test "$[*]" != "X conftest.file $srcdir/configure"; then
132 # If neither matched, then we have a broken ls. This can happen
133 # if, for instance, CONFIG_SHELL is bash and it inherits a
134 # broken ls alias from the environment. This has actually
135 # happened. Such a system could not be considered "sane".
136 AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
137 alias in your environment])
140 test "$[2]" = conftest.file
146 AC_MSG_ERROR([newly created file is older than distributed files!
147 Check your system clock])
154 # AM_MISSING_PROG(NAME, PROGRAM)
155 # ------------------------------
156 AC_DEFUN([AM_MISSING_PROG],
157 [AC_REQUIRE([AM_MISSING_HAS_RUN])
158 $1=${$1-"${am_missing_run}$2"}
164 # Define MISSING if not defined so far and test if it supports --run.
165 # If it does, set am_missing_run to use it, otherwise, to nothing.
166 AC_DEFUN([AM_MISSING_HAS_RUN],
167 [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
168 test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
169 # Use eval to expand $SHELL
170 if eval "$MISSING --run true"; then
171 am_missing_run="$MISSING --run "
175 AC_MSG_WARN([${am_backtick}missing' script is too old or missing])
181 # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
182 # $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to
183 # `$srcdir', `$srcdir/..', or `$srcdir/../..'.
185 # Of course, Automake must honor this variable whenever it calls a
186 # tool from the auxiliary directory. The problem is that $srcdir (and
187 # therefore $ac_aux_dir as well) can be either absolute or relative,
188 # depending on how configure is run. This is pretty annoying, since
189 # it makes $ac_aux_dir quite unusable in subdirectories: in the top
190 # source directory, any form will work fine, but in subdirectories a
191 # relative path needs to be adjusted first.
193 # $ac_aux_dir/missing
194 # fails when called from a subdirectory if $ac_aux_dir is relative
195 # $top_srcdir/$ac_aux_dir/missing
196 # fails if $ac_aux_dir is absolute,
197 # fails when called from a subdirectory in a VPATH build with
198 # a relative $ac_aux_dir
200 # The reason of the latter failure is that $top_srcdir and $ac_aux_dir
201 # are both prefixed by $srcdir. In an in-source build this is usually
202 # harmless because $srcdir is `.', but things will broke when you
203 # start a VPATH build or use an absolute $srcdir.
205 # So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
206 # iff we strip the leading $srcdir from $ac_aux_dir. That would be:
207 # am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
208 # and then we would define $MISSING as
209 # MISSING="\${SHELL} $am_aux_dir/missing"
210 # This will work as long as MISSING is not called from configure, because
211 # unfortunately $(top_srcdir) has no meaning in configure.
212 # However there are other variables, like CC, which are often used in
213 # configure, and could therefore not use this "fixed" $ac_aux_dir.
215 # Another solution, used here, is to always expand $ac_aux_dir to an
216 # absolute PATH. The drawback is that using absolute paths prevent a
217 # configured tree to be moved without reconfiguration.
219 AC_DEFUN([AM_AUX_DIR_EXPAND], [
220 # expand $ac_aux_dir to an absolute path
221 am_aux_dir=`CDPATH=:; cd $ac_aux_dir && pwd`
226 # Define $install_sh.
227 AC_DEFUN([AM_PROG_INSTALL_SH],
228 [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
229 install_sh=${install_sh-"$am_aux_dir/install-sh"}
230 AC_SUBST(install_sh)])
232 # One issue with vendor `install' (even GNU) is that you can't
233 # specify the program used to strip binaries. This is especially
234 # annoying in cross-compiling environments, where the build's strip
235 # is unlikely to handle the host's binaries.
236 # Fortunately install-sh will honor a STRIPPROG variable, so we
237 # always use install-sh in `make install-strip', and initialize
238 # STRIPPROG with the value of the STRIP variable (set by the user).
239 AC_DEFUN([AM_PROG_INSTALL_STRIP],
240 [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
241 INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s"
242 AC_SUBST([INSTALL_STRIP_PROGRAM])])
244 # serial 4 -*- Autoconf -*-
248 # There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
249 # written in clear, in which case automake, when reading aclocal.m4,
250 # will think it sees a *use*, and therefore will trigger all it's
251 # C support machinery. Also note that it means that autoscan, seeing
252 # CC etc. in the Makefile, will ask for an AC_PROG_CC use...
256 # _AM_DEPENDENCIES(NAME)
257 # ---------------------
258 # See how the compiler implements dependency checking.
259 # NAME is "CC", "CXX" or "OBJC".
260 # We try a few techniques and use that to set a single cache variable.
262 # We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
263 # modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
264 # dependency, and given that the user is not expected to run this macro,
265 # just rely on AC_PROG_CC.
266 AC_DEFUN([_AM_DEPENDENCIES],
267 [AC_REQUIRE([AM_SET_DEPDIR])dnl
268 AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
269 AC_REQUIRE([AM_MAKE_INCLUDE])dnl
270 AC_REQUIRE([AM_DEP_TRACK])dnl
272 ifelse([$1], CC, [depcc="$CC" am_compiler_list=],
273 [$1], CXX, [depcc="$CXX" am_compiler_list=],
274 [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc']
275 [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'],
276 [depcc="$$1" am_compiler_list=])
278 AC_CACHE_CHECK([dependency style of $depcc],
279 [am_cv_$1_dependencies_compiler_type],
280 [if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
281 # We make a subdir and do the tests there. Otherwise we can end up
282 # making bogus files that we don't know about and never remove. For
283 # instance it was reported that on HP-UX the gcc test will end up
284 # making a dummy file named `D' -- because `-MD' means `put the output
287 # Copy depcomp to subdir because otherwise we won't find it if we're
288 # using a relative directory.
289 cp "$am_depcomp" conftest.dir
292 am_cv_$1_dependencies_compiler_type=none
293 if test "$am_compiler_list" = ""; then
294 am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
296 for depmode in $am_compiler_list; do
297 # We need to recreate these files for each test, as the compiler may
298 # overwrite some of them when testing with obscure command lines.
299 # This happens at least with the AIX C compiler.
300 echo '#include "conftest.h"' > conftest.c
301 echo 'int i;' > conftest.h
302 echo "${am__include} ${am__quote}conftest.Po${am__quote}" > confmf
306 # after this tag, mechanisms are not by side-effect, so they'll
307 # only be used when explicitly requested
308 if test "x$enable_dependency_tracking" = xyes; then
316 # We check with `-c' and `-o' for the sake of the "dashmstdout"
317 # mode. It turns out that the SunPro C++ compiler does not properly
318 # handle `-M -o', and we need to detect this.
319 if depmode=$depmode \
320 source=conftest.c object=conftest.o \
321 depfile=conftest.Po tmpdepfile=conftest.TPo \
322 $SHELL ./depcomp $depcc -c conftest.c -o conftest.o >/dev/null 2>&1 &&
323 grep conftest.h conftest.Po > /dev/null 2>&1 &&
324 ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
325 am_cv_$1_dependencies_compiler_type=$depmode
333 am_cv_$1_dependencies_compiler_type=none
336 $1DEPMODE="depmode=$am_cv_$1_dependencies_compiler_type"
337 AC_SUBST([$1DEPMODE])
343 # Choose a directory name for dependency files.
344 # This macro is AC_REQUIREd in _AM_DEPENDENCIES
345 AC_DEFUN([AM_SET_DEPDIR],
346 [rm -f .deps 2>/dev/null
347 mkdir .deps 2>/dev/null
348 if test -d .deps; then
351 # MS-DOS does not allow filenames that begin with a dot.
354 rmdir .deps 2>/dev/null
361 AC_DEFUN([AM_DEP_TRACK],
362 [AC_ARG_ENABLE(dependency-tracking,
363 [ --disable-dependency-tracking Speeds up one-time builds
364 --enable-dependency-tracking Do not reject slow dependency extractors])
365 if test "x$enable_dependency_tracking" != xno; then
366 am_depcomp="$ac_aux_dir/depcomp"
369 AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
370 pushdef([subst], defn([AC_SUBST]))
371 subst(AMDEPBACKSLASH)
375 # Generate code to set up dependency tracking.
376 # This macro should only be invoked once -- use via AC_REQUIRE.
378 # AM_OUTPUT_DEPENDENCY_COMMANDS
381 # This code is only required when automatic dependency tracking
382 # is enabled. FIXME. This creates each `.P' file that we will
383 # need in order to bootstrap the dependency handling code.
384 AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],[
386 test x"$AMDEP_TRUE" != x"" ||
387 for mf in $CONFIG_FILES; do
389 Makefile) dirpart=.;;
390 */Makefile) dirpart=`echo "$mf" | sed -e 's|/[^/]*$||'`;;
393 grep '^DEP_FILES *= *[^ #]' < "$mf" > /dev/null || continue
394 # Extract the definition of DEP_FILES from the Makefile without
396 DEPDIR=`sed -n -e '/^DEPDIR = / s///p' < "$mf"`
397 test -z "$DEPDIR" && continue
398 # When using ansi2knr, U may be empty or an underscore; expand it
399 U=`sed -n -e '/^U = / s///p' < "$mf"`
400 test -d "$dirpart/$DEPDIR" || mkdir "$dirpart/$DEPDIR"
401 # We invoke sed twice because it is the simplest approach to
402 # changing $(DEPDIR) to its actual value in the expansion.
403 for file in `sed -n -e '
404 /^DEP_FILES = .*\\\\$/ {
413 /^DEP_FILES = / s/^DEP_FILES = //p' < "$mf" | \
414 sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
415 # Make sure the directory exists.
416 test -f "$dirpart/$file" && continue
417 fdir=`echo "$file" | sed -e 's|/[^/]*$||'`
418 $ac_aux_dir/mkinstalldirs "$dirpart/$fdir" > /dev/null 2>&1
419 # echo "creating $dirpart/$file"
420 echo '# dummy' > "$dirpart/$file"
423 ], [AMDEP_TRUE="$AMDEP_TRUE"
424 ac_aux_dir="$ac_aux_dir"])])
428 # Check to see how make treats includes.
429 AC_DEFUN([AM_MAKE_INCLUDE],
430 [am_make=${MAKE-make}
431 cat > confinc << 'END'
435 # If we don't find an include directive, just comment out the code.
436 AC_MSG_CHECKING([for style of include used by $am_make])
440 # First try GNU make style include.
441 echo "include confinc" > confmf
442 # We grep out `Entering directory' and `Leaving directory'
443 # messages which can occur if `w' ends up in MAKEFLAGS.
444 # In particular we don't look at `^make:' because GNU make might
445 # be invoked under some other name (usually "gmake"), in which
446 # case it prints its new name instead of `make'.
447 if test "`$am_make -s -f confmf 2> /dev/null | fgrep -v 'ing directory'`" = "done"; then
452 # Now try BSD make style include.
453 if test "$am__include" = "#"; then
454 echo '.include "confinc"' > confmf
455 if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
461 AC_SUBST(am__include)
463 AC_MSG_RESULT($_am_result)
469 # AM_CONDITIONAL(NAME, SHELL-CONDITION)
470 # -------------------------------------
471 # Define a conditional.
473 # FIXME: Once using 2.50, use this:
474 # m4_match([$1], [^TRUE\|FALSE$], [AC_FATAL([$0: invalid condition: $1])])dnl
475 AC_DEFUN([AM_CONDITIONAL],
476 [ifelse([$1], [TRUE],
477 [errprint(__file__:__line__: [$0: invalid condition: $1
480 ifelse([$1], [FALSE],
481 [errprint(__file__:__line__: [$0: invalid condition: $1
494 # Like AC_CONFIG_HEADER, but automatically create stamp file.
498 # When config.status generates a header, we must update the stamp-h file.
499 # This file resides in the same directory as the config header
500 # that is generated. We must strip everything past the first ":",
501 # and everything past the last "/".
505 AC_DEFUN([AM_CONFIG_HEADER],
506 [ifdef([AC_FOREACH],dnl
507 [dnl init our file count if it isn't already
508 m4_ifndef([_AM_Config_Header_Index], m4_define([_AM_Config_Header_Index], [0]))
509 dnl prepare to store our destination file list for use in config.status
510 AC_FOREACH([_AM_File], [$1],
511 [m4_pushdef([_AM_Dest], m4_patsubst(_AM_File, [:.*]))
512 m4_define([_AM_Config_Header_Index], m4_incr(_AM_Config_Header_Index))
513 dnl and add it to the list of files AC keeps track of, along
515 AC_CONFIG_HEADERS(_AM_File,
516 dnl COMMANDS, [, INIT-CMDS]
517 [# update the timestamp
518 echo timestamp >"AS_ESCAPE(_AM_DIRNAME(]_AM_Dest[))/stamp-h]_AM_Config_Header_Index["
519 ][$2]m4_ifval([$3], [, [$3]]))dnl AC_CONFIG_HEADERS
520 m4_popdef([_AM_Dest])])],dnl
521 [AC_CONFIG_HEADER([$1])
523 ifelse(patsubst([$1], [[^ ]], []),
525 [test -z "$CONFIG_HEADERS" || echo timestamp >dnl
526 patsubst([$1], [^\([^:]*/\)?.*], [\1])stamp-h]),dnl
528 for am_file in $1; do
529 case " \$CONFIG_HEADERS " in
531 am_dir=\`echo \$am_file |sed 's%:.*%%;s%[^/]*\$%%'\`
532 if test -n "\$am_dir"; then
533 am_tmpdir=\`echo \$am_dir |sed 's%^\(/*\).*\$%\1%'\`
534 for am_subdir in \`echo \$am_dir |sed 's%/% %'\`; do
535 am_tmpdir=\$am_tmpdir\$am_subdir/
536 if test ! -d \$am_tmpdir; then
541 echo timestamp > "\$am_dir"stamp-h\$am_indx
544 am_indx=\`expr \$am_indx + 1\`
546 ])]) # AM_CONFIG_HEADER
550 # Like AS_DIRNAME, only do it during macro expansion
551 AC_DEFUN([_AM_DIRNAME],
552 [m4_if(m4_regexp([$1], [^.*[^/]//*[^/][^/]*/*$]), -1,
553 m4_if(m4_regexp([$1], [^//\([^/]\|$\)]), -1,
554 m4_if(m4_regexp([$1], [^/.*]), -1,
556 m4_patsubst([$1], [^\(/\).*], [\1])),
557 m4_patsubst([$1], [^\(//\)\([^/].*\|$\)], [\1])),
558 m4_patsubst([$1], [^\(.*[^/]\)//*[^/][^/]*/*$], [\1]))[]dnl
562 # This test replaces the one in autoconf.
563 # Currently this macro should have the same name as the autoconf macro
564 # because gettext's gettext.m4 (distributed in the automake package)
565 # still uses it. Otherwise, the use in gettext.m4 makes autoheader
566 # give these diagnostics:
567 # configure.in:556: AC_TRY_COMPILE was called before AC_ISC_POSIX
568 # configure.in:556: AC_TRY_RUN was called before AC_ISC_POSIX
570 undefine([AC_ISC_POSIX])
572 AC_DEFUN([AC_ISC_POSIX],
574 dnl This test replaces the obsolescent AC_ISC_POSIX kludge.
575 AC_CHECK_LIB(cposix, strerror, [LIBS="$LIBS -lcposix"])
582 # @defmac AC_PROG_CC_STDC
583 # @maindex PROG_CC_STDC
585 # If the C compiler in not in ANSI C mode by default, try to add an option
586 # to output variable @code{CC} to make it so. This macro tries various
587 # options that select ANSI C on some system or another. It considers the
588 # compiler to be in ANSI C mode if it handles function prototypes correctly.
590 # If you use this macro, you should check after calling it whether the C
591 # compiler has been set to accept ANSI C; if not, the shell variable
592 # @code{am_cv_prog_cc_stdc} is set to @samp{no}. If you wrote your source
593 # code in ANSI C, you can make an un-ANSIfied copy of it by using the
594 # program @code{ansi2knr}, which comes with Ghostscript.
597 AC_DEFUN([AM_PROG_CC_STDC],
598 [AC_REQUIRE([AC_PROG_CC])
599 AC_BEFORE([$0], [AC_C_INLINE])
600 AC_BEFORE([$0], [AC_C_CONST])
601 dnl Force this before AC_PROG_CPP. Some cpp's, eg on HPUX, require
602 dnl a magic option to avoid problems with ANSI preprocessor commands
604 dnl FIXME: can't do this because then AC_AIX won't work due to a
605 dnl circular dependency.
606 dnl AC_BEFORE([$0], [AC_PROG_CPP])
607 AC_MSG_CHECKING([for ${CC-cc} option to accept ANSI C])
608 AC_CACHE_VAL(am_cv_prog_cc_stdc,
609 [am_cv_prog_cc_stdc=no
611 # Don't try gcc -ansi; that turns off useful extensions and
612 # breaks some systems' header files.
614 # Ultrix and OSF/1 -std1
615 # HP-UX 10.20 and later -Ae
616 # HP-UX older versions -Aa -D_HPUX_SOURCE
617 # SVR4 -Xc -D__EXTENSIONS__
618 for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
620 CC="$ac_save_CC $ac_arg"
624 #include <sys/types.h>
625 #include <sys/stat.h>
626 /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */
627 struct buf { int x; };
628 FILE * (*rcsopen) (struct buf *, struct stat *, int);
629 static char *e (p, i)
635 static char *f (char * (*g) (char **, int), char **p, ...)
640 s = g (p, va_arg (v,int));
644 int test (int i, double x);
645 struct s1 {int (*f) (int a);};
646 struct s2 {int (*f) (double a);};
647 int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
651 return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1];
653 [am_cv_prog_cc_stdc="$ac_arg"; break])
657 if test -z "$am_cv_prog_cc_stdc"; then
658 AC_MSG_RESULT([none needed])
660 AC_MSG_RESULT([$am_cv_prog_cc_stdc])
662 case "x$am_cv_prog_cc_stdc" in
664 *) CC="$CC $am_cv_prog_cc_stdc" ;;
668 # serial 1 -*- Autoconf -*-
670 # BISON_AC_PROG_GNU_M4
671 # --------------------
672 # Check for GNU m4, at least 1.3 (supports frozen files).
673 AC_DEFUN([BISON_AC_PROG_GNU_M4],
674 [AC_PATH_PROGS(M4, gm4 gnum4 m4, m4)
675 AC_CACHE_CHECK([whether m4 supports frozen files],
677 [ac_cv_prog_gnu_m4=no
678 if test x"$M4" != x; then
679 case `$M4 --help < /dev/null 2>&1` in
680 *reload-state*) ac_cv_prog_gnu_m4=yes ;;
683 ])# BISON_AC_PROG_GNU_M4
685 AC_DEFUN(BISON_WARNING,
686 [AC_MSG_CHECKING(whether compiler accepts $1)
687 AC_SUBST(WARNING_CFLAGS)
688 ac_save_CFLAGS="$CFLAGS"
692 WARNING_CFLAGS="$WARNING_CFLAGS $1"
695 CFLAGS="$ac_save_CFLAGS"])
700 AC_DEFUN([AM_C_PROTOTYPES],
701 [AC_REQUIRE([AM_PROG_CC_STDC])
702 AC_REQUIRE([AC_PROG_CPP])
703 AC_MSG_CHECKING([for function prototypes])
704 if test "$am_cv_prog_cc_stdc" != no; then
706 AC_DEFINE(PROTOTYPES,1,[Define if compiler has function prototypes])
710 U=_ ANSI2KNR=./ansi2knr
712 # Ensure some checks needed by ansi2knr itself.
714 AC_CHECK_HEADERS(string.h)
716 AC_SUBST(ANSI2KNR)dnl
721 dnl From Jim Meyering.
722 dnl Determine whether malloc accepts 0 as its argument.
723 dnl If it doesn't, arrange to use the replacement function.
726 AC_DEFUN(jm_FUNC_MALLOC,
728 dnl xmalloc.c requires that this symbol be defined so it doesn't
729 dnl mistakenly use a broken malloc -- as it might if this test were omitted.
730 AC_DEFINE_UNQUOTED(HAVE_DONE_WORKING_MALLOC_CHECK, 1,
731 [Define if the malloc check has been performed. ])
733 AC_CACHE_CHECK([for working malloc], jm_cv_func_working_malloc,
739 exit (malloc (0) ? 0 : 1);
742 jm_cv_func_working_malloc=yes,
743 jm_cv_func_working_malloc=no,
744 dnl When crosscompiling, assume malloc is broken.
745 jm_cv_func_working_malloc=no)
747 if test $jm_cv_func_working_malloc = no; then
749 LIBOBJS="$LIBOBJS malloc.$ac_objext"
750 AC_DEFINE_UNQUOTED(malloc, rpl_malloc,
751 [Define to rpl_malloc if the replacement function should be used.])
757 dnl From Jim Meyering.
758 dnl Determine whether realloc works when both arguments are 0.
759 dnl If it doesn't, arrange to use the replacement function.
762 AC_DEFUN(jm_FUNC_REALLOC,
764 dnl xmalloc.c requires that this symbol be defined so it doesn't
765 dnl mistakenly use a broken realloc -- as it might if this test were omitted.
766 AC_DEFINE_UNQUOTED(HAVE_DONE_WORKING_REALLOC_CHECK, 1,
767 [Define if the realloc check has been performed. ])
769 AC_CACHE_CHECK([for working realloc], jm_cv_func_working_realloc,
775 exit (realloc (0, 0) ? 0 : 1);
778 jm_cv_func_working_realloc=yes,
779 jm_cv_func_working_realloc=no,
780 dnl When crosscompiling, assume realloc is broken.
781 jm_cv_func_working_realloc=no)
783 if test $jm_cv_func_working_realloc = no; then
785 LIBOBJS="$LIBOBJS realloc.$ac_objext"
786 AC_DEFINE_UNQUOTED(realloc, rpl_realloc,
787 [Define to rpl_realloc if the replacement function should be used.])
793 dnl These are the prerequisite macros for files in the lib/
794 dnl directories of Bison.
796 AC_DEFUN([jm_PREREQ_QUOTEARG],
798 AC_CHECK_FUNCS(isascii iswprint mbrtowc)
799 AC_CHECK_HEADERS(limits.h stdlib.h string.h wchar.h wctype.h)
808 dnl From Paul Eggert.
810 AC_DEFUN(AC_C_BACKSLASH_A,
812 AC_CACHE_CHECK([whether backslash-a works in strings], ac_cv_c_backslash_a,
818 char buf['\a' == 'a' ? -1 : 1];
820 return buf[0] != "\a"[0];
822 ac_cv_c_backslash_a=yes,
823 ac_cv_c_backslash_a=no)])
824 if test $ac_cv_c_backslash_a = yes; then
825 AC_DEFINE(HAVE_C_BACKSLASH_A, 1,
826 [Define if backslash-a works in C strings.])
834 # BeOS 5 has <wchar.h> but does not define mbstate_t,
835 # so you can't declare an object of that type.
836 # Check for this incompatibility with Standard C.
838 # Include stdlib.h first, because otherwise this test would fail on Linux
839 # (at least glibc-2.1.3) because the "_XOPEN_SOURCE 500" definition elicits
840 # a syntax error in wchar.h due to the use of undefined __int32_t.
842 AC_DEFUN(AC_MBSTATE_T,
844 AC_CHECK_HEADERS(stdlib.h)
846 AC_CACHE_CHECK([for mbstate_t], ac_cv_type_mbstate_t,
852 [mbstate_t x; return sizeof x;],
853 ac_cv_type_mbstate_t=yes,
854 ac_cv_type_mbstate_t=no)])
855 if test $ac_cv_type_mbstate_t = no; then
856 AC_DEFINE(mbstate_t, int,
857 [Define to a type if <wchar.h> does not define.])
862 dnl FIXME: put these prerequisite-only *.m4 files in a separate
863 dnl directory -- otherwise, they'll conflict with existing files.
865 dnl These are the prerequisite macros for GNU's error.c file.
866 AC_DEFUN(jm_PREREQ_ERROR,
868 AC_CHECK_FUNCS(strerror strerror_r vprintf doprnt)
874 # Experimental replacement for the function in the latest CVS autoconf.
875 # If the compile-test says strerror_r doesn't work, then resort to a
876 # `run'-test that works on BeOS and segfaults on DEC Unix.
877 # Use with the error.c file in ../lib.
879 undefine([AC_FUNC_STRERROR_R])
883 AC_DEFUN([AC_FUNC_STRERROR_R],
884 [AC_CHECK_DECLS([strerror_r])
885 AC_CHECK_FUNCS([strerror_r])
886 if test $ac_cv_func_strerror_r = yes; then
887 AC_CHECK_HEADERS(string.h)
888 AC_CACHE_CHECK([for working strerror_r],
889 ac_cv_func_strerror_r_works,
900 char x = *strerror_r (0, buf, sizeof buf);
902 ac_cv_func_strerror_r_works=yes,
903 ac_cv_func_strerror_r_works=no
905 if test $ac_cv_func_strerror_r_works = no; then
906 # strerror_r seems not to work, but now we have to choose between
907 # systems that have relatively inaccessible declarations for the
908 # function. BeOS and DEC UNIX 4.0 fall in this category, but the
909 # former has a strerror_r that returns char*, while the latter
910 # has a strerror_r that returns `int'.
911 # This test should segfault on the DEC system.
918 extern char *strerror_r ();
924 char x = *strerror_r (0, buf, sizeof buf);
928 ac_cv_func_strerror_r_works=yes,
929 ac_cv_func_strerror_r_works=no,
930 ac_cv_func_strerror_r_works=no)
933 if test $ac_cv_func_strerror_r_works = yes; then
934 AC_DEFINE_UNQUOTED(HAVE_WORKING_STRERROR_R, 1,
935 [Define to 1 if `strerror_r' returns a string.])
938 ])# AC_FUNC_STRERROR_R
940 # Macro to add for using GNU gettext.
941 # Ulrich Drepper <drepper@cygnus.com>, 1995.
943 # This file can be copied and used freely without restrictions. It can
944 # be used in projects which are not available under the GNU General Public
945 # License but which still want to provide support for the GNU gettext
947 # Please note that the actual code of GNU gettext is covered by the GNU
948 # General Public License and is *not* in the public domain.
952 dnl Usage: AM_WITH_NLS([TOOLSYMBOL], [NEEDSYMBOL], [LIBDIR]).
953 dnl If TOOLSYMBOL is specified and is 'use-libtool', then a libtool library
954 dnl $(top_builddir)/intl/libintl.la will be created (shared and/or static,
955 dnl depending on --{enable,disable}-{shared,static} and on the presence of
956 dnl AM-DISABLE-SHARED). Otherwise, a static library
957 dnl $(top_builddir)/intl/libintl.a will be created.
958 dnl If NEEDSYMBOL is specified and is 'need-ngettext', then GNU gettext
959 dnl implementations (in libc or libintl) without the ngettext() function
961 dnl LIBDIR is used to find the intl libraries. If empty,
962 dnl the value `$(top_builddir)/intl/' is used.
964 dnl The result of the configuration is one of three cases:
965 dnl 1) GNU gettext, as included in the intl subdirectory, will be compiled
967 dnl Catalog format: GNU --> install in $(datadir)
968 dnl Catalog extension: .mo after installation, .gmo in source tree
969 dnl 2) GNU gettext has been found in the system's C library.
970 dnl Catalog format: GNU --> install in $(datadir)
971 dnl Catalog extension: .mo after installation, .gmo in source tree
972 dnl 3) No internationalization, always use English msgid.
973 dnl Catalog format: none
974 dnl Catalog extension: none
975 dnl The use of .gmo is historical (it was needed to avoid overwriting the
976 dnl GNU format catalogs when building on a platform with an X/Open gettext),
977 dnl but we keep it in order not to force irrelevant filename changes on the
980 AC_DEFUN([AM_WITH_NLS],
981 [AC_MSG_CHECKING([whether NLS is requested])
982 dnl Default is enabled NLS
984 [ --disable-nls do not use Native Language Support],
985 USE_NLS=$enableval, USE_NLS=yes)
986 AC_MSG_RESULT($USE_NLS)
989 BUILD_INCLUDED_LIBINTL=no
990 USE_INCLUDED_LIBINTL=no
993 dnl If we use NLS figure out what method
994 if test "$USE_NLS" = "yes"; then
995 AC_DEFINE(ENABLE_NLS, 1,
996 [Define to 1 if translation of program messages to the user's native language
998 AC_MSG_CHECKING([whether included gettext is requested])
999 AC_ARG_WITH(included-gettext,
1000 [ --with-included-gettext use the GNU gettext library included here],
1001 nls_cv_force_use_gnu_gettext=$withval,
1002 nls_cv_force_use_gnu_gettext=no)
1003 AC_MSG_RESULT($nls_cv_force_use_gnu_gettext)
1005 nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext"
1006 if test "$nls_cv_force_use_gnu_gettext" != "yes"; then
1007 dnl User does not insist on using GNU NLS library. Figure out what
1008 dnl to use. If GNU gettext is available we use this. Else we have
1009 dnl to fall back to GNU NLS library.
1012 dnl Add a version number to the cache macros.
1013 define(gt_cv_func_gnugettext_libc, [gt_cv_func_gnugettext]ifelse([$2], need-ngettext, 2, 1)[_libc])
1014 define(gt_cv_func_gnugettext_libintl, [gt_cv_func_gnugettext]ifelse([$2], need-ngettext, 2, 1)[_libintl])
1016 AC_CHECK_HEADER(libintl.h,
1017 [AC_CACHE_CHECK([for GNU gettext in libc], gt_cv_func_gnugettext_libc,
1018 [AC_TRY_LINK([#include <libintl.h>
1019 extern int _nl_msg_cat_cntr;],
1020 [bindtextdomain ("", "");
1021 return (int) gettext ("")]ifelse([$2], need-ngettext, [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr],
1022 gt_cv_func_gnugettext_libc=yes,
1023 gt_cv_func_gnugettext_libc=no)])
1025 if test "$gt_cv_func_gnugettext_libc" != "yes"; then
1026 AC_CACHE_CHECK([for GNU gettext in libintl],
1027 gt_cv_func_gnugettext_libintl,
1028 [gt_save_LIBS="$LIBS"
1029 LIBS="$LIBS -lintl $LIBICONV"
1030 AC_TRY_LINK([#include <libintl.h>
1031 extern int _nl_msg_cat_cntr;],
1032 [bindtextdomain ("", "");
1033 return (int) gettext ("")]ifelse([$2], need-ngettext, [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr],
1034 gt_cv_func_gnugettext_libintl=yes,
1035 gt_cv_func_gnugettext_libintl=no)
1036 LIBS="$gt_save_LIBS"])
1039 dnl If an already present or preinstalled GNU gettext() is found,
1040 dnl use it. But if this macro is used in GNU gettext, and GNU
1041 dnl gettext is already preinstalled in libintl, we update this
1042 dnl libintl. (Cf. the install rule in intl/Makefile.in.)
1043 if test "$gt_cv_func_gnugettext_libc" = "yes" \
1044 || { test "$gt_cv_func_gnugettext_libintl" = "yes" \
1045 && test "$PACKAGE" != gettext; }; then
1046 AC_DEFINE(HAVE_GETTEXT, 1,
1047 [Define if the GNU gettext() function is already present or preinstalled.])
1049 if test "$gt_cv_func_gnugettext_libintl" = "yes"; then
1050 dnl If iconv() is in a separate libiconv library, then anyone
1051 dnl linking with libintl{.a,.so} also needs to link with
1053 INTLLIBS="-lintl $LIBICONV"
1056 gt_save_LIBS="$LIBS"
1057 LIBS="$LIBS $INTLLIBS"
1058 AC_CHECK_FUNCS(dcgettext)
1059 LIBS="$gt_save_LIBS"
1061 dnl Search for GNU msgfmt in the PATH.
1062 AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
1063 [$ac_dir/$ac_word --statistics /dev/null >/dev/null 2>&1], :)
1064 AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
1066 dnl Search for GNU xgettext in the PATH.
1067 AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
1068 [$ac_dir/$ac_word --omit-header /dev/null >/dev/null 2>&1], :)
1074 if test "$CATOBJEXT" = "NONE"; then
1075 dnl GNU gettext is not found in the C library.
1076 dnl Fall back on GNU gettext library.
1077 nls_cv_use_gnu_gettext=yes
1081 if test "$nls_cv_use_gnu_gettext" = "yes"; then
1082 dnl Mark actions used to generate GNU NLS library.
1083 INTLOBJS="\$(GETTOBJS)"
1084 AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
1085 [$ac_dir/$ac_word --statistics /dev/null >/dev/null 2>&1], :)
1086 AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
1087 AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
1088 [$ac_dir/$ac_word --omit-header /dev/null >/dev/null 2>&1], :)
1090 BUILD_INCLUDED_LIBINTL=yes
1091 USE_INCLUDED_LIBINTL=yes
1093 INTLLIBS="ifelse([$3],[],\$(top_builddir)/intl,[$3])/libintl.ifelse([$1], use-libtool, [l], [])a $LIBICONV"
1094 LIBS=`echo " $LIBS " | sed -e 's/ -lintl / /' -e 's/^ //' -e 's/ $//'`
1097 dnl This could go away some day; the PATH_PROG_WITH_TEST already does it.
1098 dnl Test whether we really found GNU msgfmt.
1099 if test "$GMSGFMT" != ":"; then
1100 dnl If it is no GNU msgfmt we define it as : so that the
1101 dnl Makefiles still can work.
1102 if $GMSGFMT --statistics /dev/null >/dev/null 2>&1; then
1106 [found msgfmt program is not GNU msgfmt; ignore it])
1111 dnl This could go away some day; the PATH_PROG_WITH_TEST already does it.
1112 dnl Test whether we really found GNU xgettext.
1113 if test "$XGETTEXT" != ":"; then
1114 dnl If it is no GNU xgettext we define it as : so that the
1115 dnl Makefiles still can work.
1116 if $XGETTEXT --omit-header /dev/null >/dev/null 2>&1; then
1120 [found xgettext program is not GNU xgettext; ignore it])
1125 dnl We need to process the po/ directory.
1129 [for ac_file in $CONFIG_FILES; do
1130 # Support "outfile[:infile[:infile...]]"
1132 *:*) ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
1134 # PO directories have a Makefile.in generated from Makefile.in.in.
1135 case "$ac_file" in */Makefile.in)
1136 # Adjust a relative srcdir.
1137 ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'`
1138 ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`"
1139 ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'`
1140 # In autoconf-2.13 it is called $ac_given_srcdir.
1141 # In autoconf-2.50 it is called $srcdir.
1142 test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir"
1143 case "$ac_given_srcdir" in
1144 .) top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;;
1145 /*) top_srcdir="$ac_given_srcdir" ;;
1146 *) top_srcdir="$ac_dots$ac_given_srcdir" ;;
1148 if test -f "$ac_given_srcdir/$ac_dir/POTFILES.in"; then
1149 rm -f "$ac_dir/POTFILES"
1150 test -n "$as_me" && echo "$as_me: creating $ac_dir/POTFILES" || echo "creating $ac_dir/POTFILES"
1151 sed -e "/^#/d" -e "/^[ ]*\$/d" -e "s,.*, $top_srcdir/& \\\\," -e "\$s/\(.*\) \\\\/\1/" < "$ac_given_srcdir/$ac_dir/POTFILES.in" > "$ac_dir/POTFILES"
1152 test -n "$as_me" && echo "$as_me: creating $ac_dir/Makefile" || echo "creating $ac_dir/Makefile"
1153 sed -e "/POTFILES =/r $ac_dir/POTFILES" "$ac_dir/Makefile.in" > "$ac_dir/Makefile"
1160 dnl If this is used in GNU gettext we have to set BUILD_INCLUDED_LIBINTL
1161 dnl to 'yes' because some of the testsuite requires it.
1162 if test "$PACKAGE" = gettext; then
1163 BUILD_INCLUDED_LIBINTL=yes
1166 dnl intl/plural.c is generated from intl/plural.y. It requires bison,
1167 dnl because plural.y uses bison specific features. It requires at least
1168 dnl bison-1.26 because earlier versions generate a plural.c that doesn't
1170 dnl bison is only needed for the maintainer (who touches plural.y). But in
1171 dnl order to avoid separate Makefiles or --enable-maintainer-mode, we put
1172 dnl the rule in general Makefile. Now, some people carelessly touch the
1173 dnl files or have a broken "make" program, hence the plural.c rule will
1174 dnl sometimes fire. To avoid an error, defines BISON to ":" if it is not
1175 dnl present or too old.
1176 AC_CHECK_PROGS([INTLBISON], [bison])
1177 if test -z "$INTLBISON"; then
1180 dnl Found it, now check the version.
1181 AC_MSG_CHECKING([version of bison])
1182 changequote(<<,>>)dnl
1183 ac_prog_version=`$INTLBISON --version 2>&1 | sed -n 's/^.*GNU Bison .* \([0-9]*\.[0-9.]*\).*$/\1/p'`
1184 case $ac_prog_version in
1185 '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;;
1186 1.2[6-9]* | 1.[3-9][0-9]* | [2-9].*)
1188 ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;;
1189 *) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;;
1191 AC_MSG_RESULT([$ac_prog_version])
1193 if test $ac_verc_fail = yes; then
1197 dnl These rules are solely for the distribution goal. While doing this
1198 dnl we only have to keep exactly one list of the available catalogs
1199 dnl in configure.in.
1200 for lang in $ALL_LINGUAS; do
1201 GMOFILES="$GMOFILES $lang.gmo"
1202 POFILES="$POFILES $lang.po"
1205 dnl Make all variables we use known to autoconf.
1206 AC_SUBST(BUILD_INCLUDED_LIBINTL)
1207 AC_SUBST(USE_INCLUDED_LIBINTL)
1216 dnl For backward compatibility. Some configure.ins may be using this.
1218 nls_cv_header_libgt=
1220 dnl For backward compatibility. Some Makefiles may be using this.
1222 AC_SUBST(DATADIRNAME)
1224 dnl For backward compatibility. Some Makefiles may be using this.
1226 AC_SUBST(INSTOBJEXT)
1228 dnl For backward compatibility. Some Makefiles may be using this.
1233 dnl Usage: Just like AM_WITH_NLS, which see.
1234 AC_DEFUN([AM_GNU_GETTEXT],
1235 [AC_REQUIRE([AC_PROG_MAKE_SET])dnl
1236 AC_REQUIRE([AC_PROG_CC])dnl
1237 AC_REQUIRE([AC_CANONICAL_HOST])dnl
1238 AC_REQUIRE([AC_PROG_RANLIB])dnl
1239 AC_REQUIRE([AC_ISC_POSIX])dnl
1240 AC_REQUIRE([AC_HEADER_STDC])dnl
1241 AC_REQUIRE([AC_C_CONST])dnl
1242 AC_REQUIRE([AC_C_INLINE])dnl
1243 AC_REQUIRE([AC_TYPE_OFF_T])dnl
1244 AC_REQUIRE([AC_TYPE_SIZE_T])dnl
1245 AC_REQUIRE([AC_FUNC_ALLOCA])dnl
1246 AC_REQUIRE([AC_FUNC_MMAP])dnl
1247 AC_REQUIRE([jm_GLIBC21])dnl
1249 AC_CHECK_HEADERS([argz.h limits.h locale.h nl_types.h malloc.h stddef.h \
1250 stdlib.h string.h unistd.h sys/param.h])
1251 AC_CHECK_FUNCS([feof_unlocked fgets_unlocked getcwd getegid geteuid \
1252 getgid getuid mempcpy munmap putenv setenv setlocale stpcpy strchr strcasecmp \
1253 strdup strtoul tsearch __argz_count __argz_stringify __argz_next])
1258 AM_WITH_NLS([$1],[$2],[$3])
1260 if test "x$CATOBJEXT" != "x"; then
1261 if test "x$ALL_LINGUAS" = "x"; then
1264 AC_MSG_CHECKING(for catalogs to be installed)
1266 for presentlang in $ALL_LINGUAS; do
1268 for desiredlang in ${LINGUAS-$ALL_LINGUAS}; do
1269 # Use the presentlang catalog if desiredlang is
1270 # a. equal to presentlang, or
1271 # b. a variant of presentlang (because in this case,
1272 # presentlang can be used as a fallback for messages
1273 # which are not translated in the desiredlang catalog).
1274 case "$desiredlang" in
1275 "$presentlang"*) useit=yes;;
1278 if test $useit = yes; then
1279 NEW_LINGUAS="$NEW_LINGUAS $presentlang"
1282 LINGUAS=$NEW_LINGUAS
1283 AC_MSG_RESULT($LINGUAS)
1286 dnl Construct list of names of catalog files to be constructed.
1287 if test -n "$LINGUAS"; then
1288 for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done
1292 dnl If the AC_CONFIG_AUX_DIR macro for autoconf is used we possibly
1293 dnl find the mkinstalldirs script in another subdir but $(top_srcdir).
1294 dnl Try to locate is.
1296 if test -n "$ac_aux_dir"; then
1297 MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs"
1299 if test -z "$MKINSTALLDIRS"; then
1300 MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs"
1302 AC_SUBST(MKINSTALLDIRS)
1304 dnl Enable libtool support if the surrounding package wishes it.
1305 INTL_LIBTOOL_SUFFIX_PREFIX=ifelse([$1], use-libtool, [l], [])
1306 AC_SUBST(INTL_LIBTOOL_SUFFIX_PREFIX)
1309 # Search path for a program which passes the given test.
1310 # Ulrich Drepper <drepper@cygnus.com>, 1996.
1312 # This file can be copied and used freely without restrictions. It can
1313 # be used in projects which are not available under the GNU General Public
1314 # License but which still want to provide support for the GNU gettext
1316 # Please note that the actual code of GNU gettext is covered by the GNU
1317 # General Public License and is *not* in the public domain.
1321 dnl AM_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR,
1322 dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
1323 AC_DEFUN([AM_PATH_PROG_WITH_TEST],
1324 [# Extract the first word of "$2", so it can be a program name with args.
1325 set dummy $2; ac_word=[$]2
1326 AC_MSG_CHECKING([for $ac_word])
1327 AC_CACHE_VAL(ac_cv_path_$1,
1330 ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
1333 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
1334 for ac_dir in ifelse([$5], , $PATH, [$5]); do
1335 test -z "$ac_dir" && ac_dir=.
1336 if test -f $ac_dir/$ac_word; then
1338 ac_cv_path_$1="$ac_dir/$ac_word"
1344 dnl If no 4th arg is given, leave the cache variable unset,
1345 dnl so AC_PATH_PROGS will keep looking.
1346 ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
1351 if test ifelse([$4], , [-n "[$]$1"], ["[$]$1" != "$4"]); then
1352 AC_MSG_RESULT([$]$1)
1361 # Test for the GNU C Library, version 2.1 or newer.
1362 # From Bruno Haible.
1364 AC_DEFUN([jm_GLIBC21],
1366 AC_CACHE_CHECK(whether we are using the GNU C Library 2.1 or newer,
1367 ac_cv_gnu_library_2_1,
1368 [AC_EGREP_CPP([Lucky GNU user],
1370 #include <features.h>
1371 #ifdef __GNU_LIBRARY__
1372 #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1) || (__GLIBC__ > 2)
1377 ac_cv_gnu_library_2_1=yes,
1378 ac_cv_gnu_library_2_1=no)
1382 GLIBC21="$ac_cv_gnu_library_2_1"
1388 dnl From Bruno Haible.
1390 AC_DEFUN([AM_ICONV],
1392 dnl Some systems have iconv in libc, some have it in libiconv (OSF/1 and
1393 dnl those with the standalone portable GNU libiconv installed).
1395 AC_ARG_WITH([libiconv-prefix],
1396 [ --with-libiconv-prefix=DIR search for libiconv in DIR/include and DIR/lib], [
1397 for dir in `echo "$withval" | tr : ' '`; do
1398 if test -d $dir/include; then CPPFLAGS="$CPPFLAGS -I$dir/include"; fi
1399 if test -d $dir/lib; then LDFLAGS="$LDFLAGS -L$dir/lib"; fi
1403 AC_CACHE_CHECK(for iconv, am_cv_func_iconv, [
1404 am_cv_func_iconv="no, consider installing GNU libiconv"
1406 AC_TRY_LINK([#include <stdlib.h>
1407 #include <iconv.h>],
1408 [iconv_t cd = iconv_open("","");
1409 iconv(cd,NULL,NULL,NULL,NULL);
1411 am_cv_func_iconv=yes)
1412 if test "$am_cv_func_iconv" != yes; then
1413 am_save_LIBS="$LIBS"
1414 LIBS="$LIBS -liconv"
1415 AC_TRY_LINK([#include <stdlib.h>
1416 #include <iconv.h>],
1417 [iconv_t cd = iconv_open("","");
1418 iconv(cd,NULL,NULL,NULL,NULL);
1421 am_cv_func_iconv=yes)
1422 LIBS="$am_save_LIBS"
1425 if test "$am_cv_func_iconv" = yes; then
1426 AC_DEFINE(HAVE_ICONV, 1, [Define if you have the iconv() function.])
1427 AC_MSG_CHECKING([for iconv declaration])
1428 AC_CACHE_VAL(am_cv_proto_iconv, [
1436 #if defined(__STDC__) || defined(__cplusplus)
1437 size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
1441 ], [], am_cv_proto_iconv_arg1="", am_cv_proto_iconv_arg1="const")
1442 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);"])
1443 am_cv_proto_iconv=`echo "[$]am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'`
1444 AC_MSG_RESULT([$]{ac_t:-
1445 }[$]am_cv_proto_iconv)
1446 AC_DEFINE_UNQUOTED(ICONV_CONST, $am_cv_proto_iconv_arg1,
1447 [Define as const if the declaration of iconv() needs const.])
1450 if test "$am_cv_lib_iconv" = yes; then
1458 dnl From Bruno Haible.
1460 AC_DEFUN([AM_LANGINFO_CODESET],
1462 AC_CACHE_CHECK([for nl_langinfo and CODESET], am_cv_langinfo_codeset,
1463 [AC_TRY_LINK([#include <langinfo.h>],
1464 [char* cs = nl_langinfo(CODESET);],
1465 am_cv_langinfo_codeset=yes,
1466 am_cv_langinfo_codeset=no)
1468 if test $am_cv_langinfo_codeset = yes; then
1469 AC_DEFINE(HAVE_LANGINFO_CODESET, 1,
1470 [Define if you have <langinfo.h> and nl_langinfo(CODESET).])
1474 # Check whether LC_MESSAGES is available in <locale.h>.
1475 # Ulrich Drepper <drepper@cygnus.com>, 1995.
1477 # This file can be copied and used freely without restrictions. It can
1478 # be used in projects which are not available under the GNU General Public
1479 # License but which still want to provide support for the GNU gettext
1481 # Please note that the actual code of GNU gettext is covered by the GNU
1482 # General Public License and is *not* in the public domain.
1486 AC_DEFUN([AM_LC_MESSAGES],
1487 [if test $ac_cv_header_locale_h = yes; then
1488 AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES,
1489 [AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
1490 am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)])
1491 if test $am_cv_val_LC_MESSAGES = yes; then
1492 AC_DEFINE(HAVE_LC_MESSAGES, 1,
1493 [Define if your <locale.h> file defines LC_MESSAGES.])