Internal libpq (PostgreSQL client lib)

This commit is contained in:
Lionel Elie Mamane
2011-12-01 21:59:09 +01:00
parent 74283f6976
commit 44ec239eba
6 changed files with 120 additions and 16 deletions

View File

@@ -5403,7 +5403,7 @@ dnl ===================================================================
if test "x$enable_ext_postgresql_sdbc" = "xyes" -a "x$enable_extension_integration" != "xno"; then
SCPDEFS="$SCPDEFS -DWITH_EXTENSION_POSTGRESQL"
AC_MSG_CHECKING([for PostgreSQL prerequisites])
AC_MSG_CHECKING([PostgreSQL C interface])
if test "$with_system_postgresql" = "yes"; then
AC_MSG_RESULT([external PostgreSQL])
SYSTEM_POSTGRESQL=YES
@@ -5420,27 +5420,33 @@ if test "x$enable_ext_postgresql_sdbc" = "xyes" -a "x$enable_extension_integrati
POSTGRESQL_INC=-I$(${PGCONFIG} --includedir)
POSTGRESQL_LIB="-L$(${PGCONFIG} --libdir)"
else
SYSTEM_POSTGRESQL=NO
if test -n "$with_libpq_path"; then
SYSTEM_POSTGRESQL=YES
AC_MSG_RESULT([external libpq])
POSTGRESQL_LIB="-L${with_libpq_path}/lib/"
POSTGRESQL_INC=-I"${with_libpq_path}/include/"
else
AC_MSG_ERROR([not given. Please specify either --with-system-postgresql or --with-libpq-path])
SYSTEM_POSTGRESQL=NO
AC_MSG_RESULT([internal])
POSTGRESQL_LIB=""
POSTGRESQL_INC="@@OVERRIDE_ME@@"
BUILD_TYPE="$BUILD_TYPE POSTGRESQL"
fi
fi
AC_MSG_CHECKING([for PostgreSQL C interface])
save_CFLAGS=$CFLAGS
save_CPPFLAGS=$CPPFLAGS
save_LIBS=$LIBS
CPPFLAGS="${CPPFLAGS} ${POSTGRESQL_INC}"
LIBS="${LIBS} ${POSTGRESQL_LIB}"
AC_CHECK_HEADER([libpq-fe.h], [], [AC_MSG_ERROR([libpq-fe.h is needed])], [])
AC_CHECK_LIB(pq, PQconnectdbParams, [],
[AC_MSG_ERROR(libpq not found or too old. Need >= 9.0)], [])
CFLAGS=$save_CFLAGS
CPPFLAGS=$save_CPPFLAGS
LIBS=$save_LIBS
if test "${SYSTEM_POSTGRESQL}" = "YES"; then
AC_MSG_NOTICE([checking system PostgreSQL prerequisites])
save_CFLAGS=$CFLAGS
save_CPPFLAGS=$CPPFLAGS
save_LIBS=$LIBS
CPPFLAGS="${CPPFLAGS} ${POSTGRESQL_INC}"
LIBS="${LIBS} ${POSTGRESQL_LIB}"
AC_CHECK_HEADER([libpq-fe.h], [], [AC_MSG_ERROR([libpq-fe.h is needed])], [])
AC_CHECK_LIB(pq, PQconnectdbParams, [],
[AC_MSG_ERROR(libpq not found or too old. Need >= 9.0)], [])
CFLAGS=$save_CFLAGS
CPPFLAGS=$save_CPPFLAGS
LIBS=$save_LIBS
fi
BUILD_POSTGRESQL_SDBC=YES
fi
AC_SUBST(BUILD_POSTGRESQL_SDBC)

View File

@@ -1,4 +1,4 @@
cn connectivity : shell TRANSLATIONS:translations comphelper MOZ:moz svl UNIXODBC:unixODBC unoil javaunohelper HSQLDB:hsqldb qadevOOo officecfg NSS:nss LIBXSLT:libxslt NULL
cn connectivity : shell TRANSLATIONS:translations comphelper MOZ:moz POSTGRESQL:postgresql svl UNIXODBC:unixODBC unoil javaunohelper HSQLDB:hsqldb qadevOOo officecfg NSS:nss LIBXSLT:libxslt NULL
cn connectivity usr1 - all cn_mkout NULL
cn connectivity\inc nmake - all cn_inc NULL
cn connectivity\com\sun\star\sdbcx\comp\hsqldb nmake - all cn_jhsqldbdb cn_hsqldb cn_inc NULL

View File

