Changeset 24528

Show
Ignore:
Timestamp:
03/22/08 17:05:03 (8 months ago)
Author:
bonefish
Message:

* BuildPlatformMain supports overriding HOST_LIBROOT on the target now,

so one can set it to the static libroot, if desired.

* Generic attribute emulation:

  • Added build tool rm_attrs, a simple "rm" replacement, which also removes the attributes directory for a given file.
  • Added build/scripts/rm_attrs shell script, which wraps the invocation of the rm_attrs tool. If it doesn't exist yet, the ordinary rm is used.
  • The RM jam variable refers to the rm_attrs script now, i.e. whenever something is removed by the build system, the attributes are removed too (if the build tool has already been built, that is).
  • Removed the shell function attrrmrf() in build_haiku_image. We use the rm_attrs tool instead, if necessary.
Location:
haiku/trunk
Files:
2 added
8 modified

Legend:

Unmodified
Added
Removed
  • haiku/trunk/build/jam/BeOSRules

    r22412 r24528  
    263263        $(HOST_ADD_BUILD_COMPATIBILITY_LIB_DIR) 
    264264        if [ \\"$(deleteAttributeFile1)\\" = "true" ]; then 
    265                 rm -f $(1) 
     265                $(RM) $(1) 
    266266        fi 
    267267        $(2[1]) -O -o "$(1)" "$(2[2-])" 
  • haiku/trunk/build/jam/BuildSetup

    r24413 r24528  
    528528HOST_BUILD_COMPATIBILITY_LIB_DIR = [ FDirName $(HOST_OBJECT_BASE_DIR) lib ] ; 
    529529 
     530# For the generic attributes emulation: Target rm_attrs -- rm replacement that 
     531# also removes the attributes. 
     532HOST_RM_ATTRS_TARGET = ; 
     533 
    530534if $(HOST_PLATFORM_BEOS_COMPATIBLE) { 
    531535        HOST_LIBSTDC++ = stdc++.r4 ; 
    532536        HOST_LIBROOT = root ; 
     537        HOST_STATIC_LIBROOT = $(HOST_LIBROOT) ; 
    533538        HOST_LIBBE = be ; 
    534539        HOST_ADD_BUILD_COMPATIBILITY_LIB_DIR = ; 
     
    537542        HOST_LIBSTDC++ = stdc++ ; 
    538543        HOST_LIBROOT = libroot_build.so ; 
     544        HOST_STATIC_LIBROOT = libroot_build.a ; 
    539545        HOST_LIBBE = libbe_build.so ; 
    540546        HOST_ADD_BUILD_COMPATIBILITY_LIB_DIR 
     
    557563        if $(HOST_PLATFORM) = freebsd { 
    558564                HOST_LIBROOT += /usr/lib/libgnuregex.so ; 
     565                HOST_STATIC_LIBROOT += /usr/lib/libgnuregex.so ; 
    559566        } else if $(HOST_PLATFORM) = darwin { 
    560567                HOST_LIBROOT += /opt/local/lib/libgnuregex.dylib ; 
     568                HOST_STATIC_LIBROOT += /opt/local/lib/libgnuregex.dylib ; 
    561569        } 
    562570 
     
    581589        if $(HAIKU_HOST_USE_XATTR) = 1 { 
    582590                HOST_DEFINES += HAIKU_HOST_USE_XATTR ; 
     591        } else { 
     592                # Otherwise the generic attribute emulation is used, which uses a 
     593                # directory per file to store its attribute. We need to redefine RM so 
     594                # that the attributes are removed as well. We use a wrapper script, which 
     595                # invokes a build tool. If the build tool hasn't been built yet, the 
     596                # normal "rm" is used and the attributes are leaked (likely there aren't 
     597                # any yet). 
     598                RM = $(HOST_ADD_BUILD_COMPATIBILITY_LIB_DIR) ";" 
     599                        [ FDirName $(HAIKU_TOP) build scripts rm_attrs ] 
     600                        [ FDirName $(HAIKU_OBJECT_DIR) $(HOST_PLATFORM) $(HOST_ARCH) release 
     601                                tools rm_attrs ] -f ; 
     602                        # assumes that rm_attrs is built with debugging disabled 
     603                HOST_RM_ATTRS_TARGET = <build>rm_attrs ; 
    583604        } 
    584605} 
  • haiku/trunk/build/jam/HaikuImage

    r24523 r24528  
    665665AddVariableToScript $(script) : headerDirsToCopy 
    666666        : $(HAIKU_INSTALL_HEADER_DIRS) ; 
     667if $(HOST_RM_ATTRS_TARGET) { 
     668        AddTargetVariableToScript $(script) : $(HOST_RM_ATTRS_TARGET) : rmAttrs ; 
     669} else { 
     670        AddVariableToScript $(script) : rmAttrs : rm ; 
     671} 
     672 
    667673 
    668674# create the other scripts 
  • haiku/trunk/build/jam/ImageRules

    r24201 r24528  
    3838actions InitScript1 
    3939{ 
    40         rm -f $(1) 
     40        $(RM) $(1) 
    4141        echo -n > $(1) 
    4242} 
     
    679679actions BuildVMWareImage1 
    680680{ 
    681         rm -f $(1) 
     681        $(RM) $(1) 
    682682        $(2[1]) -h 64k -i$(IMAGE_SIZE)M $(1) && 
    683683        cat $(2[2]) >> $(1) 
     
    858858actions BuildFloppyBootImage1 
    859859{ 
    860         rm -f $(<) 
     860        $(RM) $(<) 
    861861        # make an empty image 
    862862        dd if=/dev/zero of=$(<) bs=1k count=1440 
     
    883883actions BuildCDBootImage1 
    884884{ 
    885         rm -f $(<) 
     885        $(RM) $(<) 
    886886        mkisofs -b $(BOOTIMG) -r -J -V bootimg -o $(<) $(>[1]) $(>[2-]) 
    887887} 
  • haiku/trunk/build/jam/MainBuildRules

    r23370 r24528  
    558558                # add the build libroot 
    559559                if ! $(HOST_PLATFORM_BEOS_COMPATIBLE) { 
    560                         Depends $(target) : $(HOST_LIBROOT) ; 
    561                         NEEDLIBS on $(target) += $(HOST_LIBROOT) ; 
     560                        local libroot = [ on $(target) return $(HOST_LIBROOT) ] ; 
     561                        Depends $(target) : $(libroot) ; 
     562                        NEEDLIBS on $(target) += $(libroot) ; 
    562563                } 
    563564        } 
     
    636637} 
    637638 
    638 rule BuildPlatformStaticLibrary 
     639rule BuildPlatformStaticLibrary lib : sources : otherObjects 
    639640{ 
    640641        # BuildPlatformStaticLibrary <lib> : <sources> ; 
    641642        # Creates a static library from sources. 
    642         # <lib>: The library. 
     643        # <lib>: The static library to be built. 
    643644        # <sources>: List of source files. 
    644  
    645         local lib = $(1) ; 
    646         local sources = $(2) ; 
     645        # <otherObjects>: List of additional object files. 
     646        # 
     647 
    647648        local objects = [ FGristFiles $(sources:S=$(SUFOBJ)) ] ; 
    648649 
     
    656657        } 
    657658 
    658         StaticLibrary $(lib) : $(sources) ; 
    659 } 
    660  
     659        StaticLibrary $(lib) : $(sources) : $(otherObjects) ; 
     660} 
     661 
  • haiku/trunk/build/jam/OverriddenJamRules

    r20352 r24528  
    3838                MimeSet $(1) ; 
    3939                SetVersion $(1) ; 
     40 
     41                # If the generic attribute emulation is enabled, make sure the tool to 
     42                # remove the attributes is built first. 
     43                if $(HOST_RM_ATTRS_TARGET) { 
     44                        Depends $(1) : $(HOST_RM_ATTRS_TARGET) ; 
     45                } 
    4046        } 
    4147} 
  • haiku/trunk/build/scripts/build_haiku_image

    r24368 r24528  
    2222# resattr 
    2323# rc 
     24# rmAttrs 
    2425# unzip 
    2526# vmdkheader 
     
    6061 
    6162 
    62 # attribute-safe rm -rf 
    63 # This makes sure there are no leftover attribute file before removing each file 
    64 attrrmrf() 
    65 { 
    66         test -e "$1" || return 
    67         if [ -d "$outputDir/attributes" ]; then 
    68                 # test for gnu stat, else fallback to the bsd one. 
    69                 statFormatOpt="-c" 
    70                 stat -c '%i' . >/dev/null 2>&1 || statFormatOpt="-f" 
    71                 find "$1" -print0 | xargs -0 stat $statFormatOpt %i | awk "{ print \"$outputDir/attributes/\" \$1 }" | xargs rm -rf 
    72         fi 
    73         rm -rf "$1" 
    74 } 
    75  
    7663unzipFile() 
    7764{ 
     
    8471        if [ $isImage ]; then 
    8572                unzipDir=$tmpDir/unzip 
    86                 attrrmrf "$unzipDir" 
     73                $rmAttrs -rf "$unzipDir" 
    8774                mkdir -p "$unzipDir" 
    8875 
     
    9077                $cp -r "${sPrefix}$unzipDir/." "${tPrefix}$targetUnzipDir" 
    9178 
    92                 attrrmrf "$unzipDir" 
     79                $rmAttrs -rf "$unzipDir" 
    9380        else 
    9481                $unzip -q -o -d "${tPrefix}$targetUnzipDir" "${sPrefix}$zipFile" 
     
    193180 
    194181        # cleanup tmp dir 
    195         attrrmrf $mimeTmpDir 
     182        $rmAttrs -rf $mimeTmpDir 
    196183fi      # ! updateOnly 
    197184 
  • haiku/trunk/src/tools/Jamfile

    r24446 r24528  
    1212        <build>mimeset 
    1313        <build>mkindex 
     14        <build>rm_attrs_tmp 
    1415        <build>rmattr 
    1516        <build>settype 
     
    5758BuildPlatformMain <build>mkindex : mkindex.cpp : $(HOST_LIBBE) ; 
    5859 
     60# We want rm_attrs to be self-contained, so we link against the static libroot. 
     61HOST_LIBROOT on <build>rm_attrs_tmp = $(HOST_STATIC_LIBROOT) ; 
     62BuildPlatformMain <build>rm_attrs_tmp : rm_attrs.cpp 
     63        : $(HOST_LIBSUPC++) $(HOST_LIBSTDC++) ; 
     64MakeLocateDebug <build>rm_attrs ; 
     65File <build>rm_attrs : <build>rm_attrs_tmp ; 
     66MODE on <build>rm_attrs = 755 ; 
     67 
    5968BuildPlatformMain <build>rmattr : rmattr.cpp : $(HOST_LIBBE) ; 
    6069