Skip to content

Commit 9044564

Browse files
authored
Merge pull request #227 from elemoine/parallel
Mark functions as PARALLEL SAFE
2 parents 8841e85 + 5202333 commit 9044564

7 files changed

Lines changed: 125 additions & 81 deletions

File tree

config.mk.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
CC = @CC@
22
CFLAGS = @CFLAGS@
33
CXXFLAGS = -fPIC -std=c++0x
4+
SQLPP = @SQLPP@
45

56
XML2_CPPFLAGS = @XML2_CPPFLAGS@
67
XML2_LDFLAGS = @XML2_LDFLAGS@

configure.ac

Lines changed: 26 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,34 @@ dnl ***********************************************************************/
1111

1212
AC_INIT()
1313
AC_CONFIG_MACRO_DIR([macros])
14-
AC_CONFIG_HEADERS([lib/pc_config.h])
14+
AC_CONFIG_HEADERS([lib/pc_config.h pgsql/sqldefines.h])
1515
AC_LANG([C++])
1616

1717
dnl
1818
dnl Compilers
1919
dnl
2020
AC_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+
2242
dnl
2343
dnl Define executable suffix to use for utility programs
2444
dnl
@@ -182,9 +202,9 @@ AC_SUBST([PGXS])
182202
dnl Extract the version information from pg_config
183203
dnl Note: we extract the major & minor separately, ensure they are numeric, and then combine to give
184204
dnl 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'`
187205
PGSQL_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/'`
188208
PGSQL_VERSION="$PGSQL_MAJOR_VERSION$PGSQL_MINOR_VERSION"
189209

190210
PGSQL_PKGLIBDIR=`$PG_CONFIG --pkglibdir`
@@ -338,6 +358,7 @@ dnl ===========================================================================
338358

339359
AC_OUTPUT([
340360
config.mk
361+
pgsql/Makefile
341362
])
342363

343364
dnl ===========================================================================
@@ -349,10 +370,11 @@ AC_MSG_RESULT([ PointCloud is now configured for ${host}])
349370
AC_MSG_RESULT()
350371
AC_MSG_RESULT([ -------------- Compiler Info ------------- ])
351372
AC_MSG_RESULT([ C compiler: ${CC} ${CFLAGS}])
373+
AC_MSG_RESULT([ SQL preprocessor: ${SQLPP}])
352374
AC_MSG_RESULT()
353375
AC_MSG_RESULT([ -------------- Dependencies -------------- ])
354376
AC_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})])
356378
AC_MSG_RESULT([ Libxml2 config: ${XML2CONFIG}])
357379
AC_MSG_RESULT([ Libxml2 version: ${LIBXML2_VERSION}])
358380
AC_MSG_RESULT([ LazPerf status: ${LAZPERF_STATUS}])

pgsql/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,5 @@ regression.diffs
33
results/
44
tmp_check/
55
log/
6+
Makefile
7+
sqldefines.h

pgsql/Makefile renamed to pgsql/Makefile.in

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
include ../config.mk
44

5+
SQLPP = @SQLPP@
6+
57
OBJS = \
68
pc_inout.o \
79
pc_access.o \
@@ -42,11 +44,11 @@ SHLIB_LINK += ../lib/$(LIB_A) ../lib/$(LIB_A_LAZPERF) -lstdc++ $(filter -lm, $(L
4244
include $(PGXS)
4345

4446
$(EXTENSION).control: $(EXTENSION).control.in Makefile
45-
$(SED) -e 's/@POINTCLOUD_VERSION@/$(EXTVERSION)/' \
46-
-e 's/@POINTCLOUD_VERSION_MAJOR@/$(EXTVERSION_MAJOR)/' $< > $@
47+
$(SED) -e 's/#POINTCLOUD_VERSION#/$(EXTVERSION)/' \
48+
-e 's/#POINTCLOUD_VERSION_MAJOR#/$(EXTVERSION_MAJOR)/' $< > $@
4749

4850
$(EXTENSION)--$(EXTVERSION).sql: $(EXTENSION).sql.in Makefile
49-
$(SED) -e 's/@POINTCLOUD_VERSION@/$(EXTVERSION)/' $< > $@
51+
$(SQLPP) -I. $< | $(SED) -e 's/#POINTCLOUD_VERSION#/$(EXTVERSION)/' > $@
5052

5153
# NOTE: relies on PERL being defined by PGXS
5254
$(EXTENSION)--%--$(EXTVERSION).sql: $(EXTENSION)--$(EXTVERSION).sql ../util/proc_upgrade.pl

pgsql/pointcloud.control.in

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# pointcloud extension
22
comment = 'data type for lidar point clouds'
3-
default_version = '@POINTCLOUD_VERSION@'
4-
module_pathname = '$libdir/pointcloud-@POINTCLOUD_VERSION_MAJOR@'
3+
default_version = '#POINTCLOUD_VERSION#'
4+
module_pathname = '$libdir/pointcloud-#POINTCLOUD_VERSION_MAJOR#'
55
relocatable = true
66
superuser = true
77
#requires = 'postgis'

0 commit comments

Comments
 (0)