[haiku-commits] haiku: hrev46201 - build/jam src/system/libroot build/jam/images

  • From: revol@xxxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Wed, 9 Oct 2013 22:11:48 +0200 (CEST)

hrev46201 adds 3 changesets to branch 'master'
old head: 0e030f22e1b838708510c0cf711c8abdb77734b3
new head: d6de84de6690d076caf2744ba3fda17ef267cabd
overview: http://cgit.haiku-os.org/haiku/log/?qt=range&q=d6de84d+%5E0e030f2

----------------------------------------------------------------------------

1586044: libroot: Style fix

c19c9e0: libroot: Pass members to filter as on-target variable

d6de84d: Allow stripping binaries when copying to image containers
  
  Currently only needed for boot floppy on some platforms.
  
  Disabled for now.
  
  Note we do not have a mean of knowing which file is a binary
  or not so we just try to strip, and silently continue when
  strip fails (like on the kernel settings file).
  
  Also note strip actually replaces the file, which means it looses
  both the resources and attributes, which shouldn't be a problem
  for the boot floppy drivers archive, but is not wanted for other
  images, so it's not usable elsewhere as such. Patch wanted.

                                          [ François Revol <revol@xxxxxxx> ]

----------------------------------------------------------------------------

4 files changed, 27 insertions(+), 8 deletions(-)
build/jam/BuildSetup             |  2 ++
build/jam/ImageRules             | 14 ++++++++++++++
build/jam/images/FloppyBootImage |  1 +
src/system/libroot/Jamfile       | 18 ++++++++++--------

############################################################################

Commit:      158604494b15849e05c0be426a4b6c094b064e31
URL:         http://cgit.haiku-os.org/haiku/commit/?id=1586044
Author:      François Revol <revol@xxxxxxx>
Date:        Wed Oct  9 06:46:51 2013 UTC

libroot: Style fix

----------------------------------------------------------------------------

diff --git a/src/system/libroot/Jamfile b/src/system/libroot/Jamfile
index 8f1e746..487df1e 100644
--- a/src/system/libroot/Jamfile
+++ b/src/system/libroot/Jamfile
@@ -2,7 +2,8 @@ SubDir HAIKU_TOP src system libroot ;
 
 UsePrivateHeaders libroot runtime_loader ;
 
