1 # gettext.m4 serial 17 (gettext-0.11.5)
2 dnl Copyright (C) 1995-2002 Free Software Foundation, Inc.
3 dnl This file is free software, distributed under the terms of the GNU
4 dnl General Public License. As a special exception to the GNU General
5 dnl Public License, this file may be distributed as part of a program
6 dnl that contains a configuration script generated by Autoconf, under
7 dnl the same distribution terms as the rest of that program.
9 dnl This file can can be used in projects which are not available under
10 dnl the GNU General Public License or the GNU Library General Public
11 dnl License but which still want to provide support for the GNU gettext
13 dnl Please note that the actual code of the GNU gettext library is covered
14 dnl by the GNU Library General Public License, and the rest of the GNU
15 dnl gettext package package is covered by the GNU General Public License.
16 dnl They are *not* in the public domain.
19 dnl Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
20 dnl Bruno Haible <haible@clisp.cons.org>, 2000-2002.
22 dnl Macro to add for using GNU gettext.
24 dnl Usage: AM_GNU_GETTEXT([INTLSYMBOL], [NEEDSYMBOL], [INTLDIR]).
25 dnl INTLSYMBOL can be one of 'external', 'no-libtool', 'use-libtool'. The
26 dnl default (if it is not specified or empty) is 'no-libtool'.
27 dnl INTLSYMBOL should be 'external' for packages with no intl directory,
28 dnl and 'no-libtool' or 'use-libtool' for packages with an intl directory.
29 dnl If INTLSYMBOL is 'use-libtool', then a libtool library
30 dnl $(top_builddir)/intl/libintl.la will be created (shared and/or static,
31 dnl depending on --{enable,disable}-{shared,static} and on the presence of
32 dnl AM-DISABLE-SHARED). If INTLSYMBOL is 'no-libtool', a static library
33 dnl $(top_builddir)/intl/libintl.a will be created.
34 dnl If NEEDSYMBOL is specified and is 'need-ngettext', then GNU gettext
35 dnl implementations (in libc or libintl) without the ngettext() function
36 dnl will be ignored. If NEEDSYMBOL is specified and is
37 dnl 'need-formatstring-macros', then GNU gettext implementations that don't
38 dnl support the ISO C 99 <inttypes.h> formatstring macros will be ignored.
39 dnl INTLDIR is used to find the intl libraries. If empty,
40 dnl the value `$(top_builddir)/intl/' is used.
42 dnl The result of the configuration is one of three cases:
43 dnl 1) GNU gettext, as included in the intl subdirectory, will be compiled
45 dnl Catalog format: GNU --> install in $(datadir)
46 dnl Catalog extension: .mo after installation, .gmo in source tree
47 dnl 2) GNU gettext has been found in the system's C library.
48 dnl Catalog format: GNU --> install in $(datadir)
49 dnl Catalog extension: .mo after installation, .gmo in source tree
50 dnl 3) No internationalization, always use English msgid.
51 dnl Catalog format: none
52 dnl Catalog extension: none
53 dnl If INTLSYMBOL is 'external', only cases 2 and 3 can occur.
54 dnl The use of .gmo is historical (it was needed to avoid overwriting the
55 dnl GNU format catalogs when building on a platform with an X/Open gettext),
56 dnl but we keep it in order not to force irrelevant filename changes on the
59 AC_DEFUN([AM_GNU_GETTEXT],
61 dnl Argument checking.
62 ifelse([$1], [], , [ifelse([$1], [external], , [ifelse([$1], [no-libtool], , [ifelse([$1], [use-libtool], ,
63 [errprint([ERROR: invalid first argument to AM_GNU_GETTEXT
65 ifelse([$2], [], , [ifelse([$2], [need-ngettext], , [ifelse([$2], [need-formatstring-macros], ,
66 [errprint([ERROR: invalid second argument to AM_GNU_GETTEXT
68 define(gt_included_intl, ifelse([$1], [external], [no], [yes]))
69 define(gt_libtool_suffix_prefix, ifelse([$1], [use-libtool], [l], []))
71 AC_REQUIRE([AM_PO_SUBDIRS])dnl
72 ifelse(gt_included_intl, yes, [
73 AC_REQUIRE([AM_INTL_SUBDIR])dnl
76 dnl Prerequisites of AC_LIB_LINKFLAGS_BODY.
77 AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
78 AC_REQUIRE([AC_LIB_RPATH])
80 dnl Sometimes libintl requires libiconv, so first search for libiconv.
81 dnl Ideally we would do this search only after the
82 dnl if test "$USE_NLS" = "yes"; then
83 dnl if test "$gt_cv_func_gnugettext_libc" != "yes"; then
84 dnl tests. But if configure.in invokes AM_ICONV after AM_GNU_GETTEXT
85 dnl the configure script would need to contain the same shell code
86 dnl again, outside any 'if'. There are two solutions:
87 dnl - Invoke AM_ICONV_LINKFLAGS_BODY here, outside any 'if'.
88 dnl - Control the expansions in more detail using AC_PROVIDE_IFELSE.
89 dnl Since AC_PROVIDE_IFELSE is only in autoconf >= 2.52 and not
90 dnl documented, we avoid it.
91 ifelse(gt_included_intl, yes, , [
92 AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY])
95 AC_MSG_CHECKING([whether NLS is requested])
96 dnl Default is enabled NLS
98 [ --disable-nls do not use Native Language Support],
99 USE_NLS=$enableval, USE_NLS=yes)
100 AC_MSG_RESULT($USE_NLS)
103 ifelse(gt_included_intl, yes, [
104 BUILD_INCLUDED_LIBINTL=no
105 USE_INCLUDED_LIBINTL=no
111 dnl If we use NLS figure out what method
112 if test "$USE_NLS" = "yes"; then
113 gt_use_preinstalled_gnugettext=no
114 ifelse(gt_included_intl, yes, [
115 AC_MSG_CHECKING([whether included gettext is requested])
116 AC_ARG_WITH(included-gettext,
117 [ --with-included-gettext use the GNU gettext library included here],
118 nls_cv_force_use_gnu_gettext=$withval,
119 nls_cv_force_use_gnu_gettext=no)
120 AC_MSG_RESULT($nls_cv_force_use_gnu_gettext)
122 nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext"
123 if test "$nls_cv_force_use_gnu_gettext" != "yes"; then
125 dnl User does not insist on using GNU NLS library. Figure out what
126 dnl to use. If GNU gettext is available we use this. Else we have
127 dnl to fall back to GNU NLS library.
129 dnl Add a version number to the cache macros.
130 define([gt_api_version], ifelse([$2], [need-formatstring-macros], 3, ifelse([$2], [need-ngettext], 2, 1)))
131 define([gt_cv_func_gnugettext_libc], [gt_cv_func_gnugettext]gt_api_version[_libc])
132 define([gt_cv_func_gnugettext_libintl], [gt_cv_func_gnugettext]gt_api_version[_libintl])
134 AC_CACHE_CHECK([for GNU gettext in libc], gt_cv_func_gnugettext_libc,
135 [AC_TRY_LINK([#include <libintl.h>
136 ]ifelse([$2], [need-formatstring-macros],
137 [#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
138 #define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1)
141 typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1];
143 ], [])[extern int _nl_msg_cat_cntr;
144 extern int *_nl_domain_bindings;],
145 [bindtextdomain ("", "");
146 return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_domain_bindings],
147 gt_cv_func_gnugettext_libc=yes,
148 gt_cv_func_gnugettext_libc=no)])
150 if test "$gt_cv_func_gnugettext_libc" != "yes"; then
151 dnl Sometimes libintl requires libiconv, so first search for libiconv.
152 ifelse(gt_included_intl, yes, , [
155 dnl Search for libintl and define LIBINTL, LTLIBINTL and INCINTL
156 dnl accordingly. Don't use AC_LIB_LINKFLAGS_BODY([intl],[iconv])
157 dnl because that would add "-liconv" to LIBINTL and LTLIBINTL
158 dnl even if libiconv doesn't exist.
159 AC_LIB_LINKFLAGS_BODY([intl])
160 AC_CACHE_CHECK([for GNU gettext in libintl],
161 gt_cv_func_gnugettext_libintl,
162 [gt_save_CPPFLAGS="$CPPFLAGS"
163 CPPFLAGS="$CPPFLAGS $INCINTL"
165 LIBS="$LIBS $LIBINTL"
166 dnl Now see whether libintl exists and does not depend on libiconv.
167 AC_TRY_LINK([#include <libintl.h>
168 ]ifelse([$2], [need-formatstring-macros],
169 [#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
170 #define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1)
173 typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1];
175 ], [])[extern int _nl_msg_cat_cntr;
180 const char *_nl_expand_alias ();],
181 [bindtextdomain ("", "");
182 return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_expand_alias (0)],
183 gt_cv_func_gnugettext_libintl=yes,
184 gt_cv_func_gnugettext_libintl=no)
185 dnl Now see whether libintl exists and depends on libiconv.
186 if test "$gt_cv_func_gnugettext_libintl" != yes && test -n "$LIBICONV"; then
187 LIBS="$LIBS $LIBICONV"
188 AC_TRY_LINK([#include <libintl.h>
189 ]ifelse([$2], [need-formatstring-macros],
190 [#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
191 #define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1)
194 typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1];
196 ], [])[extern int _nl_msg_cat_cntr;
201 const char *_nl_expand_alias ();],
202 [bindtextdomain ("", "");
203 return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_expand_alias (0)],
204 [LIBINTL="$LIBINTL $LIBICONV"
205 LTLIBINTL="$LTLIBINTL $LTLIBICONV"
206 gt_cv_func_gnugettext_libintl=yes
209 CPPFLAGS="$gt_save_CPPFLAGS"
210 LIBS="$gt_save_LIBS"])
213 dnl If an already present or preinstalled GNU gettext() is found,
214 dnl use it. But if this macro is used in GNU gettext, and GNU
215 dnl gettext is already preinstalled in libintl, we update this
216 dnl libintl. (Cf. the install rule in intl/Makefile.in.)
217 if test "$gt_cv_func_gnugettext_libc" = "yes" \
218 || { test "$gt_cv_func_gnugettext_libintl" = "yes" \
219 && test "$PACKAGE" != gettext; }; then
220 gt_use_preinstalled_gnugettext=yes
222 dnl Reset the values set by searching for libintl.
228 ifelse(gt_included_intl, yes, [
229 if test "$gt_use_preinstalled_gnugettext" != "yes"; then
230 dnl GNU gettext is not found in the C library.
231 dnl Fall back on included GNU gettext library.
232 nls_cv_use_gnu_gettext=yes
236 if test "$nls_cv_use_gnu_gettext" = "yes"; then
237 dnl Mark actions used to generate GNU NLS library.
238 INTLOBJS="\$(GETTOBJS)"
239 BUILD_INCLUDED_LIBINTL=yes
240 USE_INCLUDED_LIBINTL=yes
241 LIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LIBICONV"
242 LTLIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LTLIBICONV"
243 LIBS=`echo " $LIBS " | sed -e 's/ -lintl / /' -e 's/^ //' -e 's/ $//'`
246 if test "$gt_use_preinstalled_gnugettext" = "yes" \
247 || test "$nls_cv_use_gnu_gettext" = "yes"; then
248 dnl Mark actions to use GNU gettext tools.
253 if test "$gt_use_preinstalled_gnugettext" = "yes" \
254 || test "$nls_cv_use_gnu_gettext" = "yes"; then
255 AC_DEFINE(ENABLE_NLS, 1,
256 [Define to 1 if translation of program messages to the user's native language
263 if test "$USE_NLS" = "yes"; then
265 if test "$gt_use_preinstalled_gnugettext" = "yes"; then
266 if test "$gt_cv_func_gnugettext_libintl" = "yes"; then
267 AC_MSG_CHECKING([how to link with libintl])
268 AC_MSG_RESULT([$LIBINTL])
269 AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCINTL])
272 dnl For backward compatibility. Some packages may be using this.
273 AC_DEFINE(HAVE_GETTEXT, 1,
274 [Define if the GNU gettext() function is already present or preinstalled.])
275 AC_DEFINE(HAVE_DCGETTEXT, 1,
276 [Define if the GNU dcgettext() function is already present or preinstalled.])
279 dnl We need to process the po/ directory.
283 ifelse(gt_included_intl, yes, [
284 dnl If this is used in GNU gettext we have to set BUILD_INCLUDED_LIBINTL
285 dnl to 'yes' because some of the testsuite requires it.
286 if test "$PACKAGE" = gettext; then
287 BUILD_INCLUDED_LIBINTL=yes
290 dnl Make all variables we use known to autoconf.
291 AC_SUBST(BUILD_INCLUDED_LIBINTL)
292 AC_SUBST(USE_INCLUDED_LIBINTL)
296 dnl For backward compatibility. Some configure.ins may be using this.
300 dnl For backward compatibility. Some Makefiles may be using this.
302 AC_SUBST(DATADIRNAME)
304 dnl For backward compatibility. Some Makefiles may be using this.
308 dnl For backward compatibility. Some Makefiles may be using this.
312 dnl Enable libtool support if the surrounding package wishes it.
313 INTL_LIBTOOL_SUFFIX_PREFIX=gt_libtool_suffix_prefix
314 AC_SUBST(INTL_LIBTOOL_SUFFIX_PREFIX)
317 dnl For backward compatibility. Some Makefiles may be using this.
321 dnl Make all documented variables known to autoconf.
328 dnl Checks for all prerequisites of the po subdirectory,
329 dnl except for USE_NLS.
330 AC_DEFUN([AM_PO_SUBDIRS],
332 AC_REQUIRE([AC_PROG_MAKE_SET])dnl
333 AC_REQUIRE([AC_PROG_INSTALL])dnl
334 AC_REQUIRE([AM_MKINSTALLDIRS])dnl
336 dnl Perform the following tests also if --disable-nls has been given,
337 dnl because they are needed for "make dist" to work.
339 dnl Search for GNU msgfmt in the PATH.
340 dnl The first test excludes Solaris msgfmt and early GNU msgfmt versions.
341 dnl The second test excludes FreeBSD msgfmt.
342 AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
343 [$ac_dir/$ac_word --statistics /dev/null >/dev/null 2>&1 &&
344 (if $ac_dir/$ac_word --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi)],
346 AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
348 dnl Search for GNU xgettext 0.11 or newer in the PATH.
349 dnl The first test excludes Solaris xgettext and early GNU xgettext versions.
350 dnl The second test excludes FreeBSD xgettext.
351 AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
352 [$ac_dir/$ac_word --omit-header --copyright-holder= /dev/null >/dev/null 2>&1 &&
353 (if $ac_dir/$ac_word --omit-header --copyright-holder= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi)],
355 dnl Remove leftover from FreeBSD xgettext call.
358 dnl Search for GNU msgmerge 0.11 or newer in the PATH.
359 AM_PATH_PROG_WITH_TEST(MSGMERGE, msgmerge,
360 [$ac_dir/$ac_word --update -q /dev/null /dev/null >/dev/null 2>&1], :)
362 dnl This could go away some day; the PATH_PROG_WITH_TEST already does it.
363 dnl Test whether we really found GNU msgfmt.
364 if test "$GMSGFMT" != ":"; then
365 dnl If it is no GNU msgfmt we define it as : so that the
366 dnl Makefiles still can work.
367 if $GMSGFMT --statistics /dev/null >/dev/null 2>&1 &&
368 (if $GMSGFMT --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then
371 GMSGFMT=`echo "$GMSGFMT" | sed -e 's,^.*/,,'`
373 [found $GMSGFMT program is not GNU msgfmt; ignore it])
378 dnl This could go away some day; the PATH_PROG_WITH_TEST already does it.
379 dnl Test whether we really found GNU xgettext.
380 if test "$XGETTEXT" != ":"; then
381 dnl If it is no GNU xgettext we define it as : so that the
382 dnl Makefiles still can work.
383 if $XGETTEXT --omit-header --copyright-holder= /dev/null >/dev/null 2>&1 &&
384 (if $XGETTEXT --omit-header --copyright-holder= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then
388 [found xgettext program is not GNU xgettext; ignore it])
391 dnl Remove leftover from FreeBSD xgettext call.
396 for ac_file in $CONFIG_FILES; do
397 # Support "outfile[:infile[:infile...]]"
399 *:*) ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
401 # PO directories have a Makefile.in generated from Makefile.in.in.
402 case "$ac_file" in */Makefile.in)
403 # Adjust a relative srcdir.
404 ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'`
405 ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`"
406 ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'`
407 # In autoconf-2.13 it is called $ac_given_srcdir.
408 # In autoconf-2.50 it is called $srcdir.
409 test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir"
410 case "$ac_given_srcdir" in
411 .) top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;;
412 /*) top_srcdir="$ac_given_srcdir" ;;
413 *) top_srcdir="$ac_dots$ac_given_srcdir" ;;
415 if test -f "$ac_given_srcdir/$ac_dir/POTFILES.in"; then
416 rm -f "$ac_dir/POTFILES"
417 test -n "$as_me" && echo "$as_me: creating $ac_dir/POTFILES" || echo "creating $ac_dir/POTFILES"
418 cat "$ac_given_srcdir/$ac_dir/POTFILES.in" | sed -e "/^#/d" -e "/^[ ]*\$/d" -e "s,.*, $top_srcdir/& \\\\," | sed -e "\$s/\(.*\) \\\\/\1/" > "$ac_dir/POTFILES"
419 # ALL_LINGUAS, POFILES, GMOFILES, UPDATEPOFILES, DUMMYPOFILES depend
420 # on $ac_dir but don't depend on user-specified configuration
422 if test -f "$ac_given_srcdir/$ac_dir/LINGUAS"; then
423 # The LINGUAS file contains the set of available languages.
424 if test -n "$ALL_LINGUAS"; then
425 test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete"
427 ALL_LINGUAS_=`sed -e "/^#/d" "$ac_given_srcdir/$ac_dir/LINGUAS"`
428 # Hide the ALL_LINGUAS assigment from automake.
429 eval 'ALL_LINGUAS''=$ALL_LINGUAS_'
431 case "$ac_given_srcdir" in
433 *) srcdirpre='$(srcdir)/' ;;
439 for lang in $ALL_LINGUAS; do
440 POFILES="$POFILES $srcdirpre$lang.po"
441 GMOFILES="$GMOFILES $srcdirpre$lang.gmo"
442 UPDATEPOFILES="$UPDATEPOFILES $lang.po-update"
443 DUMMYPOFILES="$DUMMYPOFILES $lang.nop"
445 # CATALOGS depends on both $ac_dir and the user's LINGUAS
446 # environment variable.
448 if test -n "$ALL_LINGUAS"; then
449 for presentlang in $ALL_LINGUAS; do
451 if test "%UNSET%" != "$LINGUAS"; then
452 desiredlanguages="$LINGUAS"
454 desiredlanguages="$ALL_LINGUAS"
456 for desiredlang in $desiredlanguages; do
457 # Use the presentlang catalog if desiredlang is
458 # a. equal to presentlang, or
459 # b. a variant of presentlang (because in this case,
460 # presentlang can be used as a fallback for messages
461 # which are not translated in the desiredlang catalog).
462 case "$desiredlang" in
463 "$presentlang"*) useit=yes;;
466 if test $useit = yes; then
467 INST_LINGUAS="$INST_LINGUAS $presentlang"
472 if test -n "$INST_LINGUAS"; then
473 for lang in $INST_LINGUAS; do
474 CATALOGS="$CATALOGS $lang.gmo"
477 test -n "$as_me" && echo "$as_me: creating $ac_dir/Makefile" || echo "creating $ac_dir/Makefile"
478 sed -e "/^POTFILES =/r $ac_dir/POTFILES" -e "/^# Makevars/r $ac_given_srcdir/$ac_dir/Makevars" -e "s|@POFILES@|$POFILES|g" -e "s|@GMOFILES@|$GMOFILES|g" -e "s|@UPDATEPOFILES@|$UPDATEPOFILES|g" -e "s|@DUMMYPOFILES@|$DUMMYPOFILES|g" -e "s|@CATALOGS@|$CATALOGS|g" "$ac_dir/Makefile.in" > "$ac_dir/Makefile"
479 for f in "$ac_given_srcdir/$ac_dir"/Rules-*; do
480 if test -f "$f"; then
482 *.orig | *.bak | *~) ;;
483 *) cat "$f" >> "$ac_dir/Makefile" ;;
491 [# Capture the value of obsolete ALL_LINGUAS because we need it to compute
492 # POFILES, GMOFILES, UPDATEPOFILES, DUMMYPOFILES, CATALOGS. But hide it
494 eval 'ALL_LINGUAS''="$ALL_LINGUAS"'
495 # Capture the value of LINGUAS because we need it to compute CATALOGS.
496 LINGUAS="${LINGUAS-%UNSET%}"
501 dnl Checks for all prerequisites of the intl subdirectory,
502 dnl except for INTL_LIBTOOL_SUFFIX_PREFIX (and possibly LIBTOOL), INTLOBJS,
503 dnl USE_INCLUDED_LIBINTL, BUILD_INCLUDED_LIBINTL.
504 AC_DEFUN([AM_INTL_SUBDIR],
506 AC_REQUIRE([AC_PROG_INSTALL])dnl
507 AC_REQUIRE([AM_MKINSTALLDIRS])dnl
508 AC_REQUIRE([AC_PROG_CC])dnl
509 AC_REQUIRE([AC_CANONICAL_HOST])dnl
510 AC_REQUIRE([AC_PROG_RANLIB])dnl
511 AC_REQUIRE([AC_ISC_POSIX])dnl
512 AC_REQUIRE([AC_HEADER_STDC])dnl
513 AC_REQUIRE([AC_C_CONST])dnl
514 AC_REQUIRE([AC_C_INLINE])dnl
515 AC_REQUIRE([AC_TYPE_OFF_T])dnl
516 AC_REQUIRE([AC_TYPE_SIZE_T])dnl
517 AC_REQUIRE([AC_FUNC_ALLOCA])dnl
518 AC_REQUIRE([AC_FUNC_MMAP])dnl
519 AC_REQUIRE([jm_GLIBC21])dnl
520 AC_REQUIRE([gt_INTDIV0])dnl
521 AC_REQUIRE([jm_AC_TYPE_UINTMAX_T])dnl
522 AC_REQUIRE([gt_INTTYPES_PRI])dnl
524 AC_CHECK_HEADERS([argz.h limits.h locale.h nl_types.h malloc.h stddef.h \
525 stdlib.h string.h unistd.h sys/param.h])
526 AC_CHECK_FUNCS([feof_unlocked fgets_unlocked getc_unlocked getcwd getegid \
527 geteuid getgid getuid mempcpy munmap putenv setenv setlocale stpcpy \
528 strcasecmp strdup strtoul tsearch __argz_count __argz_stringify __argz_next])
532 if test $ac_cv_header_locale_h = yes; then
536 dnl intl/plural.c is generated from intl/plural.y. It requires bison,
537 dnl because plural.y uses bison specific features. It requires at least
538 dnl bison-1.26 because earlier versions generate a plural.c that doesn't
540 dnl bison is only needed for the maintainer (who touches plural.y). But in
541 dnl order to avoid separate Makefiles or --enable-maintainer-mode, we put
542 dnl the rule in general Makefile. Now, some people carelessly touch the
543 dnl files or have a broken "make" program, hence the plural.c rule will
544 dnl sometimes fire. To avoid an error, defines BISON to ":" if it is not
545 dnl present or too old.
546 AC_CHECK_PROGS([INTLBISON], [bison])
547 if test -z "$INTLBISON"; then
550 dnl Found it, now check the version.
551 AC_MSG_CHECKING([version of bison])
552 changequote(<<,>>)dnl
553 ac_prog_version=`$INTLBISON --version 2>&1 | sed -n 's/^.*GNU Bison.* \([0-9]*\.[0-9.]*\).*$/\1/p'`
554 case $ac_prog_version in
555 '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;;
556 1.2[6-9]* | 1.[3-9][0-9]* | [2-9].*)
558 ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;;
559 *) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;;
561 AC_MSG_RESULT([$ac_prog_version])
563 if test $ac_verc_fail = yes; then
569 AC_DEFUN([AM_MKINSTALLDIRS],
571 dnl If the AC_CONFIG_AUX_DIR macro for autoconf is used we possibly
572 dnl find the mkinstalldirs script in another subdir but $(top_srcdir).
573 dnl Try to locate is.
575 if test -n "$ac_aux_dir"; then
576 MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs"
578 if test -z "$MKINSTALLDIRS"; then
579 MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs"
581 AC_SUBST(MKINSTALLDIRS)
585 dnl Usage: AM_GNU_GETTEXT_VERSION([gettext-version])
586 AC_DEFUN([AM_GNU_GETTEXT_VERSION], [])