diff options
-rw-r--r-- | configure.in | 36 | ||||
-rw-r--r-- | connectivity/prj/build.lst | 2 | ||||
-rw-r--r-- | connectivity/source/drivers/postgresql/makefile.mk | 7 | ||||
-rw-r--r-- | postgresql/makefile.mk | 81 | ||||
-rw-r--r-- | postgresql/prj/build.lst | 3 | ||||
-rw-r--r-- | postgresql/prj/d.lst | 7 |
6 files changed, 120 insertions, 16 deletions
diff --git a/configure.in b/configure.in index 796c5f12cecc..890ec7b150f4 100644 --- a/configure.in +++ b/configure.in @@ -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) diff --git a/connectivity/prj/build.lst b/connectivity/prj/build.lst index dae34996ec58..fd358fa30d3a 100644 --- a/connectivity/prj/build.lst +++ b/connectivity/prj/build.lst @@ -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 diff --git a/connectivity/source/drivers/postgresql/makefile.mk b/connectivity/source/drivers/postgresql/makefile.mk index e49898166e56..615b26b7e097 100644 --- a/connectivity/source/drivers/postgresql/makefile.mk +++ b/connectivity/source/drivers/postgresql/makefile.mk @@ -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= \ diff --git a/postgresql/makefile.mk b/postgresql/makefile.mk new file mode 100644 index 000000000000..d75b0dea6bac --- /dev/null +++ b/postgresql/makefile.mk @@ -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 + diff --git a/postgresql/prj/build.lst b/postgresql/prj/build.lst new file mode 100644 index 000000000000..756db8a1bfd1 --- /dev/null +++ b/postgresql/prj/build.lst @@ -0,0 +1,3 @@ +my postgresql : solenv sal NULL +my postgresql nmake - all my_mkout NULL + diff --git a/postgresql/prj/d.lst b/postgresql/prj/d.lst new file mode 100644 index 000000000000..4582682dc159 --- /dev/null +++ b/postgresql/prj/d.lst @@ -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 + |