On Sun, Jan 22, 2012 at 05:55:07PM +0100, Lionel Elie Mamane wrote:

> With respect to fdo#45090, that is the GNU/Linux dlopen() does not
> find libldap50.so when loading PostgreSQL-SDBC's
> postgresql-sdbc-impl.uno.so.

> Now that I think of it, only the copy solution will make it work with
> a LibreOffice compiled with --with-openldap, since that LibreOffice
> won't ship libldap50.so. But distros will hate that, so they need a
> way to disable that... I'd say do it only if LibreOffice is not
> configured to use its internal mozldap.

I'm thinking of something along the lines of the attached patch.

-- 
Lionel
>From 27e7993fde6154e0a7b13323cb854d99d8e3af63 Mon Sep 17 00:00:00 2001
From: Lionel Elie Mamane <lio...@mamane.lu>
Date: Sun, 22 Jan 2012 18:48:22 +0100
Subject: [PATCH] fdo#45090: copy LDAP library to postgresql-sdbc .oxt file

---
 connectivity/source/drivers/postgresql/makefile.mk |   18 +++++++++++++++---
 1 files changed, 15 insertions(+), 3 deletions(-)

diff --git a/connectivity/source/drivers/postgresql/makefile.mk b/connectivity/source/drivers/postgresql/makefile.mk
index cc6a4df..dcd5842 100644
--- a/connectivity/source/drivers/postgresql/makefile.mk
+++ b/connectivity/source/drivers/postgresql/makefile.mk
@@ -88,13 +88,13 @@ LIBPQ_DEP_LIBS += \
 .IF "$(WITH_LDAP)" == "YES"
 LIBPQ_DEP_LIBS+=\
         $(LDAPSDKLIB)
-.ENDIF
-.ELSE
+.ENDIF # WITH_LDAP == YES
+.ELSE # Not MSVC on MSWindows
 LIBPQ_LINK=$(OUTDIR)/lib/libpq.a
 LIBPQ_DEP_LIBS+=$(eq,$(OS),MACOSX $(NULL) -Wl,--as-needed)
 .INCLUDE : $(OUTDIR_FOR_BUILD)/inc/postgresql/libpq-flags.mk
 LIBPQ_DEP_LIBS+=$(eq,$(OS),MACOSX $(NULL) -Wl,--no-as-needed)
-.ENDIF
+.ENDIF # MSVC on MSWindows
 POSTGRESQL_INC=-I$(OUTDIR)/inc/postgresql
 POSTGRESQL_LIB=
 .ENDIF # SYSTEM_POSTGRESQL
@@ -191,11 +191,22 @@ INI_EXT=.ini
 $(DLLDEST)$/$(SHL1TARGET)$(INI_EXT): $(SHL1TARGET)
     +cp $? $@
 
+LDAP_LIBFILE_OUTDIR=
+LDAP_LIBFILE_FNAME=
+.IF "$(GUI)"!="WNT" && "$(SYSTEM_POSTGRESQL)"!="YES" && "$(WITH_LDAP)" == "YES" && "$(WITH_OPENLDAP)" != "YES" && "$(SYSTEM_MOZILLA)" != "YES"
+LDAP_LIBFILE_FULLPATH := $(OUTDIR)$/lib$/$(shell echo '$(LDAPSDKLIB)' | sed -e 's/^-l/lib/' -e 's/\.lib$//' )$(DLLPOST)
+LDAP_LIBFILE_FNAME := $(LDAP_LIBFILE_FULLPATH:f)
+LDAP_LIBFILE_OUTDIR += $(DLLDEST)$/$(LDAP_LIBFILE_FNAME)
+$(LDAP_LIBFILE_OUTDIR): $(LDAP_LIBFILE_FULLPATH)
+    +cp $? $@
+.ENDIF
+
 $(DLLDEST)$/$(DRIVERNAME): \
         $(DLLDEST)$/META-INF$/manifest.xml \
         $(DLLDEST)$/description.xml \
         $(DLLDEST)$/description/description_en-US.txt \
         $(DLLDEST)$/postgresql.xcu \
+        $(LDAP_LIBFILE_OUTDIR) \
         $(DLLDEST)$/$(SHL1TARGET)$(DLLPOST) \
         $(DLLDEST)$/$(SHL2TARGET)$(DLLPOST) \
         $(DLLDEST)$/$(SHL1TARGET)$(INI_EXT)
@@ -205,6 +216,7 @@ $(DLLDEST)$/$(DRIVERNAME): \
             $(SHL1TARGET)$(DLLPOST) \
             $(SHL2TARGET)$(DLLPOST) \
             $(SHL1TARGET)$(INI_EXT) \
+            $(LDAP_LIBFILE_FNAME) \
             description.xml \
             description/description_en-US.txt \
             postgresql.xcu
-- 
1.7.7.3

_______________________________________________
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice

Reply via email to