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 Public License
531 # but which still want to provide support for the GNU gettext functionality.
532 # Please note that the actual code is *not* freely available.
536 dnl Usage: AM_WITH_NLS([TOOLSYMBOL], [NEEDSYMBOL], [LIBDIR]).
537 dnl If TOOLSYMBOL is specified and is 'use-libtool', then a libtool library
538 dnl $(top_builddir)/intl/libintl.la will be created (shared and/or static,
539 dnl depending on --{enable,disable}-{shared,static} and on the presence of
540 dnl AM-DISABLE-SHARED). Otherwise, a static library
541 dnl $(top_builddir)/intl/libintl.a will be created.
542 dnl If NEEDSYMBOL is specified and is 'need-ngettext', then GNU gettext
543 dnl implementations (in libc or libintl) without the ngettext() function
545 dnl LIBDIR is used to find the intl libraries. If empty,
546 dnl the value `$(top_builddir)/intl/' is used.
548 dnl The result of the configuration is one of three cases:
549 dnl 1) GNU gettext, as included in the intl subdirectory, will be compiled
551 dnl Catalog format: GNU --> install in $(datadir)
552 dnl Catalog extension: .mo after installation, .gmo in source tree
553 dnl 2) GNU gettext has been found in the system's C library.
554 dnl Catalog format: GNU --> install in $(datadir)
555 dnl Catalog extension: .mo after installation, .gmo in source tree
556 dnl 3) No internationalization, always use English msgid.
557 dnl Catalog format: none
558 dnl Catalog extension: none
559 dnl The use of .gmo is historical (it was needed to avoid overwriting the
560 dnl GNU format catalogs when building on a platform with an X/Open gettext),
561 dnl but we keep it in order not to force irrelevant filename changes on the
564 AC_DEFUN([AM_WITH_NLS],
565 [AC_MSG_CHECKING([whether NLS is requested])
566 dnl Default is enabled NLS
568 [ --disable-nls do not use Native Language Support],
569 USE_NLS=$enableval, USE_NLS=yes)
570 AC_MSG_RESULT($USE_NLS)
573 BUILD_INCLUDED_LIBINTL=no
574 USE_INCLUDED_LIBINTL=no
577 dnl If we use NLS figure out what method
578 if test "$USE_NLS" = "yes"; then
579 AC_DEFINE(ENABLE_NLS, 1,
580 [Define to 1 if translation of program messages to the user's native language
582 AC_MSG_CHECKING([whether included gettext is requested])
583 AC_ARG_WITH(included-gettext,
584 [ --with-included-gettext use the GNU gettext library included here],
585 nls_cv_force_use_gnu_gettext=$withval,
586 nls_cv_force_use_gnu_gettext=no)
587 AC_MSG_RESULT($nls_cv_force_use_gnu_gettext)
589 nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext"
590 if test "$nls_cv_force_use_gnu_gettext" != "yes"; then
591 dnl User does not insist on using GNU NLS library. Figure out what
592 dnl to use. If GNU gettext is available we use this. Else we have
593 dnl to fall back to GNU NLS library.
596 dnl Add a version number to the cache macros.
597 define(gt_cv_func_gnugettext_libc, [gt_cv_func_gnugettext]ifelse([$2], need-ngettext, 2, 1)[_libc])
598 define(gt_cv_func_gnugettext_libintl, [gt_cv_func_gnugettext]ifelse([$2], need-ngettext, 2, 1)[_libintl])
600 AC_CHECK_HEADER(libintl.h,
601 [AC_CACHE_CHECK([for GNU gettext in libc], gt_cv_func_gnugettext_libc,
602 [AC_TRY_LINK([#include <libintl.h>
603 extern int _nl_msg_cat_cntr;],
604 [bindtextdomain ("", "");
605 return (int) gettext ("")]ifelse([$2], need-ngettext, [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr],
606 gt_cv_func_gnugettext_libc=yes,
607 gt_cv_func_gnugettext_libc=no)])
609 if test "$gt_cv_func_gnugettext_libc" != "yes"; then
610 AC_CACHE_CHECK([for GNU gettext in libintl],
611 gt_cv_func_gnugettext_libintl,
612 [gt_save_LIBS="$LIBS"
613 LIBS="$LIBS -lintl $LIBICONV"
614 AC_TRY_LINK([#include <libintl.h>
615 extern int _nl_msg_cat_cntr;],
616 [bindtextdomain ("", "");
617 return (int) gettext ("")]ifelse([$2], need-ngettext, [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr],
618 gt_cv_func_gnugettext_libintl=yes,
619 gt_cv_func_gnugettext_libintl=no)
620 LIBS="$gt_save_LIBS"])
623 dnl If an already present or preinstalled GNU gettext() is found,
624 dnl use it. But if this macro is used in GNU gettext, and GNU
625 dnl gettext is already preinstalled in libintl, we update this
626 dnl libintl. (Cf. the install rule in intl/Makefile.in.)
627 if test "$gt_cv_func_gnugettext_libc" = "yes" \
628 || { test "$gt_cv_func_gnugettext_libintl" = "yes" \
629 && test "$PACKAGE" != gettext; }; then
630 AC_DEFINE(HAVE_GETTEXT, 1,
631 [Define if the GNU gettext() function is already present or preinstalled.])
633 if test "$gt_cv_func_gnugettext_libintl" = "yes"; then
634 dnl If iconv() is in a separate libiconv library, then anyone
635 dnl linking with libintl{.a,.so} also needs to link with
637 INTLLIBS="-lintl $LIBICONV"
641 LIBS="$LIBS $INTLLIBS"
642 AC_CHECK_FUNCS(dcgettext)
645 AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
646 [test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], no)dnl
647 if test "$MSGFMT" != "no"; then
648 AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
651 AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
652 [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
658 if test "$CATOBJEXT" = "NONE"; then
659 dnl GNU gettext is not found in the C library.
660 dnl Fall back on GNU gettext library.
661 nls_cv_use_gnu_gettext=yes
665 if test "$nls_cv_use_gnu_gettext" = "yes"; then
666 dnl Mark actions used to generate GNU NLS library.
667 INTLOBJS="\$(GETTOBJS)"
668 AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
669 [test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], msgfmt)
670 AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
671 AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
672 [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
674 BUILD_INCLUDED_LIBINTL=yes
675 USE_INCLUDED_LIBINTL=yes
677 INTLLIBS="ifelse([$3],[],\$(top_builddir)/intl,[$3])/libintl.ifelse([$1], use-libtool, [l], [])a $LIBICONV"
678 LIBS=`echo " $LIBS " | sed -e 's/ -lintl / /' -e 's/^ //' -e 's/ $//'`
681 dnl Test whether we really found GNU xgettext.
682 if test "$XGETTEXT" != ":"; then
683 dnl If it is no GNU xgettext we define it as : so that the
684 dnl Makefiles still can work.
685 if $XGETTEXT --omit-header /dev/null 2> /dev/null; then
689 [found xgettext program is not GNU xgettext; ignore it])
694 dnl We need to process the po/ directory.
698 [for ac_file in $CONFIG_FILES; do
699 # Support "outfile[:infile[:infile...]]"
701 *:*) ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
703 # PO directories have a Makefile.in generated from Makefile.in.in.
704 case "$ac_file" in */Makefile.in)
705 # Adjust a relative srcdir.
706 ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'`
707 ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`"
708 ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'`
709 test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir"
710 case "$ac_given_srcdir" in
711 .) top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;;
712 /*) top_srcdir="$ac_given_srcdir" ;;
713 *) top_srcdir="$ac_dots$ac_given_srcdir" ;;
715 if test -f "$ac_given_srcdir/$ac_dir/POTFILES.in"; then
716 rm -f "$ac_dir/POTFILES"
717 test -n "$as_me" && echo "$as_me: creating $ac_dir/POTFILES" || echo "creating $ac_dir/POTFILES"
718 sed -e "/^#/d" -e "/^[ ]*\$/d" -e "s,.*, $top_srcdir/& \\\\," -e "\$s/\(.*\) \\\\/\1/" < "$ac_given_srcdir/$ac_dir/POTFILES.in" > "$ac_dir/POTFILES"
719 test -n "$as_me" && echo "$as_me: creating $ac_dir/Makefile" || echo "creating $ac_dir/Makefile"
720 sed -e "/POTFILES =/r $ac_dir/POTFILES" "$ac_dir/Makefile.in" > "$ac_dir/Makefile"
727 dnl If this is used in GNU gettext we have to set BUILD_INCLUDED_LIBINTL
728 dnl to 'yes' because some of the testsuite requires it.
729 if test "$PACKAGE" = gettext; then
730 BUILD_INCLUDED_LIBINTL=yes
733 dnl intl/plural.c is generated from intl/plural.y. It requires bison,
734 dnl because plural.y uses bison specific features. It requires at least
735 dnl bison-1.26 because earlier versions generate a plural.c that doesn't
737 dnl bison is only needed for the maintainer (who touches plural.y). But in
738 dnl order to avoid separate Makefiles or --enable-maintainer-mode, we put
739 dnl the rule in general Makefile. Now, some people carelessly touch the
740 dnl files or have a broken "make" program, hence the plural.c rule will
741 dnl sometimes fire. To avoid an error, defines BISON to ":" if it is not
742 dnl present or too old.
743 AC_CHECK_PROGS([INTLBISON], [bison])
744 if test -z "$INTLBISON"; then
747 dnl Found it, now check the version.
748 AC_MSG_CHECKING([version of bison])
749 changequote(<<,>>)dnl
750 ac_prog_version=`$INTLBISON --version 2>&1 | sed -n 's/^.*GNU Bison .* \([0-9]*\.[0-9.]*\).*$/\1/p'`
751 case $ac_prog_version in
752 '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;;
753 1.2[6-9]* | 1.[3-9][0-9]* | [2-9].*)
755 ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;;
756 *) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;;
758 AC_MSG_RESULT([$ac_prog_version])
760 if test $ac_verc_fail = yes; then
764 dnl These rules are solely for the distribution goal. While doing this
765 dnl we only have to keep exactly one list of the available catalogs
767 for lang in $ALL_LINGUAS; do
768 GMOFILES="$GMOFILES $lang.gmo"
769 POFILES="$POFILES $lang.po"
772 dnl Make all variables we use known to autoconf.
773 AC_SUBST(BUILD_INCLUDED_LIBINTL)
774 AC_SUBST(USE_INCLUDED_LIBINTL)
783 dnl For backward compatibility. Some configure.ins may be using this.
787 dnl For backward compatibility. Some Makefiles may be using this.
789 AC_SUBST(DATADIRNAME)
791 dnl For backward compatibility. Some Makefiles may be using this.
795 dnl For backward compatibility. Some Makefiles may be using this.
800 dnl Usage: Just like AM_WITH_NLS, which see.
801 AC_DEFUN([AM_GNU_GETTEXT],
802 [AC_REQUIRE([AC_PROG_MAKE_SET])dnl
803 AC_REQUIRE([AC_PROG_CC])dnl
804 AC_REQUIRE([AC_CANONICAL_HOST])dnl
805 AC_REQUIRE([AC_PROG_RANLIB])dnl
806 AC_REQUIRE([AC_ISC_POSIX])dnl
807 AC_REQUIRE([AC_HEADER_STDC])dnl
808 AC_REQUIRE([AC_C_CONST])dnl
809 AC_REQUIRE([AC_C_INLINE])dnl
810 AC_REQUIRE([AC_TYPE_OFF_T])dnl
811 AC_REQUIRE([AC_TYPE_SIZE_T])dnl
812 AC_REQUIRE([AC_FUNC_ALLOCA])dnl
813 AC_REQUIRE([AC_FUNC_MMAP])dnl
814 AC_REQUIRE([jm_GLIBC21])dnl
816 AC_CHECK_HEADERS([argz.h limits.h locale.h nl_types.h malloc.h stddef.h \
817 stdlib.h string.h unistd.h sys/param.h])
818 AC_CHECK_FUNCS([feof_unlocked fgets_unlocked getcwd getegid geteuid \
819 getgid getuid mempcpy munmap putenv setenv setlocale stpcpy strchr strcasecmp \
820 strdup strtoul tsearch __argz_count __argz_stringify __argz_next])
825 AM_WITH_NLS([$1],[$2],[$3])
827 if test "x$CATOBJEXT" != "x"; then
828 if test "x$ALL_LINGUAS" = "x"; then
831 AC_MSG_CHECKING(for catalogs to be installed)
833 for presentlang in $ALL_LINGUAS; do
835 for desiredlang in ${LINGUAS-$ALL_LINGUAS}; do
836 # Use the presentlang catalog if desiredlang is
837 # a. equal to presentlang, or
838 # b. a variant of presentlang (because in this case,
839 # presentlang can be used as a fallback for messages
840 # which are not translated in the desiredlang catalog).
841 case "$desiredlang" in
842 "$presentlang"*) useit=yes;;
845 if test $useit = yes; then
846 NEW_LINGUAS="$NEW_LINGUAS $presentlang"
850 AC_MSG_RESULT($LINGUAS)
853 dnl Construct list of names of catalog files to be constructed.
854 if test -n "$LINGUAS"; then
855 for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done
859 dnl If the AC_CONFIG_AUX_DIR macro for autoconf is used we possibly
860 dnl find the mkinstalldirs script in another subdir but $(top_srcdir).
861 dnl Try to locate is.
863 if test -n "$ac_aux_dir"; then
864 MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs"
866 if test -z "$MKINSTALLDIRS"; then
867 MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs"
869 AC_SUBST(MKINSTALLDIRS)
871 dnl Enable libtool support if the surrounding package wishes it.
872 INTL_LIBTOOL_SUFFIX_PREFIX=ifelse([$1], use-libtool, [l], [])
873 AC_SUBST(INTL_LIBTOOL_SUFFIX_PREFIX)
876 # Search path for a program which passes the given test.
877 # Ulrich Drepper <drepper@cygnus.com>, 1996.
879 # This file can be copied and used freely without restrictions. It can
880 # be used in projects which are not available under the GNU Public License
881 # but which still want to provide support for the GNU gettext functionality.
882 # Please note that the actual code is *not* freely available.
886 dnl AM_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR,
887 dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
888 AC_DEFUN([AM_PATH_PROG_WITH_TEST],
889 [# Extract the first word of "$2", so it can be a program name with args.
890 set dummy $2; ac_word=[$]2
891 AC_MSG_CHECKING([for $ac_word])
892 AC_CACHE_VAL(ac_cv_path_$1,
895 ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
898 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
899 for ac_dir in ifelse([$5], , $PATH, [$5]); do
900 test -z "$ac_dir" && ac_dir=.
901 if test -f $ac_dir/$ac_word; then
903 ac_cv_path_$1="$ac_dir/$ac_word"
909 dnl If no 4th arg is given, leave the cache variable unset,
910 dnl so AC_PATH_PROGS will keep looking.
911 ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
916 if test -n "[$]$1"; then
926 # Test for the GNU C Library, version 2.1 or newer.
929 AC_DEFUN([jm_GLIBC21],
931 AC_CACHE_CHECK(whether we are using the GNU C Library 2.1 or newer,
932 ac_cv_gnu_library_2_1,
933 [AC_EGREP_CPP([Lucky GNU user],
935 #include <features.h>
936 #ifdef __GNU_LIBRARY__
937 #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1) || (__GLIBC__ > 2)
942 ac_cv_gnu_library_2_1=yes,
943 ac_cv_gnu_library_2_1=no)
947 GLIBC21="$ac_cv_gnu_library_2_1"
953 dnl From Bruno Haible.
957 dnl Some systems have iconv in libc, some have it in libiconv (OSF/1 and
958 dnl those with the standalone portable GNU libiconv installed).
960 AC_ARG_WITH([libiconv-prefix],
961 [ --with-libiconv-prefix=DIR search for libiconv in DIR/include and DIR/lib], [
962 for dir in `echo "$withval" | tr : ' '`; do
963 if test -d $dir/include; then CPPFLAGS="$CPPFLAGS -I$dir/include"; fi
964 if test -d $dir/lib; then LDFLAGS="$LDFLAGS -L$dir/lib"; fi
968 AC_CACHE_CHECK(for iconv, am_cv_func_iconv, [
969 am_cv_func_iconv="no, consider installing GNU libiconv"
971 AC_TRY_LINK([#include <stdlib.h>
973 [iconv_t cd = iconv_open("","");
974 iconv(cd,NULL,NULL,NULL,NULL);
976 am_cv_func_iconv=yes)
977 if test "$am_cv_func_iconv" != yes; then
980 AC_TRY_LINK([#include <stdlib.h>
982 [iconv_t cd = iconv_open("","");
983 iconv(cd,NULL,NULL,NULL,NULL);
986 am_cv_func_iconv=yes)
990 if test "$am_cv_func_iconv" = yes; then
991 AC_DEFINE(HAVE_ICONV, 1, [Define if you have the iconv() function.])
992 AC_MSG_CHECKING([for iconv declaration])
993 AC_CACHE_VAL(am_cv_proto_iconv, [
1001 #if defined(__STDC__) || defined(__cplusplus)
1002 size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
1006 ], [], am_cv_proto_iconv_arg1="", am_cv_proto_iconv_arg1="const")
1007 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);"])
1008 am_cv_proto_iconv=`echo "[$]am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'`
1009 AC_MSG_RESULT([$]{ac_t:-
1010 }[$]am_cv_proto_iconv)
1011 AC_DEFINE_UNQUOTED(ICONV_CONST, $am_cv_proto_iconv_arg1,
1012 [Define as const if the declaration of iconv() needs const.])
1015 if test "$am_cv_lib_iconv" = yes; then
1023 dnl From Bruno Haible.
1025 AC_DEFUN([AM_LANGINFO_CODESET],
1027 AC_CACHE_CHECK([for nl_langinfo and CODESET], am_cv_langinfo_codeset,
1028 [AC_TRY_LINK([#include <langinfo.h>],
1029 [char* cs = nl_langinfo(CODESET);],
1030 am_cv_langinfo_codeset=yes,
1031 am_cv_langinfo_codeset=no)
1033 if test $am_cv_langinfo_codeset = yes; then
1034 AC_DEFINE(HAVE_LANGINFO_CODESET, 1,
1035 [Define if you have <langinfo.h> and nl_langinfo(CODESET).])
1039 # Check whether LC_MESSAGES is available in <locale.h>.
1040 # Ulrich Drepper <drepper@cygnus.com>, 1995.
1042 # This file can be copied and used freely without restrictions. It can
1043 # be used in projects which are not available under the GNU Public License
1044 # but which still want to provide support for the GNU gettext functionality.
1045 # Please note that the actual code is *not* freely available.
1049 AC_DEFUN([AM_LC_MESSAGES],
1050 [if test $ac_cv_header_locale_h = yes; then
1051 AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES,
1052 [AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
1053 am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)])
1054 if test $am_cv_val_LC_MESSAGES = yes; then
1055 AC_DEFINE(HAVE_LC_MESSAGES, 1,
1056 [Define if your <locale.h> file defines LC_MESSAGES.])