summaryrefslogtreecommitdiffstats
path: root/scripts/brp-rtems-strip.in
diff options
context:
space:
mode:
authorRalf Corsepius <ralf.corsepius@rtems.org>2005-07-28 22:57:30 +0000
committerRalf Corsepius <ralf.corsepius@rtems.org>2005-07-28 22:57:30 +0000
commit0813e0da8b2873d9efaad75c25a846a44209aa9d (patch)
tree48e6d0a5c3007dbd742b27198ca3cfc13a9b4b97 /scripts/brp-rtems-strip.in
parentUpdate to automake-1.9.6 (diff)
downloadrtems-0813e0da8b2873d9efaad75c25a846a44209aa9d.tar.bz2
New.
Diffstat (limited to 'scripts/brp-rtems-strip.in')
-rwxr-xr-xscripts/brp-rtems-strip.in19
1 files changed, 19 insertions, 0 deletions
diff --git a/scripts/brp-rtems-strip.in b/scripts/brp-rtems-strip.in
new file mode 100755
index 0000000000..58f215551b
--- /dev/null
+++ b/scripts/brp-rtems-strip.in
@@ -0,0 +1,19 @@
+#!/bin/sh
+# If using normal root, avoid changing anything.
+if [ -z "$RPM_BUILD_ROOT" -o "$RPM_BUILD_ROOT" = "/" ]; then
+ exit 0
+fi
+
+cd "$RPM_BUILD_ROOT"
+
+[ -z "$STRIP" -a -n "$1" ] && STRIP="$1"
+[ -z "$STRIP" ] && STRIP=strip
+
+# Strip native binaries
+for f in `find @BRPSTRIPPATH@ \
+ -type f \( -perm -0100 -or -perm -0010 -or -perm -0001 \) -exec file {} \; | \
+ grep -v "^./\?usr/lib/debug" | \
+ grep -v ' shared object,' | \
+ sed -n -e 's/^\(.*\):[ ]*ELF.*, not stripped/\1/p'`; do
+ $STRIP -g $f || :
+done