Blame m4/gettext.m4

Packit Service 9f2c4a
# gettext.m4 serial 28 (gettext-0.13)
Packit Service 9f2c4a
dnl Copyright (C) 1995-2003 Free Software Foundation, Inc.
Packit Service 9f2c4a
dnl This file is free software, distributed under the terms of the GNU
Packit Service 9f2c4a
dnl General Public License.  As a special exception to the GNU General
Packit Service 9f2c4a
dnl Public License, this file may be distributed as part of a program
Packit Service 9f2c4a
dnl that contains a configuration script generated by Autoconf, under
Packit Service 9f2c4a
dnl the same distribution terms as the rest of that program.
Packit Service 9f2c4a
dnl
Packit Service 9f2c4a
dnl This file can can be used in projects which are not available under
Packit Service 9f2c4a
dnl the GNU General Public License or the GNU Library General Public
Packit Service 9f2c4a
dnl License but which still want to provide support for the GNU gettext
Packit Service 9f2c4a
dnl functionality.
Packit Service 9f2c4a
dnl Please note that the actual code of the GNU gettext library is covered
Packit Service 9f2c4a
dnl by the GNU Library General Public License, and the rest of the GNU
Packit Service 9f2c4a
dnl gettext package package is covered by the GNU General Public License.
Packit Service 9f2c4a
dnl They are *not* in the public domain.
Packit Service 9f2c4a
Packit Service 9f2c4a
dnl Authors:
Packit Service 9f2c4a
dnl   Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
Packit Service 9f2c4a
dnl   Bruno Haible <haible@clisp.cons.org>, 2000-2003.
Packit Service 9f2c4a
Packit Service 9f2c4a
dnl Macro to add for using GNU gettext.
Packit Service 9f2c4a
Packit Service 9f2c4a
dnl Usage: AM_GNU_GETTEXT([INTLSYMBOL], [NEEDSYMBOL], [INTLDIR]).
Packit Service 9f2c4a
dnl INTLSYMBOL can be one of 'external', 'no-libtool', 'use-libtool'. The
Packit Service 9f2c4a
dnl    default (if it is not specified or empty) is 'no-libtool'.
Packit Service 9f2c4a
dnl    INTLSYMBOL should be 'external' for packages with no intl directory,
Packit Service 9f2c4a
dnl    and 'no-libtool' or 'use-libtool' for packages with an intl directory.
Packit Service 9f2c4a
dnl    If INTLSYMBOL is 'use-libtool', then a libtool library
Packit Service 9f2c4a
dnl    $(top_builddir)/intl/libintl.la will be created (shared and/or static,
Packit Service 9f2c4a
dnl    depending on --{enable,disable}-{shared,static} and on the presence of
Packit Service 9f2c4a
dnl    AM-DISABLE-SHARED). If INTLSYMBOL is 'no-libtool', a static library
Packit Service 9f2c4a
dnl    $(top_builddir)/intl/libintl.a will be created.
Packit Service 9f2c4a
dnl If NEEDSYMBOL is specified and is 'need-ngettext', then GNU gettext
Packit Service 9f2c4a
dnl    implementations (in libc or libintl) without the ngettext() function
Packit Service 9f2c4a
dnl    will be ignored.  If NEEDSYMBOL is specified and is
Packit Service 9f2c4a
dnl    'need-formatstring-macros', then GNU gettext implementations that don't
Packit Service 9f2c4a
dnl    support the ISO C 99 <inttypes.h> formatstring macros will be ignored.
Packit Service 9f2c4a
dnl INTLDIR is used to find the intl libraries.  If empty,
Packit Service 9f2c4a
dnl    the value `$(top_builddir)/intl/' is used.
Packit Service 9f2c4a
dnl
Packit Service 9f2c4a
dnl The result of the configuration is one of three cases:
Packit Service 9f2c4a
dnl 1) GNU gettext, as included in the intl subdirectory, will be compiled
Packit Service 9f2c4a
dnl    and used.
Packit Service 9f2c4a
dnl    Catalog format: GNU --> install in $(datadir)
Packit Service 9f2c4a
dnl    Catalog extension: .mo after installation, .gmo in source tree
Packit Service 9f2c4a
dnl 2) GNU gettext has been found in the system's C library.
Packit Service 9f2c4a
dnl    Catalog format: GNU --> install in $(datadir)
Packit Service 9f2c4a
dnl    Catalog extension: .mo after installation, .gmo in source tree
Packit Service 9f2c4a
dnl 3) No internationalization, always use English msgid.
Packit Service 9f2c4a
dnl    Catalog format: none
Packit Service 9f2c4a
dnl    Catalog extension: none
Packit Service 9f2c4a
dnl If INTLSYMBOL is 'external', only cases 2 and 3 can occur.
Packit Service 9f2c4a
dnl The use of .gmo is historical (it was needed to avoid overwriting the
Packit Service 9f2c4a
dnl GNU format catalogs when building on a platform with an X/Open gettext),
Packit Service 9f2c4a
dnl but we keep it in order not to force irrelevant filename changes on the
Packit Service 9f2c4a
dnl maintainers.
Packit Service 9f2c4a
dnl
Packit Service 9f2c4a
AC_DEFUN([AM_GNU_GETTEXT],
Packit Service 9f2c4a
[
Packit Service 9f2c4a
  dnl Argument checking.
Packit Service 9f2c4a
  ifelse([$1], [], , [ifelse([$1], [external], , [ifelse([$1], [no-libtool], , [ifelse([$1], [use-libtool], ,
Packit Service 9f2c4a
    [errprint([ERROR: invalid first argument to AM_GNU_GETTEXT
Packit Service 9f2c4a
])])])])])
Packit Service 9f2c4a
  ifelse([$2], [], , [ifelse([$2], [need-ngettext], , [ifelse([$2], [need-formatstring-macros], ,
Packit Service 9f2c4a
    [errprint([ERROR: invalid second argument to AM_GNU_GETTEXT
Packit Service 9f2c4a
])])])])
Packit Service 9f2c4a
  define(gt_included_intl, ifelse([$1], [external], [no], [yes]))
Packit Service 9f2c4a
  define(gt_libtool_suffix_prefix, ifelse([$1], [use-libtool], [l], []))
Packit Service 9f2c4a
Packit Service 9f2c4a
  AC_REQUIRE([AM_PO_SUBDIRS])dnl
Packit Service 9f2c4a
  ifelse(gt_included_intl, yes, [
Packit Service 9f2c4a
    AC_REQUIRE([AM_INTL_SUBDIR])dnl
Packit Service 9f2c4a
  ])
Packit Service 9f2c4a
Packit Service 9f2c4a
  dnl Prerequisites of AC_LIB_LINKFLAGS_BODY.
Packit Service 9f2c4a
  AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
Packit Service 9f2c4a
  AC_REQUIRE([AC_LIB_RPATH])
Packit Service 9f2c4a
Packit Service 9f2c4a
  dnl Sometimes libintl requires libiconv, so first search for libiconv.
Packit Service 9f2c4a
  dnl Ideally we would do this search only after the
Packit Service 9f2c4a
  dnl      if test "$USE_NLS" = "yes"; then
Packit Service 9f2c4a
  dnl        if test "$gt_cv_func_gnugettext_libc" != "yes"; then
Packit Service 9f2c4a
  dnl tests. But if configure.in invokes AM_ICONV after AM_GNU_GETTEXT
Packit Service 9f2c4a
  dnl the configure script would need to contain the same shell code
Packit Service 9f2c4a
  dnl again, outside any 'if'. There are two solutions:
Packit Service 9f2c4a
  dnl - Invoke AM_ICONV_LINKFLAGS_BODY here, outside any 'if'.
Packit Service 9f2c4a
  dnl - Control the expansions in more detail using AC_PROVIDE_IFELSE.
Packit Service 9f2c4a
  dnl Since AC_PROVIDE_IFELSE is only in autoconf >= 2.52 and not
Packit Service 9f2c4a
  dnl documented, we avoid it.
Packit Service 9f2c4a
  ifelse(gt_included_intl, yes, , [
Packit Service 9f2c4a
    AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY])
Packit Service 9f2c4a
  ])
Packit Service 9f2c4a
Packit Service 9f2c4a
  dnl Set USE_NLS.
Packit Service 9f2c4a
  AM_NLS
Packit Service 9f2c4a
Packit Service 9f2c4a
  ifelse(gt_included_intl, yes, [
Packit Service 9f2c4a
    BUILD_INCLUDED_LIBINTL=no
Packit Service 9f2c4a
    USE_INCLUDED_LIBINTL=no
Packit Service 9f2c4a
  ])
Packit Service 9f2c4a
  LIBINTL=
Packit Service 9f2c4a
  LTLIBINTL=
Packit Service 9f2c4a
  POSUB=
Packit Service 9f2c4a
Packit Service 9f2c4a
  dnl If we use NLS figure out what method
Packit Service 9f2c4a
  if test "$USE_NLS" = "yes"; then
Packit Service 9f2c4a
    gt_use_preinstalled_gnugettext=no
Packit Service 9f2c4a
    ifelse(gt_included_intl, yes, [
Packit Service 9f2c4a
      AC_MSG_CHECKING([whether included gettext is requested])
Packit Service 9f2c4a
      AC_ARG_WITH(included-gettext,
Packit Service 9f2c4a
        [  --with-included-gettext use the GNU gettext library included here],
Packit Service 9f2c4a
        nls_cv_force_use_gnu_gettext=$withval,
Packit Service 9f2c4a
        nls_cv_force_use_gnu_gettext=no)
Packit Service 9f2c4a
      AC_MSG_RESULT($nls_cv_force_use_gnu_gettext)
Packit Service 9f2c4a
Packit Service 9f2c4a
      nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext"
Packit Service 9f2c4a
      if test "$nls_cv_force_use_gnu_gettext" != "yes"; then
Packit Service 9f2c4a
    ])
Packit Service 9f2c4a
        dnl User does not insist on using GNU NLS library.  Figure out what
Packit Service 9f2c4a
        dnl to use.  If GNU gettext is available we use this.  Else we have
Packit Service 9f2c4a
        dnl to fall back to GNU NLS library.
Packit Service 9f2c4a
Packit Service 9f2c4a
        dnl Add a version number to the cache macros.
Packit Service 9f2c4a
        define([gt_api_version], ifelse([$2], [need-formatstring-macros], 3, ifelse([$2], [need-ngettext], 2, 1)))
Packit Service 9f2c4a
        define([gt_cv_func_gnugettext_libc], [gt_cv_func_gnugettext]gt_api_version[_libc])
Packit Service 9f2c4a
        define([gt_cv_func_gnugettext_libintl], [gt_cv_func_gnugettext]gt_api_version[_libintl])
Packit Service 9f2c4a
Packit Service 9f2c4a
        AC_CACHE_CHECK([for GNU gettext in libc], gt_cv_func_gnugettext_libc,
Packit Service 9f2c4a
         [AC_TRY_LINK([#include <libintl.h>
Packit Service 9f2c4a
]ifelse([$2], [need-formatstring-macros],
Packit Service 9f2c4a
[#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
Packit Service 9f2c4a
#define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1)
Packit Service 9f2c4a
#endif
Packit Service 9f2c4a
changequote(,)dnl
Packit Service 9f2c4a
typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1];
Packit Service 9f2c4a
changequote([,])dnl
Packit Service 9f2c4a
], [])[extern int _nl_msg_cat_cntr;
Packit Service 9f2c4a
extern int *_nl_domain_bindings;],
Packit Service 9f2c4a
            [bindtextdomain ("", "");
Packit Service 9f2c4a
return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_domain_bindings],
Packit Service 9f2c4a
            gt_cv_func_gnugettext_libc=yes,
Packit Service 9f2c4a
            gt_cv_func_gnugettext_libc=no)])
Packit Service 9f2c4a
Packit Service 9f2c4a
        if test "$gt_cv_func_gnugettext_libc" != "yes"; then
Packit Service 9f2c4a
          dnl Sometimes libintl requires libiconv, so first search for libiconv.
Packit Service 9f2c4a
          ifelse(gt_included_intl, yes, , [
Packit Service 9f2c4a
            AM_ICONV_LINK
Packit Service 9f2c4a
          ])
Packit Service 9f2c4a
          dnl Search for libintl and define LIBINTL, LTLIBINTL and INCINTL
Packit Service 9f2c4a
          dnl accordingly. Don't use AC_LIB_LINKFLAGS_BODY([intl],[iconv])
Packit Service 9f2c4a
          dnl because that would add "-liconv" to LIBINTL and LTLIBINTL
Packit Service 9f2c4a
          dnl even if libiconv doesn't exist.
Packit Service 9f2c4a
          AC_LIB_LINKFLAGS_BODY([intl])
Packit Service 9f2c4a
          AC_CACHE_CHECK([for GNU gettext in libintl],
Packit Service 9f2c4a
            gt_cv_func_gnugettext_libintl,
Packit Service 9f2c4a
           [gt_save_CPPFLAGS="$CPPFLAGS"
Packit Service 9f2c4a
            CPPFLAGS="$CPPFLAGS $INCINTL"
Packit Service 9f2c4a
            gt_save_LIBS="$LIBS"
Packit Service 9f2c4a
            LIBS="$LIBS $LIBINTL"
Packit Service 9f2c4a
            dnl Now see whether libintl exists and does not depend on libiconv.
Packit Service 9f2c4a
            AC_TRY_LINK([#include <libintl.h>
Packit Service 9f2c4a
]ifelse([$2], [need-formatstring-macros],
Packit Service 9f2c4a
[#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
Packit Service 9f2c4a
#define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1)
Packit Service 9f2c4a
#endif
Packit Service 9f2c4a
changequote(,)dnl
Packit Service 9f2c4a
typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1];
Packit Service 9f2c4a
changequote([,])dnl
Packit Service 9f2c4a
], [])[extern int _nl_msg_cat_cntr;
Packit Service 9f2c4a
extern
Packit Service 9f2c4a
#ifdef __cplusplus
Packit Service 9f2c4a
"C"
Packit Service 9f2c4a
#endif
Packit Service 9f2c4a
const char *_nl_expand_alias ();],
Packit Service 9f2c4a
              [bindtextdomain ("", "");
Packit Service 9f2c4a
return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_expand_alias (0)],
Packit Service 9f2c4a
              gt_cv_func_gnugettext_libintl=yes,
Packit Service 9f2c4a
              gt_cv_func_gnugettext_libintl=no)
Packit Service 9f2c4a
            dnl Now see whether libintl exists and depends on libiconv.
Packit Service 9f2c4a
            if test "$gt_cv_func_gnugettext_libintl" != yes && test -n "$LIBICONV"; then
Packit Service 9f2c4a
              LIBS="$LIBS $LIBICONV"
Packit Service 9f2c4a
              AC_TRY_LINK([#include <libintl.h>
Packit Service 9f2c4a
]ifelse([$2], [need-formatstring-macros],
Packit Service 9f2c4a
[#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
Packit Service 9f2c4a
#define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1)
Packit Service 9f2c4a
#endif
Packit Service 9f2c4a
changequote(,)dnl
Packit Service 9f2c4a
typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1];
Packit Service 9f2c4a
changequote([,])dnl
Packit Service 9f2c4a
], [])[extern int _nl_msg_cat_cntr;
Packit Service 9f2c4a
extern
Packit Service 9f2c4a
#ifdef __cplusplus
Packit Service 9f2c4a
"C"
Packit Service 9f2c4a
#endif
Packit Service 9f2c4a
const char *_nl_expand_alias ();],
Packit Service 9f2c4a
                [bindtextdomain ("", "");
Packit Service 9f2c4a
return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_expand_alias (0)],
Packit Service 9f2c4a
               [LIBINTL="$LIBINTL $LIBICONV"
Packit Service 9f2c4a
                LTLIBINTL="$LTLIBINTL $LTLIBICONV"
Packit Service 9f2c4a
                gt_cv_func_gnugettext_libintl=yes
Packit Service 9f2c4a
               ])
Packit Service 9f2c4a
            fi
Packit Service 9f2c4a
            CPPFLAGS="$gt_save_CPPFLAGS"
Packit Service 9f2c4a
            LIBS="$gt_save_LIBS"])
Packit Service 9f2c4a
        fi
Packit Service 9f2c4a
Packit Service 9f2c4a
        dnl If an already present or preinstalled GNU gettext() is found,
Packit Service 9f2c4a
        dnl use it.  But if this macro is used in GNU gettext, and GNU
Packit Service 9f2c4a
        dnl gettext is already preinstalled in libintl, we update this
Packit Service 9f2c4a
        dnl libintl.  (Cf. the install rule in intl/Makefile.in.)
Packit Service 9f2c4a
        if test "$gt_cv_func_gnugettext_libc" = "yes" \
Packit Service 9f2c4a
           || { test "$gt_cv_func_gnugettext_libintl" = "yes" \
Packit Service 9f2c4a
                && test "$PACKAGE" != gettext-runtime \
Packit Service 9f2c4a
                && test "$PACKAGE" != gettext-tools; }; then
Packit Service 9f2c4a
          gt_use_preinstalled_gnugettext=yes
Packit Service 9f2c4a
        else
Packit Service 9f2c4a
          dnl Reset the values set by searching for libintl.
Packit Service 9f2c4a
          LIBINTL=
Packit Service 9f2c4a
          LTLIBINTL=
Packit Service 9f2c4a
          INCINTL=
Packit Service 9f2c4a
        fi
Packit Service 9f2c4a
Packit Service 9f2c4a
    ifelse(gt_included_intl, yes, [
Packit Service 9f2c4a
        if test "$gt_use_preinstalled_gnugettext" != "yes"; then
Packit Service 9f2c4a
          dnl GNU gettext is not found in the C library.
Packit Service 9f2c4a
          dnl Fall back on included GNU gettext library.
Packit Service 9f2c4a
          nls_cv_use_gnu_gettext=yes
Packit Service 9f2c4a
        fi
Packit Service 9f2c4a
      fi
Packit Service 9f2c4a
Packit Service 9f2c4a
      if test "$nls_cv_use_gnu_gettext" = "yes"; then
Packit Service 9f2c4a
        dnl Mark actions used to generate GNU NLS library.
Packit Service 9f2c4a
        BUILD_INCLUDED_LIBINTL=yes
Packit Service 9f2c4a
        USE_INCLUDED_LIBINTL=yes
Packit Service 9f2c4a
        LIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LIBICONV"
Packit Service 9f2c4a
        LTLIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LTLIBICONV"
Packit Service 9f2c4a
        LIBS=`echo " $LIBS " | sed -e 's/ -lintl / /' -e 's/^ //' -e 's/ $//'`
Packit Service 9f2c4a
      fi
Packit Service 9f2c4a
Packit Service 9f2c4a
      if test "$gt_use_preinstalled_gnugettext" = "yes" \
Packit Service 9f2c4a
         || test "$nls_cv_use_gnu_gettext" = "yes"; then
Packit Service 9f2c4a
        dnl Mark actions to use GNU gettext tools.
Packit Service 9f2c4a
        CATOBJEXT=.gmo
Packit Service 9f2c4a
      fi
Packit Service 9f2c4a
    ])
Packit Service 9f2c4a
Packit Service 9f2c4a
    if test "$gt_use_preinstalled_gnugettext" = "yes" \
Packit Service 9f2c4a
       || test "$nls_cv_use_gnu_gettext" = "yes"; then
Packit Service 9f2c4a
      AC_DEFINE(ENABLE_NLS, 1,
Packit Service 9f2c4a
        [Define to 1 if translation of program messages to the user's native language
Packit Service 9f2c4a
   is requested.])
Packit Service 9f2c4a
    else
Packit Service 9f2c4a
      USE_NLS=no
Packit Service 9f2c4a
    fi
Packit Service 9f2c4a
  fi
Packit Service 9f2c4a
Packit Service 9f2c4a
  AC_MSG_CHECKING([whether to use NLS])
Packit Service 9f2c4a
  AC_MSG_RESULT([$USE_NLS])
Packit Service 9f2c4a
  if test "$USE_NLS" = "yes"; then
Packit Service 9f2c4a
    AC_MSG_CHECKING([where the gettext function comes from])
Packit Service 9f2c4a
    if test "$gt_use_preinstalled_gnugettext" = "yes"; then
Packit Service 9f2c4a
      if test "$gt_cv_func_gnugettext_libintl" = "yes"; then
Packit Service 9f2c4a
        gt_source="external libintl"
Packit Service 9f2c4a
      else
Packit Service 9f2c4a
        gt_source="libc"
Packit Service 9f2c4a
      fi
Packit Service 9f2c4a
    else
Packit Service 9f2c4a
      gt_source="included intl directory"
Packit Service 9f2c4a
    fi
Packit Service 9f2c4a
    AC_MSG_RESULT([$gt_source])
Packit Service 9f2c4a
  fi
Packit Service 9f2c4a
Packit Service 9f2c4a
  if test "$USE_NLS" = "yes"; then
Packit Service 9f2c4a
Packit Service 9f2c4a
    if test "$gt_use_preinstalled_gnugettext" = "yes"; then
Packit Service 9f2c4a
      if test "$gt_cv_func_gnugettext_libintl" = "yes"; then
Packit Service 9f2c4a
        AC_MSG_CHECKING([how to link with libintl])
Packit Service 9f2c4a
        AC_MSG_RESULT([$LIBINTL])
Packit Service 9f2c4a
        AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCINTL])
Packit Service 9f2c4a
      fi
Packit Service 9f2c4a
Packit Service 9f2c4a
      dnl For backward compatibility. Some packages may be using this.
Packit Service 9f2c4a
      AC_DEFINE(HAVE_GETTEXT, 1,
Packit Service 9f2c4a
       [Define if the GNU gettext() function is already present or preinstalled.])
Packit Service 9f2c4a
      AC_DEFINE(HAVE_DCGETTEXT, 1,
Packit Service 9f2c4a
       [Define if the GNU dcgettext() function is already present or preinstalled.])
Packit Service 9f2c4a
    fi
Packit Service 9f2c4a
Packit Service 9f2c4a
    dnl We need to process the po/ directory.
Packit Service 9f2c4a
    POSUB=po
Packit Service 9f2c4a
  fi
Packit Service 9f2c4a
Packit Service 9f2c4a
  ifelse(gt_included_intl, yes, [
Packit Service 9f2c4a
    dnl If this is used in GNU gettext we have to set BUILD_INCLUDED_LIBINTL
Packit Service 9f2c4a
    dnl to 'yes' because some of the testsuite requires it.
Packit Service 9f2c4a
    if test "$PACKAGE" = gettext-runtime || test "$PACKAGE" = gettext-tools; then
Packit Service 9f2c4a
      BUILD_INCLUDED_LIBINTL=yes
Packit Service 9f2c4a
    fi
Packit Service 9f2c4a
Packit Service 9f2c4a
    dnl Make all variables we use known to autoconf.
Packit Service 9f2c4a
    AC_SUBST(BUILD_INCLUDED_LIBINTL)
Packit Service 9f2c4a
    AC_SUBST(USE_INCLUDED_LIBINTL)
Packit Service 9f2c4a
    AC_SUBST(CATOBJEXT)
Packit Service 9f2c4a
Packit Service 9f2c4a
    dnl For backward compatibility. Some configure.ins may be using this.
Packit Service 9f2c4a
    nls_cv_header_intl=
Packit Service 9f2c4a
    nls_cv_header_libgt=
Packit Service 9f2c4a
Packit Service 9f2c4a
    dnl For backward compatibility. Some Makefiles may be using this.
Packit Service 9f2c4a
    DATADIRNAME=share
Packit Service 9f2c4a
    AC_SUBST(DATADIRNAME)
Packit Service 9f2c4a
Packit Service 9f2c4a
    dnl For backward compatibility. Some Makefiles may be using this.
Packit Service 9f2c4a
    INSTOBJEXT=.mo
Packit Service 9f2c4a
    AC_SUBST(INSTOBJEXT)
Packit Service 9f2c4a
Packit Service 9f2c4a
    dnl For backward compatibility. Some Makefiles may be using this.
Packit Service 9f2c4a
    GENCAT=gencat
Packit Service 9f2c4a
    AC_SUBST(GENCAT)
Packit Service 9f2c4a
Packit Service 9f2c4a
    dnl For backward compatibility. Some Makefiles may be using this.
Packit Service 9f2c4a
    if test "$USE_INCLUDED_LIBINTL" = yes; then
Packit Service 9f2c4a
      INTLOBJS="\$(GETTOBJS)"
Packit Service 9f2c4a
    fi
Packit Service 9f2c4a
    AC_SUBST(INTLOBJS)
Packit Service 9f2c4a
Packit Service 9f2c4a
    dnl Enable libtool support if the surrounding package wishes it.
Packit Service 9f2c4a
    INTL_LIBTOOL_SUFFIX_PREFIX=gt_libtool_suffix_prefix
Packit Service 9f2c4a
    AC_SUBST(INTL_LIBTOOL_SUFFIX_PREFIX)
Packit Service 9f2c4a
  ])
Packit Service 9f2c4a
Packit Service 9f2c4a
  dnl For backward compatibility. Some Makefiles may be using this.
Packit Service 9f2c4a
  INTLLIBS="$LIBINTL"
Packit Service 9f2c4a
  AC_SUBST(INTLLIBS)
Packit Service 9f2c4a
Packit Service 9f2c4a
  dnl Make all documented variables known to autoconf.
Packit Service 9f2c4a
  AC_SUBST(LIBINTL)
Packit Service 9f2c4a
  AC_SUBST(LTLIBINTL)
Packit Service 9f2c4a
  AC_SUBST(POSUB)
Packit Service 9f2c4a
])
Packit Service 9f2c4a
Packit Service 9f2c4a
Packit Service 9f2c4a
dnl Checks for all prerequisites of the intl subdirectory,
Packit Service 9f2c4a
dnl except for INTL_LIBTOOL_SUFFIX_PREFIX (and possibly LIBTOOL), INTLOBJS,
Packit Service 9f2c4a
dnl            USE_INCLUDED_LIBINTL, BUILD_INCLUDED_LIBINTL.
Packit Service 9f2c4a
AC_DEFUN([AM_INTL_SUBDIR],
Packit Service 9f2c4a
[
Packit Service 9f2c4a
  AC_REQUIRE([AC_PROG_INSTALL])dnl
Packit Service 9f2c4a
  AC_REQUIRE([AM_MKINSTALLDIRS])dnl
Packit Service 9f2c4a
  AC_REQUIRE([AC_PROG_CC])dnl
Packit Service 9f2c4a
  AC_REQUIRE([AC_CANONICAL_HOST])dnl
Packit Service 9f2c4a
  AC_REQUIRE([AC_PROG_RANLIB])dnl
Packit Service 9f2c4a
  AC_REQUIRE([AC_ISC_POSIX])dnl
Packit Service 9f2c4a
  AC_REQUIRE([AC_HEADER_STDC])dnl
Packit Service 9f2c4a
  AC_REQUIRE([AC_C_CONST])dnl
Packit Service 9f2c4a
  AC_REQUIRE([bh_C_SIGNED])dnl
Packit Service 9f2c4a
  AC_REQUIRE([AC_C_INLINE])dnl
Packit Service 9f2c4a
  AC_REQUIRE([AC_TYPE_OFF_T])dnl
Packit Service 9f2c4a
  AC_REQUIRE([AC_TYPE_SIZE_T])dnl
Packit Service 9f2c4a
  AC_REQUIRE([jm_AC_TYPE_LONG_LONG])dnl
Packit Service 9f2c4a
  AC_REQUIRE([gt_TYPE_LONGDOUBLE])dnl
Packit Service 9f2c4a
  AC_REQUIRE([gt_TYPE_WCHAR_T])dnl
Packit Service 9f2c4a
  AC_REQUIRE([gt_TYPE_WINT_T])dnl
Packit Service 9f2c4a
  AC_REQUIRE([jm_AC_HEADER_INTTYPES_H])
Packit Service 9f2c4a
  AC_REQUIRE([jm_AC_HEADER_STDINT_H])
Packit Service 9f2c4a
  AC_REQUIRE([gt_TYPE_INTMAX_T])
Packit Service 9f2c4a
  AC_REQUIRE([gt_PRINTF_POSIX])
Packit Service 9f2c4a
  AC_REQUIRE([AC_FUNC_ALLOCA])dnl
Packit Service 9f2c4a
  AC_REQUIRE([AC_FUNC_MMAP])dnl
Packit Service 9f2c4a
  AC_REQUIRE([jm_GLIBC21])dnl
Packit Service 9f2c4a
  AC_REQUIRE([gt_INTDIV0])dnl
Packit Service 9f2c4a
  AC_REQUIRE([jm_AC_TYPE_UINTMAX_T])dnl
Packit Service 9f2c4a
  AC_REQUIRE([gt_HEADER_INTTYPES_H])dnl
Packit Service 9f2c4a
  AC_REQUIRE([gt_INTTYPES_PRI])dnl
Packit Service 9f2c4a
  AC_REQUIRE([gl_XSIZE])dnl
Packit Service 9f2c4a
Packit Service 9f2c4a
  AC_CHECK_TYPE([ptrdiff_t], ,
Packit Service 9f2c4a
    [AC_DEFINE([ptrdiff_t], [long],
Packit Service 9f2c4a
       [Define as the type of the result of subtracting two pointers, if the system doesn't define it.])
Packit Service 9f2c4a
    ])
Packit Service 9f2c4a
  AC_CHECK_HEADERS([argz.h limits.h locale.h nl_types.h malloc.h stddef.h \
Packit Service 9f2c4a
stdlib.h string.h unistd.h sys/param.h])
Packit Service 9f2c4a
  AC_CHECK_FUNCS([asprintf fwprintf getcwd getegid geteuid getgid getuid \
Packit Service 9f2c4a
mempcpy munmap putenv setenv setlocale snprintf stpcpy strcasecmp strdup \
Packit Service 9f2c4a
strtoul tsearch wcslen __argz_count __argz_stringify __argz_next \
Packit Service 9f2c4a
__fsetlocking])
Packit Service 9f2c4a
Packit Service 9f2c4a
  dnl Use the _snprintf function only if it is declared (because on NetBSD it
Packit Service 9f2c4a
  dnl is defined as a weak alias of snprintf; we prefer to use the latter).
Packit Service 9f2c4a
  gt_CHECK_DECL(_snprintf, [#include <stdio.h>])
Packit Service 9f2c4a
  gt_CHECK_DECL(_snwprintf, [#include <stdio.h>])
Packit Service 9f2c4a
Packit Service 9f2c4a
  dnl Use the *_unlocked functions only if they are declared.
Packit Service 9f2c4a
  dnl (because some of them were defined without being declared in Solaris
Packit Service 9f2c4a
  dnl 2.5.1 but were removed in Solaris 2.6, whereas we want binaries built
Packit Service 9f2c4a
  dnl on Solaris 2.5.1 to run on Solaris 2.6).
Packit Service 9f2c4a
  dnl Don't use AC_CHECK_DECLS because it isn't supported in autoconf-2.13.
Packit Service 9f2c4a
  gt_CHECK_DECL(feof_unlocked, [#include <stdio.h>])
Packit Service 9f2c4a
  gt_CHECK_DECL(fgets_unlocked, [#include <stdio.h>])
Packit Service 9f2c4a
  gt_CHECK_DECL(getc_unlocked, [#include <stdio.h>])
Packit Service 9f2c4a
Packit Service 9f2c4a
  case $gt_cv_func_printf_posix in
Packit Service 9f2c4a
    *yes) HAVE_POSIX_PRINTF=1 ;;
Packit Service 9f2c4a
    *) HAVE_POSIX_PRINTF=0 ;;
Packit Service 9f2c4a
  esac
Packit Service 9f2c4a
  AC_SUBST([HAVE_POSIX_PRINTF])
Packit Service 9f2c4a
  if test "$ac_cv_func_asprintf" = yes; then
Packit Service 9f2c4a
    HAVE_ASPRINTF=1
Packit Service 9f2c4a
  else
Packit Service 9f2c4a
    HAVE_ASPRINTF=0
Packit Service 9f2c4a
  fi
Packit Service 9f2c4a
  AC_SUBST([HAVE_ASPRINTF])
Packit Service 9f2c4a
  if test "$ac_cv_func_snprintf" = yes; then
Packit Service 9f2c4a
    HAVE_SNPRINTF=1
Packit Service 9f2c4a
  else
Packit Service 9f2c4a
    HAVE_SNPRINTF=0
Packit Service 9f2c4a
  fi
Packit Service 9f2c4a
  AC_SUBST([HAVE_SNPRINTF])
Packit Service 9f2c4a
  if test "$ac_cv_func_wprintf" = yes; then
Packit Service 9f2c4a
    HAVE_WPRINTF=1
Packit Service 9f2c4a
  else
Packit Service 9f2c4a
    HAVE_WPRINTF=0
Packit Service 9f2c4a
  fi
Packit Service 9f2c4a
  AC_SUBST([HAVE_WPRINTF])
Packit Service 9f2c4a
Packit Service 9f2c4a
  AM_ICONV
Packit Service 9f2c4a
  AM_LANGINFO_CODESET
Packit Service 9f2c4a
  if test $ac_cv_header_locale_h = yes; then
Packit Service 9f2c4a
    AM_LC_MESSAGES
Packit Service 9f2c4a
  fi
Packit Service 9f2c4a
Packit Service 9f2c4a
  dnl intl/plural.c is generated from intl/plural.y. It requires bison,
Packit Service 9f2c4a
  dnl because plural.y uses bison specific features. It requires at least
Packit Service 9f2c4a
  dnl bison-1.26 because earlier versions generate a plural.c that doesn't
Packit Service 9f2c4a
  dnl compile.
Packit Service 9f2c4a
  dnl bison is only needed for the maintainer (who touches plural.y). But in
Packit Service 9f2c4a
  dnl order to avoid separate Makefiles or --enable-maintainer-mode, we put
Packit Service 9f2c4a
  dnl the rule in general Makefile. Now, some people carelessly touch the
Packit Service 9f2c4a
  dnl files or have a broken "make" program, hence the plural.c rule will
Packit Service 9f2c4a
  dnl sometimes fire. To avoid an error, defines BISON to ":" if it is not
Packit Service 9f2c4a
  dnl present or too old.
Packit Service 9f2c4a
  AC_CHECK_PROGS([INTLBISON], [bison])
Packit Service 9f2c4a
  if test -z "$INTLBISON"; then
Packit Service 9f2c4a
    ac_verc_fail=yes
Packit Service 9f2c4a
  else
Packit Service 9f2c4a
    dnl Found it, now check the version.
Packit Service 9f2c4a
    AC_MSG_CHECKING([version of bison])
Packit Service 9f2c4a
changequote(<<,>>)dnl
Packit Service 9f2c4a
    ac_prog_version=`$INTLBISON --version 2>&1 | sed -n 's/^.*GNU Bison.* \([0-9]*\.[0-9.]*\).*$/\1/p'`
Packit Service 9f2c4a
    case $ac_prog_version in
Packit Service 9f2c4a
      '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;;
Packit Service 9f2c4a
      1.2[6-9]* | 1.[3-9][0-9]* | [2-9].*)
Packit Service 9f2c4a
changequote([,])dnl
Packit Service 9f2c4a
         ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;;
Packit Service 9f2c4a
      *) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;;
Packit Service 9f2c4a
    esac
Packit Service 9f2c4a
    AC_MSG_RESULT([$ac_prog_version])
Packit Service 9f2c4a
  fi
Packit Service 9f2c4a
  if test $ac_verc_fail = yes; then
Packit Service 9f2c4a
    INTLBISON=:
Packit Service 9f2c4a
  fi
Packit Service 9f2c4a
])
Packit Service 9f2c4a
Packit Service 9f2c4a
Packit Service 9f2c4a
dnl gt_CHECK_DECL(FUNC, INCLUDES)
Packit Service 9f2c4a
dnl Check whether a function is declared.
Packit Service 9f2c4a
AC_DEFUN([gt_CHECK_DECL],
Packit Service 9f2c4a
[
Packit Service 9f2c4a
  AC_CACHE_CHECK([whether $1 is declared], ac_cv_have_decl_$1,
Packit Service 9f2c4a
    [AC_TRY_COMPILE([$2], [
Packit Service 9f2c4a
#ifndef $1
Packit Service 9f2c4a
  char *p = (char *) $1;
Packit Service 9f2c4a
#endif
Packit Service 9f2c4a
], ac_cv_have_decl_$1=yes, ac_cv_have_decl_$1=no)])
Packit Service 9f2c4a
  if test $ac_cv_have_decl_$1 = yes; then
Packit Service 9f2c4a
    gt_value=1
Packit Service 9f2c4a
  else
Packit Service 9f2c4a
    gt_value=0
Packit Service 9f2c4a
  fi
Packit Service 9f2c4a
  AC_DEFINE_UNQUOTED([HAVE_DECL_]translit($1, [a-z], [A-Z]), [$gt_value],
Packit Service 9f2c4a
    [Define to 1 if you have the declaration of `$1', and to 0 if you don't.])
Packit Service 9f2c4a
])
Packit Service 9f2c4a
Packit Service 9f2c4a
Packit Service 9f2c4a
dnl Usage: AM_GNU_GETTEXT_VERSION([gettext-version])
Packit Service 9f2c4a
AC_DEFUN([AM_GNU_GETTEXT_VERSION], [])