Discussion:
gt_INTL_MACOSX not defined by gettext.m4
Gavin Smith
2017-07-13 20:36:22 UTC
Permalink
gettext.m4 from gnulib uses a macro gt_INTL_MACOSX, but running
gnulib-tool --add-import doesn't cause this macro to be defined in the
produced configure script.

There is a definition in intlmacosx.m4 but this file is not pulled in.
I have a backup of this file intlmacosx.m4~ which was probably created
by gnulib-tool when I updated the gnulib files. My guess is that the
dependencies for the gettext module have changed so it is not pulling
in the definition of this macro.

Originally reported here:
http://lists.gnu.org/archive/html/bug-texinfo/2017-07/msg00026.html
Bruno Haible
2017-07-13 21:56:24 UTC
Permalink
Hi Gavin,
Post by Gavin Smith
gettext.m4 from gnulib uses a macro gt_INTL_MACOSX, but running
gnulib-tool --add-import doesn't cause this macro to be defined in the
produced configure script.
This is hard to believe, because

1) The only gnulib module which contains gettext.m4 is the 'gettext' module:

$ ./gnulib-tool --find m4/gettext.m4
gettext

2) The 'gettext' module also contains the intlmacosx.m4 file that defines
gt_INTL_MACOSX:

$ ./gnulib-tool --extract-filelist gettext
m4/codeset.m4
m4/fcntl-o.m4
m4/gettext.m4
m4/glibc2.m4
m4/glibc21.m4
m4/iconv.m4
m4/intdiv0.m4
m4/intl.m4
m4/intldir.m4
m4/intlmacosx.m4
m4/intmax.m4
m4/inttypes_h.m4
m4/inttypes-pri.m4
m4/lcmessage.m4
m4/lock.m4
m4/longlong.m4
m4/nls.m4
m4/po.m4
m4/printf-posix.m4
m4/progtest.m4
m4/size_max.m4
m4/stdint_h.m4
m4/threadlib.m4
m4/uintmax_t.m4
m4/visibility.m4
m4/wchar_t.m4
m4/wint_t.m4
m4/xsize.m4
build-aux/config.rpath

m4/00gnulib.m4
m4/gnulib-common.m4
m4/onceonly.m4
Post by Gavin Smith
There is a definition in intlmacosx.m4 but this file is not pulled in.
I have a backup of this file intlmacosx.m4~ which was probably created
by gnulib-tool when I updated the gnulib files.
Could you please investigate
1) What was the gnulib-tool invocation?
2) What other operations were performed after gnulib-tool?
3) Can you send a copy of the generated gnulib-cache.m4 and gnulib-comp.m4
files?
Post by Gavin Smith
My guess is that the
dependencies for the gettext module have changed so it is not pulling
in the definition of this macro.
The dependencies and file list of the 'gettext' module have not changed in
7 years.

Bruno
Bruno Haible
2017-07-13 22:05:06 UTC
Permalink
Post by Bruno Haible
2) What other operations were performed after gnulib-tool?
Some other possible causes of trouble include:

* Committing some of the files brought in by gnulib-tool into a
version control system and some others not. My recommendation here
is to not commit any file brought in by gnulib-tool / automake / autoconf
into version control.

* Creating a tarball using automake's "make dist" target, then unpacking
the tarball and running "autoconf" in the tarball again. This procedure
fails if relevant files have not been marked for distribution; unfortunately
automake's "make dist" target is based on a file list that must be manually
maintained. My recommendation here is to use two specific directories (e.g.
'gnulib-m4' and 'gnulib-lib') for the .m4 and .[hc] files brought in by
gnulib-tool, and tell automake to include the entire 'gnulib-m4' directory
in the distribution tarball.

Bruno
Bruno Haible
2017-07-13 22:57:43 UTC
Permalink
Post by Gavin Smith
http://lists.gnu.org/archive/html/bug-texinfo/2017-07/msg00026.html
Looking at the gnulib-cache.m4 and gnulib-comp.m4 from said package:
* gettext.m4 does NOT come from gnulib.
* You are using gnulib module 'gettext-h', not 'gettext'. (Which is perfectly
OK, since the 'gettext' module is now marked obsolete.)

Then further in the ChangeLog:

2017-05-17 gettextize <bug-gnu-***@gnu.org>

* gnulib/m4/gettext.m4: New file, from gettext-0.19.8.
* gnulib/m4/iconv.m4: Upgrade to gettext-0.19.8.
* gnulib/m4/lib-ld.m4: Upgrade to gettext-0.19.8.
* gnulib/m4/lib-link.m4: Upgrade to gettext-0.19.8.
* gnulib/m4/lib-prefix.m4: Upgrade to gettext-0.19.8.
* gnulib/m4/nls.m4: New file, from gettext-0.19.8.
* gnulib/m4/po.m4: New file, from gettext-0.19.8.
* gnulib/m4/progtest.m4: New file, from gettext-0.19.8.

2017-05-17 Gavin Smith <***@gmail.com>

* gnulib: run gnulib-tool to import 'gettext-h' module instead
of 'gettext' module, as the 'gettext' module is deprecated in
Gnulib. run gettexize again to put the files back.

Here's the problem: gettextize, when it installs gettext.m4, also ought
to install intlmacosx.m4 and other files (23 files, not just 8 files).

I guess the problem is that when you ran gettextize, you still had some
*.m4 files from earlier gnulib-tool invocations present in gnulib/m4/,
therefore gettextize did not update them. But later on, "gnulib-tool --update"
removed these files, because the 'gettext' module was not present any more.

The fix should be to use 2 directories for *.m4 files:
ACLOCAL_AMFLAGS = -I otherm4 -I gnulib/m4
then run gettextize again. It should put its *.m4 files into otherm4/ and ignore
gnulib/m4/. Then you should get all 23 files, including intlmacosx.m4.
Post by Gavin Smith
gettext.m4 from gnulib uses a macro gt_INTL_MACOSX
But you are not using gettext.m4 from gnulib!

Bruno
Gavin Smith
2017-07-15 09:03:28 UTC
Permalink
Post by Bruno Haible
Post by Gavin Smith
http://lists.gnu.org/archive/html/bug-texinfo/2017-07/msg00026.html
* gettext.m4 does NOT come from gnulib.
* You are using gnulib module 'gettext-h', not 'gettext'. (Which is perfectly
OK, since the 'gettext' module is now marked obsolete.)
I see. Thanks a lot for working this out. I had forgotten I had removed the
gettext module from gnulib.

I ran gettextize again, but it didn't install the extra files:

$ gettextize -f --po-dir=po --po-dir=po_document
Copying file ABOUT-NLS
Copying file build-aux/config.rpath
Not copying intl/ directory.
Copying file po/Makefile.in.in
Copying file po/Makevars.template
Copying file po/Rules-quot
Copying file po/boldquot.sed
Copying file po/***@boldquot.header
Copying file po/***@quot.header
Copying file po/insert-header.sin
Copying file po/quot.sed
Copying file po/remove-potcdate.sin
Copying file po_document/Makefile.in.in
Copying file po_document/Makevars.template
Copying file po_document/Rules-quot
Copying file po_document/boldquot.sed
Copying file po_document/***@boldquot.header
Copying file po_document/***@quot.header
Copying file po_document/insert-header.sin
Copying file po_document/quot.sed
Copying file po_document/remove-potcdate.sin
Copying file otherm4/gettext.m4
Copying file otherm4/iconv.m4
Copying file otherm4/lib-ld.m4
Copying file otherm4/lib-link.m4
Copying file otherm4/lib-prefix.m4
Copying file otherm4/nls.m4
Copying file otherm4/po.m4
Copying file otherm4/progtest.m4
Adding an entry to ChangeLog (backup is in ChangeLog~)

Please run 'aclocal -I otherm4 -I gnulib/m4' to regenerate the aclocal.m4 file.
You need aclocal from GNU automake 1.9 (or newer) to do this.
Then run 'autoconf' to regenerate the configure file.

You might also want to copy the convenience header file gettext.h
from the /usr/local/share/gettext directory into your package.
It is a wrapper around <libintl.h> that implements the configure --disable-nls
option.

Press Return to acknowledge the previous two paragraphs.

$

I understand this is not a gnulib problem. I will continue to research
gettextize and why it is not adding the files it needs.
Bruno Haible
2017-07-15 10:43:02 UTC
Permalink
Post by Gavin Smith
$ gettextize -f --po-dir=po --po-dir=po_document
Copying file ABOUT-NLS
Copying file build-aux/config.rpath
Not copying intl/ directory.
Copying file po/Makefile.in.in
Copying file po/Makevars.template
Copying file po/Rules-quot
Copying file po/boldquot.sed
Copying file po/insert-header.sin
Copying file po/quot.sed
Copying file po/remove-potcdate.sin
Copying file po_document/Makefile.in.in
Copying file po_document/Makevars.template
Copying file po_document/Rules-quot
Copying file po_document/boldquot.sed
Copying file po_document/insert-header.sin
Copying file po_document/quot.sed
Copying file po_document/remove-potcdate.sin
Copying file otherm4/gettext.m4
Copying file otherm4/iconv.m4
Copying file otherm4/lib-ld.m4
Copying file otherm4/lib-link.m4
Copying file otherm4/lib-prefix.m4
Copying file otherm4/nls.m4
Copying file otherm4/po.m4
Copying file otherm4/progtest.m4
Adding an entry to ChangeLog (backup is in ChangeLog~)
Ouch. This bug in 'gettextize' has been present since 2009 !!

Now fixed through http://git.savannah.gnu.org/gitweb/?p=gettext.git;a=commit;h=22005c5fd27c1a590bd3c7ee66bee2971f1b6860

Probably you were the first one to see this because most other users of
gettext are still using the obsolete 'gettext' module of gnulib.

Bruno
Bruno Haible
2017-07-15 10:47:05 UTC
Permalink
As a workaround, until the next gettext release, I would suggest that
- you continue to use gettextize
- but additionally you run the command
gnulib-tool --copy-file m4/intlmacosx.m4 gnulib/m4/intlmacosx.m4

Bruno

Loading...