1 dnl aclocal.m4 generated automatically by aclocal 1.4-p4
3 dnl Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
4 dnl This file is free software; the Free Software Foundation
5 dnl gives unlimited permission to copy and/or distribute it,
6 dnl with or without modifications, as long as this notice is preserved.
8 dnl This program is distributed in the hope that it will be useful,
9 dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without
10 dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A
11 dnl PARTICULAR PURPOSE.
13 # Do all the work for Automake. This macro actually does too much --
14 # some checks are only needed if your package does certain things.
15 # But this isn't really a big deal.
20 dnl AM_INIT_AUTOMAKE(package,version, [no-define])
22 AC_DEFUN(AM_INIT_AUTOMAKE,
23 [AC_REQUIRE([AC_PROG_INSTALL])
28 dnl test to see if srcdir already configured
29 if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
30 AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
33 AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
34 AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package]))
35 AC_REQUIRE([AM_SANITY_CHECK])
36 AC_REQUIRE([AC_ARG_PROGRAM])
37 dnl FIXME This is truly gross.
38 missing_dir=`cd $ac_aux_dir && pwd`
39 AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
40 AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
41 AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir)
42 AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
43 AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
44 AC_REQUIRE([AC_PROG_MAKE_SET])])
47 # Check to make sure that the build environment is sane.
50 AC_DEFUN(AM_SANITY_CHECK,
51 [AC_MSG_CHECKING([whether build environment is sane])
54 echo timestamp > conftestfile
55 # Do `set' in a subshell so we don't clobber the current shell's
56 # arguments. Must try -L first in case configure is actually a
57 # symlink; some systems play weird games with the mod time of symlinks
58 # (eg FreeBSD returns the mod time of the symlink's containing
61 set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
62 if test "[$]*" = "X"; then
64 set X `ls -t $srcdir/configure conftestfile`
66 if test "[$]*" != "X $srcdir/configure conftestfile" \
67 && test "[$]*" != "X conftestfile $srcdir/configure"; then
69 # If neither matched, then we have a broken ls. This can happen
70 # if, for instance, CONFIG_SHELL is bash and it inherits a
71 # broken ls alias from the environment. This has actually
72 # happened. Such a system could not be considered "sane".
73 AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
74 alias in your environment])
77 test "[$]2" = conftestfile
83 AC_MSG_ERROR([newly created file is older than distributed files!
84 Check your system clock])
89 dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY)
90 dnl The program must properly implement --version.
91 AC_DEFUN(AM_MISSING_PROG,
92 [AC_MSG_CHECKING(for working $2)
93 # Run test in a subshell; some versions of sh will print an error if
94 # an executable is not found, even if stderr is redirected.
95 # Redirect stdin to placate older versions of autoconf. Sigh.
96 if ($2 --version) < /dev/null > /dev/null 2>&1; then
101 AC_MSG_RESULT(missing)
105 # Like AC_CONFIG_HEADER, but automatically create stamp file.
107 AC_DEFUN(AM_CONFIG_HEADER,
109 AC_CONFIG_HEADER([$1])
110 dnl When config.status generates a header, we must update the stamp-h file.
111 dnl This file resides in the same directory as the config header
112 dnl that is generated. We must strip everything past the first ":",
113 dnl and everything past the last "/".
114 AC_OUTPUT_COMMANDS(changequote(<<,>>)dnl
115 ifelse(patsubst(<<$1>>, <<[^ ]>>, <<>>), <<>>,
116 <<test -z "<<$>>CONFIG_HEADERS" || echo timestamp > patsubst(<<$1>>, <<^\([^:]*/\)?.*>>, <<\1>>)stamp-h<<>>dnl>>,
118 for am_file in <<$1>>; do
119 case " <<$>>CONFIG_HEADERS " in
120 *" <<$>>am_file "*<<)>>
121 echo timestamp > `echo <<$>>am_file | sed -e 's%:.*%%' -e 's%[^/]*$%%'`stamp-h$am_indx
124 am_indx=`expr "<<$>>am_indx" + 1`
131 # Single argument says where are built sources to test, relative to the
132 # built test directory. Maybe omitted if the same (flat distribution).
134 AC_DEFUN([AT_CONFIG],
135 [AT_TESTPATH=ifelse([$1], [], [.], [$1])
136 AC_SUBST([AT_TESTPATH])
137 # Try to be compatible with both Autoconf 2.13 and 2.50.
138 if test -z "$ECHO_C$ECHO_N$ECHO_T"; then
149 # This test replaces the one in autoconf.
150 # Currently this macro should have the same name as the autoconf macro
151 # because gettext's gettext.m4 (distributed in the automake package)
152 # still uses it. Otherwise, the use in gettext.m4 makes autoheader
153 # give these diagnostics:
154 # configure.in:556: AC_TRY_COMPILE was called before AC_ISC_POSIX
155 # configure.in:556: AC_TRY_RUN was called before AC_ISC_POSIX
157 undefine([AC_ISC_POSIX])
159 AC_DEFUN([AC_ISC_POSIX],
161 dnl This test replaces the obsolescent AC_ISC_POSIX kludge.
162 AC_CHECK_LIB(cposix, strerror, [LIBS="$LIBS -lcposix"])
169 # @defmac AC_PROG_CC_STDC
170 # @maindex PROG_CC_STDC
172 # If the C compiler in not in ANSI C mode by default, try to add an option
173 # to output variable @code{CC} to make it so. This macro tries various
174 # options that select ANSI C on some system or another. It considers the
175 # compiler to be in ANSI C mode if it handles function prototypes correctly.
177 # If you use this macro, you should check after calling it whether the C
178 # compiler has been set to accept ANSI C; if not, the shell variable
179 # @code{am_cv_prog_cc_stdc} is set to @samp{no}. If you wrote your source
180 # code in ANSI C, you can make an un-ANSIfied copy of it by using the
181 # program @code{ansi2knr}, which comes with Ghostscript.
184 AC_DEFUN(AM_PROG_CC_STDC,
185 [AC_REQUIRE([AC_PROG_CC])
186 AC_BEFORE([$0], [AC_C_INLINE])
187 AC_BEFORE([$0], [AC_C_CONST])
188 dnl Force this before AC_PROG_CPP. Some cpp's, eg on HPUX, require
189 dnl a magic option to avoid problems with ANSI preprocessor commands
191 dnl FIXME: can't do this because then AC_AIX won't work due to a
192 dnl circular dependency.
193 dnl AC_BEFORE([$0], [AC_PROG_CPP])
194 AC_MSG_CHECKING(for ${CC-cc} option to accept ANSI C)
195 AC_CACHE_VAL(am_cv_prog_cc_stdc,
196 [am_cv_prog_cc_stdc=no
198 # Don't try gcc -ansi; that turns off useful extensions and
199 # breaks some systems' header files.
201 # Ultrix and OSF/1 -std1
202 # HP-UX -Aa -D_HPUX_SOURCE
203 # SVR4 -Xc -D__EXTENSIONS__
204 for ac_arg in "" -qlanglvl=ansi -std1 "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
206 CC="$ac_save_CC $ac_arg"
210 #include <sys/types.h>
211 #include <sys/stat.h>
212 /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */
213 struct buf { int x; };
214 FILE * (*rcsopen) (struct buf *, struct stat *, int);
215 static char *e (p, i)
221 static char *f (char * (*g) (char **, int), char **p, ...)
226 s = g (p, va_arg (v,int));
230 int test (int i, double x);
231 struct s1 {int (*f) (int a);};
232 struct s2 {int (*f) (double a);};
233 int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
237 return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1];
239 [am_cv_prog_cc_stdc="$ac_arg"; break])
243 if test -z "$am_cv_prog_cc_stdc"; then
244 AC_MSG_RESULT([none needed])
246 AC_MSG_RESULT($am_cv_prog_cc_stdc)
248 case "x$am_cv_prog_cc_stdc" in
250 *) CC="$CC $am_cv_prog_cc_stdc" ;;
254 # serial 1 -*- Autoconf -*-
256 # BISON_AC_PROG_GNU_M4
257 # --------------------
258 # Check for GNU m4, at least 1.3 (supports frozen files).
259 AC_DEFUN([BISON_AC_PROG_GNU_M4],
260 [AC_PATH_PROGS(M4, gm4 gnum4 m4, m4)
261 AC_CACHE_CHECK([whether m4 supports frozen files],
263 [ac_cv_prog_gnu_m4=no
264 if test x"$M4" != x; then
265 case `$M4 --help < /dev/null 2>&1` in
266 *reload-state*) ac_cv_prog_gnu_m4=yes ;;
269 ])# BISON_AC_PROG_GNU_M4
271 AC_DEFUN(BISON_WARNING,
272 [AC_MSG_CHECKING(whether compiler accepts $1)
273 AC_SUBST(WARNING_CFLAGS)
274 ac_save_CFLAGS="$CFLAGS"
278 WARNING_CFLAGS="$WARNING_CFLAGS $1"
281 CFLAGS="$ac_save_CFLAGS"])
286 AC_DEFUN(AM_C_PROTOTYPES,
287 [AC_REQUIRE([AM_PROG_CC_STDC])
288 AC_REQUIRE([AC_PROG_CPP])
289 AC_MSG_CHECKING([for function prototypes])
290 if test "$am_cv_prog_cc_stdc" != no; then
292 AC_DEFINE(PROTOTYPES,1,[Define if compiler has function prototypes])
296 U=_ ANSI2KNR=./ansi2knr
297 # Ensure some checks needed by ansi2knr itself.
299 AC_CHECK_HEADERS(string.h)
302 AC_SUBST(ANSI2KNR)dnl
307 dnl From Jim Meyering.
308 dnl Determine whether malloc accepts 0 as its argument.
309 dnl If it doesn't, arrange to use the replacement function.
312 AC_DEFUN(jm_FUNC_MALLOC,
314 dnl xmalloc.c requires that this symbol be defined so it doesn't
315 dnl mistakenly use a broken malloc -- as it might if this test were omitted.
316 AC_DEFINE_UNQUOTED(HAVE_DONE_WORKING_MALLOC_CHECK, 1,
317 [Define if the malloc check has been performed. ])
319 AC_CACHE_CHECK([for working malloc], jm_cv_func_working_malloc,
325 exit (malloc (0) ? 0 : 1);
328 jm_cv_func_working_malloc=yes,
329 jm_cv_func_working_malloc=no,
330 dnl When crosscompiling, assume malloc is broken.
331 jm_cv_func_working_malloc=no)
333 if test $jm_cv_func_working_malloc = no; then
335 LIBOBJS="$LIBOBJS malloc.$ac_objext"
336 AC_DEFINE_UNQUOTED(malloc, rpl_malloc,
337 [Define to rpl_malloc if the replacement function should be used.])
343 dnl From Jim Meyering.
344 dnl Determine whether realloc works when both arguments are 0.
345 dnl If it doesn't, arrange to use the replacement function.
348 AC_DEFUN(jm_FUNC_REALLOC,
350 dnl xmalloc.c requires that this symbol be defined so it doesn't
351 dnl mistakenly use a broken realloc -- as it might if this test were omitted.
352 AC_DEFINE_UNQUOTED(HAVE_DONE_WORKING_REALLOC_CHECK, 1,
353 [Define if the realloc check has been performed. ])
355 AC_CACHE_CHECK([for working realloc], jm_cv_func_working_realloc,
361 exit (realloc (0, 0) ? 0 : 1);
364 jm_cv_func_working_realloc=yes,
365 jm_cv_func_working_realloc=no,
366 dnl When crosscompiling, assume realloc is broken.
367 jm_cv_func_working_realloc=no)
369 if test $jm_cv_func_working_realloc = no; then
371 LIBOBJS="$LIBOBJS realloc.$ac_objext"
372 AC_DEFINE_UNQUOTED(realloc, rpl_realloc,
373 [Define to rpl_realloc if the replacement function should be used.])
379 dnl These are the prerequisite macros for files in the lib/
380 dnl directories of Bison.
382 AC_DEFUN([jm_PREREQ_QUOTEARG],
384 AC_CHECK_FUNCS(isascii iswprint mbrtowc)
385 AC_CHECK_HEADERS(limits.h stdlib.h string.h wchar.h wctype.h)
394 dnl From Paul Eggert.
396 AC_DEFUN(AC_C_BACKSLASH_A,
398 AC_CACHE_CHECK([whether backslash-a works in strings], ac_cv_c_backslash_a,
404 char buf['\a' == 'a' ? -1 : 1];
406 return buf[0] != "\a"[0];
408 ac_cv_c_backslash_a=yes,
409 ac_cv_c_backslash_a=no)])
410 if test $ac_cv_c_backslash_a = yes; then
411 AC_DEFINE(HAVE_C_BACKSLASH_A, 1,
412 [Define if backslash-a works in C strings.])
420 # BeOS 5 has <wchar.h> but does not define mbstate_t,
421 # so you can't declare an object of that type.
422 # Check for this incompatibility with Standard C.
424 # Include stdlib.h first, because otherwise this test would fail on Linux
425 # (at least glibc-2.1.3) because the "_XOPEN_SOURCE 500" definition elicits
426 # a syntax error in wchar.h due to the use of undefined __int32_t.
428 AC_DEFUN(AC_MBSTATE_T,
430 AC_CHECK_HEADERS(stdlib.h)
432 AC_CACHE_CHECK([for mbstate_t], ac_cv_type_mbstate_t,
438 [mbstate_t x; return sizeof x;],
439 ac_cv_type_mbstate_t=yes,
440 ac_cv_type_mbstate_t=no)])
441 if test $ac_cv_type_mbstate_t = no; then
442 AC_DEFINE(mbstate_t, int,
443 [Define to a type if <wchar.h> does not define.])
448 dnl FIXME: put these prerequisite-only *.m4 files in a separate
449 dnl directory -- otherwise, they'll conflict with existing files.
451 dnl These are the prerequisite macros for GNU's error.c file.
452 AC_DEFUN(jm_PREREQ_ERROR,
454 AC_CHECK_FUNCS(strerror strerror_r vprintf doprnt)
460 # Experimental replacement for the function in the latest CVS autoconf.
461 # If the compile-test says strerror_r doesn't work, then resort to a
462 # `run'-test that works on BeOS and segfaults on DEC Unix.
463 # Use with the error.c file in ../lib.
465 undefine([AC_FUNC_STRERROR_R])
469 AC_DEFUN([AC_FUNC_STRERROR_R],
470 [AC_CHECK_DECLS([strerror_r])
471 AC_CHECK_FUNCS([strerror_r])
472 if test $ac_cv_func_strerror_r = yes; then
473 AC_CHECK_HEADERS(string.h)
474 AC_CACHE_CHECK([for working strerror_r],
475 ac_cv_func_strerror_r_works,
486 char x = *strerror_r (0, buf, sizeof buf);
488 ac_cv_func_strerror_r_works=yes,
489 ac_cv_func_strerror_r_works=no
491 if test $ac_cv_func_strerror_r_works = no; then
492 # strerror_r seems not to work, but now we have to choose between
493 # systems that have relatively inaccessible declarations for the
494 # function. BeOS and DEC UNIX 4.0 fall in this category, but the
495 # former has a strerror_r that returns char*, while the latter
496 # has a strerror_r that returns `int'.
497 # This test should segfault on the DEC system.
504 extern char *strerror_r ();
510 char x = *strerror_r (0, buf, sizeof buf);
514 ac_cv_func_strerror_r_works=yes,
515 ac_cv_func_strerror_r_works=no,
516 ac_cv_func_strerror_r_works=no)
519 if test $ac_cv_func_strerror_r_works = yes; then
520 AC_DEFINE_UNQUOTED(HAVE_WORKING_STRERROR_R, 1,
521 [Define to 1 if `strerror_r' returns a string.])
524 ])# AC_FUNC_STRERROR_R
526 # Macro to add for using GNU gettext.
527 # Ulrich Drepper <drepper@cygnus.com>, 1995.
529 # This file can be copied and used freely without restrictions. It can
530 # be used in projects which are not available under the GNU General Public
531 # License but which still want to provide support for the GNU gettext
533 # Please note that the actual code of GNU gettext is covered by the GNU
534 # General Public License and is *not* in the public domain.
538 dnl Usage: AM_WITH_NLS([TOOLSYMBOL], [NEEDSYMBOL], [LIBDIR]).
539 dnl If TOOLSYMBOL is specified and is 'use-libtool', then a libtool library
540 dnl $(top_builddir)/intl/libintl.la will be created (shared and/or static,
541 dnl depending on --{enable,disable}-{shared,static} and on the presence of
542 dnl AM-DISABLE-SHARED). Otherwise, a static library
543 dnl $(top_builddir)/intl/libintl.a will be created.
544 dnl If NEEDSYMBOL is specified and is 'need-ngettext', then GNU gettext
545 dnl implementations (in libc or libintl) without the ngettext() function
547 dnl LIBDIR is used to find the intl libraries. If empty,
548 dnl the value `$(top_builddir)/intl/' is used.
550 dnl The result of the configuration is one of three cases:
551 dnl 1) GNU gettext, as included in the intl subdirectory, will be compiled
553 dnl Catalog format: GNU --> install in $(datadir)
554 dnl Catalog extension: .mo after installation, .gmo in source tree
555 dnl 2) GNU gettext has been found in the system's C library.
556 dnl Catalog format: GNU --> install in $(datadir)
557 dnl Catalog extension: .mo after installation, .gmo in source tree
558 dnl 3) No internationalization, always use English msgid.
559 dnl Catalog format: none
560 dnl Catalog extension: none
561 dnl The use of .gmo is historical (it was needed to avoid overwriting the
562 dnl GNU format catalogs when building on a platform with an X/Open gettext),
563 dnl but we keep it in order not to force irrelevant filename changes on the
566 AC_DEFUN([AM_WITH_NLS],
567 [AC_MSG_CHECKING([whether NLS is requested])
568 dnl Default is enabled NLS
570 [ --disable-nls do not use Native Language Support],
571 USE_NLS=$enableval, USE_NLS=yes)
572 AC_MSG_RESULT($USE_NLS)
575 BUILD_INCLUDED_LIBINTL=no
576 USE_INCLUDED_LIBINTL=no
579 dnl If we use NLS figure out what method
580 if test "$USE_NLS" = "yes"; then
581 AC_DEFINE(ENABLE_NLS, 1,
582 [Define to 1 if translation of program messages to the user's native language
584 AC_MSG_CHECKING([whether included gettext is requested])
585 AC_ARG_WITH(included-gettext,
586 [ --with-included-gettext use the GNU gettext library included here],
587 nls_cv_force_use_gnu_gettext=$withval,
588 nls_cv_force_use_gnu_gettext=no)
589 AC_MSG_RESULT($nls_cv_force_use_gnu_gettext)
591 nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext"
592 if test "$nls_cv_force_use_gnu_gettext" != "yes"; then
593 dnl User does not insist on using GNU NLS library. Figure out what
594 dnl to use. If GNU gettext is available we use this. Else we have
595 dnl to fall back to GNU NLS library.
598 dnl Add a version number to the cache macros.
599 define(gt_cv_func_gnugettext_libc, [gt_cv_func_gnugettext]ifelse([$2], need-ngettext, 2, 1)[_libc])
600 define(gt_cv_func_gnugettext_libintl, [gt_cv_func_gnugettext]ifelse([$2], need-ngettext, 2, 1)[_libintl])
602 AC_CHECK_HEADER(libintl.h,
603 [AC_CACHE_CHECK([for GNU gettext in libc], gt_cv_func_gnugettext_libc,
604 [AC_TRY_LINK([#include <libintl.h>
605 extern int _nl_msg_cat_cntr;],
606 [bindtextdomain ("", "");
607 return (int) gettext ("")]ifelse([$2], need-ngettext, [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr],
608 gt_cv_func_gnugettext_libc=yes,
609 gt_cv_func_gnugettext_libc=no)])
611 if test "$gt_cv_func_gnugettext_libc" != "yes"; then
612 AC_CACHE_CHECK([for GNU gettext in libintl],
613 gt_cv_func_gnugettext_libintl,
614 [gt_save_LIBS="$LIBS"
615 LIBS="$LIBS -lintl $LIBICONV"
616 AC_TRY_LINK([#include <libintl.h>
617 extern int _nl_msg_cat_cntr;],
618 [bindtextdomain ("", "");
619 return (int) gettext ("")]ifelse([$2], need-ngettext, [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr],
620 gt_cv_func_gnugettext_libintl=yes,
621 gt_cv_func_gnugettext_libintl=no)
622 LIBS="$gt_save_LIBS"])
625 dnl If an already present or preinstalled GNU gettext() is found,
626 dnl use it. But if this macro is used in GNU gettext, and GNU
627 dnl gettext is already preinstalled in libintl, we update this
628 dnl libintl. (Cf. the install rule in intl/Makefile.in.)
629 if test "$gt_cv_func_gnugettext_libc" = "yes" \
630 || { test "$gt_cv_func_gnugettext_libintl" = "yes" \
631 && test "$PACKAGE" != gettext; }; then
632 AC_DEFINE(HAVE_GETTEXT, 1,
633 [Define if the GNU gettext() function is already present or preinstalled.])
635 if test "$gt_cv_func_gnugettext_libintl" = "yes"; then
636 dnl If iconv() is in a separate libiconv library, then anyone
637 dnl linking with libintl{.a,.so} also needs to link with
639 INTLLIBS="-lintl $LIBICONV"
643 LIBS="$LIBS $INTLLIBS"
644 AC_CHECK_FUNCS(dcgettext)
647 dnl Search for GNU msgfmt in the PATH.
648 AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
649 [$ac_dir/$ac_word --statistics /dev/null >/dev/null 2>&1], :)
650 AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
652 dnl Search for GNU xgettext in the PATH.
653 AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
654 [$ac_dir/$ac_word --omit-header /dev/null >/dev/null 2>&1], :)
660 if test "$CATOBJEXT" = "NONE"; then
661 dnl GNU gettext is not found in the C library.
662 dnl Fall back on GNU gettext library.
663 nls_cv_use_gnu_gettext=yes
667 if test "$nls_cv_use_gnu_gettext" = "yes"; then
668 dnl Mark actions used to generate GNU NLS library.
669 INTLOBJS="\$(GETTOBJS)"
670 AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
671 [$ac_dir/$ac_word --statistics /dev/null >/dev/null 2>&1], :)
672 AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
673 AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
674 [$ac_dir/$ac_word --omit-header /dev/null >/dev/null 2>&1], :)
676 BUILD_INCLUDED_LIBINTL=yes
677 USE_INCLUDED_LIBINTL=yes
679 INTLLIBS="ifelse([$3],[],\$(top_builddir)/intl,[$3])/libintl.ifelse([$1], use-libtool, [l], [])a $LIBICONV"
680 LIBS=`echo " $LIBS " | sed -e 's/ -lintl / /' -e 's/^ //' -e 's/ $//'`
683 dnl This could go away some day; the PATH_PROG_WITH_TEST already does it.
684 dnl Test whether we really found GNU msgfmt.
685 if test "$GMSGFMT" != ":"; then
686 dnl If it is no GNU msgfmt we define it as : so that the
687 dnl Makefiles still can work.
688 if $GMSGFMT --statistics /dev/null >/dev/null 2>&1; then
692 [found msgfmt program is not GNU msgfmt; ignore it])
697 dnl This could go away some day; the PATH_PROG_WITH_TEST already does it.
698 dnl Test whether we really found GNU xgettext.
699 if test "$XGETTEXT" != ":"; then
700 dnl If it is no GNU xgettext we define it as : so that the
701 dnl Makefiles still can work.
702 if $XGETTEXT --omit-header /dev/null >/dev/null 2>&1; then
706 [found xgettext program is not GNU xgettext; ignore it])
711 dnl We need to process the po/ directory.
715 [for ac_file in $CONFIG_FILES; do
716 # Support "outfile[:infile[:infile...]]"
718 *:*) ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
720 # PO directories have a Makefile.in generated from Makefile.in.in.
721 case "$ac_file" in */Makefile.in)
722 # Adjust a relative srcdir.
723 ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'`
724 ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`"
725 ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'`
726 # In autoconf-2.13 it is called $ac_given_srcdir.
727 # In autoconf-2.50 it is called $srcdir.
728 test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir"
729 case "$ac_given_srcdir" in
730 .) top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;;
731 /*) top_srcdir="$ac_given_srcdir" ;;
732 *) top_srcdir="$ac_dots$ac_given_srcdir" ;;
734 if test -f "$ac_given_srcdir/$ac_dir/POTFILES.in"; then
735 rm -f "$ac_dir/POTFILES"
736 test -n "$as_me" && echo "$as_me: creating $ac_dir/POTFILES" || echo "creating $ac_dir/POTFILES"
737 sed -e "/^#/d" -e "/^[ ]*\$/d" -e "s,.*, $top_srcdir/& \\\\," -e "\$s/\(.*\) \\\\/\1/" < "$ac_given_srcdir/$ac_dir/POTFILES.in" > "$ac_dir/POTFILES"
738 test -n "$as_me" && echo "$as_me: creating $ac_dir/Makefile" || echo "creating $ac_dir/Makefile"
739 sed -e "/POTFILES =/r $ac_dir/POTFILES" "$ac_dir/Makefile.in" > "$ac_dir/Makefile"
746 dnl If this is used in GNU gettext we have to set BUILD_INCLUDED_LIBINTL
747 dnl to 'yes' because some of the testsuite requires it.
748 if test "$PACKAGE" = gettext; then
749 BUILD_INCLUDED_LIBINTL=yes
752 dnl intl/plural.c is generated from intl/plural.y. It requires bison,
753 dnl because plural.y uses bison specific features. It requires at least
754 dnl bison-1.26 because earlier versions generate a plural.c that doesn't
756 dnl bison is only needed for the maintainer (who touches plural.y). But in
757 dnl order to avoid separate Makefiles or --enable-maintainer-mode, we put
758 dnl the rule in general Makefile. Now, some people carelessly touch the
759 dnl files or have a broken "make" program, hence the plural.c rule will
760 dnl sometimes fire. To avoid an error, defines BISON to ":" if it is not
761 dnl present or too old.
762 AC_CHECK_PROGS([INTLBISON], [bison])
763 if test -z "$INTLBISON"; then
766 dnl Found it, now check the version.
767 AC_MSG_CHECKING([version of bison])
768 changequote(<<,>>)dnl
769 ac_prog_version=`$INTLBISON --version 2>&1 | sed -n 's/^.*GNU Bison .* \([0-9]*\.[0-9.]*\).*$/\1/p'`
770 case $ac_prog_version in
771 '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;;
772 1.2[6-9]* | 1.[3-9][0-9]* | [2-9].*)
774 ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;;
775 *) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;;
777 AC_MSG_RESULT([$ac_prog_version])
779 if test $ac_verc_fail = yes; then
783 dnl These rules are solely for the distribution goal. While doing this
784 dnl we only have to keep exactly one list of the available catalogs
786 for lang in $ALL_LINGUAS; do
787 GMOFILES="$GMOFILES $lang.gmo"
788 POFILES="$POFILES $lang.po"
791 dnl Make all variables we use known to autoconf.
792 AC_SUBST(BUILD_INCLUDED_LIBINTL)
793 AC_SUBST(USE_INCLUDED_LIBINTL)
802 dnl For backward compatibility. Some configure.ins may be using this.
806 dnl For backward compatibility. Some Makefiles may be using this.
808 AC_SUBST(DATADIRNAME)
810 dnl For backward compatibility. Some Makefiles may be using this.
814 dnl For backward compatibility. Some Makefiles may be using this.
819 dnl Usage: Just like AM_WITH_NLS, which see.
820 AC_DEFUN([AM_GNU_GETTEXT],
821 [AC_REQUIRE([AC_PROG_MAKE_SET])dnl
822 AC_REQUIRE([AC_PROG_CC])dnl
823 AC_REQUIRE([AC_CANONICAL_HOST])dnl
824 AC_REQUIRE([AC_PROG_RANLIB])dnl
825 AC_REQUIRE([AC_ISC_POSIX])dnl
826 AC_REQUIRE([AC_HEADER_STDC])dnl
827 AC_REQUIRE([AC_C_CONST])dnl
828 AC_REQUIRE([AC_C_INLINE])dnl
829 AC_REQUIRE([AC_TYPE_OFF_T])dnl
830 AC_REQUIRE([AC_TYPE_SIZE_T])dnl
831 AC_REQUIRE([AC_FUNC_ALLOCA])dnl
832 AC_REQUIRE([AC_FUNC_MMAP])dnl
833 AC_REQUIRE([jm_GLIBC21])dnl
835 AC_CHECK_HEADERS([argz.h limits.h locale.h nl_types.h malloc.h stddef.h \
836 stdlib.h string.h unistd.h sys/param.h])
837 AC_CHECK_FUNCS([feof_unlocked fgets_unlocked getcwd getegid geteuid \
838 getgid getuid mempcpy munmap putenv setenv setlocale stpcpy strchr strcasecmp \
839 strdup strtoul tsearch __argz_count __argz_stringify __argz_next])
844 AM_WITH_NLS([$1],[$2],[$3])
846 if test "x$CATOBJEXT" != "x"; then
847 if test "x$ALL_LINGUAS" = "x"; then
850 AC_MSG_CHECKING(for catalogs to be installed)
852 for presentlang in $ALL_LINGUAS; do
854 for desiredlang in ${LINGUAS-$ALL_LINGUAS}; do
855 # Use the presentlang catalog if desiredlang is
856 # a. equal to presentlang, or
857 # b. a variant of presentlang (because in this case,
858 # presentlang can be used as a fallback for messages
859 # which are not translated in the desiredlang catalog).
860 case "$desiredlang" in
861 "$presentlang"*) useit=yes;;
864 if test $useit = yes; then
865 NEW_LINGUAS="$NEW_LINGUAS $presentlang"
869 AC_MSG_RESULT($LINGUAS)
872 dnl Construct list of names of catalog files to be constructed.
873 if test -n "$LINGUAS"; then
874 for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done
878 dnl If the AC_CONFIG_AUX_DIR macro for autoconf is used we possibly
879 dnl find the mkinstalldirs script in another subdir but $(top_srcdir).
880 dnl Try to locate is.
882 if test -n "$ac_aux_dir"; then
883 MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs"
885 if test -z "$MKINSTALLDIRS"; then
886 MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs"
888 AC_SUBST(MKINSTALLDIRS)
890 dnl Enable libtool support if the surrounding package wishes it.
891 INTL_LIBTOOL_SUFFIX_PREFIX=ifelse([$1], use-libtool, [l], [])
892 AC_SUBST(INTL_LIBTOOL_SUFFIX_PREFIX)
895 # Search path for a program which passes the given test.
896 # Ulrich Drepper <drepper@cygnus.com>, 1996.
898 # This file can be copied and used freely without restrictions. It can
899 # be used in projects which are not available under the GNU General Public
900 # License but which still want to provide support for the GNU gettext
902 # Please note that the actual code of GNU gettext is covered by the GNU
903 # General Public License and is *not* in the public domain.
907 dnl AM_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR,
908 dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
909 AC_DEFUN([AM_PATH_PROG_WITH_TEST],
910 [# Extract the first word of "$2", so it can be a program name with args.
911 set dummy $2; ac_word=[$]2
912 AC_MSG_CHECKING([for $ac_word])
913 AC_CACHE_VAL(ac_cv_path_$1,
916 ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
919 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
920 for ac_dir in ifelse([$5], , $PATH, [$5]); do
921 test -z "$ac_dir" && ac_dir=.
922 if test -f $ac_dir/$ac_word; then
924 ac_cv_path_$1="$ac_dir/$ac_word"
930 dnl If no 4th arg is given, leave the cache variable unset,
931 dnl so AC_PATH_PROGS will keep looking.
932 ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
937 if test ifelse([$4], , [-n "[$]$1"], ["[$]$1" != "$4"]); then
947 # Test for the GNU C Library, version 2.1 or newer.
950 AC_DEFUN([jm_GLIBC21],
952 AC_CACHE_CHECK(whether we are using the GNU C Library 2.1 or newer,
953 ac_cv_gnu_library_2_1,
954 [AC_EGREP_CPP([Lucky GNU user],
956 #include <features.h>
957 #ifdef __GNU_LIBRARY__
958 #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1) || (__GLIBC__ > 2)
963 ac_cv_gnu_library_2_1=yes,
964 ac_cv_gnu_library_2_1=no)
968 GLIBC21="$ac_cv_gnu_library_2_1"
974 dnl From Bruno Haible.
978 dnl Some systems have iconv in libc, some have it in libiconv (OSF/1 and
979 dnl those with the standalone portable GNU libiconv installed).
981 AC_ARG_WITH([libiconv-prefix],
982 [ --with-libiconv-prefix=DIR search for libiconv in DIR/include and DIR/lib], [
983 for dir in `echo "$withval" | tr : ' '`; do
984 if test -d $dir/include; then CPPFLAGS="$CPPFLAGS -I$dir/include"; fi
985 if test -d $dir/lib; then LDFLAGS="$LDFLAGS -L$dir/lib"; fi
989 AC_CACHE_CHECK(for iconv, am_cv_func_iconv, [
990 am_cv_func_iconv="no, consider installing GNU libiconv"
992 AC_TRY_LINK([#include <stdlib.h>
994 [iconv_t cd = iconv_open("","");
995 iconv(cd,NULL,NULL,NULL,NULL);
997 am_cv_func_iconv=yes)
998 if test "$am_cv_func_iconv" != yes; then
1000 LIBS="$LIBS -liconv"
1001 AC_TRY_LINK([#include <stdlib.h>
1002 #include <iconv.h>],
1003 [iconv_t cd = iconv_open("","");
1004 iconv(cd,NULL,NULL,NULL,NULL);
1007 am_cv_func_iconv=yes)
1008 LIBS="$am_save_LIBS"
1011 if test "$am_cv_func_iconv" = yes; then
1012 AC_DEFINE(HAVE_ICONV, 1, [Define if you have the iconv() function.])
1013 AC_MSG_CHECKING([for iconv declaration])
1014 AC_CACHE_VAL(am_cv_proto_iconv, [
1022 #if defined(__STDC__) || defined(__cplusplus)
1023 size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
1027 ], [], am_cv_proto_iconv_arg1="", am_cv_proto_iconv_arg1="const")
1028 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);"])
1029 am_cv_proto_iconv=`echo "[$]am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'`
1030 AC_MSG_RESULT([$]{ac_t:-
1031 }[$]am_cv_proto_iconv)
1032 AC_DEFINE_UNQUOTED(ICONV_CONST, $am_cv_proto_iconv_arg1,
1033 [Define as const if the declaration of iconv() needs const.])
1036 if test "$am_cv_lib_iconv" = yes; then
1044 dnl From Bruno Haible.
1046 AC_DEFUN([AM_LANGINFO_CODESET],
1048 AC_CACHE_CHECK([for nl_langinfo and CODESET], am_cv_langinfo_codeset,
1049 [AC_TRY_LINK([#include <langinfo.h>],
1050 [char* cs = nl_langinfo(CODESET);],
1051 am_cv_langinfo_codeset=yes,
1052 am_cv_langinfo_codeset=no)
1054 if test $am_cv_langinfo_codeset = yes; then
1055 AC_DEFINE(HAVE_LANGINFO_CODESET, 1,
1056 [Define if you have <langinfo.h> and nl_langinfo(CODESET).])
1060 # Check whether LC_MESSAGES is available in <locale.h>.
1061 # Ulrich Drepper <drepper@cygnus.com>, 1995.
1063 # This file can be copied and used freely without restrictions. It can
1064 # be used in projects which are not available under the GNU General Public
1065 # License but which still want to provide support for the GNU gettext
1067 # Please note that the actual code of GNU gettext is covered by the GNU
1068 # General Public License and is *not* in the public domain.
1072 AC_DEFUN([AM_LC_MESSAGES],
1073 [if test $ac_cv_header_locale_h = yes; then
1074 AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES,
1075 [AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
1076 am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)])
1077 if test $am_cv_val_LC_MESSAGES = yes; then
1078 AC_DEFINE(HAVE_LC_MESSAGES, 1,
1079 [Define if your <locale.h> file defines LC_MESSAGES.])