[Libreoffice-commits] .: mysqlcppconn/makefile.mk solenv/inc

Lionel Elie Mamane lmamane at kemper.freedesktop.org
Thu Dec 8 14:55:44 PST 2011


 mysqlcppconn/makefile.mk |   34 ++++++++++++++++++++--------------
 solenv/inc/tg_ext.mk     |   29 ++++++++++++++++-------------
 2 files changed, 36 insertions(+), 27 deletions(-)

New commits:
commit 694627b7860fb69f115c020719c5b149d328f9ef
Author: Lionel Elie Mamane <lionel at mamane.lu>
Date:   Thu Dec 8 23:56:40 2011 +0100

    mysqlcppconn: force recompilation when switching between different bindings

diff --git a/mysqlcppconn/makefile.mk b/mysqlcppconn/makefile.mk
index d7fa8a6..a6534a2 100644
--- a/mysqlcppconn/makefile.mk
+++ b/mysqlcppconn/makefile.mk
@@ -27,10 +27,21 @@
 
 PRJ=.
 
-PRJNAME=mysqlcppconn
-TARGET=so_mysqlcppconn
+# 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_MYSQL)" == "YES"
+MYSQL_BINDING=static
+.ELSE
+MYSQL_BINDING=dynamic
+.ENDIF
 
+PRJNAME=mysqlcppconn
 EXT_PROJECT_NAME=mysql-connector-c++-1.1.0
+TARGET=so_mysqlcppconn_binding-$(MYSQL_BINDING)
+TARFILE_ROOTDIR=mysql-connector-c++-1.1.0_binding-$(MYSQL_BINDING)
+
 
 # --- Settings -----------------------------------------------------
 
@@ -49,16 +60,6 @@ ADDITIONAL_FILES=\
 CONVERTFILES=\
                 cppconn$/build_config.h
 
-# 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_MYSQL)" == "YES"
-MYSQL_BINDING=static
-.ELSE
-MYSQL_BINDING=dynamic
-.ENDIF
-
 PATCH_FILES=\
     $(TARFILE_NAME).patch \
     $(TARFILE_NAME)-mysql-binding-$(MYSQL_BINDING).patch \
@@ -66,6 +67,11 @@ PATCH_FILES=\
 
 BUILD_DIR=driver
 BUILD_ACTION = \
