[Libreoffice-commits] .: 2 commits - configure.in connectivity/prj connectivity/source postgresql/makefile.mk postgresql/prj

Lionel Elie Mamane lmamane at kemper.freedesktop.org
Thu Dec 1 13:56:27 PST 2011


 configure.in                                       |   44 +++++++----
 connectivity/prj/build.lst                         |    2 
 connectivity/source/drivers/postgresql/makefile.mk |    7 +
 postgresql/makefile.mk                             |   81 +++++++++++++++++++++
 postgresql/prj/build.lst                           |    3 
 postgresql/prj/d.lst                               |    7 +
 6 files changed, 127 insertions(+), 17 deletions(-)

New commits:
commit 44ec239eba3b652fc8dbe1e0eb66c7f9ed018137
Author: Lionel Elie Mamane <lionel at mamane.lu>
Date:   Thu Dec 1 21:59:09 2011 +0100

    Internal libpq (PostgreSQL client lib)

diff --git a/configure.in b/configure.in
index 796c5f1..890ec7b 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 dae3499..fd358fa 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 e498981..615b26b 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 0000000..d75b0de
--- /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"
+ at 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 0000000..756db8a
--- /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 0000000..4582682
--- /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
+
commit 74283f6976c727233ca330a1e9bf6ee4f52f86c5
Author: Lionel Elie Mamane <lionel at mamane.lu>
Date:   Thu Dec 1 22:21:43 2011 +0100

    External PostgreSQL: automatically search MacOS-specific paths

diff --git a/configure.in b/configure.in
index f75aeb3..796c5f1 100644
--- a/configure.in
+++ b/configure.in
@@ -5407,7 +5407,13 @@ if test "x$enable_ext_postgresql_sdbc" = "xyes" -a "x$enable_extension_integrati
     if test "$with_system_postgresql" = "yes"; then
         AC_MSG_RESULT([external PostgreSQL])
         SYSTEM_POSTGRESQL=YES
-        AC_PATH_PROG(PGCONFIG, pg_config)
+        if test "$_os" = Darwin; then
+           supp_path=''
+           for d in /Library/PostgreSQL/9.*/bin; do
+            pg_supp_path="$PATH_SEPARATOR$d$pg_supp_path"
+           done
+        fi
+        AC_PATH_PROG(PGCONFIG, pg_config, ,$PATH$pg_supp_path)
         if test -z "$PGCONFIG"; then
            AC_MSG_ERROR([pg_config needed; set PGCONFIG if not in PATH])
         fi


More information about the Libreoffice-commits mailing list