From ac35cb0ab134026b40e95c8be5156a18b70fa9f2 Mon Sep 17 00:00:00 2001 From: Mark Cave-Ayland Date: Sun, 5 Jul 2009 21:41:27 +0000 Subject: [PATCH] =?utf8?q?Alter=20loader=20Makefile=20to=20include=20PGXS?= =?utf8?q?=20so=20that=20we=20can=20extract=20DESTDIR=20to=20use=20for=20t?= =?utf8?q?he=20location=20for=20shp2pgsql/pgsql2shp.=20Per=20report=20from?= =?utf8?q?=20Devrim=20G=C3=9CND=C3=9CZ.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit git-svn-id: http://svn.osgeo.org/postgis/trunk@4258 b70326c6-7e19-0410-871a-916f4a2858ee --- loader/Makefile.in | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/loader/Makefile.in b/loader/Makefile.in index 56eb003ba..6f600a8ce 100644 --- a/loader/Makefile.in +++ b/loader/Makefile.in @@ -23,9 +23,6 @@ SHP2PGSQL-CLI=shp2pgsql-cli@EXESUFFIX@ PGSQL_FE_CPPFLAGS=@PGSQL_FE_CPPFLAGS@ PGSQL_FE_LDFLAGS=@PGSQL_FE_LDFLAGS@ -# PostgreSQL executable directory -PGSQL_BINDIR=@PGSQL_BINDIR@ - # iconv flags ICONV_LDFLAGS=@ICONV_LDFLAGS@ @@ -36,6 +33,18 @@ LIBLWGEOM=../liblwgeom/liblwgeom.a GTK_CFLAGS = @GTK_CFLAGS@ GTK_LIBS = @GTK_LIBS@ +# PGXS information +# +# Note that PGXS currently doesn't handle building FE executables, but we need +# the INSTALL and DESTDIR variables so we can get the correct install paths. +# Hence we include the PGXS Makefile here, but ensure that we override the +# 'all' and 'install' targets with the ones we really want to use below. +PG_CONFIG = @PGCONFIG@ +PGXS := @PGXS@ +include $(PGXS) + + +# The real parts of the Makefile all: $(SHP2PGSQL) $(PGSQL2SHP) @GTK_BUILD@ gui: $(SHP2PGSQL-GUI) $(SHP2PGSQL-CLI) @@ -67,12 +76,13 @@ $(SHP2PGSQL-CLI): stringbuffer.o shpopen.o dbfopen.o shp2pgsql-core.o shp2pgsql- $(CC) $(CFLAGS) $(ICONV_LDFLAGS) -lm $^ -o $@ install: all - @cp $(PGSQL2SHP) $(PGSQL_BINDIR)/$(PGSQL2SHP) - @cp $(SHP2PGSQL) $(PGSQL_BINDIR)/$(SHP2PGSQL) + @mkdir -p $(DESTDIR)$(bindir) + $(INSTALL) $(PGSQL2SHP) $(DESTDIR)$(bindir) + $(INSTALL) $(SHP2PGSQL) $(DESTDIR)$(bindir) uninstall: - @rm -f $(PGSQL_BINDIR)/$(PGSQL2SHP) - @rm -f $(PGSQL_BINDIR)/$(SHP2PGSQL) + @rm -f $(DESTDIR)$(bindir)/$(PGSQL2SHP) + @rm -f $(DESTDIR)$(bindir)/$(SHP2PGSQL) clean: @rm -f *.o $(SHP2PGSQL) $(PGSQL2SHP) -- 2.50.0