+	    if test -e ../../lastbuild; then LASTBUILD=$$(cat ../../lastbuild); else LASTBUILD='$(MYSQL_BINDING)'; fi && \
+	    if test "$${LASTBUILD}" != "$(MYSQL_BINDING)"; then \
+               rm -f ../$(BACK_PATH)/slo/* ../../so_built_so_mysqlcppconn_binding-$${LASTBUILD}; \
+            fi && \
+            echo "$(MYSQL_BINDING)" > ../../lastbuild && \
             cd nativeapi \
          && $(MAKE) $(MFLAGS) $(CALLMACROS) \
          && cd .. \
@@ -88,9 +94,9 @@ BUILD_ACTION = \
 NORMALIZE_FLAG_FILE=so_normalized_$(TARGET)
 
 $(PACKAGE_DIR)$/$(NORMALIZE_FLAG_FILE) : $(PACKAGE_DIR)$/$(BUILD_FLAG_FILE)
-    @$(GNUCOPY) -r $(PACKAGE_DIR)$/$(EXT_PROJECT_NAME)$/driver$/mysql_driver.h $(INCCOM)
+    @$(GNUCOPY) -r $(PACKAGE_DIR)$/$(TARFILE_ROOTDIR)$/driver$/mysql_driver.h $(INCCOM)
     -@$(MKDIRHIER) $(INCCOM)$/cppconn
-    @$(GNUCOPY) -r $(PACKAGE_DIR)$/$(EXT_PROJECT_NAME)$/cppconn$/* $(INCCOM)$/cppconn
+    @$(GNUCOPY) -r $(PACKAGE_DIR)$/$(TARFILE_ROOTDIR)$/cppconn$/* $(INCCOM)$/cppconn
     @$(TOUCH) $(PACKAGE_DIR)$/$(NORMALIZE_FLAG_FILE)
 
 normalize: $(PACKAGE_DIR)$/$(NORMALIZE_FLAG_FILE)
diff --git a/solenv/inc/tg_ext.mk b/solenv/inc/tg_ext.mk
index 0adec0c..e696054 100644
--- a/solenv/inc/tg_ext.mk
+++ b/solenv/inc/tg_ext.mk
@@ -54,10 +54,13 @@ ABS_PACKAGE_DIR:=$(MAKEDIR)/$(MISC)/build
 BACK_PATH=../../../
 #MUST match with reference (currently MISC)
 MBACK_PATH=../../
-.IF "$(TARFILE_IS_FLAT)" != ""
-fake_root_dir=/$(TARFILE_NAME)
+fake_root_dir=/$(TARFILE_ROOTDIR)
 #MUST match fake_root_dir in directory levels
 fake_back=../
+.IF "$(TARFILE_IS_FLAT)" != ""
+TAR_STRIP_LEVEL=0
+.ELSE
+TAR_STRIP_LEVEL=1
 .ENDIF "$(TARFILE_IS_FLAT)" != ""
 
 TARFILE_LOCATION*=$(BACK_PATH)$(fake_back)download
@@ -106,9 +109,9 @@ clean:
 $(MISC)/%.unpack : $(TARFILE_LOCATION2)/%.tar.bz2
     @-$(RM) $@
 .IF "$(GUI)"=="UNX"
-    @noop $(assign UNPACKCMD := sh -c "bzip2 -cd $(TARFILE_LOCATION)/$(TARFILE_MD5)-$(TARFILE_NAME).tar.bz2 $(TARFILE_FILTER) | $(GNUTAR) --no-same-owner -x$(tar_verbose_switch)f - ")
+    @noop $(assign UNPACKCMD := sh -c "bzip2 -cd $(TARFILE_LOCATION)/$(TARFILE_MD5)-$(TARFILE_NAME).tar.bz2 $(TARFILE_FILTER) | $(GNUTAR) --no-same-owner --strip-components=$(TAR_STRIP_LEVEL) -x$(tar_verbose_switch)f - ")
 .ELSE			# "$(GUI)"=="UNX"
-    @noop $(assign UNPACKCMD := bzip2 -cd $(TARFILE_LOCATION)/$(TARFILE_MD5)-$(TARFILE_NAME).tar.bz2 $(TARFILE_FILTER) | $(GNUTAR) --no-same-owner -x$(tar_verbose_switch)f - )
+    @noop $(assign UNPACKCMD := bzip2 -cd $(TARFILE_LOCATION)/$(TARFILE_MD5)-$(TARFILE_NAME).tar.bz2 $(TARFILE_FILTER) | $(GNUTAR) --no-same-owner --strip-components=$(TAR_STRIP_LEVEL) -x$(tar_verbose_switch)f - )
 .ENDIF			# "$(GUI)"=="UNX"
     @$(TYPE) $(mktmp $(UNPACKCMD)) > $@.$(INPATH)
     @$(RENAME) $@.$(INPATH) $@
@@ -116,28 +119,28 @@ $(MISC)/%.unpack : $(TARFILE_LOCATION2)/%.tar.bz2
 $(MISC)/%.unpack : $(TARFILE_LOCATION2)/%.tar.Z
     @-$(RM) $@
 .IF "$(GUI)"=="UNX"
-    @noop $(assign UNPACKCMD := sh -c "uncompress -c $(TARFILE_LOCATION)/$(TARFILE_MD5)-$(TARFILE_NAME).tar.Z | $(GNUTAR) --no-same-owner -x$(tar_verbose_switch)f - ")
+    @noop $(assign UNPACKCMD := sh -c "uncompress -c $(TARFILE_LOCATION)/$(TARFILE_MD5)-$(TARFILE_NAME).tar.Z | $(GNUTAR) --no-same-owner --strip-components=$(TAR_STRIP_LEVEL) -x$(tar_verbose_switch)f - ")
 .ELSE			# "$(GUI)"=="UNX"
-    @noop $(assign UNPACKCMD := uncompress -c $(TARFILE_LOCATION)/$(TARFILE_MD5)-$(TARFILE_NAME).tar.Z | $(GNUTAR) --no-same-owner -x$(tar_verbose_switch)f - )
+    @noop $(assign UNPACKCMD := uncompress -c $(TARFILE_LOCATION)/$(TARFILE_MD5)-$(TARFILE_NAME).tar.Z | $(GNUTAR) --no-same-owner --strip-components=$(TAR_STRIP_LEVEL) -x$(tar_verbose_switch)f - )
 .ENDIF			# "$(GUI)"=="UNX"
     @$(TYPE) $(mktmp $(UNPACKCMD)) > $@.$(INPATH)
     @$(RENAME) $@.$(INPATH) $@
 
 $(MISC)/%.unpack : $(TARFILE_LOCATION2)/%.tar.gz
     @-$(RM) $@
-    @noop $(assign UNPACKCMD := gzip -d -c $(subst,\,/ $(TARFILE_LOCATION)/$(TARFILE_MD5)-$(TARFILE_NAME).tar.gz) $(TARFILE_FILTER) | $(GNUTAR) --no-same-owner -x$(tar_verbose_switch)f - )
+    @noop $(assign UNPACKCMD := gzip -d -c $(subst,\,/ $(TARFILE_LOCATION)/$(TARFILE_MD5)-$(TARFILE_NAME).tar.gz) $(TARFILE_FILTER) | $(GNUTAR) --no-same-owner --strip-components=$(TAR_STRIP_LEVEL) -x$(tar_verbose_switch)f - )
     @$(TYPE) $(mktmp $(UNPACKCMD)) > $@.$(INPATH)
     @$(RENAME) $@.$(INPATH) $@
 
 $(MISC)/%.unpack : $(TARFILE_LOCATION2)/%.tgz
     @-$(RM) $@
-    @noop $(assign UNPACKCMD := gzip -d -c $(subst,\,/ $(TARFILE_LOCATION)/$(TARFILE_MD5)-$(TARFILE_NAME).tgz) $(TARFILE_FILTER) | $(GNUTAR) --no-same-owner -x$(tar_verbose_switch)f - )
+    @noop $(assign UNPACKCMD := gzip -d -c $(subst,\,/ $(TARFILE_LOCATION)/$(TARFILE_MD5)-$(TARFILE_NAME).tgz) $(TARFILE_FILTER) | $(GNUTAR) --no-same-owner --strip-components=$(TAR_STRIP_LEVEL) -x$(tar_verbose_switch)f - )
     @$(TYPE) $(mktmp $(UNPACKCMD)) > $@.$(INPATH)
     @$(RENAME) $@.$(INPATH) $@
 
 $(MISC)/%.unpack : $(TARFILE_LOCATION2)/%.tar
     @-$(RM) $@
-    @noop $(assign UNPACKCMD := $(GNUTAR) --no-same-owner -x$(tar_verbose_switch)f $(TARFILE_LOCATION)/$(TARFILE_MD5)-$(TARFILE_NAME).tar)
+    @noop $(assign UNPACKCMD := $(GNUTAR) --no-same-owner --strip-components=$(TAR_STRIP_LEVEL) -x$(tar_verbose_switch)f $(TARFILE_LOCATION)/$(TARFILE_MD5)-$(TARFILE_NAME).tar)
     @$(TYPE) $(mktmp $(UNPACKCMD)) > $@.$(INPATH)
     @$(RENAME) $@.$(INPATH) $@
 
@@ -189,9 +192,9 @@ $(PACKAGE_DIR)/$(PATCH_FLAG_FILE) : $(PACKAGE_DIR)/$(ADD_FILES_FLAG_FILE)
     $(COMMAND_ECHO)$(TOUCH) $@
 .ELSE			# "$(PATCH_FILES)"=="none" ||	"$(PATCH_FILES)"==""
 .IF "$(GUI)"=="WNT"
-    $(COMMAND_ECHO)cd $(PACKAGE_DIR) && $(TYPE:s/+//) $(BACK_PATH)$(PATH_IN_MODULE)/{$(PATCH_FILES)} | tr -d "\015" | patch $(PATCHFLAGS) -p2 && $(TOUCH) $(PATCH_FLAG_FILE)
+    $(COMMAND_ECHO)cd $(PACKAGE_DIR) && $(TYPE:s/+//) $(BACK_PATH)$(PATH_IN_MODULE)/{$(PATCH_FILES)} | tr -d "\015" | (cd .$(fake_root_dir) && patch $(PATCHFLAGS) -p3 ) && $(TOUCH) $(PATCH_FLAG_FILE)
 .ELSE           # "$(GUI)"=="WNT"
-    $(COMMAND_ECHO)cd $(PACKAGE_DIR) && $(TYPE) $(BACK_PATH)$(PATH_IN_MODULE)/{$(PATCH_FILES)} | $(GNUPATCH) $(PATCHFLAGS) -p2 && $(TOUCH) $(PATCH_FLAG_FILE)
+    $(COMMAND_ECHO)cd $(PACKAGE_DIR) && $(TYPE) $(BACK_PATH)$(PATH_IN_MODULE)/{$(PATCH_FILES)} | (cd .$(fake_root_dir) && $(GNUPATCH) $(PATCHFLAGS) -p3 ) && $(TOUCH) $(PATCH_FLAG_FILE)
 .ENDIF          # "$(GUI)"=="WNT"
 .ENDIF			# "$(PATCH_FILES)"=="none" ||	"$(PATCH_FILES)"==""
 .IF "$(T_ADDITIONAL_FILES)"!=""
@@ -301,10 +304,10 @@ $(MISC)/$(TARFILE_ROOTDIR).done : $(MISC)/$(TARFILE_MD5)-$(TARFILE_NAME).unpack
 #.IF "$(my4ver:s/.//:s/,//)" >= "300"
 #	$(COMMAND_ECHO)cd $(MISC) && ( $(TYPE:s/+//) $(BACK_PATH)$(PATH_IN_MODULE)/{$(PATCH_FILES)} | tr -d "\015" | patch $(PATCHFLAGS) -p2 )
 #.ELSE			# "$(my4ver:s/.//:s/,//)" >= "300"
-    $(COMMAND_ECHO)cd $(MISC) && $(TYPE:s/+//) $(MBACK_PATH)$(PATH_IN_MODULE)/{$(PATCH_FILES)} | tr -d "\015" | patch $(PATCHFLAGS) -p2
+    $(COMMAND_ECHO)cd $(MISC) && $(TYPE:s/+//) $(MBACK_PATH)$(PATH_IN_MODULE)/{$(PATCH_FILES)} | tr -d "\015" | (cd .$(fake_root_dir) && patch $(PATCHFLAGS) -p3 )
 #.ENDIF			# "$(my4ver:s/.//:s/,//)" >= "300"
 .ELSE           # "$(GUI)"=="WNT"
-    $(COMMAND_ECHO)cd $(MISC) && $(TYPE) $(MBACK_PATH)$(PATH_IN_MODULE)/{$(PATCH_FILES)} | $(GNUPATCH) $(PATCHFLAGS) -p2
+    $(COMMAND_ECHO)cd $(MISC) && $(TYPE) $(MBACK_PATH)$(PATH_IN_MODULE)/{$(PATCH_FILES)} | ( cd .$(fake_root_dir) && $(GNUPATCH) $(PATCHFLAGS) -p3 )
 .ENDIF          # "$(GUI)"=="WNT"
 .IF "$(CONVERTFILES)"!=""
     $(COMMAND_ECHO)$(CONVERT) dos  $(foreach,i,$(CONVERTFILES) $(MISC)/$(TARFILE_ROOTDIR)/$i)


More information about the Libreoffice-commits mailing list