>From fcbfc068ca2e711b6a8231b1e4237325cb923a82 Mon Sep 17 00:00:00 2001 From: Pavel Raiskup Date: Mon, 30 Nov 2015 08:37:18 +0100 Subject: [PATCH] m4/libtool.m4: FreeBSD elftoolchain strip support References: http://savannah.gnu.org/patch/?8675 Message-Id: * m4/libtool.m4 (_LT_CMD_STRIPLIB): Remove the redundant tests for empty $old_striplib and $striplib. Move the test for empty $STRIP variable up. Allow elftoolchain strip (with the same arguments we used to have with GNU strip) on FreeBSD. --- NO-THANKS | 2 ++ m4/libtool.m4 | 39 ++++++++++++++++++++++++--------------- 2 files changed, 26 insertions(+), 15 deletions(-) diff --git a/NO-THANKS b/NO-THANKS index 51ec8eb..13a3c4b 100644 --- a/NO-THANKS +++ b/NO-THANKS @@ -37,6 +37,7 @@ Bruno Haible address@hidden Dalibor Topic address@hidden David Edelsohn address@hidden DJ Delorie address@hidden +Ed Maste address@hidden Erez Zadok address@hidden Eric Blake address@hidden H.J. Lu address@hidden @@ -140,5 +141,6 @@ Ulrich Drepper address@hidden Václav Zeman address@hidden Warren Dodge address@hidden Xavier Pianet address@hidden +Xin Li Юрий Андреевич Пухальский address@hidden Дилян Палаузов address@hidden diff --git a/m4/libtool.m4 b/m4/libtool.m4 index 2e8c3cf..1b44f02 100644 --- a/m4/libtool.m4 +++ b/m4/libtool.m4 @@ -2220,26 +2220,35 @@ m4_defun([_LT_CMD_STRIPLIB], striplib= old_striplib= AC_MSG_CHECKING([whether stripping libraries is possible]) -if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then - test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" - test -z "$striplib" && striplib="$STRIP --strip-unneeded" - AC_MSG_RESULT([yes]) +if test -z "$STRIP"; then + AC_MSG_RESULT([no]) else -# FIXME - insert some real tests, host_os isn't really good enough - case $host_os in - darwin*) - if test -n "$STRIP"; then + if $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then + old_striplib="$STRIP --strip-debug" + striplib="$STRIP --strip-unneeded" + AC_MSG_RESULT([yes]) + else + case $host_os in + darwin*) + # FIXME - insert some real tests, host_os isn't really good enough striplib="$STRIP -x" old_striplib="$STRIP -S" AC_MSG_RESULT([yes]) - else + ;; + freebsd*) + if $STRIP -V 2>&1 | $GREP "elftoolchain" >/dev/null; then + old_striplib="$STRIP --strip-debug" + striplib="$STRIP --strip-unneeded" + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) + fi + ;; + *) AC_MSG_RESULT([no]) - fi - ;; - *) - AC_MSG_RESULT([no]) - ;; - esac + ;; + esac + fi fi _LT_DECL([], [old_striplib], [1], [Commands to strip libraries]) _LT_DECL([], [striplib], [1]) -- 2.5.0