-rule FilterArchive {
+rule FilterArchive
+{
        # FilterArchive <target> : <source> : <members to remove>
 
        # set the tools according to the platform
@@ -20,10 +21,13 @@ rule FilterArchive {
        # delete the unwanted members
        FilterArchive1 $(1) : $(3) ;
 
-       if $(RANLIB) { Ranlib $(1) ; }
+       if $(RANLIB) {
+               Ranlib $(1) ;
+       }
 }
 
-actions FilterArchive1 {
+actions FilterArchive1
+{
        $(AR) $(<) $(>)
 }
 

############################################################################

Commit:      c19c9e08ef2f723f610ca1263f8775dd7f64ce2a
URL:         http://cgit.haiku-os.org/haiku/commit/?id=c19c9e0
Author:      François Revol <revol@xxxxxxx>
Date:        Wed Oct  9 07:01:41 2013 UTC

libroot: Pass members to filter as on-target variable

----------------------------------------------------------------------------

diff --git a/src/system/libroot/Jamfile b/src/system/libroot/Jamfile
index 487df1e..3a9edc4 100644
--- a/src/system/libroot/Jamfile
+++ b/src/system/libroot/Jamfile
@@ -10,16 +10,14 @@ rule FilterArchive
        AR on $(1) = $(TARGET_AR_$(TARGET_PACKAGING_ARCH)) d ;
        # TODO: use $(TARGET_DELARFLAGS_$(TARGET_PACKAGING_ARCH))
        RANLIB on $(1) = $(TARGET_RANLIB_$(TARGET_PACKAGING_ARCH)) ;
+       MEMBERS on $(1) = $(3) ;
 
        MakeLocateArch $(1) ;
        Depends $(1) : $(2) ;
        File $(1) : $(2) ;
-       # we don't want the path
-       # XXX: is it done this way?
-       NotFile $(3) ;
 
        # delete the unwanted members
-       FilterArchive1 $(1) : $(3) ;
+       FilterArchive1 $(1) ;
 
        if $(RANLIB) {
                Ranlib $(1) ;
@@ -28,7 +26,7 @@ rule FilterArchive
 
 actions FilterArchive1
 {
-       $(AR) $(<) $(>)
+       $(AR) $(<) $(MEMBERS)
 }
 
 local architectureObject ;

############################################################################

Revision:    hrev46201
Commit:      d6de84de6690d076caf2744ba3fda17ef267cabd
URL:         http://cgit.haiku-os.org/haiku/commit/?id=d6de84d
Author:      François Revol <revol@xxxxxxx>
Date:        Wed Oct  9 16:30:03 2013 UTC

Allow stripping binaries when copying to image containers

Currently only needed for boot floppy on some platforms.

Disabled for now.

Note we do not have a mean of knowing which file is a binary
or not so we just try to strip, and silently continue when
strip fails (like on the kernel settings file).

Also note strip actually replaces the file, which means it looses
both the resources and attributes, which shouldn't be a problem
for the boot floppy drivers archive, but is not wanted for other
images, so it's not usable elsewhere as such. Patch wanted.

----------------------------------------------------------------------------

diff --git a/build/jam/BuildSetup b/build/jam/BuildSetup
index d777044..fff02c1 100644
--- a/build/jam/BuildSetup
+++ b/build/jam/BuildSetup
@@ -41,6 +41,8 @@ HAIKU_INSTALL_TARGETS_VAR on 
$(HAIKU_FLOPPY_BOOT_IMAGE_CONTAINER_NAME)
        = HAIKU_FLOPPY_BOOT_IMAGE_INSTALL_TARGETS ;
 HAIKU_CONTAINER_SYSTEM_DIR_TOKENS on $(HAIKU_FLOPPY_BOOT_IMAGE_CONTAINER_NAME)
        = system ;
+#HAIKU_CONTAINER_STRIP_BINARIES on $(HAIKU_FLOPPY_BOOT_IMAGE_CONTAINER_NAME)
+#      = 1 ;
 
 # boot CD image
 HAIKU_CD_BOOT_IMAGE_CONTAINER_NAME = haiku-boot-cd-container ;
diff --git a/build/jam/ImageRules b/build/jam/ImageRules
index 172a766..631bf6d 100644
--- a/build/jam/ImageRules
+++ b/build/jam/ImageRules
@@ -692,6 +692,8 @@ rule CreateContainerCopyFilesScript container : script
                                local dummyTarget = 
$(script)-dummy-$(dir:G=)-$(target) ;
                                NotFile $(dummyTarget) ;
                                TARGET_DIR on $(dummyTarget) = $(dir:G=) ;
+                               DO_STRIP on $(dummyTarget) = [ on $(container)
+                                       return 
$(HAIKU_CONTAINER_STRIP_BINARIES) ] ;
 
                                local nameFunction
                                        = [ on $(destTarget) return 
$(NAME_FUNCTION) ] ;
@@ -721,6 +723,8 @@ rule CreateContainerCopyFilesScript container : script
                        local dummyTarget = $(script)-dummy-$(dir:G=) ;
                        NotFile $(dummyTarget) ;
                        TARGET_DIR on $(dummyTarget) = $(dir:G=) ;
+                       DO_STRIP on $(dummyTarget) = [ on $(container)
+                               return $(HAIKU_CONTAINER_STRIP_BINARIES) ] ;
 
                        Depends $(dummyTarget) : $(initScript) $(targets)
                                $(serializationDependency) ;
@@ -763,6 +767,11 @@ actions piecemeal AppendToContainerCopyFilesScript bind 
OUTPUT_SCRIPT
 {
        echo \$cp "\"\${sPrefix}$(2)\"" "\"\${tPrefix}$(TARGET_DIR)\"" \
                >> $(OUTPUT_SCRIPT)
+
+       if [ -n "$(DO_STRIP:E)" ]; then
+               echo \$strip "\"\${tPrefix}$(TARGET_DIR)/$(2:BS)\"" 
"2>/dev/null" \
+                       "|| true" >> $(OUTPUT_SCRIPT)
+       fi
 }
 
 
@@ -775,6 +784,11 @@ actions AppendToContainerCopyFilesScriptSingleFile
 
        echo \$cp "\"\${sPrefix}$(2[2])\"" \
                "\"\${tPrefix}$(TARGET_DIR)/$(INSTALL_TARGET_NAME)\"" >> $(2[1])
+
+       if [ -n "$(DO_STRIP:E)" ]; then
+               echo \$strip 
"\"\${tPrefix}$(TARGET_DIR)/$(INSTALL_TARGET_NAME)\"" \
+                       "2>/dev/null" "|| true" >> $(2[1])
+       fi
 }
 
 
diff --git a/build/jam/images/FloppyBootImage b/build/jam/images/FloppyBootImage
index b44f1ee..61c16ff 100644
--- a/build/jam/images/FloppyBootImage
+++ b/build/jam/images/FloppyBootImage
@@ -183,6 +183,7 @@ AddVariableToScript $(script) : tmpDir : $(HAIKU_TMP_DIR) ;
 AddVariableToScript $(script) : addBuildCompatibilityLibDir
        : $(HOST_ADD_BUILD_COMPATIBILITY_LIB_DIR) ;
 AddTargetVariableToScript $(script) : <build>copyattr ;
+AddTargetVariableToScript $(script) : $(HAIKU_STRIP_$(TARGET_ARCH)) : strip ;
 
 # create the other scripts
 local makeDirsScript = <FloppyBootArchive>haiku-floppyboot-make-dirs ;


Other related posts: