[postgis-devel] GNU gettext required version (actual vs autoconf)

Greg Troxel gdt at ir.bbn.com
Sat Jan 14 07:08:49 PST 2012


postgis depends on GNU gettext, at least for NLS support (this isn't
mentioned in README.postgis).

On my system GNU gettext 0.14 is part of the base operating system, and
0.18 is available in pkgsrc.  (0.14 is old, but base updates are
conservative and there seem to be few things that actually need newer.)

The autoconf test in postgis (from macros/gettext.m4, from gettext 0.17)
checks not only for -lintl, but also that certain private
variables/functions are defined.  Specifically, it looks for
_nl_expand_alias -- and needs to declare it before using it.  This isn't
present in 0.14, and so the configure test fails.  postgis builds and
make checks fine with 0.14 (modulo the Latin1 loader issue, which I'm
99% is about postgresql and encodings).

So, I wonder if people think the following would be reasonable.  It only
changes the test for standalone gettext, as opposed to getttext-in-libc,
and all it does is drop the insistence on _nl_expand_alias.  If so, I'll
file a ticket, but this seems to be a somewhat subtle issue, so I asked
here first.

Index: macros/gettext.m4
===================================================================
--- macros/gettext.m4	(revision 8814)
+++ macros/gettext.m4	(working copy)
@@ -17,6 +17,10 @@
 dnl   Ulrich Drepper <drepper at cygnus.com>, 1995-2000.
 dnl   Bruno Haible <haible at clisp.cons.org>, 2000-2006.
 
+dnl Modified 20120114 to not insist on _nl_expand_alias, so that it
+dnl will find and accept gettext 0.14, because postgis does not
+dnl actually require any 0.17 features.
+
 dnl Macro to add for using GNU gettext.
 
 dnl Usage: AM_GNU_GETTEXT([INTLSYMBOL], [NEEDSYMBOL], [INTLDIR]).
@@ -187,10 +191,9 @@
 extern
 #ifdef __cplusplus
 "C"
-#endif
-const char *_nl_expand_alias (const char *);],
+#endif],
               [bindtextdomain ("", "");
-return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_expand_alias ("")],
+return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr],
               [eval "$gt_func_gnugettext_libintl=yes"],
               [eval "$gt_func_gnugettext_libintl=no"])
             dnl Now see whether libintl exists and depends on libiconv.

Index: README.postgis
===================================================================
--- README.postgis	(revision 8814)
+++ README.postgis	(working copy)
@@ -59,6 +59,11 @@
 
     http://xmlsoft.org/
 
+* GNU gettext
+
+   The loader, and hence postgis, requires GNU gettext 0.14 or higher
+   (typically in libc on GNU/Linux, in which case 0.17 is required).
+
 If you want to compile PostGIS with raster support, you additionally 
 must have installed:
 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 194 bytes
Desc: not available
URL: <http://lists.osgeo.org/pipermail/postgis-devel/attachments/20120114/35a2b262/attachment.sig>


More information about the postgis-devel mailing list