Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add POCO_PGSQL_{INCLUDE,LIB} variables #3360

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions Data/PostgreSQL/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

include $(POCO_BASE)/build/rules/global

ifndef POCO_PGSQL_INCLUDE
ifeq (0, $(shell test -e /usr/include/postgresql; echo $$?))
INCLUDE += -I/usr/include/postgresql
endif
Expand All @@ -21,7 +22,9 @@ 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
Expand All @@ -40,8 +43,16 @@ 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

objects = Extractor Binder SessionImpl Connector \
PostgreSQLStatementImpl PostgreSQLException \
SessionHandle StatementExecutor PostgreSQLTypes Utility
Expand Down
19 changes: 19 additions & 0 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)}'`" ;;

Expand Down Expand Up @@ -333,6 +345,13 @@ fi
if [ -n "$mysqlinclude" ] ; then
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
fi
Expand Down