Pádraig Brady <p...@draigbrady.com> writes: > I'm not sure that removing the gettext dependencies is OK because > they're used to provide @LIB_INTL@ which was added to support solaris 2.[67] > http://git.sv.gnu.org/gitweb/?p=gnulib.git;a=commitdiff;h=41dca647
Thanks for the pointer, I missed it. > they're used to provide @LIB_INTL@ which was added to support solaris 2.[67] If this is the only use-case, perhaps we could separate out the @LIBINTL@ check from the gettext module (possibly to the gettext-h module) and let the tests depend on it? I'm attaching a patch as a proof of concept.
>From 875d647f9bb0ffc8f8b507083cff737c56f3a9e8 Mon Sep 17 00:00:00 2001 From: Daiki Ueno <u...@gnu.org> Date: Thu, 10 Jul 2014 13:35:57 +0900 Subject: [PATCH] gettext: move libintl check to gettext-h The gettext module copies the entire gettext infrastructure, including po/ directory handling, etc., while some modules only need the @LIBINTL@ definition. This patch moves the libintl-related stuff to the gettext-h module and make it self-contained. * m4/gettext.m4 (AM_GNU_GETTEXT): Separate out libintl check to.. (AM_GNU_GETTEXT_LIBINTL): ..here. * modules/gettext (Files): Move m4/gettext.m4 to.. * modules/gettext-h (Files): ..here. * modules/quotearg-tests (Depends-on): Depend on gettext-h, not gettext. * modules/utimens-tests (Depends-on): Likewise. * modules/futimens-tests (Depends-on): Likewise. * gnulib-tool (func_create_testdir): Look for po.m4, instead of gettext.m4, to check if autopoint invocation is needed. --- ChangeLog | 19 +++++++++++++++ gnulib-tool | 6 ++--- m4/gettext.m4 | 63 +++++++++++++++++++++++++++++--------------------- modules/futimens-tests | 2 +- modules/gettext | 1 - modules/gettext-h | 4 ++-- modules/libintl | 23 ++++++++++++++++++ modules/quotearg-tests | 2 +- modules/utimens-tests | 2 +- 9 files changed, 87 insertions(+), 35 deletions(-) create mode 100644 modules/libintl diff --git a/ChangeLog b/ChangeLog index 66fd9c8..7e773c2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,22 @@ +2014-07-10 Daiki Ueno <u...@gnu.org> + + gettext: move libintl check to gettext-h + The gettext module copies the entire gettext infrastructure, + including po/ directory handling, etc., while some modules only + need the @LIBINTL@ definition. This patch moves the + libintl-related stuff to the gettext-h module and make it + self-contained. + * m4/gettext.m4 (AM_GNU_GETTEXT): Separate out libintl check to.. + (AM_GNU_GETTEXT_LIBINTL): ..here. + * modules/gettext (Files): Move m4/gettext.m4 to.. + * modules/gettext-h (Files): ..here. + * modules/quotearg-tests (Depends-on): Depend on gettext-h, not + gettext. + * modules/utimens-tests (Depends-on): Likewise. + * modules/futimens-tests (Depends-on): Likewise. + * gnulib-tool (func_create_testdir): Look for po.m4, instead of + gettext.m4, to check if autopoint invocation is needed. + 2014-07-09 Pavel Hrdina <phrd...@redhat.com> (tiny change) nl_langinfo: fix build under mingw diff --git a/gnulib-tool b/gnulib-tool index 7353920..da39cdc 100755 --- a/gnulib-tool +++ b/gnulib-tool @@ -5770,7 +5770,7 @@ func_create_testdir () subdirs="$sourcebase $m4base" subdirs_with_configure_ac="" - if false && test -f "$testdir"/$m4base/gettext.m4; then + if false && test -f "$testdir"/$m4base/po.m4; then # Avoid stupid error message from automake: # "AM_GNU_GETTEXT used but `po' not in SUBDIRS" mkdir -p "$testdir/po" @@ -6033,7 +6033,7 @@ func_create_testdir () (cd "$testdir" # Do not use "${AUTORECONF} --force --install", because it may invoke # autopoint, which brings in older versions of some of our .m4 files. - if test -f $m4base/gettext.m4; then + if test -f $m4base/po.m4; then func_execute_command ${AUTOPOINT} --force || func_exit 1 for f in $m4base/*.m4~; do if test -f $f; then @@ -6057,7 +6057,7 @@ func_create_testdir () (cd "$testdir/$testsbase" || func_exit 1 # Do not use "${AUTORECONF} --force --install", because it may invoke # autopoint, which brings in older versions of some of our .m4 files. - if test -f ../$m4base/gettext.m4; then + if test -f ../$m4base/po.m4; then func_execute_command ${AUTOPOINT} --force || func_exit 1 for f in ../$m4base/*.m4~; do if test -f $f; then diff --git a/m4/gettext.m4 b/m4/gettext.m4 index be247bf..f06edca 100644 --- a/m4/gettext.m4 +++ b/m4/gettext.m4 @@ -1,4 +1,4 @@ -# gettext.m4 serial 66 (gettext-0.18.2) +# gettext.m4 serial 67 (gettext-0.18.2) dnl Copyright (C) 1995-2014 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -56,6 +56,42 @@ dnl maintainers. dnl AC_DEFUN([AM_GNU_GETTEXT], [ + dnl Check for libintl. + AM_GNU_GETTEXT_LIBINTL([$1], [$2]) + + dnl Check for the po/ directory. + AC_REQUIRE([AM_PO_SUBDIRS]) + POSUB= + if test "$USE_NLS" = "yes"; then + dnl We need to process the po/ directory. + POSUB=po + fi + AC_SUBST([POSUB]) +]) + + +dnl gt_NEEDS_INIT ensures that the gt_needs variable is initialized. +m4_define([gt_NEEDS_INIT], +[ + m4_divert_text([DEFAULTS], [gt_needs=]) + m4_define([gt_NEEDS_INIT], []) +]) + + +dnl Usage: AM_GNU_GETTEXT_NEED([NEEDSYMBOL]) +AC_DEFUN([AM_GNU_GETTEXT_NEED], +[ + m4_divert_text([INIT_PREPARE], [gt_needs="$gt_needs $1"]) +]) + + +dnl Usage: AM_GNU_GETTEXT_VERSION([gettext-version]) +AC_DEFUN([AM_GNU_GETTEXT_VERSION], []) + +dnl Usage: AM_GNU_GETTEXT_LIBINTL([INTLSYMBOL], [NEEDSYMBOL], [INTLDIR]) +dnl This takes the same arguments as AM_GNU_GETTEXT defined above. +AC_DEFUN([AM_GNU_GETTEXT_LIBINTL], +[ dnl Argument checking. ifelse([$1], [], , [ifelse([$1], [external], , [ifelse([$1], [no-libtool], , [ifelse([$1], [use-libtool], , [errprint([ERROR: invalid first argument to AM_GNU_GETTEXT @@ -73,7 +109,6 @@ AC_DEFUN([AM_GNU_GETTEXT], 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 ]) @@ -109,7 +144,6 @@ AC_DEFUN([AM_GNU_GETTEXT], ]) LIBINTL= LTLIBINTL= - POSUB= dnl Add a version number to the cache macros. case " $gt_needs " in @@ -326,9 +360,6 @@ return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_expand_a AC_DEFINE([HAVE_DCGETTEXT], [1], [Define if the GNU dcgettext() function is already present or preinstalled.]) fi - - dnl We need to process the po/ directory. - POSUB=po fi ifelse(gt_included_intl, yes, [ @@ -378,24 +409,4 @@ return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_expand_a dnl Make all documented variables known to autoconf. AC_SUBST([LIBINTL]) AC_SUBST([LTLIBINTL]) - AC_SUBST([POSUB]) -]) - - -dnl gt_NEEDS_INIT ensures that the gt_needs variable is initialized. -m4_define([gt_NEEDS_INIT], -[ - m4_divert_text([DEFAULTS], [gt_needs=]) - m4_define([gt_NEEDS_INIT], []) ]) - - -dnl Usage: AM_GNU_GETTEXT_NEED([NEEDSYMBOL]) -AC_DEFUN([AM_GNU_GETTEXT_NEED], -[ - m4_divert_text([INIT_PREPARE], [gt_needs="$gt_needs $1"]) -]) - - -dnl Usage: AM_GNU_GETTEXT_VERSION([gettext-version]) -AC_DEFUN([AM_GNU_GETTEXT_VERSION], []) diff --git a/modules/futimens-tests b/modules/futimens-tests index a1948eb..c7e9db2 100644 --- a/modules/futimens-tests +++ b/modules/futimens-tests @@ -7,7 +7,7 @@ tests/signature.h tests/macros.h Depends-on: -gettext +gettext-h fcntl-h ignore-value nanosleep diff --git a/modules/gettext b/modules/gettext index a9ceed7..244be80 100644 --- a/modules/gettext +++ b/modules/gettext @@ -7,7 +7,6 @@ You must add an invocation of AM_GNU_GETTEXT([external]) to configure.ac. Files: m4/codeset.m4 m4/fcntl-o.m4 -m4/gettext.m4 m4/glibc2.m4 m4/glibc21.m4 m4/iconv.m4 diff --git a/modules/gettext-h b/modules/gettext-h index 2d6c2cd..e656e56 100644 --- a/modules/gettext-h +++ b/modules/gettext-h @@ -3,12 +3,12 @@ Translate messages to user's native language if the gettext module is also used. Files: lib/gettext.h +m4/gettext.m4 Depends-on: configure.ac: -AC_SUBST([LIBINTL]) -AC_SUBST([LTLIBINTL]) +AM_GNU_GETTEXT_LIBINTL([external]) Makefile.am: lib_SOURCES += gettext.h diff --git a/modules/libintl b/modules/libintl new file mode 100644 index 0000000..876e608 --- /dev/null +++ b/modules/libintl @@ -0,0 +1,23 @@ +Description: +Translate messages to user's native language if the gettext module is also used. + +Files: +m4/libintl.m4 + +Depends-on: + +configure.ac: +AM_LIBINTL + +Makefile.am: + +Include: + +Link: +$(LTLIBINTL) when linking with libtool, $(LIBINTL) otherwise + +License: +LGPLv2+ + +Maintainer: +all diff --git a/modules/quotearg-tests b/modules/quotearg-tests index 1af4eff..5e062a7 100644 --- a/modules/quotearg-tests +++ b/modules/quotearg-tests @@ -12,7 +12,7 @@ m4/locale-fr.m4 m4/codeset.m4 Depends-on: -gettext +gettext-h progname stdint setenv diff --git a/modules/utimens-tests b/modules/utimens-tests index 76dad1b..d5e3085 100644 --- a/modules/utimens-tests +++ b/modules/utimens-tests @@ -9,7 +9,7 @@ tests/macros.h Depends-on: dup -gettext +gettext-h ignore-value nanosleep symlink -- 1.9.3
Regards, -- Daiki Ueno