Skip to content

Commit

Permalink
Merge pull request #2 from lrusak/seo-stripping
Browse files Browse the repository at this point in the history
stripping changes
  • Loading branch information
MilhouseVH committed Mar 14, 2016
2 parents f1c2ced + 4f60b88 commit d8f6577
Show file tree
Hide file tree
Showing 7 changed files with 32 additions and 3 deletions.
7 changes: 7 additions & 0 deletions config/functions
Original file line number Diff line number Diff line change
Expand Up @@ -462,3 +462,10 @@ show_config() {

echo -e "$config_message"
}

# strip
debug_strip() {
if [ ! "$DEBUG" = yes ]; then
$STRIP `find $* -type f -executable 2>/dev/null` 2>/dev/null || :
fi
}
2 changes: 1 addition & 1 deletion config/optimize
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ if [ "$DEBUG" = yes ]; then
else
TARGET_CFLAGS="$TARGET_CFLAGS -fomit-frame-pointer"
TARGET_CXXFLAGS="$TARGET_CXXFLAGS -fomit-frame-pointer"
TARGET_LDFLAGS="$TARGET_LDFLAGS -s"
TARGET_LDFLAGS="$TARGET_LDFLAGS"
fi

TARGET_CPPFLAGS=
Expand Down
4 changes: 4 additions & 0 deletions packages/lang/Python/package.mk
Original file line number Diff line number Diff line change
Expand Up @@ -130,4 +130,8 @@ post_makeinstall_target() {
rm -rf $INSTALL/usr/bin/pydoc
rm -rf $INSTALL/usr/bin/smtpd.py
rm -rf $INSTALL/usr/bin/python*-config

# strip
chmod u+w $INSTALL/usr/lib/libpython*.so.*
debug_strip $INSTALL/usr
}
2 changes: 2 additions & 0 deletions packages/mediacenter/kodi/package.mk
Original file line number Diff line number Diff line change
Expand Up @@ -408,6 +408,8 @@ post_makeinstall_target() {
mkdir -p $INSTALL/usr/share/kodi/media/Fonts
cp $PKG_DIR/fonts/*.ttf $INSTALL/usr/share/kodi/media/Fonts
fi

debug_strip $INSTALL/usr/lib/kodi/kodi.bin
}

post_install() {
Expand Down
2 changes: 2 additions & 0 deletions packages/network/openssh/package.mk
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ post_makeinstall_target() {

sed -i $INSTALL/etc/ssh/sshd_config -e "s|^#PermitRootLogin.*|PermitRootLogin yes|g"
echo "PubkeyAcceptedKeyTypes +ssh-dss" >> $INSTALL/etc/ssh/sshd_config

debug_strip $INSTALL/usr
}

post_install() {
Expand Down
4 changes: 4 additions & 0 deletions packages/sysutils/systemd/package.mk
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,10 @@ post_makeinstall_target() {
ln -sf /usr/bin/systemctl $INSTALL/usr/sbin/shutdown
ln -sf /usr/bin/systemctl $INSTALL/usr/sbin/telinit

# strip
debug_strip $INSTALL/usr

# defaults
mkdir -p $INSTALL/usr/config
cp -PR $PKG_DIR/config/* $INSTALL/usr/config

Expand Down
14 changes: 12 additions & 2 deletions scripts/build
Original file line number Diff line number Diff line change
Expand Up @@ -352,8 +352,18 @@ if [ ! -f $STAMP ]; then
find $INSTALL -type d -exec rmdir -p "{}" ";" 2>/dev/null || true

if [ ! "$DEBUG" = yes ]; then
$STRIP `find $INSTALL -name "*.so" 2>/dev/null` 2>/dev/null || :
$STRIP `find $INSTALL -name "*.so.[0-9]*" 2>/dev/null` 2>/dev/null || :
$STRIP `find $INSTALL \
-type f -name "*.so*" \
! -name "ld-*.so" \
! -name "libc-*.so" \
! -name "libpthread-*.so" \
! -name "libthread_db-*so" \
2>/dev/null` 2>/dev/null || :
if [ "$TARGET" = "init" ]; then
$STRIP `find $INSTALL -type f -name "*.so*" 2>/dev/null` 2>/dev/null || :
fi
$STRIP `find $INSTALL/bin $INSTALL/usr/bin $INSTALL/sbin $INSTALL/usr/sbin \
-type f -executable 2>/dev/null` 2>/dev/null || :
fi
fi
fi
Expand Down

0 comments on commit d8f6577

Please sign in to comment.