@@ -11,14 +11,34 @@ dnl ***********************************************************************/
1111
1212AC_INIT ( )
1313AC_CONFIG_MACRO_DIR ( [ macros] )
14- AC_CONFIG_HEADERS ( [ lib/pc_config.h] )
14+ AC_CONFIG_HEADERS ( [ lib/pc_config.h pgsql/sqldefines.h ] )
1515AC_LANG ( [ C++] )
1616
1717dnl
1818dnl Compilers
1919dnl
2020AC_PROG_CC
2121
22+ dnl
23+ dnl SQL Preprocessor
24+ dnl
25+ AC_PATH_PROG ( [ CPPBIN] , [ cpp] , [ ] )
26+ if test "x$CPPBIN" != "x"; then
27+ SQLPP="${CPPBIN} -traditional-cpp -w -P"
28+ else
29+ AC_PATH_PROG ( [ GPP] , [ gpp_] , [ ] )
30+ if test "x$GPP" != "x"; then
31+ SQLPP="${GPP} -C -s \'" dnl Use better string support
32+ else
33+ if test "x${CPP}" != "x"; then
34+ SQLPP="${CPP} -traditional-cpp"
35+ else
36+ AC_MSG_ERROR ( [ Required "cpp" command not found] )
37+ fi
38+ fi
39+ fi
40+ AC_SUBST ( [ SQLPP] )
41+
2242dnl
2343dnl Define executable suffix to use for utility programs
2444dnl
@@ -182,9 +202,9 @@ AC_SUBST([PGXS])
182202dnl Extract the version information from pg_config
183203dnl Note: we extract the major & minor separately, ensure they are numeric, and then combine to give
184204dnl the final version. This is to guard against user error...
185- PGSQL_MAJOR_VERSION=`$PG_CONFIG --version | sed 's/[ [ A-Za-z ] ] *//' | cut -d. -f1 | sed 's/[ [ ^0-9] ] //g'`
186- PGSQL_MINOR_VERSION=`$PG_CONFIG --version | sed 's/[ [ A-Za-z ] ] *//' | cut -d. -f2 | sed 's/[ [ ^0-9] ] //g'`
187205PGSQL_FULL_VERSION=`$PG_CONFIG --version`
206+ PGSQL_MAJOR_VERSION=`echo $PGSQL_FULL_VERSION | sed 's/[ [ ^0-9] ] *\([ [ 0-9] ] *\).*/\1/'`
207+ PGSQL_MINOR_VERSION=`echo $PGSQL_FULL_VERSION | sed 's/[ [ ^0-9] ] *\([ [ 0-9] ] *\)\.\([ [ 0-9] ] *\).*/\2/'`
188208PGSQL_VERSION="$PGSQL_MAJOR_VERSION$PGSQL_MINOR_VERSION"
189209
190210PGSQL_PKGLIBDIR=`$PG_CONFIG --pkglibdir`
@@ -338,6 +358,7 @@ dnl ===========================================================================
338358
339359AC_OUTPUT ([
340360 config.mk
361+ pgsql/Makefile
341362] )
342363
343364dnl ===========================================================================
@@ -349,10 +370,11 @@ AC_MSG_RESULT([ PointCloud is now configured for ${host}])
349370AC_MSG_RESULT ( )
350371AC_MSG_RESULT ( [ -------------- Compiler Info ------------- ] )
351372AC_MSG_RESULT ( [ C compiler: ${CC} ${CFLAGS}] )
373+ AC_MSG_RESULT ( [ SQL preprocessor: ${SQLPP}] )
352374AC_MSG_RESULT ( )
353375AC_MSG_RESULT ( [ -------------- Dependencies -------------- ] )
354376AC_MSG_RESULT ( [ PostgreSQL config: ${PG_CONFIG}] )
355- AC_MSG_RESULT ( [ PostgreSQL version: ${PGSQL_FULL_VERSION}] )
377+ AC_MSG_RESULT ( [ PostgreSQL version: ${PGSQL_FULL_VERSION} (${PGSQL_VERSION}) ] )
356378AC_MSG_RESULT ( [ Libxml2 config: ${XML2CONFIG}] )
357379AC_MSG_RESULT ( [ Libxml2 version: ${LIBXML2_VERSION}] )
358380AC_MSG_RESULT ( [ LazPerf status: ${LAZPERF_STATUS}] )
0 commit comments