#3360: Add POCO_PGSQL_{INCLUDE,LIB} variables

This commit is contained in:
Günter Obiltschnig 2021-11-05 14:14:12 +01:00
parent e2f7e72a9e
commit 931143df85
4 changed files with 90 additions and 75 deletions

View File

@ -6,41 +6,7 @@
include $(POCO_BASE)/build/rules/global
ifeq (0, $(shell test -e /usr/include/postgresql; echo $$?))
INCLUDE += -I/usr/include/postgresql
endif
ifeq (0, $(shell test -e /usr/local/include/postgresql; echo $$?))
INCLUDE += -I/usr/local/include/postgresql
endif
ifeq (0, $(shell test -e /usr/local/postgresql/include; echo $$?))
INCLUDE += -I/usr/local/postgresql/include
endif
ifeq (0, $(shell test -e /opt/postgresql/include; echo $$?))
INCLUDE += -I/opt/postgresql/include
endif
ifeq (0, $(shell test -e /usr/local/opt/libpq/include; echo $$?))
INCLUDE += -I/usr/local/opt/libpq/include
endif
ifeq (0, $(shell test -e /usr/lib$(LIB64SUFFIX)/postgresql; echo $$?))
SYSLIBS += -L/usr/lib$(LIB64SUFFIX)/postgresql
endif
ifeq (0, $(shell test -e /usr/local/lib$(LIB64SUFFIX)/postgresql; echo $$?))
SYSLIBS += -L/usr/local/lib$(LIB64SUFFIX)/postgresql
endif
ifeq (0, $(shell test -e /usr/local/postgresql/lib$(LIB64SUFFIX); echo $$?))
SYSLIBS += -L/usr/local/postgresql/lib$(LIB64SUFFIX)
endif
ifeq (0, $(shell test -e /opt/postgresql/lib$(LIB64SUFFIX); echo $$?))
SYSLIBS += -L/opt/postgresql/lib$(LIB64SUFFIX)
endif
ifeq (0, $(shell test -e /opt/postgresql/lib$(LIB64SUFFIX); echo $$?))
SYSLIBS += -L/opt/postgresql/lib$(LIB64SUFFIX)
endif
ifeq (0, $(shell test -e /usr/local/opt/libpq/lib; echo $$?))
SYSLIBS += -L/usr/local/opt/libpq/lib$(LIB64SUFFIX)
endif
SYSLIBS += -lpq
include PostgreSQL.make
objects = Extractor Binder SessionImpl Connector \
PostgreSQLStatementImpl PostgreSQLException \

View File

@ -0,0 +1,52 @@
#
# PostgreSQL.make
#
# Makefile fragment for finding PostgreSQL library
#
ifndef POCO_PGSQL_INCLUDE
ifeq (0, $(shell test -e /usr/include/postgresql; echo $$?))
INCLUDE += -I/usr/include/postgresql
endif
ifeq (0, $(shell test -e /usr/local/include/postgresql; echo $$?))
INCLUDE += -I/usr/local/include/postgresql
endif
ifeq (0, $(shell test -e /usr/local/postgresql/include; echo $$?))
INCLUDE += -I/usr/local/postgresql/include
endif
ifeq (0, $(shell test -e /opt/postgresql/include; echo $$?))
INCLUDE += -I/opt/postgresql/include
endif
ifeq (0, $(shell test -e /usr/local/opt/libpq/include; echo $$?))
INCLUDE += -I/usr/local/opt/libpq/include
endif
endif
ifndef POCO_PGSQL_LIB
ifeq (0, $(shell test -e /usr/lib$(LIB64SUFFIX)/postgresql; echo $$?))
SYSLIBS += -L/usr/lib$(LIB64SUFFIX)/postgresql
endif
ifeq (0, $(shell test -e /usr/local/lib$(LIB64SUFFIX)/postgresql; echo $$?))
SYSLIBS += -L/usr/local/lib$(LIB64SUFFIX)/postgresql
endif
ifeq (0, $(shell test -e /usr/local/postgresql/lib$(LIB64SUFFIX); echo $$?))
SYSLIBS += -L/usr/local/postgresql/lib$(LIB64SUFFIX)
endif
ifeq (0, $(shell test -e /opt/postgresql/lib$(LIB64SUFFIX); echo $$?))
SYSLIBS += -L/opt/postgresql/lib$(LIB64SUFFIX)
endif
ifeq (0, $(shell test -e /opt/postgresql/lib$(LIB64SUFFIX); echo $$?))
SYSLIBS += -L/opt/postgresql/lib$(LIB64SUFFIX)
endif
ifeq (0, $(shell test -e /usr/local/opt/libpq/lib; echo $$?))
SYSLIBS += -L/usr/local/opt/libpq/lib$(LIB64SUFFIX)
endif
endif
SYSLIBS += -lpq
ifdef POCO_PGSQL_INCLUDE
INCLUDE += -I$(POCO_PGSQL_INCLUDE)
endif
ifdef POCO_PGSQL_LIB
SYSLIBS += -L$(POCO_PGSQL_LIB)
endif

View File

