From: Sandro Santilli Date: Mon, 18 Mar 2013 17:20:18 +0000 (+0000) Subject: Drop the .c suffix of sql files to preprocess X-Git-Tag: 2.1.0beta2~172 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=86a5b32f543bf51ec9eada1b07cb14ed890fa7b2;p=postgis Drop the .c suffix of sql files to preprocess The suffix was added to make compilers happy about preprocessing, but invoking cpp directly should be just fine (SQLPP macro) This is an experimental change under postgis/, if everyone is happy the same thing will be done for raster/ and topology/ git-svn-id: http://svn.osgeo.org/postgis/trunk@11175 b70326c6-7e19-0410-871a-916f4a2858ee --- diff --git a/.gitignore b/.gitignore index e3a9a01aa..efda711d7 100644 --- a/.gitignore +++ b/.gitignore @@ -69,22 +69,11 @@ postgis_config.h postgis/Makefile postgis/legacy_gist.sql postgis/legacy_minimal.sql -postgis/legacy_minimal.sql.in postgis/legacy.sql -postgis/legacy.sql.in postgis/postgis.sql -postgis/postgis.sql.in -postgis/postgis_upgrade_13_to_15.sql -postgis/postgis_upgrade_14_to_15.sql -postgis/postgis_upgrade_15_minor.sql -postgis/postgis_upgrade_20_minor.sql -postgis/postgis_upgrade_20_minor.sql.in -postgis/postgis_upgrade_20_21.sql -postgis/postgis_upgrade_20_21.sql.in -postgis/postgis_upgrade_21_minor.sql +postgis/postgis_upgrade_*.sql* postgis/sqldefines.h postgis/uninstall_legacy.sql -postgis/uninstall_legacy.sql.in postgis/uninstall_postgis.sql raster/loader/Makefile raster/loader/raster2pgsql diff --git a/postgis/Makefile.in b/postgis/Makefile.in index 017350542..8efabc1cb 100644 --- a/postgis/Makefile.in +++ b/postgis/Makefile.in @@ -22,7 +22,7 @@ DATA=../spatial_ref_sys.sql SQLPP = @SQLPP@ # SQL objects (files requiring pre-processing) -SQL_OBJS=postgis.sql.in legacy.sql.in legacy_minimal.sql.in +SQL_OBJS=postgis.sql legacy.sql legacy_minimal.sql # PostgreSQL objects PG_OBJS= \ @@ -133,7 +133,8 @@ $(PG_OBJS): ../liblwgeom/.libs/liblwgeom.a ../libpgcommon/libpgcommon.a ../postg # Borrow the $libdir substitution from PGXS but customise by adding the version number %.sql: %.sql.in - $(PERL) -lpe "s'MODULE_PATHNAME'\$$libdir/postgis-@POSTGIS_MAJOR_VERSION@.@POSTGIS_MINOR_VERSION@'g" $< > $@ + $(SQLPP) -I../libpgcommon $< | grep -v '^#' | \ + $(PERL) -lpe "s'MODULE_PATHNAME'\$$libdir/postgis-@POSTGIS_MAJOR_VERSION@.@POSTGIS_MINOR_VERSION@'g" > $@ postgis_upgrade_20_21.sql.in: postgis_drop_before.sql postgis.sql postgis_drop_after.sql cat $^ > $@ @@ -145,15 +146,14 @@ postgis_upgrade_21_minor.sql: postgis_upgrade_20_21.sql cp $< $@ # Generate any .sql.in files from .sql.in.c files by running them through the SQL pre-processor -$(SQL_OBJS): %.in: %.in.c - $(SQLPP) -I../libpgcommon $< | grep -v '^#' > $@ +#$(SQL_OBJS): %.in: %.in.c +# $(SQLPP) -I../libpgcommon $< | grep -v '^#' > $@ # SQL objects are also dependent on postgis_config.h for PostgreSQL version $(SQL_OBJS): ../postgis_config.h ../postgis_svn_revision.h -postgis.sql.in: sqldefines.h long_xact.sql.in.c geography.sql.in.c +#postgis.sql.in: sqldefines.h long_xact.sql.in.c geography.sql.in.c -#uninstall_postgis.sql.in: sqldefines.h uninstall_sqlmm.sql.in.c uninstall_long_xact.sql.in.c uninstall_geography.sql.in.c uninstall_postgis.sql: postgis.sql ../utils/create_undef.pl $(PERL) ../utils/create_undef.pl $< $(POSTGIS_PGSQL_VERSION) > $@ diff --git a/postgis/geography.sql.in.c b/postgis/geography.sql.in similarity index 100% rename from postgis/geography.sql.in.c rename to postgis/geography.sql.in diff --git a/postgis/legacy.sql.in.c b/postgis/legacy.sql.in similarity index 99% rename from postgis/legacy.sql.in.c rename to postgis/legacy.sql.in index f472b469f..c2742c5fb 100644 --- a/postgis/legacy.sql.in.c +++ b/postgis/legacy.sql.in @@ -2,7 +2,7 @@ -- Legacy functions without chip functions -- -- This is the full list including the legacy_minimal.sql (minimal) -- so no need to install both legacy and the minimal -#include "legacy_minimal.sql.in.c" +#include "legacy_minimal.sql.in" --- start functions that in theory should never have been used or internal like stuff deprecated -- these were superceded by PostGIS_AddBBOX , PostGIS_DropBBOX, PostGIS_HasBBOX in 1.5 -- diff --git a/postgis/legacy_minimal.sql.in.c b/postgis/legacy_minimal.sql.in similarity index 100% rename from postgis/legacy_minimal.sql.in.c rename to postgis/legacy_minimal.sql.in diff --git a/postgis/long_xact.sql.in.c b/postgis/long_xact.sql.in similarity index 100% rename from postgis/long_xact.sql.in.c rename to postgis/long_xact.sql.in diff --git a/postgis/postgis.sql.in.c b/postgis/postgis.sql.in similarity index 99% rename from postgis/postgis.sql.in.c rename to postgis/postgis.sql.in index 5b7beb4ac..ad3e5f1ff 100644 --- a/postgis/postgis.sql.in.c +++ b/postgis/postgis.sql.in @@ -4371,8 +4371,9 @@ END; $$ LANGUAGE 'plpgsql' IMMUTABLE STRICT; -#include "long_xact.sql.in.c" -#include "geography.sql.in.c" +/* Should we include the .sql directly here ? */ +#include "long_xact.sql.in" +#include "geography.sql.in" diff --git a/postgis/uninstall_geography.sql.in.c b/postgis/uninstall_geography.sql.in similarity index 100% rename from postgis/uninstall_geography.sql.in.c rename to postgis/uninstall_geography.sql.in diff --git a/postgis/uninstall_legacy.sql.in.c b/postgis/uninstall_legacy.sql.in similarity index 100% rename from postgis/uninstall_legacy.sql.in.c rename to postgis/uninstall_legacy.sql.in diff --git a/postgis/uninstall_long_xact.sql.in.c b/postgis/uninstall_long_xact.sql.in similarity index 100% rename from postgis/uninstall_long_xact.sql.in.c rename to postgis/uninstall_long_xact.sql.in diff --git a/postgis/uninstall_sqlmm.sql.in.c b/postgis/uninstall_sqlmm.sql.in similarity index 100% rename from postgis/uninstall_sqlmm.sql.in.c rename to postgis/uninstall_sqlmm.sql.in