@@ -101,11 +101,18 @@ SHL1VERSIONMAP=$(SOLARENV)$/src$/reg-component.map
# LEM 17/11/2011: removed everything except libpq proper;
# as per instructions in libpq documentation.
# If it turns out the rest was needed, reenable it.
.IF "$(SYSTEM_POSTGRESQL)"=="YES"
.IF "$(GUI)"=="WNT"
LIBPQ_LINK=libpq.lib #wsock32.lib advapi32.lib
.ELSE
LIBPQ_LINK=-lpq #-lcrypt
.ENDIF
.ELSE #SYSTEM_POSTGRESQL==NO
LIBPQ_LINK=$(OUTDIR_FOR_BUILD)/lib/libpq.a
POSTGRESQL_INC=-I$(OUTDIR_FOR_BUILD)/inc/postgresql
POSTGRESQL_LIB=
.ENDIF
SHL2TARGET=postgresql-sdbc-impl.uno
LIB2TARGET=$(SLB)$/$(SHL2TARGET).lib
LIB2OBJFILES= \

81
postgresql/makefile.mk Normal file
View File

@@ -0,0 +1,81 @@
#*************************************************************************
#
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# Copyright 2008 by Sun Microsystems, Inc.
#
# OpenOffice.org - a multi-platform office productivity suite
#
# This file is part of OpenOffice.org.
#
# OpenOffice.org is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License version 3
# only, as published by the Free Software Foundation.
#
# OpenOffice.org is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License version 3 for more details
# (a copy is included in the LICENSE file that accompanied this code).
#
# You should have received a copy of the GNU Lesser General Public License
# version 3 along with OpenOffice.org. If not, see
# <http://www.openoffice.org/license.html>
# for a copy of the LGPLv3 License.
#
#*************************************************************************
PRJ=.
PRJNAME=postgresql
TARGET=so_postgresql
EXT_PROJECT_NAME=postgresql-9.1.1
MAJOR_VER=9.1
# --- Settings -----------------------------------------------------
.INCLUDE : settings.mk
# --- Files --------------------------------------------------------
TARFILE_NAME=$(EXT_PROJECT_NAME)
TARFILE_MD5=0981bda6548a8c8233ffce2b6e4b2a23
# distro-specific builds want to link against a particular mysql library
# then they do not require mysql-devel package at runtime
# So put mysql-connector-cpp/driver/nativeapi/binding_config.h into separate patch
# and enable/disable MYSQLCLIENT_STATIC_BINDING according to the used mysql library
.IF "$(SYSTEM_POSTGRESQL)" == "YES"
@all:
@echo "Using system postgresql..."
.ENDIF
BUILD_DIR=.
# TODO:
# --datarootdir changes where libpq expects internationalisation of its messages
# (which we don't install anyway for now...)
# --sysconfdir: config files. Ideally, we would like that to be "the same as the platform default",
# but that's quite some guessing work.
.IF "$(VERBOSE)"==""
MAKE_SILENT=-s
.ENDIF
BUILD_ACTION = \
./configure --sysconfdir=/etc/postgresql-common \
--datarootdir=/usr/share/ \
--datadir=/usr/share/postgresql/$(MAJOR_VER) \
--bindir=/usr/lib/postgresql/$(MAJOR_VER)/bin \
--libdir=/usr/lib/ \
--includedir=/usr/include/postgresql/ \
&& make -C src/backend ../../src/include/utils/errcodes.h ../../src/include/utils/fmgroids.h \
&& make -C src/include DESTDIR="../../../../../" install \
&& make $(MAKE_SILENT) -j$(GMAKE_MODULE_PARALLELISM) -C src/interfaces/libpq DESTDIR="../../../../../../" install
# --- Targets ------------------------------------------------------
.INCLUDE : set_ext.mk
.INCLUDE : target.mk
.INCLUDE : tg_ext.mk

3
postgresql/prj/build.lst Normal file
View File

@@ -0,0 +1,3 @@
my postgresql : solenv sal NULL
my postgresql nmake - all my_mkout NULL

7
postgresql/prj/d.lst Normal file
View File

@@ -0,0 +1,7 @@
mkdir: %_DEST%\inc\postgresql
..\%__SRC%\usr\include\postgresql\libpq-fe.h %_DEST%\inc\postgresql\
..\%__SRC%\usr\include\postgresql\postgres_ext.h %_DEST%\inc\postgresql\
..\%__SRC%\usr\lib\libpq.a %_DEST%\lib\libpq.a
#..\%__SRC%\usr\share\locale\* %_DEST%\ TODO