[Libreoffice-commits] core.git: 2 commits - solenv/gbuild

Michael Stahl mstahl at redhat.com
Sun Apr 21 14:38:48 PDT 2013


 solenv/gbuild/LinkTarget.mk             |    6 +++++-
 solenv/gbuild/platform/com_MSC_class.mk |    4 ++--
 2 files changed, 7 insertions(+), 3 deletions(-)

New commits:
commit d5e5de641cef7664a605f474bf7c18a70008806b
Author: Michael Stahl <mstahl at redhat.com>
Date:   Sun Apr 21 18:07:43 2013 +0200

    gbuild: work around problems with aux-targets and DLL renames (MSVC)
    
    When renaming a DLL but not the import lib it can happen that
    the "touch" rule creates the DLL file which is not helpful.
    Since there is no easy way to fix this properly, and DLLs are not
    renamed often, put in a lame hack to detect the situtation and delete
    the import lib, which will get it re-linked on the next make invocation.
    
    Change-Id: I3909cf7d377433d263e517719cca07005bade512

diff --git a/solenv/gbuild/LinkTarget.mk b/solenv/gbuild/LinkTarget.mk
old mode 100644
new mode 100755
index 720a23d..da0018f
--- a/solenv/gbuild/LinkTarget.mk
+++ b/solenv/gbuild/LinkTarget.mk
@@ -1230,9 +1230,13 @@ endef
 # Add a file that is built by the LinkTarget command and define
 # a dummy touch rule for it so it can be tracked via dependencies.
 # gb_LinkTarget_add_auxtarget linktarget auxtarget
+# The assumption is that the file is created by linking; in case it does not
+# exist there is some problem.  This can be caused on WNT by re-naming DLL
+# files (which are aux-targets) but not the import .lib files (which
+# are the LinkTargets) and doing an incremental build.
 define gb_LinkTarget_add_auxtarget
 $(2) : $(call gb_LinkTarget_get_target,$(1))
-	touch $$@
+	$$(if $$(wildcard $$@),touch -r $$< $$@,rm -f $$<; echo "ERROR: aux-target missing, library deleted, please try again"; false)
 
 $(call gb_LinkTarget_get_clean_target,$(1)) : AUXTARGETS += $(2)
 
commit 1ae59b52e302491ffcd97bde25a6dd68bf109123
Author: Michael Stahl <mstahl at redhat.com>
Date:   Sun Apr 21 18:06:17 2013 +0200

    gbuild: fix spurious delivering of import libs (MSVC)
    
    The DLL aux-target is always newer than the work-dir import lib,
    which causes spurious re-delivery of the solver import lib.
    Touch the DLL file to the same timestamp as the import lib
    to prevent this.
    
    Change-Id: I8394201c7a672a50db3af51b9442f8992cdef1d1

diff --git a/solenv/gbuild/platform/com_MSC_class.mk b/solenv/gbuild/platform/com_MSC_class.mk
index 36f973d..6457e9c 100755
--- a/solenv/gbuild/platform/com_MSC_class.mk
+++ b/solenv/gbuild/platform/com_MSC_class.mk
@@ -213,8 +213,8 @@ $(call gb_Helper_abbreviate_dirs,\
 		$(if $(filter-out StaticLibrary,$(TARGETTYPE)),user32.lib) \
 		$(if $(DLLTARGET),-out:$(DLLTARGET) -implib:$(1),-out:$(1)); RC=$$?; rm $${RESPONSEFILE} \
 	$(if $(DLLTARGET),; if [ ! -f $(DLLTARGET) ]; then rm -f $(1) && false; fi) \
-	$(if $(filter Library,$(TARGETTYPE)),; if [ -f $(DLLTARGET).manifest ]; then mt.exe $(MTFLAGS) -nologo -manifest $(DLLTARGET).manifest -outputresource:$(DLLTARGET)\;2; fi) \
-	$(if $(filter Executable,$(TARGETTYPE)),; if [ -f $(1).manifest ]; then mt.exe $(MTFLAGS) -nologo -manifest $(1).manifest -outputresource:$(1)\;1; fi) \
+	$(if $(filter Library,$(TARGETTYPE)),&& if [ -f $(DLLTARGET).manifest ]; then mt.exe $(MTFLAGS) -nologo -manifest $(DLLTARGET).manifest -outputresource:$(DLLTARGET)\;2 && touch -r $(1) $(DLLTARGET).manifest $(DLLTARGET); fi) \
+	$(if $(filter Executable,$(TARGETTYPE)),&& if [ -f $(1).manifest ]; then mt.exe $(MTFLAGS) -nologo -manifest $(1).manifest -outputresource:$(1)\;1 && touch -r $(1) $(1).manifest; fi) \
 	; exit $$RC)
 endef
 


More information about the Libreoffice-commits mailing list