Changeset 9639


Ignore:
Timestamp:
Apr 12, 2012, 7:09:22 AM (12 years ago)
Author:
strk
Message:

Use an SQLPP command for pre-processing SQL files (#1694)

The SQLPP command is figured at ./configure time.
It will use cpp(1) or gpp(1) if any is found in that order or
fallback to whatever CPP expands to (usually the compiler with -E)

Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/configure.ac

    r9569 r9639  
    2828AC_PATH_PROG([ANT], [ant], [])
    2929AC_SUBST([ANT])
     30
     31dnl
     32dnl SQL Preprocessor
     33dnl
     34AC_PATH_PROG([CPPBIN], [cpp], [])
     35if test "x$CPPBIN" != "x"; then
     36  SQLPP="${CPPBIN} -traditional-cpp -P"
     37else
     38  AC_PATH_PROG([GPP], [gpp_], [])
     39  if test "x$GPP" != "x"; then
     40    SQLPP="${GPP} -C -s \'" dnl Use better string support
     41  else
     42    SQLPP="${CPP} -traditional-cpp"
     43  fi
     44fi
     45AC_SUBST([SQLPP])
    3046
    3147dnl
     
    11051121AC_MSG_RESULT([  C compiler:           ${CC} ${CFLAGS}])
    11061122AC_MSG_RESULT([  C++ compiler:         ${CXX} ${CXXFLAGS}])
     1123AC_MSG_RESULT([  SQL preprocessor:     ${SQLPP}])
    11071124AC_MSG_RESULT()
    11081125AC_MSG_RESULT([ -------------- Dependencies -------------- ])
  • trunk/postgis/Makefile.in

    r9523 r9639  
    1919DATA=../spatial_ref_sys.sql
    2020
    21 # SQL objects (files requiring C pre-processing)
     21# SQL preprocessor
     22SQLPP = @SQLPP@
     23
     24# SQL objects (files requiring pre-processing)
    2225SQL_OBJS=postgis.sql.in legacy.sql.in legacy_minimal.sql.in
    2326
     
    129132        $(PERL) ../utils/postgis_proc_upgrade.pl $< 2.0 > $@
    130133
    131 # Generate any .sql.in files from .sql.in.c files by running them through the C pre-processor
     134# Generate any .sql.in files from .sql.in.c files by running them through the SQL pre-processor
    132135$(SQL_OBJS): %.in: %.in.c
    133         $(CPP) -traditional-cpp -I../libpgcommon $< | grep -v '^#' > $@
     136        $(SQLPP) -I../libpgcommon $< | grep -v '^#' > $@
    134137
    135138# SQL objects are also dependent on postgis_config.h for PostgreSQL version
  • trunk/raster/rt_pg/Makefile.in

    r9523 r9639  
    1818DATA=
    1919
    20 # SQL objects (files requiring C pre-processing)
     20# SQL preprocessor
     21SQLPP = @SQLPP@
     22
     23# SQL objects (files requiring pre-processing)
    2124SQL_OBJS=rtpostgis.sql.in rtpostgis_drop.sql.in rtpostgis_upgrade_cleanup.sql.in rtpostgis_legacy.sql.in
    2225
     
    8891$(OBJS): ../../liblwgeom/.libs/liblwgeom.a ../../libpgcommon/libpgcommon.a ../../postgis_config.h ../../postgis_svn_revision.h
    8992
    90 # Generate any .sql.in files from .sql.in.c files by running them through the C pre-processor
     93# Generate any .sql.in files from .sql.in.c files by running them through the SQL pre-processor
    9194$(SQL_OBJS): %.in: %.in.c
    92         $(CPP) -I../../postgis/ -I../../ -traditional-cpp $< | grep -v '^#' > $@
     95        $(SQLPP) -I../../postgis/ -I../../ $< | grep -v '^#' > $@
    9396
    9497# SQL objects deps here
  • trunk/topology/Makefile.in

    r9523 r9639  
    2727DATA_built=topology.sql topology_upgrade_20_minor.sql uninstall_topology.sql
    2828
    29 # SQL objects (files requiring C pre-processing)
     29# SQL preprocessor
     30SQLPP = @SQLPP@
     31
     32# SQL objects (files requiring pre-processing)
    3033SQL_OBJS = \
    3134  topology.sql \
     
    7477        sed 's,MODULE_PATHNAME,$$libdir/$*,g' $< >$@
    7578
    76 # Generate any .sql.in files from .sql.in.c files by running them through the C pre-processor
     79# Generate any .sql.in files from .sql.in.c files by running them through the SQL pre-processor
    7780%.in: %.in.c
    78         $(CPP) -traditional-cpp $< | grep -v '^#' > $@
     81        $(SQLPP) $< | grep -v '^#' > $@
    7982       
    8083#Generate upgrade script by stripping things that can't be reinstalled
Note: See TracChangeset for help on using the changeset viewer.