-Version 0.21.2 - January 2023
+Version 0.21.2 - February 2023
* PO file format:
- When a #: line contains references to file names that contain spaces,
these file names are surrounded by Unicode characters U+2068 and U+2069.
This makes it possible to parse such references correctly.
+* Improvements for maintainers:
+ - The AM_GNU_GETTEXT macro now defines two variables localedir_c and
+ localedir_c_make, that can be used in C code or in Makefiles,
+ respectively, for representing the value of the --localedir configure
+ option.
+
* Programming languages support:
- C, C++: xgettext now supports gettext-like functions that take wide strings
(of type 'const wchar_t *', 'const char16_t *', or 'const char32_t *') as
# -DBUILDING_DLL: Change expansion of RELOCATABLE_DLL_EXPORTED macro.
AM_CPPFLAGS = \
-Ignulib-lib -I$(srcdir)/gnulib-lib \
- -DLOCALEDIR=\"$(localedir)\" -DLOCALE_ALIAS_PATH=\"$(aliaspath)\" \
+ -DLOCALEDIR=$(localedir_c_make) -DLOCALE_ALIAS_PATH=\"$(aliaspath)\" \
-DLIBDIR=\"$(libdir)\" -DBUILDING_LIBINTL
if WOE32
-# gettext.m4 serial 75 (gettext-0.21.2)
-dnl Copyright (C) 1995-2014, 2016, 2018-2022 Free Software Foundation, Inc.
+# gettext.m4 serial 76 (gettext-0.21.2)
+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 with or without modifications, as long as this notice is preserved.
AC_SUBST([LIBINTL])
AC_SUBST([LTLIBINTL])
AC_SUBST([POSUB])
+
+ dnl Define localedir_c.
+ AC_REQUIRE([AC_CANONICAL_BUILD])
+ 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"
+ gt_final_localedir="$localedir"
+ localedir="${gt_save_localedir}"
+ datarootdir="${gt_save_datarootdir}"
+ prefix="${gt_save_prefix}"
+ dnl Translate it from build syntax to host syntax.
+ case "$build_os" in
+ cygwin*) gt_final_localedir=`cygpath -w "$gt_final_localedir"` ;;
+ esac
+ dnl Convert it to C string syntax.
+ gt_sed_double_backslashes='s/\\/\\\\/g'
+ gt_sed_escape_doublequotes='s/"/\\"/g'
+ localedir_c=`echo "$gt_final_localedir" | sed -e "$gt_sed_double_backslashes" -e "$gt_sed_escape_doublequotes"`
+ localedir_c='"'"$localedir_c"'"'
+ AC_SUBST([localedir_c])
+
+ dnl Define localedir_c_make.
+changequote(,)dnl
+ gt_sed_escape_for_make_1="s,\\([ \"&'();<>\\\\\`|]\\),\\\\\\1,g"
+changequote([,])dnl
+ gt_sed_escape_for_make_2='s,\$,\\$$,g'
+ localedir_c_make=`echo "$localedir_c" | sed -e "$gt_sed_escape_for_make_1" -e "$gt_sed_escape_for_make_2"`
+ dnl Use the substituted localedir variable, when possible, so that the user
+ dnl may adjust localedir a posteriori when there are no special characters.
+ if test "$localedir_c_make" = '\"'"${gt_final_localedir}"'\"'; then
+ localedir_c_make='\"$(localedir)\"'
+ fi
+ AC_SUBST([localedir_c_make])
])
## Makefile for the gettext-runtime/src subdirectory of GNU gettext
-## Copyright (C) 1995-1998, 2000-2007, 2009, 2019 Free Software Foundation, Inc.
+## Copyright (C) 1995-1998, 2000-2007, 2009, 2019, 2023 Free Software Foundation, Inc.
##
## This program is free software: you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by
-I.. \
-I../intl -I$(srcdir)/../intl \
-I../gnulib-lib -I$(srcdir)/../gnulib-lib
-DEFS = -DLOCALEDIR=\"$(localedir)\" @DEFS@
+DEFS = -DLOCALEDIR=$(localedir_c_make) @DEFS@
# Source dependencies.
gettext_SOURCES = gettext.c escapes.h
@code{AM_PO_SUBDIRS}, thus preparing the @file{po/} directories of the
package for building.
-@code{AM_GNU_GETTEXT} accepts up to three optional arguments. The general
+@code{AM_GNU_GETTEXT} accepts up to two optional arguments. The general
syntax is
@example
the library search path).
@item
-Except for glibc, the operating system's native @code{gettext} cannot
-exploit the GNU mo files, doesn't have the necessary locale dependency
-features, and cannot convert messages from the catalog's text encoding
-to the user's locale encoding.
+Except for glibc and the Solaris 11 libc, the operating system's native
+@code{gettext} cannot exploit the GNU mo files, doesn't have the
+necessary locale dependency features, and cannot convert messages from
+the catalog's text encoding to the user's locale encoding.
@item
GNU @code{libintl}, if installed, is not necessarily already in the
and @code{LTLIBINTL} variables.
@end itemize
+Additionally, the @code{AM_GNU_GETTEXT} macro sets two variables, for
+convenience. Both are derived from the @code{--localedir} configure
+option. They are correct even on native Windows, where directories
+frequently contain backslashes.
+@table @code
+@item localedir_c
+This is the value of @code{localedir}, in C syntax. This variable is
+meant to be substituted into C or C++ code through
+@code{AC_CONFIG_FILES}.
+
+@item localedir_c_make
+This is the value of @code{localedir}, in C syntax, escaped for use in
+a @code{Makefile}. This variable is meant to be used in Makefiles,
+for example for defining a C macro named @code{LOCALEDIR}:
+@smallexample
+AM_CPPFLAGS = ... -DLOCALEDIR=$(localedir_c_make) ...
+@end smallexample
+@end table
+
@node AM_GNU_GETTEXT_VERSION
@subsection AM_GNU_GETTEXT_VERSION in @file{gettext.m4}
## Makefile for the gettext-tools/src subdirectory of GNU gettext
-## Copyright (C) 1995-1998, 2000-2021 Free Software Foundation, Inc.
+## Copyright (C) 1995-1998, 2000-2023 Free Software Foundation, Inc.
##
## This program is free software: you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by
-I../gnulib-lib -I$(top_srcdir)/gnulib-lib \
-I../../gettext-runtime/intl -I$(top_srcdir)/../gettext-runtime/intl
DEFS = \
- -DLOCALEDIR=\"$(localedir)\" -DBISON_LOCALEDIR=\"$(BISON_LOCALEDIR)\" \
+ -DLOCALEDIR=$(localedir_c_make) -DBISON_LOCALEDIR=\"$(BISON_LOCALEDIR)\" \
-DLOCALE_ALIAS_PATH=\"$(aliaspath)\" \
-DUSEJAVA=$(USEJAVA) \
-DGETTEXTJAR=\"$(jardir)/gettext.jar\" \
## Makefile for the gettext-tools/tests subdirectory of GNU gettext
-## Copyright (C) 1995-1997, 2001-2010, 2012-2016, 2018-2022 Free Software Foundation, Inc.
+## Copyright (C) 1995-1997, 2001-2010, 2012-2016, 2018-2023 Free Software Foundation, Inc.
##
## This program is free software: you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by
-I.. \
-I../gnulib-lib -I$(top_srcdir)/gnulib-lib \
-I../../gettext-runtime/intl
-DEFS = -DLOCALEDIR=\"$(localedir)\" @DEFS@
+DEFS = -DLOCALEDIR=$(localedir_c_make) @DEFS@
# INTL_MACOSX_LIBS is needed because the programs depend on libintl.la
# but libtool doesn't put -Wl,-framework options into .la files.
LDADD = $(LDADD_@USE_INCLUDED_LIBINTL@) @INTL_MACOSX_LIBS@