common/makefiles/MakeBase.gmk

changeset 670
3b8ffb80db0f
parent 660
19a59a13b3ef
child 673
2ef28c12d649
     1.1 --- a/common/makefiles/MakeBase.gmk	Thu Apr 04 09:25:58 2013 +0200
     1.2 +++ b/common/makefiles/MakeBase.gmk	Fri Apr 05 09:38:54 2013 +0200
     1.3 @@ -374,15 +374,24 @@
     1.4  
     1.5  ifeq ($(OPENJDK_TARGET_OS),solaris)
     1.6  # On Solaris, if the target is a symlink and exists, cp won't overwrite.
     1.7 +# Cp has to operate in recursive mode to allow for -P flag, to preserve soft links. If the
     1.8 +# name of the target file differs from the source file, rename after copy.
     1.9  define install-file
    1.10  	$(MKDIR) -p $(@D)
    1.11  	$(RM) '$@'
    1.12  	$(CP) -f -r -P '$<' '$(@D)'
    1.13 +	if [ "$(@F)" != "$(<F)" ]; then $(MV) '$(@D)/$(<F)' '$@'; fi
    1.14  endef
    1.15  else ifeq ($(OPENJDK_TARGET_OS),macosx)
    1.16 +# On mac, extended attributes sometimes creep into the source files, which may later 
    1.17 +# cause the creation of ._* files which confuses testing. Clear these with xattr if
    1.18 +# set. Some files get their write permissions removed after being copied to the 
    1.19 +# output dir. When these are copied again to images, xattr would fail. By only clearing
    1.20 +# attributes when they are present, failing on this is avoided.
    1.21  define install-file
    1.22  	$(MKDIR) -p $(@D)
    1.23 -	$(CP) -fpRP '$<' '$@'
    1.24 +	$(CP) -fRP '$<' '$@'
    1.25 +	if [ -n "`$(XATTR) -l '$@'`" ]; then $(XATTR) -c '$@'; fi
    1.26  endef
    1.27  else
    1.28  define install-file

mercurial