Bruno Haible [Thu, 4 Jan 2018 09:52:13 +0000 (10:52 +0100)]
Use locales with the customary names.
On glibc systems, nowadays, the German and French locales are named
'de_DE.UTF-8' and 'fr_FR.UTF-8', respectively. This change avoids the need
to install similar locales with different names.
* gettext-tools/tests/gettext-3: Use locales with '.UTF-8' suffix.
* gettext-tools/tests/gettext-3-prg.c (lang): Likewise.
Bruno Haible [Wed, 3 Jan 2018 01:32:55 +0000 (02:32 +0100)]
Fix "make dist" of modified git checkouts.
This fixes error messages such as
tar: gettext-0.19.8.1.74-72e49-dirty/gettext-tools/gnulib-tests/test-term-ostream-xterm-linux-mandriva.out: file name is too long (max 99); not dumped
tar: gettext-0.19.8.1.74-72e49-dirty/gettext-runtime/intl-csharp/doc/GNU_Gettext_GettextResourceManager.html: file name is too long (max 99); not dumped
* configure.ac: Pass option 'tar-ustar' to AM_INIT_AUTOMAKE.
(am__tar): Use 'tar' option --format=ustar.
Bruno Haible [Tue, 2 Jan 2018 18:38:43 +0000 (19:38 +0100)]
Fix 'ar' invocation when cross-compiling and in 64-bit mode on AIX.
Reported by Benedikt Morbach <bmorbach@redhat.com>
at <https://savannah.gnu.org/bugs/?43037>.
* gettext-runtime/m4/intl.m4 (AM_INTL_SUBDIR): Require gl_PROG_AR_RANLIB if
available. Otherwise, use AC_PROG_RANLIB and set AR and ARFLAGS.
* gettext-runtime/intl/Makefile.in (AR): Use the value determined through
autoconf.
(ARFLAGS): New variable.
(libintl.a, libgnuintl.a): Use it.
* gettext-runtime/configure.ac: Invoke gl_PROG_AR_RANLIB.
* gettext-runtime/libasprintf/configure.ac: Likewise.
* gettext-tools/configure.ac: Likewise.
Bruno Haible [Sun, 24 Sep 2017 12:25:53 +0000 (14:25 +0200)]
Verify that system dependent strings in .mo files are NUL terminated.
Reported by Jakub Wilk <jwilk@jwilk.net> in
<https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=876498>.
* gettext-runtime/intl/loadmsgcat.c (_nl_load_domain): Bail out if some of the
system-dependent strings has a last static segment that is not NUL terminated.
* gettext-tools/src/read-mo.c (get_sysdep_string): Likewise.
Bruno Haible [Sat, 15 Jul 2017 10:35:57 +0000 (12:35 +0200)]
Fix bug: gettextize does not add intlmacosx.m4 file.
Reported by Eli Zaretskii via Gavin Smith in
<http://lists.gnu.org/archive/html/bug-texinfo/2017-07/msg00026.html>.
* gettext-tools/misc/gettextize.in (m4filelist): Include intlmacosx.m4 also
when --intl option is not given.
* gettext-tools/doc/gettext.texi (aclocal): Add intlmacosx.m4 to file list.
Bruno Haible [Thu, 15 Jun 2017 20:51:11 +0000 (22:51 +0200)]
gettext.h: Update theoretical condition for use of variable size arrays.
Reported by Paul Eggert.
* gnulib-local/lib/gettext.h (_LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS): Extend
comment to include the theoretical condition for availability of variable size
arrays, if we could trust the value of __STDC_VERSION__.
Bruno Haible [Thu, 18 May 2017 23:15:33 +0000 (01:15 +0200)]
Update gettext-runtime files from gnulib.
* Makefile.am (distcheck-hook): Check also flexmember.m4, flexmember.h.
* gettext-runtime/intl/Makefile.in (SOURCES): Add flexmember.h.
* gettext-runtime/intl/flexmember.h: New file, from gnulib.
* gettext-runtime/intl/localcharset.c:
* localcharset.c (relocate2): Define fallback.
(get_charset_aliases): Invoke relocate2 instead of relocate. Free the
allocated memory.
* localcharset.c (WINDOWS_NATIVE): Don't define on Cygwin.
* localcharset.c (locale_charset) [WINDOWS_NATIVE]: Don't use the
return value from setlocale if it would lead to a buffer overrun.
* gettext-runtime/intl/localename.c:
* localename.c [__CYGWIN__]: Include <langinfo.h>, since this is
where NL_LOCALE_NAME is defined.
* localename.c (WINDOWS_NATIVE): Don't define on Cygwin.
* localename.c (gl_locale_name_thread_unsafe): Add clause for
Cygwin.
* localename.c (struct hash_node): Use FLEXIBLE_ARRAY_MEMBER.
* gettext-runtime/intl/lock.c:
* lock.c: On glibc systems without
PTHREAD_RWLOCK_WRITER_NONRECURSIVE_INITIALIZER_NP, use the fallback
implementation of rwlocks.
* lock.c [USE_POSIX_THREADS]
(glthread_rwlock_init_for_glibc): New function.
[USE_POSIX_THREADS] (glthread_rwlock_rdlock_multithreaded): Update
comment.
[USE_PTH_THREADS]: New implementation of rwlocks.
[USE_WINDOWS_THREADS] (glthread_rwlock_rdlock_func): Prefer writers over
readers.
* gettext-runtime/intl/lock.h:
* lock.h (pthread_rwlockattr_setkind_np): Don't declare
weak on non-glibc platforms.
* lock.h: On glibc systems without
PTHREAD_RWLOCK_WRITER_NONRECURSIVE_INITIALIZER_NP, use the fallback
implementation of rwlocks.
* lock.h [USE_POSIX_THREADS_WEAK]: Declare also
pthread_rwlockattr_init, pthread_rwlockattr_setkind_np,
pthread_rwlockattr_destroy weak.
* lock.h [USE_POSIX_THREADS]: Test
HAVE_PTHREAD_RWLOCK_RDLOCK_PREFER_WRITER. Use a different implementation
of rwlock initialization on glibc systems without
HAVE_PTHREAD_RWLOCK_RDLOCK_PREFER_WRITER. Use a different implementation
of rwlocks altogether on non-glibc systems without
HAVE_PTHREAD_RWLOCK_RDLOCK_PREFER_WRITER.
[USE_PTH_THREADS]: Use a different implementation of rwlocks altogether.
* gettext-runtime/intl/relocatable.c:
* relocatable.c (relocate2): New function.
* relocatable.c (relocate): Assume pathname is non-NULL. Use
ISSLASH macro consistently. Avoid dangerous string concatenation idiom.
* gettext-runtime/intl/relocatable.h:
* relocatable.h (relocate2): New declaration/macro.
* gettext-runtime/intl/vasnprintf.c, gettext-runtime/libasprintf/vasnprintf.c:
* vasnprintf.c (FALLTHROUGH): New macro.
Use it whenever one switch case falls through into the next.
* vasnprintf.c (USE_MSVC__SNPRINTF): New macro.
Everywhere, use !HAVE_SNPRINTF_RETVAL_C99 || USE_MSVC__SNPRINTF instead
of !HAVE_SNPRINTF_RETVAL_C99.
* vasnprintf.c (VASNPRINTF): Move comment down past two cpp
directives, so that it takes effect once again. This is clearly
not a proper change, and I will revert it once this bug is fixed:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77817
* vasnprintf.c (IF_LINT): Treat GCC_LINT like lint.
* gettext-runtime/intl/verify.h:
* verify.h (verify) [!__GNUC__]:
Use shorter albeit meaningless string to bypass silly compiler limits.
* verify.h (assume): Treat GCC_LINT like lint.
* gettext-runtime/intl/xsize.h: Update.
* gettext-runtime/m4/Makefile.am (EXTRA_DIST): Add flexmember.m4.
* gettext-runtime/m4/extern-inline.m4: Update.
* gettext-runtime/m4/fcntl-o.m4: Update.
* gettext-runtime/m4/flexmember.m4: New file, from gnulib.
* gettext-runtime/m4/glibc2.m4: Update.
* gettext-runtime/m4/glibc21.m4: Update.
* gettext-runtime/m4/intdiv0.m4: Update.
* gettext-runtime/m4/intl.m4 (AM_INTL_SUBDIR): Require AC_C_FLEXIBLE_ARRAY_MEMBER.
* gettext-runtime/m4/intmax.m4: Update.
* gettext-runtime/m4/inttypes-pri.m4: Update.
* gettext-runtime/m4/inttypes_h.m4: Update.
* gettext-runtime/m4/lock.m4 (gl_LOCK): Invoke gl_PTHREAD_RWLOCK_RDLOCK_PREFER_WRITER.
* gettext-runtime/m4/longlong.m4: Update.
* gettext-runtime/m4/printf-posix.m4: Update.
* gettext-runtime/m4/progtest.m4: Update.
* gettext-runtime/m4/size_max.m4: Update.
* gettext-runtime/m4/stdint_h.m4: Update.
* gettext-runtime/m4/threadlib.m4 (gl_THREADLIB_BODY): Don't set
PTHREAD_IN_USE_DETECTION_HARD if configuring on Solaris 10 or newer.
Reported by Peter Felecan at <https://savannah.gnu.org/bugs/?32087>.
* gettext-runtime/m4/uintmax_t.m4: Update.
* gettext-runtime/m4/visibility.m4: Update.
* gettext-runtime/m4/wchar_t.m4: Update.
* gettext-runtime/m4/xsize.m4: Update.
* gettext-runtime/tests/test-lock.c:
* test-lock.c: On Mac OS X, use named semaphores, not unnamed
semaphores.
(USE_NAMED_SEMAPHORE, USE_UNNAMED_SEMAPHORE): New macros.
(atomic_int_semaphore): New macro.
* test-lock.c (USE_SEMAPHORE): Don't set if <semaphore.h> does not
exist.
* test-lock.c (USE_SEMAPHORE): New constant.
(struct atomic_int, init_atomic_int, get_atomic_int_value,
set_atomic_int_value) [USE_SEMAPHORE]: Define using a POSIX semaphore.
Suggested by Torvald Riegel <triegel@redhat.com>.
Bruno Haible [Mon, 15 May 2017 22:27:57 +0000 (00:27 +0200)]
Update after gnulib changed.
* gnulib-local/lib/getopt-core.h.diff: New file.
* gnulib-local/lib/getopt.in.h.diff: Remove file.
* gnulib-local/lib/unistd.in.h.diff: Update.
* gnulib-local/modules/fnmatch.diff: Update.
* gnulib-local/Makefile.am (EXTRA_DIST): Add lib/getopt-core.h.diff. Remove
lib/getopt.in.h.diff.
* gettext-runtime/m4/wint_t.m4: Update from gnulib.
* autogen.sh: In the gnulib-tool invocations, avoid gnulib test modules that
depend on 'hash' (because we use a different 'hash' module).
* .gitignore: Update.
Bruno Haible [Mon, 15 May 2017 16:22:29 +0000 (18:22 +0200)]
Respect the configure option --localedir.
Reported by Markus Gothe at https://savannah.gnu.org/bugs/index.php?49862 .
The AC_SUBSTed variable @localedir@ is supported since Autoconf 2.60.
* gettext-runtime/intl/Makefile.in (localedir): Set to @localedir@. Suggested
by Markus Gothe <nietzsche@lysator.liu.se>.
* gettext-runtime/m4/intldir.m4: Require Autoconf 2.60 or newer.
* gettext-tools/doc/gettext.texi (src/Makefile): Assume Autoconf 2.60 or newer.
Bruno Haible [Fri, 21 Apr 2017 23:40:18 +0000 (01:40 +0200)]
Avoid -Wundef warning in gettext.h.
* gnulib-local/lib/gettext.h: Test the value of ENABLE_NLS only if it is defined.
Reported by Tim Rühsen <tim.ruehsen@gmx.de> in
<https://lists.gnu.org/archive/html/bug-gnulib/2017-04/msg00022.html>.
Bruno Haible [Wed, 19 Apr 2017 10:01:45 +0000 (12:01 +0200)]
PO mode: Fix recognition of C and C++ modes.
The variable 'mode-name' can contain a suffix, see
https://www.gnu.org/software/emacs/manual/html_node/ccmode/Minor-Modes.html
https://www.gnu.org/software/emacs/manual/html_node/emacs/Electric-C.html
Therefore use 'major-mode' instead of 'mode-name'.
* gettext-tools/misc/po-mode.el (po-preset-string-functions): Test major-mode,
not mode-name.
(po-mode-version-string): Bump to 2.25.
Reported at <https://savannah.gnu.org/bugs/index.php?50830>
by Peter Hull <peterhull90@gmail.com>.
Bruno Haible [Mon, 2 Jan 2017 00:00:00 +0000 (01:00 +0100)]
lock test: Fix performance problem on multi-core machines.
* gettext-runtime/tests/test-lock.c (USE_VOLATILE): New macro.
(struct atomic_int): New type.
(init_atomic_int, get_atomic_int_value, set_atomic_int_value): New
functions.
(lock_checker_done, rwlock_checker_done, reclock_checker_done): Define
as 'struct atomic_int'.
(lock_checker_thread, test_lock, rwlock_checker_thread, test_rwlock,
reclock_checker_thread, test_recursive_lock): Use the new functions.
Reported by Eric Blake in
https://www.redhat.com/archives/libvir-list/2012-March/msg00854.html
and by Pádraig Brady in
http://lists.gnu.org/archive/html/bug-gnulib/2016-12/msg00117.html.
John Darrington [Thu, 15 Dec 2016 20:56:44 +0000 (21:56 +0100)]
msgfmt: Remove POT-Creation-Date field from the header in the output.
This helps reproducible builds.
Reported at <https://savannah.gnu.org/bugs/?49654>.
* gettext-tools/src/msgl-header.h (message_list_delete_header_field): New
declaration.
* gettext-tools/src/msgl-header.c (known_fields): New variable, extracted from
msgdomain_list_set_header_field.
(message_list_delete_header_field): New function.
* gettext-tools/src/write-mo.c: Include msgl-header.h.
(msgdomain_write_mo): Delete the POT-Creation-Date field.
* gettext-tools/src/write-java.c: Include msgl-header.h.
(msgdomain_write_java): Delete the POT-Creation-Date field.
* gettext-tools/src/write-csharp.c: Include msgl-header.h.
(msgdomain_write_csharp): Delete the POT-Creation-Date field.
* gettext-tools/src/write-resources.c: Include msgl-header.h.
(msgdomain_write_csharp_resources): Delete the POT-Creation-Date field.
* gettext-tools/src/write-tcl.c: Include msgl-header.h.
(msgdomain_write_tcl): Delete the POT-Creation-Date field.
* gettext-tools/src/write-qt.c: Include msgl-header.h.
(msgdomain_write_qt): Delete the POT-Creation-Date field.
* gettext-tools/src/write-desktop.c: Include msgl-header.h.
(msgdomain_write_desktop): Delete the POT-Creation-Date field.
* gettext-tools/src/write-xml.c: Include msgl-header.h.
(msgdomain_write_xml): Delete the POT-Creation-Date field.
* gettext-tools/tests/msgfmt-19: New file, based on
gettext-tools/tests/msgfmt-18.
* gettext-tools/tests/Makefile.am (TESTS): Add it.
KO Myung-Hun [Thu, 1 Dec 2016 09:19:56 +0000 (18:19 +0900)]
intl: Fix that /@unixroot prefix is not working on OS/2 kLIBC
OS/2 kLIBC has a feature to rewrite some path components. For example,
'/@unixroot' is replaced with a value of $UNIXROOT if it is.
So prepending a drive letter to the path starting with '/' makes the
path starting with '/@unixroot' to 'x:/@unixroot' which is unexpected.
This will breaks the behavior of some programs depending on /@unixroot
prefix.
* gettext-runtime/intl/bindtextdom.c (BINDTEXTDOMAIN): Do not touch
dirname if it is started with '/@unixroot'.
* gettext-runtime/intl/relocatable.c (relocate): Do not touch pathname
if it is started with '/@unixroot'.
When xgettext was given two *.po files with the same msgid_plural, it
crashed with double-free. Problem reported by Davlet Panech in:
http://lists.gnu.org/archive/html/bug-gettext/2016-09/msg00001.html
* gettext-tools/src/po-gram-gen.y: Don't free msgid_pluralform after
calling do_callback_message, assuming that it takes ownership.
* gettext-tools/src/read-catalog.c (default_add_message): Free
msgid_plural after calling message_alloc.
* gettext-tools/tests/xgettext-po-2: New file.
* gettext-tools/tests/Makefile.am (TESTS): Add new test.
Daiki Ueno [Tue, 9 Aug 2016 07:32:00 +0000 (09:32 +0200)]
gettextize: Don't add config.rpath to EXTRA_DIST
The file is automatically included in the distribution by Automake,
because of an AC_REQUIRE_AUX_FILE invocation. Reported in:
http://savannah.gnu.org/bugs/?48729
* gettext-tools/misc/gettextize.in: Don't add config.rpath to
added_extradist.
Daiki Ueno [Wed, 3 Aug 2016 12:10:13 +0000 (14:10 +0200)]
po-mode: Fix po-send-mail behaviour on Emacs 25
* gettext-tools/misc/po-mode.el (po-send-mail): Don't rely on
region markers.
Reported by Göran Uddeborg in:
http://lists.gnu.org/archive/html/bug-gettext/2016-07/msg00027.html
msgmerge --previous is a very useful feature that makes adjusting of
translation much easier when small changes in the source code are done.
msgmerge supports it for 10 years, but it is not used by most projects,
as Makefile.in.in never added support for it.
Use msgmerge --previous as default on all systems with gettext >= 0.16.
Daiki Ueno [Tue, 31 May 2016 07:05:24 +0000 (16:05 +0900)]
tests: Turn sentence test into a shell script
For consistency with other tests. Also it fixes a test failure when
built with --disable-shared, since LOG_COMPILER set to $(SHELL) doesn't
recognize binary executable.
* gettext-tools/tests/Makefile.am (TESTS): Rename 'sentence' to
'sentence-1'.
(check_PROGRAMS): Rename 'sentence' to 'sentence-1-prg'.
(sentence_1_prg_SOURCES): Rename from 'sentence_SOURCES'.
(sentence_1_prg_CPPFLAGS): Rename from 'sentence_CPPFLAGS'.
(sentence_1_prg_LDADD): Rename from 'sentence_LDADD'.
* gettext-tools/tests/sentence-1: New file.
* gettext-tools/tests/sentence-1-prg.c: Rename from sentence.c, move the
test data to sentence-1.
* gettext-tools/tests/.gitignore: Ignore sentence-1-prg.
Daniel Burr [Sat, 28 May 2016 00:30:00 +0000 (09:30 +0900)]
build: Make libxml2 check tighter
* gnulib-local/m4/libxml.m4 (gl_LIBXML): Try to check
xmlXPathSetContextNode, which is available in libxml2 2.9.1 or later.
Problem reported by Dominyk in:
http://savannah.gnu.org/bugs/?46844