@ -6,40 +6,7 @@
include $(POCO_BASE)/build/rules/global
ifeq (0, $(shell test -e /usr/include/postgresql; echo $$?))
INCLUDE += -I/usr/include/postgresql
endif
ifeq (0, $(shell test -e /usr/local/include/postgresql; echo $$?))
INCLUDE += -I/usr/local/include/postgresql
endif
ifeq (0, $(shell test -e /usr/local/postgresql/include; echo $$?))
INCLUDE += -I/usr/local/postgresql/include
endif
ifeq (0, $(shell test -e /opt/postgresql/include; echo $$?))
INCLUDE += -I/opt/postgresql/include
endif
ifeq (0, $(shell test -e /usr/local/opt/libpq/include; echo $$?))
INCLUDE += -I/usr/local/opt/libpq/include
endif
ifeq (0, $(shell test -e /usr/lib$(LIB64SUFFIX)/postgresql; echo $$?))
SYSLIBS += -L/usr/lib$(LIB64SUFFIX)/postgresql
endif
ifeq (0, $(shell test -e /usr/local/lib$(LIB64SUFFIX)/postgresql; echo $$?))
SYSLIBS += -L/usr/local/lib$(LIB64SUFFIX)/postgresql
endif
ifeq (0, $(shell test -e /usr/local/postgresql/lib$(LIB64SUFFIX); echo $$?))
SYSLIBS += -L/usr/local/postgresql/lib$(LIB64SUFFIX)
endif
ifeq (0, $(shell test -e /opt/postgresql/lib$(LIB64SUFFIX); echo $$?))
SYSLIBS += -L/opt/postgresql/lib$(LIB64SUFFIX)
endif
ifeq (0, $(shell test -e /opt/postgresql/lib$(LIB64SUFFIX); echo $$?))
SYSLIBS += -L/opt/postgresql/lib$(LIB64SUFFIX)
endif
ifeq (0, $(shell test -e /usr/local/opt/libpq/lib; echo $$?))
SYSLIBS += -L/usr/local/opt/libpq/lib$(LIB64SUFFIX)
endif
include $(POCO_BASE)/Data/PostgreSQL/PostgreSQL.make
# Note: linking order is important, do not change it.
SYSLIBS += -lpq -lz -lpthread -ldl

42
configure vendored
View File

@ -108,6 +108,12 @@ Options:
--mysql-include=<path>
Specify the directory where MySQL header files are located.
--pgsql-lib=<path>
Specify the directory where PostgreSQL library is located.
--pgsql-include=<path>
Specify the directory where PostgreSQL header files are located.
--cflags=<flags>
Pass additional flags to compiler.
Example: --cflags=-wall
@ -190,6 +196,12 @@ while [ $# -ge 1 ]; do
--mysql-include=*)
mysqlinclude="`echo ${1} | awk '{print substr($0,17)}'`" ;;
--pgsql-lib=*)
pgsqllib="`echo ${1} | awk '{print substr($0,13)}'`" ;;
--pgsql-include=*)
pgsqlinclude="`echo ${1} | awk '{print substr($0,17)}'`" ;;
--cflags=*)
flags="$flags `echo ${1} | awk '{print substr($0,10)}'`" ;;
@ -322,16 +334,22 @@ if [ -n "$librarypath" ] ; then
echo "POCO_ADD_LIBRARY = $librarypath" >>$build/config.make
fi
if [ -n "$odbclib" ] ; then
echo "POCO_ODBC_LIB = $odbclib" >>$build/config.make
echo "POCO_ODBC_LIB = $odbclib" >>$build/config.make
fi
if [ -n "$odbcinclude" ] ; then
echo "POCO_ODBC_INCLUDE = $odbcinclude" >>$build/config.make
echo "POCO_ODBC_INCLUDE = $odbcinclude" >>$build/config.make
fi
if [ -n "$mysqllib" ] ; then
echo "POCO_MYSQL_LIB = $mysqllib" >>$build/config.make
echo "POCO_MYSQL_LIB = $mysqllib" >>$build/config.make
fi
if [ -n "$mysqlinclude" ] ; then
echo "POCO_MYSQL_INCLUDE = $mysqlinclude" >>$build/config.make
echo "POCO_MYSQL_INCLUDE = $mysqlinclude" >>$build/config.make
fi
if [ -n "$pgsqllib" ] ; then
echo "POCO_PGSQL_LIB = $pgsqllib" >>$build/config.make
fi
if [ -n "$pgsqlinclude" ] ; then
echo "POCO_PGSQL_INCLUDE = $pgsqlinclude" >>$build/config.make
fi
if [ -n "$unbundled" ] ; then
echo "POCO_UNBUNDLED = 1" >>$build/config.make
@ -360,10 +378,22 @@ if [ -n "$librarypath" ] ; then
echo "export POCO_ADD_LIBRARY" >>$build/config.make
fi
if [ -n "$odbclib" ] ; then
echo "export POCO_ODBC_LIB" >>$build/config.make
echo "export POCO_ODBC_LIB" >>$build/config.make
fi
if [ -n "$odbcinclude" ] ; then
echo "export POCO_ODBC_INCLUDE" >>$build/config.make
echo "export POCO_ODBC_INCLUDE" >>$build/config.make
fi
if [ -n "$mysqllib" ] ; then
echo "export POCO_MYSQL_LIB" >>$build/config.make
fi
if [ -n "$mysqlinclude" ] ; then
echo "export POCO_MYSQL_INCLUDE" >>$build/config.make
fi
if [ -n "$pgsqllib" ] ; then
echo "export POCO_PGSQL_LIB" >>$build/config.make
fi
if [ -n "$pgsqlinclude" ] ; then
echo "export POCO_PGSQL_INCLUDE" >>$build/config.make
fi
if [ -n "$unbundled" ] ; then
echo "export POCO_UNBUNDLED" >>$build/config.make