Revert "Rework stripping binaries when copying to containers"
This reverts commit e2332987bc
.
This commit is contained in:
parent
d05822f18b
commit
cc5c6133d2
@ -341,11 +341,6 @@ rule CopySetHaikuRevision target : source
|
|||||||
|
|
||||||
PropagateContainerUpdateTargetFlags $(target) : $(source) ;
|
PropagateContainerUpdateTargetFlags $(target) : $(source) ;
|
||||||
|
|
||||||
if [ on $(source) return $(LINKFLAGS) ] {
|
|
||||||
# hint the target as a (strippable) binary
|
|
||||||
LINKFLAGS on $(target) = [ on $(source) return $(LINKFLAGS) ] ;
|
|
||||||
}
|
|
||||||
|
|
||||||
local revisionFile = [ DetermineHaikuRevision ] ;
|
local revisionFile = [ DetermineHaikuRevision ] ;
|
||||||
|
|
||||||
Depends $(target)
|
Depends $(target)
|
||||||
|
@ -676,32 +676,24 @@ rule CreateContainerCopyFilesScript container : script
|
|||||||
# concurrent writes to the script file when building with multiple
|
# concurrent writes to the script file when building with multiple
|
||||||
# jobs.
|
# jobs.
|
||||||
|
|
||||||
local needStrip = [ on $(container)
|
|
||||||
return $(HAIKU_CONTAINER_STRIP_BINARIES) ] ;
|
|
||||||
# We are asked to strip the binaries when copying them.
|
|
||||||
|
|
||||||
local dir ;
|
local dir ;
|
||||||
for dir in [ on $(container) return $(HAIKU_INSTALL_DIRECTORIES) ] {
|
for dir in [ on $(container) return $(HAIKU_INSTALL_DIRECTORIES) ] {
|
||||||
# filter the targets that shall be renamed; they have to be copied
|
# filter the targets that shall be renamed; they have to be copied
|
||||||
# individually
|
# individually
|
||||||
# we also handle binary separately when asked to strip them
|
|
||||||
local destTargets = [ on $(dir) return $(TARGETS_TO_INSTALL) ] ;
|
local destTargets = [ on $(dir) return $(TARGETS_TO_INSTALL) ] ;
|
||||||
local remainingTargets ;
|
local remainingTargets ;
|
||||||
local destTarget ;
|
local destTarget ;
|
||||||
for destTarget in $(destTargets) {
|
for destTarget in $(destTargets) {
|
||||||
local target = [ on $(destTarget) return $(TARGET) ] ;
|
local target = [ on $(destTarget) return $(TARGET) ] ;
|
||||||
local name = $(destTarget:G=) ;
|
local name = $(destTarget:G=) ;
|
||||||
local isBinary = [ on $(target) return $(LINKFLAGS) ] ;
|
if $(name) != $(target:BS) {
|
||||||
local doStrip ;
|
|
||||||
if $(needStrip) && $(isBinary) {
|
|
||||||
doStrip = 1 ;
|
|
||||||
}
|
|
||||||
if $(name) != $(target:BS) || $(doStrip) {
|
|
||||||
# use a unique dummy target for this file, on which we
|
# use a unique dummy target for this file, on which we
|
||||||
# can define the TARGET_DIR variable
|
# can define the TARGET_DIR variable
|
||||||
local dummyTarget = $(script)-dummy-$(dir:G=)-$(target) ;
|
local dummyTarget = $(script)-dummy-$(dir:G=)-$(target) ;
|
||||||
NotFile $(dummyTarget) ;
|
NotFile $(dummyTarget) ;
|
||||||
TARGET_DIR on $(dummyTarget) = $(dir:G=) ;
|
TARGET_DIR on $(dummyTarget) = $(dir:G=) ;
|
||||||
|
DO_STRIP on $(dummyTarget) = [ on $(container)
|
||||||
|
return $(HAIKU_CONTAINER_STRIP_BINARIES) ] ;
|
||||||
|
|
||||||
local nameFunction
|
local nameFunction
|
||||||
= [ on $(destTarget) return $(NAME_FUNCTION) ] ;
|
= [ on $(destTarget) return $(NAME_FUNCTION) ] ;
|
||||||
@ -717,13 +709,8 @@ rule CreateContainerCopyFilesScript container : script
|
|||||||
Depends $(script) : $(dummyTarget) ;
|
Depends $(script) : $(dummyTarget) ;
|
||||||
serializationDependency = $(dummyTarget) ;
|
serializationDependency = $(dummyTarget) ;
|
||||||
|
|
||||||
if $(doStrip) {
|
AppendToContainerCopyFilesScriptSingleFile $(dummyTarget)
|
||||||
AppendToContainerCopyFilesScriptStripFile $(dummyTarget)
|
: $(initScript) $(target) ;
|
||||||
: $(initScript) $(target) ;
|
|
||||||
} else {
|
|
||||||
AppendToContainerCopyFilesScriptSingleFile $(dummyTarget)
|
|
||||||
: $(initScript) $(target) ;
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
remainingTargets += $(target) ;
|
remainingTargets += $(target) ;
|
||||||
}
|
}
|
||||||
@ -736,6 +723,8 @@ rule CreateContainerCopyFilesScript container : script
|
|||||||
local dummyTarget = $(script)-dummy-$(dir:G=) ;
|
local dummyTarget = $(script)-dummy-$(dir:G=) ;
|
||||||
NotFile $(dummyTarget) ;
|
NotFile $(dummyTarget) ;
|
||||||
TARGET_DIR on $(dummyTarget) = $(dir:G=) ;
|
TARGET_DIR on $(dummyTarget) = $(dir:G=) ;
|
||||||
|
DO_STRIP on $(dummyTarget) = [ on $(container)
|
||||||
|
return $(HAIKU_CONTAINER_STRIP_BINARIES) ] ;
|
||||||
|
|
||||||
Depends $(dummyTarget) : $(initScript) $(targets)
|
Depends $(dummyTarget) : $(initScript) $(targets)
|
||||||
$(serializationDependency) ;
|
$(serializationDependency) ;
|
||||||
@ -778,6 +767,11 @@ actions piecemeal AppendToContainerCopyFilesScript bind OUTPUT_SCRIPT
|
|||||||
{
|
{
|
||||||
echo \$cp "\"\${sPrefix}$(2)\"" "\"\${tPrefix}$(TARGET_DIR)\"" \
|
echo \$cp "\"\${sPrefix}$(2)\"" "\"\${tPrefix}$(TARGET_DIR)\"" \
|
||||||
>> $(OUTPUT_SCRIPT)
|
>> $(OUTPUT_SCRIPT)
|
||||||
|
|
||||||
|
if [ -n "$(DO_STRIP:E)" ]; then
|
||||||
|
echo \$strip "\"\${tPrefix}$(TARGET_DIR)/$(2:BS)\"" "2>/dev/null" \
|
||||||
|
"|| true" >> $(OUTPUT_SCRIPT)
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -790,21 +784,11 @@ actions AppendToContainerCopyFilesScriptSingleFile
|
|||||||
|
|
||||||
echo \$cp "\"\${sPrefix}$(2[2])\"" \
|
echo \$cp "\"\${sPrefix}$(2[2])\"" \
|
||||||
"\"\${tPrefix}$(TARGET_DIR)/$(INSTALL_TARGET_NAME)\"" >> $(2[1])
|
"\"\${tPrefix}$(TARGET_DIR)/$(INSTALL_TARGET_NAME)\"" >> $(2[1])
|
||||||
}
|
|
||||||
|
|
||||||
|
if [ -n "$(DO_STRIP:E)" ]; then
|
||||||
actions AppendToContainerCopyFilesScriptStripFile
|
echo \$strip "\"\${tPrefix}$(TARGET_DIR)/$(INSTALL_TARGET_NAME)\"" \
|
||||||
{
|
"2>/dev/null" "|| true" >> $(2[1])
|
||||||
if [ -n "$(NAME_FUNCTION:E)" ]; then
|
|
||||||
echo "name=\`$(NAME_FUNCTION:E) \"$(2[2])\" 2> /dev/null \` || exit 1" \
|
|
||||||
>> $(2[1])
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo \$cp "\"\${sPrefix}$(2[2])\"" \
|
|
||||||
"\"\${tPrefix}$(TARGET_DIR)/$(INSTALL_TARGET_NAME)\"" >> $(2[1])
|
|
||||||
|
|
||||||
echo \$strip "\"\${tPrefix}$(TARGET_DIR)/$(INSTALL_TARGET_NAME)\"" \
|
|
||||||
"2>/dev/null" "|| true" >> $(2[1])
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user