]> granicus.if.org Git - postgis/commitdiff
Switch NLS build to use the in-built ENABLE_NLS define rather than USE_NLS.
authorMark Cave-Ayland <mark.cave-ayland@siriusit.co.uk>
Sat, 14 Jan 2012 00:49:14 +0000 (00:49 +0000)
committerMark Cave-Ayland <mark.cave-ayland@siriusit.co.uk>
Sat, 14 Jan 2012 00:49:14 +0000 (00:49 +0000)
The key concept here is that we eliminate all logic from the Makefile and put
it in the build system (e.g. configure). By having the logic at this higher
layer, we make it much easier to transition to another build system in future
such as CMake.

git-svn-id: http://svn.osgeo.org/postgis/trunk@8808 b70326c6-7e19-0410-871a-916f4a2858ee

configure.ac
loader/Makefile.in
loader/pgsql2shp-core.h
loader/shp2pgsql-cli.c
loader/shp2pgsql-core.c
loader/shp2pgsql-core.h
loader/shp2pgsql-gui.c
loader/shpcommon.h
postgis_config.h.in

index faa69dceb583eadfb799b828c35820dccec07272..75002d3beec80e7b67eec7ad22e769db34bbe382 100644 (file)
@@ -376,6 +376,10 @@ PGSQL_MANDIR=`$PGCONFIG --mandir`
 AC_SUBST([PGSQL_DOCDIR])
 AC_SUBST([PGSQL_MANDIR])
 
+dnl Extract the locale directory
+PGSQL_LOCALEDIR=`$PGCONFIG --localedir`
+AC_DEFINE_UNQUOTED([PGSQL_LOCALEDIR], ["$PGSQL_LOCALEDIR"], [Location of PostgreSQL locale directory])
+
 dnl Extract the executable directory
 PGSQL_BINDIR=`$PGCONFIG --bindir`
 
index acd4a2bf33adbc6d47131c967c2a4cad9515dfe8..f658cb2594cddd5cd0493ac18fef219a88ab1f14 100644 (file)
@@ -53,13 +53,7 @@ GTK_WIN32_RES = @GTK_WIN32_RES@
 # GetText includes and libraries
 GETTEXT_CFLAGS = @GETTEXT_CFLAGS@
 GETTEXT_LDFLAGS = @GETTEXT_LDFLAGS@ @LIBINTL@
-nls_build = @USE_NLS@
-ifdef nls_build
-       localedir = $(shell $(PG_CONFIG) --localedir)
-       CFLAGS += -DUSE_NLS
-       CFLAGS += -DLOCALEDIR=\"$(localedir)\"
-       LANGUAGES = fr
-endif
+LANGUAGES = fr
 
 # Built out CFLAGS with ICONV and GETTEXT
 CFLAGS += $(GETTEXT_CFLAGS) $(ICONV_CFLAGS)
index 2119364fca2198e21db90892c763182a4829567d..8f5dfe7579ae16f1fc7b97b58f4bae0eec8ca20e 100644 (file)
  *
  **********************************************************************/
 
-/* For internationalization */
-#ifdef USE_NLS
-#include <libintl.h>
-#include <locale.h>
-#define _(String) gettext(String)
-#define PACKAGE "shp2pgsql"
-#else
-#define _(String) String
-#endif
-
 #include <stdio.h>
 #include <string.h>
 #include <stdlib.h>
index b81f29a4c187a7d47d88fb9e51707416d499a8f5..f65b13dbbf965dd0e0eb35593f87a8450a63189c 100644 (file)
@@ -13,6 +13,8 @@
  *
  **********************************************************************/
 
+#include "../postgis_config.h"
+
 #include "shp2pgsql-core.h"
 #include "../liblwgeom/liblwgeom.h" /* for SRID_UNKNOWN */
 
@@ -68,9 +70,9 @@ main (int argc, char **argv)
        int c;
        int ret, i;
 
-#ifdef USE_NLS
+#ifdef ENABLE_NLS
        setlocale (LC_ALL, "");
-       bindtextdomain (PACKAGE, LOCALEDIR);
+       bindtextdomain (PACKAGE, PGSQL_LOCALEDIR);
        textdomain (PACKAGE);
 #endif
 
index 26b5e0063b315d9c9c6a9e21e5826d82d366e6cd..31704c5581baed4f9ee1362119f4f5908b159e05 100644 (file)
@@ -13,6 +13,8 @@
  *
  **********************************************************************/
 
+#include "../postgis_config.h"
+
 #include "shp2pgsql-core.h"
 #include "../liblwgeom/liblwgeom.h" /* for lw_vasprintf */
 #include "../liblwgeom/lwgeom_log.h" /* for LWDEBUG macros */
index b516299122c30c9df0cf183726881d4e1b813aff..6efc072e4e59fc0a0e6462122f6962df6700677b 100644 (file)
  *
  **********************************************************************/
 
-/* For internationalization */
-#ifdef USE_NLS
-#include <libintl.h>
-#include <locale.h>
-#define _(String) gettext(String)
-#define PACKAGE "shp2pgsql"
-#else
-#define _(String) String
-#endif
-
 /* Standard headers */
 #include <stdio.h>
 #include <string.h>
@@ -39,7 +29,6 @@
 
 
 #include "../liblwgeom/stringbuffer.h"
-#include "../postgis_config.h"
 
 #define RCSID "$Id$"
 
index 9d7cd30d8a03932718376ec80c0d303cc2560d8e..abe49409bf94151633acb3326ba3d1aaf97077cc 100644 (file)
@@ -14,6 +14,8 @@
  *
  **********************************************************************/
 
+#include "../postgis_config.h"
+
 #include <stdarg.h>
 #include <stdio.h>
 #include <stdlib.h>
@@ -2276,10 +2278,10 @@ main(int argc, char *argv[])
 {
        int c;
 
-#ifdef USE_NLS
-    setlocale (LC_ALL, "");
-    bindtextdomain (PACKAGE, LOCALEDIR);
-    textdomain (PACKAGE);
+#ifdef ENABLE_NLS
+       setlocale (LC_ALL, "");
+       bindtextdomain (PACKAGE, PGSQL_LOCALEDIR);
+       textdomain (PACKAGE);
 #endif
 
        /* Parse command line options and set configuration */
index f5b34f9defe8c348f779c4a93fe942af504af791..16a023904c4f06f48c368556e33e03f167d27d8d 100644 (file)
 #ifndef SHPCOMMON_H
 #define SHPCOMMON_H
 
+/* For internationalization */
+#ifdef ENABLE_NLS
+#include <libintl.h>
+#include <locale.h>
+#define _(String) gettext(String)
+#define PACKAGE "shp2pgsql"
+#else
+#define _(String) String
+#endif
+
 typedef struct shp_connection_state
 {
        /* PgSQL username to log in with */
index 48a0e720ecfb74dcf64e9f13b72975d7eef8a3c0..f7762214d231f39d541b3e7c2c4e9d583c2d2442 100644 (file)
@@ -95,6 +95,9 @@
    */
 #undef LT_OBJDIR
 
+/* Location of PostgreSQL locale directory */
+#undef PGSQL_LOCALEDIR
+
 /* Enable caching of bounding box within geometries */
 #undef POSTGIS_AUTOCACHE_BBOX