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
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`
# 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)
*
**********************************************************************/
-/* 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>
*
**********************************************************************/
+#include "../postgis_config.h"
+
#include "shp2pgsql-core.h"
#include "../liblwgeom/liblwgeom.h" /* for SRID_UNKNOWN */
int c;
int ret, i;
-#ifdef USE_NLS
+#ifdef ENABLE_NLS
setlocale (LC_ALL, "");
- bindtextdomain (PACKAGE, LOCALEDIR);
+ bindtextdomain (PACKAGE, PGSQL_LOCALEDIR);
textdomain (PACKAGE);
#endif
*
**********************************************************************/
+#include "../postgis_config.h"
+
#include "shp2pgsql-core.h"
#include "../liblwgeom/liblwgeom.h" /* for lw_vasprintf */
#include "../liblwgeom/lwgeom_log.h" /* for LWDEBUG macros */
*
**********************************************************************/
-/* 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>
#include "../liblwgeom/stringbuffer.h"
-#include "../postgis_config.h"
#define RCSID "$Id$"
*
**********************************************************************/
+#include "../postgis_config.h"
+
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
{
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 */
#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 */
*/
#undef LT_OBJDIR
+/* Location of PostgreSQL locale directory */
+#undef PGSQL_LOCALEDIR
+
/* Enable caching of bounding box within geometries */
#undef POSTGIS_AUTOCACHE_BBOX