Skip to content

Commit

Permalink
Mark functions as PARALLEL SAFE
Browse files Browse the repository at this point in the history
  • Loading branch information
Éric Lemoine committed Aug 21, 2018
1 parent 8841e85 commit 5202333
Show file tree
Hide file tree
Showing 7 changed files with 125 additions and 81 deletions.
1 change: 1 addition & 0 deletions config.mk.in
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
CC = @CC@
CFLAGS = @CFLAGS@
CXXFLAGS = -fPIC -std=c++0x
SQLPP = @SQLPP@

XML2_CPPFLAGS = @XML2_CPPFLAGS@
XML2_LDFLAGS = @XML2_LDFLAGS@
Expand Down
30 changes: 26 additions & 4 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,34 @@ dnl ***********************************************************************/

AC_INIT()
AC_CONFIG_MACRO_DIR([macros])
AC_CONFIG_HEADERS([lib/pc_config.h])
AC_CONFIG_HEADERS([lib/pc_config.h pgsql/sqldefines.h])
AC_LANG([C++])

dnl
dnl Compilers
dnl
AC_PROG_CC

dnl
dnl SQL Preprocessor
dnl
AC_PATH_PROG([CPPBIN], [cpp], [])
if test "x$CPPBIN" != "x"; then
SQLPP="${CPPBIN} -traditional-cpp -w -P"
else
AC_PATH_PROG([GPP], [gpp_], [])
if test "x$GPP" != "x"; then
SQLPP="${GPP} -C -s \'" dnl Use better string support
else
if test "x${CPP}" != "x"; then
SQLPP="${CPP} -traditional-cpp"
else
AC_MSG_ERROR([Required "cpp" command not found])
fi
fi
fi
AC_SUBST([SQLPP])

dnl
dnl Define executable suffix to use for utility programs
dnl
Expand Down Expand Up @@ -182,9 +202,9 @@ AC_SUBST([PGXS])
dnl Extract the version information from pg_config
dnl Note: we extract the major & minor separately, ensure they are numeric, and then combine to give
dnl the final version. This is to guard against user error...
PGSQL_MAJOR_VERSION=`$PG_CONFIG --version | sed 's/[[A-Za-z ]]*//' | cut -d. -f1 | sed 's/[[^0-9]]//g'`
PGSQL_MINOR_VERSION=`$PG_CONFIG --version | sed 's/[[A-Za-z ]]*//' | cut -d. -f2 | sed 's/[[^0-9]]//g'`
PGSQL_FULL_VERSION=`$PG_CONFIG --version`
PGSQL_MAJOR_VERSION=`echo $PGSQL_FULL_VERSION | sed 's/[[^0-9]]*\([[0-9]]*\).*/\1/'`
PGSQL_MINOR_VERSION=`echo $PGSQL_FULL_VERSION | sed 's/[[^0-9]]*\([[0-9]]*\)\.\([[0-9]]*\).*/\2/'`
PGSQL_VERSION="$PGSQL_MAJOR_VERSION$PGSQL_MINOR_VERSION"

PGSQL_PKGLIBDIR=`$PG_CONFIG --pkglibdir`
Expand Down Expand Up @@ -338,6 +358,7 @@ dnl ===========================================================================

AC_OUTPUT([
config.mk
pgsql/Makefile
])

dnl ===========================================================================
Expand All @@ -349,10 +370,11 @@ AC_MSG_RESULT([ PointCloud is now configured for ${host}])
AC_MSG_RESULT()
AC_MSG_RESULT([ -------------- Compiler Info ------------- ])
AC_MSG_RESULT([ C compiler: ${CC} ${CFLAGS}])
AC_MSG_RESULT([ SQL preprocessor: ${SQLPP}])
AC_MSG_RESULT()
AC_MSG_RESULT([ -------------- Dependencies -------------- ])
AC_MSG_RESULT([ PostgreSQL config: ${PG_CONFIG}])
AC_MSG_RESULT([ PostgreSQL version: ${PGSQL_FULL_VERSION}])
AC_MSG_RESULT([ PostgreSQL version: ${PGSQL_FULL_VERSION} (${PGSQL_VERSION})])
AC_MSG_RESULT([ Libxml2 config: ${XML2CONFIG}])
AC_MSG_RESULT([ Libxml2 version: ${LIBXML2_VERSION}])
AC_MSG_RESULT([ LazPerf status: ${LAZPERF_STATUS}])
Expand Down
2 changes: 2 additions & 0 deletions pgsql/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@ regression.diffs
results/
tmp_check/
log/
Makefile
sqldefines.h
8 changes: 5 additions & 3 deletions pgsql/Makefile → pgsql/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

include ../config.mk

SQLPP = @SQLPP@

OBJS = \
pc_inout.o \
pc_access.o \
Expand Down Expand Up @@ -42,11 +44,11 @@ SHLIB_LINK += ../lib/$(LIB_A) ../lib/$(LIB_A_LAZPERF) -lstdc++ $(filter -lm, $(L
include $(PGXS)

$(EXTENSION).control: $(EXTENSION).control.in Makefile
$(SED) -e 's/@POINTCLOUD_VERSION@/$(EXTVERSION)/' \
-e 's/@POINTCLOUD_VERSION_MAJOR@/$(EXTVERSION_MAJOR)/' $< > $@
$(SED) -e 's/#POINTCLOUD_VERSION#/$(EXTVERSION)/' \
-e 's/#POINTCLOUD_VERSION_MAJOR#/$(EXTVERSION_MAJOR)/' $< > $@

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

# NOTE: relies on PERL being defined by PGXS
$(EXTENSION)--%--$(EXTVERSION).sql: $(EXTENSION)--$(EXTVERSION).sql ../util/proc_upgrade.pl
Expand Down
4 changes: 2 additions & 2 deletions pgsql/pointcloud.control.in
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# pointcloud extension
comment = 'data type for lidar point clouds'
default_version = '@POINTCLOUD_VERSION@'
module_pathname = '$libdir/pointcloud-@POINTCLOUD_VERSION_MAJOR@'
default_version = '#POINTCLOUD_VERSION#'
module_pathname = '$libdir/pointcloud-#POINTCLOUD_VERSION_MAJOR#'
relocatable = true
superuser = true
#requires = 'postgis'
Loading

0 comments on commit 5202333

Please sign in to comment.