-# gettext.m4 serial 71 (gettext-0.20.2)
+# gettext.m4 serial 77 (gettext-0.22)
dnl Copyright (C) 1995-2014, 2016, 2018-2023 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl Macro to add for using GNU gettext.
dnl Usage: AM_GNU_GETTEXT([INTLSYMBOL], [NEEDSYMBOL], [INTLDIR]).
-dnl INTLSYMBOL must be one of 'external', 'use-libtool'.
-dnl INTLSYMBOL should be 'external' for packages other than GNU gettext, and
-dnl 'use-libtool' for the packages 'gettext-runtime' and 'gettext-tools'.
-dnl If INTLSYMBOL is 'use-libtool', then a libtool library
-dnl $(top_builddir)/intl/libintl.la will be created (shared and/or static,
+dnl INTLSYMBOL must be one of 'external', 'use-libtool', 'here'.
+dnl INTLSYMBOL should be 'external' for packages other than GNU gettext.
+dnl It should be 'use-libtool' for the packages 'gettext-runtime' and
+dnl 'gettext-tools'.
+dnl It should be 'here' for the package 'gettext-runtime/intl'.
+dnl If INTLSYMBOL is 'here', then a libtool library
+dnl $(top_builddir)/libintl.la will be created (shared and/or static,
dnl depending on --{enable,disable}-{shared,static} and on the presence of
dnl AM-DISABLE-SHARED).
dnl If NEEDSYMBOL is specified and is 'need-ngettext', then GNU gettext
AC_DEFUN([AM_GNU_GETTEXT],
[
dnl Argument checking.
- ifelse([$1], [], , [ifelse([$1], [external], , [ifelse([$1], [use-libtool], ,
+ m4_if([$1], [], , [m4_if([$1], [external], , [m4_if([$1], [use-libtool], , [m4_if([$1], [here], ,
[errprint([ERROR: invalid first argument to AM_GNU_GETTEXT
-])])])])
- ifelse(ifelse([$1], [], [old])[]ifelse([$1], [no-libtool], [old]), [old],
+])])])])])
+ m4_if(m4_if([$1], [], [old])[]m4_if([$1], [no-libtool], [old]), [old],
[errprint([ERROR: Use of AM_GNU_GETTEXT without [external] argument is no longer supported.
])])
- ifelse([$2], [], , [ifelse([$2], [need-ngettext], , [ifelse([$2], [need-formatstring-macros], ,
+ m4_if([$2], [], , [m4_if([$2], [need-ngettext], , [m4_if([$2], [need-formatstring-macros], ,
[errprint([ERROR: invalid second argument to AM_GNU_GETTEXT
])])])])
- define([gt_included_intl],
- ifelse([$1], [external], [no], [yes]))
+ define([gt_building_libintl_in_same_build_tree],
+ m4_if([$1], [use-libtool], [yes], [m4_if([$1], [here], [yes], [no])]))
gt_NEEDS_INIT
AM_GNU_GETTEXT_NEED([$2])
AC_REQUIRE([AM_PO_SUBDIRS])dnl
- ifelse(gt_included_intl, yes, [
- AC_REQUIRE([AM_INTL_SUBDIR])dnl
- ])
dnl Prerequisites of AC_LIB_LINKFLAGS_BODY.
AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
dnl Ideally we would do this search only after the
dnl if test "$USE_NLS" = "yes"; then
dnl if { eval "gt_val=\$$gt_func_gnugettext_libc"; test "$gt_val" != "yes"; }; then
- dnl tests. But if configure.in invokes AM_ICONV after AM_GNU_GETTEXT
+ dnl tests. But if configure.ac invokes AM_ICONV after AM_GNU_GETTEXT
dnl the configure script would need to contain the same shell code
dnl again, outside any 'if'. There are two solutions:
dnl - Invoke AM_ICONV_LINKFLAGS_BODY here, outside any 'if'.
dnl - Control the expansions in more detail using AC_PROVIDE_IFELSE.
dnl Since AC_PROVIDE_IFELSE is not documented, we avoid it.
- ifelse(gt_included_intl, yes, , [
+ m4_if(gt_building_libintl_in_same_build_tree, yes, , [
AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY])
])
dnl Set USE_NLS.
AC_REQUIRE([AM_NLS])
- ifelse(gt_included_intl, yes, [
- BUILD_INCLUDED_LIBINTL=no
+ m4_if(gt_building_libintl_in_same_build_tree, yes, [
USE_INCLUDED_LIBINTL=no
])
LIBINTL=
dnl If we use NLS figure out what method
if test "$USE_NLS" = "yes"; then
gt_use_preinstalled_gnugettext=no
- ifelse(gt_included_intl, yes, [
+ m4_if(gt_building_libintl_in_same_build_tree, yes, [
AC_MSG_CHECKING([whether included gettext is requested])
AC_ARG_WITH([included-gettext],
[ --with-included-gettext use the GNU gettext library included here],
if { eval "gt_val=\$$gt_func_gnugettext_libc"; test "$gt_val" != "yes"; }; then
dnl Sometimes libintl requires libiconv, so first search for libiconv.
- ifelse(gt_included_intl, yes, , [
+ m4_if(gt_building_libintl_in_same_build_tree, yes, , [
AM_ICONV_LINK
])
dnl Search for libintl and define LIBINTL, LTLIBINTL and INCINTL
if { eval "gt_val=\$$gt_func_gnugettext_libc"; test "$gt_val" = "yes"; } \
|| { { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; } \
&& test "$PACKAGE" != gettext-runtime \
- && test "$PACKAGE" != gettext-tools; }; then
+ && test "$PACKAGE" != gettext-tools \
+ && test "$PACKAGE" != libintl; }; then
gt_use_preinstalled_gnugettext=yes
else
dnl Reset the values set by searching for libintl.
INCINTL=
fi
- ifelse(gt_included_intl, yes, [
+ m4_if(gt_building_libintl_in_same_build_tree, yes, [
if test "$gt_use_preinstalled_gnugettext" != "yes"; then
dnl GNU gettext is not found in the C library.
dnl Fall back on included GNU gettext library.
if test "$nls_cv_use_gnu_gettext" = "yes"; then
dnl Mark actions used to generate GNU NLS library.
- BUILD_INCLUDED_LIBINTL=yes
USE_INCLUDED_LIBINTL=yes
- LIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.la $LIBICONV $LIBTHREAD"
- LTLIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.la $LTLIBICONV $LTLIBTHREAD"
+ LIBINTL="m4_if([$3],[],\${top_builddir}/intl,[$3])/libintl.la $LIBICONV $LIBTHREAD"
+ LTLIBINTL="m4_if([$3],[],\${top_builddir}/intl,[$3])/libintl.la $LTLIBICONV $LTLIBTHREAD"
LIBS=`echo " $LIBS " | sed -e 's/ -lintl / /' -e 's/^ //' -e 's/ $//'`
fi
POSUB=po
fi
- ifelse(gt_included_intl, yes, [
- dnl In GNU gettext we have to set BUILD_INCLUDED_LIBINTL to 'yes'
- dnl because some of the testsuite requires it.
- BUILD_INCLUDED_LIBINTL=yes
-
+ m4_if(gt_building_libintl_in_same_build_tree, yes, [
dnl Make all variables we use known to autoconf.
- AC_SUBST([BUILD_INCLUDED_LIBINTL])
AC_SUBST([USE_INCLUDED_LIBINTL])
AC_SUBST([CATOBJEXT])
])
- dnl For backward compatibility. Some Makefiles may be using this.
- INTLLIBS="$LIBINTL"
- AC_SUBST([INTLLIBS])
+ m4_if(gt_building_libintl_in_same_build_tree, yes, [], [
+ dnl For backward compatibility. Some Makefiles may be using this.
+ INTLLIBS="$LIBINTL"
+ AC_SUBST([INTLLIBS])
+ ])
dnl Make all documented variables known to autoconf.
AC_SUBST([LIBINTL])
AC_SUBST([LTLIBINTL])
AC_SUBST([POSUB])
+
+ dnl Define localedir_c and localedir_c_make.
+ dnl Find the final value of localedir.
+ gt_save_prefix="${prefix}"
+ gt_save_datarootdir="${datarootdir}"
+ gt_save_localedir="${localedir}"
+ dnl Unfortunately, prefix gets only finally determined at the end of
+ dnl configure.
+ if test "X$prefix" = "XNONE"; then
+ prefix="$ac_default_prefix"
+ fi
+ eval datarootdir="$datarootdir"
+ eval localedir="$localedir"
+ gl_BUILD_TO_HOST([localedir])
+ localedir="${gt_save_localedir}"
+ datarootdir="${gt_save_datarootdir}"
+ prefix="${gt_save_prefix}"
])