2014-06-27 12:33:05 +01:00
|
|
|
# This setup hook strips libraries and executables in the fixup phase.
|
|
|
|
|
2014-07-08 12:47:09 +01:00
|
|
|
fixupOutputHooks+=(_doStrip)
|
2014-06-27 12:33:05 +01:00
|
|
|
|
|
|
|
_doStrip() {
|
|
|
|
if [ -z "$dontStrip" ]; then
|
2016-05-04 12:40:53 +01:00
|
|
|
stripDebugList=${stripDebugList:-lib lib32 lib64 libexec bin sbin}
|
2014-06-27 12:33:05 +01:00
|
|
|
if [ -n "$stripDebugList" ]; then
|
|
|
|
stripDirs "$stripDebugList" "${stripDebugFlags:--S}"
|
|
|
|
fi
|
|
|
|
|
|
|
|
stripAllList=${stripAllList:-}
|
|
|
|
if [ -n "$stripAllList" ]; then
|
|
|
|
stripDirs "$stripAllList" "${stripAllFlags:--s}"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
stripDirs() {
|
|
|
|
local dirs="$1"
|
|
|
|
local stripFlags="$2"
|
|
|
|
local dirsNew=
|
|
|
|
|
|
|
|
for d in ${dirs}; do
|
|
|
|
if [ -d "$prefix/$d" ]; then
|
|
|
|
dirsNew="${dirsNew} $prefix/$d "
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
dirs=${dirsNew}
|
|
|
|
|
|
|
|
if [ -n "${dirs}" ]; then
|
2016-05-04 12:40:53 +01:00
|
|
|
header "stripping (with flags $stripFlags) in$dirs"
|
2017-09-21 06:33:00 +01:00
|
|
|
find $dirs -type f -print0 | xargs -0 ${xargsFlags:--r} $STRIP $commonStripFlags $stripFlags 2>/dev/null || true
|
2014-06-27 12:33:05 +01:00
|
|
|
stopNest
|
|
|
|
fi
|
|
|
|
}
|