-
-
Notifications
You must be signed in to change notification settings - Fork 42
/
strip_bins.sh
executable file
·41 lines (35 loc) · 1.15 KB
/
strip_bins.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#!/bin/bash
#---------------------------------------------------------------------------------
# strip binaries
# strip has trouble using wildcards so do it this way instead
#---------------------------------------------------------------------------------
if [ ! -z $CROSSBUILD ]; then
HOST_STRIP=$CROSSBUILD-strip
else
HOST_STRIP=strip
fi
for f in $prefix/bin/* \
$prefix/$target/bin/* \
$prefix/libexec/gcc/$target/$GCC_VER/*
do
# exclude dll for windows, so for linux/osx, directories .la files, embedspu script & the gccbug text file
if ! [[ "$f" == *.dll || "$f" == *.so || -d $f || "$f" == *.la || "$f" == *-embedspu || "$f" == *-gccbug ]]
then
$HOST_STRIP $f
fi
if [[ "$f" == *.dll ]]
then
$HOST_STRIP -d $f
fi
done
if [ $VERSION -eq 2 ]; then
for f in $prefix/mn10200/bin/*
do
$HOST_STRIP $f
done
fi
#---------------------------------------------------------------------------------
# strip debug info from libraries
#---------------------------------------------------------------------------------
find $prefix/lib/gcc/$target -name *.a -exec $target-strip -d {} \;
find $prefix/$target -name *.a -exec $target-strip -d {} \;