* 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.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24528 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Ingo Weinhold
2008-03-22 21:05:03 +00:00
parent b78dc1e8dd
commit 0ba49c35b3
10 changed files with 305 additions and 29 deletions
+1 -1
View File
@@ -262,7 +262,7 @@ actions ResAttr1
{
$(HOST_ADD_BUILD_COMPATIBILITY_LIB_DIR)
if [ \\"$(deleteAttributeFile1)\\" = "true" ]; then
rm -f $(1)
$(RM) $(1)
fi
$(2[1]) -O -o "$(1)" "$(2[2-])"
}
+21
View File
@@ -527,15 +527,21 @@ if $(HOST_PLATFORM_BEOS_COMPATIBLE) {
# for builds of tools in the current environment
HOST_BUILD_COMPATIBILITY_LIB_DIR = [ FDirName $(HOST_OBJECT_BASE_DIR) lib ] ;
# For the generic attributes emulation: Target rm_attrs -- rm replacement that
# also removes the attributes.
HOST_RM_ATTRS_TARGET = ;
if $(HOST_PLATFORM_BEOS_COMPATIBLE) {
HOST_LIBSTDC++ = stdc++.r4 ;
HOST_LIBROOT = root ;
HOST_STATIC_LIBROOT = $(HOST_LIBROOT) ;
HOST_LIBBE = be ;
HOST_ADD_BUILD_COMPATIBILITY_LIB_DIR = ;
HOST_LIBRARY_NAME_MAP_input_server = /system/servers/input_server ;
} else {
HOST_LIBSTDC++ = stdc++ ;
HOST_LIBROOT = libroot_build.so ;
HOST_STATIC_LIBROOT = libroot_build.a ;
HOST_LIBBE = libbe_build.so ;
HOST_ADD_BUILD_COMPATIBILITY_LIB_DIR
= "export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$(HOST_BUILD_COMPATIBILITY_LIB_DIR)" ;
@@ -556,8 +562,10 @@ if $(HOST_PLATFORM_BEOS_COMPATIBLE) {
# Unlike glibc FreeBSD's libc doesn't have built-in regex support.
if $(HOST_PLATFORM) = freebsd {
HOST_LIBROOT += /usr/lib/libgnuregex.so ;
HOST_STATIC_LIBROOT += /usr/lib/libgnuregex.so ;
} else if $(HOST_PLATFORM) = darwin {
HOST_LIBROOT += /opt/local/lib/libgnuregex.dylib ;
HOST_STATIC_LIBROOT += /opt/local/lib/libgnuregex.dylib ;
}
@@ -580,6 +588,19 @@ if $(HOST_PLATFORM_BEOS_COMPATIBLE) {
# which is somewhat more robust.
if $(HAIKU_HOST_USE_XATTR) = 1 {
HOST_DEFINES += HAIKU_HOST_USE_XATTR ;
} else {
# Otherwise the generic attribute emulation is used, which uses a
# directory per file to store its attribute. We need to redefine RM so
# that the attributes are removed as well. We use a wrapper script, which
# invokes a build tool. If the build tool hasn't been built yet, the
# normal "rm" is used and the attributes are leaked (likely there aren't
# any yet).
RM = $(HOST_ADD_BUILD_COMPATIBILITY_LIB_DIR) ";"
[ FDirName $(HAIKU_TOP) build scripts rm_attrs ]
[ FDirName $(HAIKU_OBJECT_DIR) $(HOST_PLATFORM) $(HOST_ARCH) release
tools rm_attrs ] -f ;
# assumes that rm_attrs is built with debugging disabled
HOST_RM_ATTRS_TARGET = <build>rm_attrs ;
}
}
+6
View File
@@ -664,6 +664,12 @@ AddVariableToScript $(script) : sourceDirsToCopy
: $(HAIKU_INSTALL_SOURCE_DIRS) ;
AddVariableToScript $(script) : headerDirsToCopy
: $(HAIKU_INSTALL_HEADER_DIRS) ;
if $(HOST_RM_ATTRS_TARGET) {
AddTargetVariableToScript $(script) : $(HOST_RM_ATTRS_TARGET) : rmAttrs ;
} else {
AddVariableToScript $(script) : rmAttrs : rm ;
}
# create the other scripts
HAIKU_IMAGE_MAKE_DIRS_SCRIPT = <HaikuImage>haiku.image-make-dirs ;
+4 -4
View File
@@ -37,7 +37,7 @@ rule InitScript
actions InitScript1
{
rm -f $(1)
$(RM) $(1)
echo -n > $(1)
}
@@ -678,7 +678,7 @@ rule BuildVMWareImage vmwareImage : plainImage : imageSize
actions BuildVMWareImage1
{
rm -f $(1)
$(RM) $(1)
$(2[1]) -h 64k -i$(IMAGE_SIZE)M $(1) &&
cat $(2[2]) >> $(1)
}
@@ -857,7 +857,7 @@ rule BuildFloppyBootImage image : zbeos : archive
actions BuildFloppyBootImage1
{
rm -f $(<)
$(RM) $(<)
# make an empty image
dd if=/dev/zero of=$(<) bs=1k count=1440
# add zbeos
@@ -882,7 +882,7 @@ rule BuildCDBootImage image : bootfloppy : extrafiles
actions BuildCDBootImage1
{
rm -f $(<)
$(RM) $(<)
mkisofs -b $(BOOTIMG) -r -J -V bootimg -o $(<) $(>[1]) $(>[2-])
}
+8 -7
View File
@@ -557,8 +557,9 @@ rule BuildPlatformMain
# add the build libroot
if ! $(HOST_PLATFORM_BEOS_COMPATIBLE) {
Depends $(target) : $(HOST_LIBROOT) ;
NEEDLIBS on $(target) += $(HOST_LIBROOT) ;
local libroot = [ on $(target) return $(HOST_LIBROOT) ] ;
Depends $(target) : $(libroot) ;
NEEDLIBS on $(target) += $(libroot) ;
}
}
@@ -635,15 +636,15 @@ rule BuildPlatformMergeObjectPIC target : sources : otherObjects
BuildPlatformMergeObject $(target) : $(sources) : $(otherObjects) ;
}
rule BuildPlatformStaticLibrary
rule BuildPlatformStaticLibrary lib : sources : otherObjects
{
# BuildPlatformStaticLibrary <lib> : <sources> ;
# Creates a static library from sources.
# <lib>: The library.
# <lib>: The static library to be built.
# <sources>: List of source files.
# <otherObjects>: List of additional object files.
#
local lib = $(1) ;
local sources = $(2) ;
local objects = [ FGristFiles $(sources:S=$(SUFOBJ)) ] ;
PLATFORM on $(lib) = host ;
@@ -655,6 +656,6 @@ rule BuildPlatformStaticLibrary
USES_BE_API on $(objects) = $(usesBeAPI) ;
}
StaticLibrary $(lib) : $(sources) ;
StaticLibrary $(lib) : $(sources) : $(otherObjects) ;
}
+6
View File
@@ -37,6 +37,12 @@ rule Link
SetType $(1) ;
MimeSet $(1) ;
SetVersion $(1) ;
# If the generic attribute emulation is enabled, make sure the tool to
# remove the attributes is built first.
if $(HOST_RM_ATTRS_TARGET) {
Depends $(1) : $(HOST_RM_ATTRS_TARGET) ;
}
}
}
+4 -17
View File
@@ -21,6 +21,7 @@
# makebootable
# resattr
# rc
# rmAttrs
# unzip
# vmdkheader
#
@@ -59,20 +60,6 @@ else
fi
# attribute-safe rm -rf
# This makes sure there are no leftover attribute file before removing each file
attrrmrf()
{
test -e "$1" || return
if [ -d "$outputDir/attributes" ]; then
# test for gnu stat, else fallback to the bsd one.
statFormatOpt="-c"
stat -c '%i' . >/dev/null 2>&1 || statFormatOpt="-f"
find "$1" -print0 | xargs -0 stat $statFormatOpt %i | awk "{ print \"$outputDir/attributes/\" \$1 }" | xargs rm -rf
fi
rm -rf "$1"
}
unzipFile()
{
# unzipFile <archive> <directory>
@@ -83,13 +70,13 @@ unzipFile()
if [ $isImage ]; then
unzipDir=$tmpDir/unzip
attrrmrf "$unzipDir"
$rmAttrs -rf "$unzipDir"
mkdir -p "$unzipDir"
$unzip -q -d "$unzipDir" "$zipFile"
$cp -r "${sPrefix}$unzipDir/." "${tPrefix}$targetUnzipDir"
attrrmrf "$unzipDir"
$rmAttrs -rf "$unzipDir"
else
$unzip -q -o -d "${tPrefix}$targetUnzipDir" "${sPrefix}$zipFile"
fi
@@ -192,7 +179,7 @@ if [ ! $updateOnly ]; then
done
# cleanup tmp dir
attrrmrf $mimeTmpDir
$rmAttrs -rf $mimeTmpDir
fi # ! updateOnly
+15
View File
@@ -0,0 +1,15 @@
#!/bin/sh
if [ $# -lt 2 ]; then
echo "$0: Usage:..."
exit 1;
fi
rmAttrs=$1
shift
if [ -f $rmAttrs ]; then
$rmAttrs $@
else
rm $@
fi