AC_PATH_PROG([ANT], [ant], [])
AC_SUBST([ANT])
+dnl
+dnl SQL Preprocessor
+dnl
+AC_PATH_PROG([CPPBIN], [cpp], [])
+if test "x$CPPBIN" != "x"; then
+ SQLPP="${CPPBIN} -traditional-cpp -P"
+else
+ AC_PATH_PROG([GPP], [gpp_], [])
+ if test "x$GPP" != "x"; then
+ SQLPP="${GPP} -C -s \'" dnl Use better string support
+ else
+ SQLPP="${CPP} -traditional-cpp"
+ fi
+fi
+AC_SUBST([SQLPP])
+
dnl
dnl Define PIC flags in PICFLAGS (note: this variable is set as part of libtool initialisation above)
dnl
AC_MSG_RESULT([ -------------- Compiler Info ------------- ])
AC_MSG_RESULT([ C compiler: ${CC} ${CFLAGS}])
AC_MSG_RESULT([ C++ compiler: ${CXX} ${CXXFLAGS}])
+AC_MSG_RESULT([ SQL preprocessor: ${SQLPP}])
AC_MSG_RESULT()
AC_MSG_RESULT([ -------------- Dependencies -------------- ])
AC_MSG_RESULT([ GEOS config: ${GEOSCONFIG}])
DATA_built=postgis.sql uninstall_postgis.sql postgis_upgrade_20_minor.sql legacy.sql uninstall_legacy.sql legacy_minimal.sql
DATA=../spatial_ref_sys.sql
-# SQL objects (files requiring C pre-processing)
+# SQL preprocessor
+SQLPP = @SQLPP@
+
+# SQL objects (files requiring pre-processing)
SQL_OBJS=postgis.sql.in legacy.sql.in legacy_minimal.sql.in
# PostgreSQL objects
postgis_upgrade_20_minor.sql: postgis_upgrade_20_minor.sql.in ../utils/postgis_proc_upgrade.pl
$(PERL) ../utils/postgis_proc_upgrade.pl $< 2.0 > $@
-# Generate any .sql.in files from .sql.in.c files by running them through the C pre-processor
+# Generate any .sql.in files from .sql.in.c files by running them through the SQL pre-processor
$(SQL_OBJS): %.in: %.in.c
- $(CPP) -traditional-cpp -I../libpgcommon $< | grep -v '^#' > $@
+ $(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
DATA_built=rtpostgis.sql rtpostgis_upgrade_20_minor.sql uninstall_rtpostgis.sql rtpostgis_legacy.sql
DATA=
-# SQL objects (files requiring C pre-processing)
+# SQL preprocessor
+SQLPP = @SQLPP@
+
+# SQL objects (files requiring pre-processing)
SQL_OBJS=rtpostgis.sql.in rtpostgis_drop.sql.in rtpostgis_upgrade_cleanup.sql.in rtpostgis_legacy.sql.in
# Objects to build using PGXS
# Objects dependencies
$(OBJS): ../../liblwgeom/.libs/liblwgeom.a ../../libpgcommon/libpgcommon.a ../../postgis_config.h ../../postgis_svn_revision.h
-# Generate any .sql.in files from .sql.in.c files by running them through the C pre-processor
+# Generate any .sql.in files from .sql.in.c files by running them through the SQL pre-processor
$(SQL_OBJS): %.in: %.in.c
- $(CPP) -I../../postgis/ -I../../ -traditional-cpp $< | grep -v '^#' > $@
+ $(SQLPP) -I../../postgis/ -I../../ $< | grep -v '^#' > $@
# SQL objects deps here
$(SQL_OBJS): ../../postgis/sqldefines.h ../../postgis_svn_revision.h
# Files to be copied to the contrib/ directory
DATA_built=topology.sql topology_upgrade_20_minor.sql uninstall_topology.sql
-# SQL objects (files requiring C pre-processing)
+# SQL preprocessor
+SQLPP = @SQLPP@
+
+# SQL objects (files requiring pre-processing)
SQL_OBJS = \
topology.sql \
topology_upgrade.sql \
%.sql: %.sql.in
sed 's,MODULE_PATHNAME,$$libdir/$*,g' $< >$@
-# Generate any .sql.in files from .sql.in.c files by running them through the C pre-processor
+# Generate any .sql.in files from .sql.in.c files by running them through the SQL pre-processor
%.in: %.in.c
- $(CPP) -traditional-cpp $< | grep -v '^#' > $@
+ $(SQLPP) $< | grep -v '^#' > $@
#Generate upgrade script by stripping things that can't be reinstalled
#e.g. don't bother with tables, types, triggers, and domains