Fix stripping when cross-compiling.
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 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89
diff --git a/Makefile b/Makefile
index 223bdaa..6ea3109 100644
--- a/Makefile
+++ b/Makefile
@@ -19,11 +19,6 @@ ifeq ($(BUILD_MSVC),yes)
else
LIBCMD=echo ignoring lib
endif
-ifeq ($(DO_STRIP),yes)
- STRIP=strip
-else
- STRIP=echo ignoring strip
-endif
all: $(TARGETS)
diff --git a/configure b/configure
index ab4459e..b962057 100755
--- a/configure
+++ b/configure
@@ -40,7 +40,7 @@ show_help(){
echo " --enable-shared build shared libraries [no]"
echo " --enable-static build static libraries [yes]"
echo " --enable-msvc create msvc-compatible import lib [auto]"
- echo " --enable-strip strip shared library [yes]"
+ echo " --enable-stripping strip shared library [yes]"
echo
echo " --cc=CC use C compiler CC [$cc_default]"
echo " --cross-prefix=PREFIX use PREFIX for compilation tools [$cross_prefix]"
@@ -59,6 +59,7 @@ incdir="${PREFIX}/include"
ar="ar"
cc_default="gcc"
ranlib="ranlib"
+strip="strip"
DEFAULT="msvc
"
@@ -67,7 +68,7 @@ DEFAULT_NO="shared
"
DEFAULT_YES="static
- strip
+ stripping
"
CMDLINE_SELECT="$DEFAULT
@@ -113,6 +114,7 @@ done
ar="${cross_prefix}${ar}"
cc_default="${cross_prefix}${cc_default}"
ranlib="${cross_prefix}${ranlib}"
+strip="${cross_prefix}${strip}"
if ! test -z $cc; then
cc_default="${cc}"
@@ -152,6 +154,10 @@ if enabled msvc; then
}
fi
+if ! enabled stripping; then
+ strip="echo ignoring strip"
+fi
+
if enabled shared; then
lib /? > /dev/null 2>&1 /dev/null && enable msvc || disable msvc
fi
@@ -163,10 +169,10 @@ echo "incdir=$incdir" >> config.mak
echo "AR=$ar" >> config.mak
echo "CC=$cc" >> config.mak
echo "RANLIB=$ranlib" >> config.mak
+echo "STRIP=$strip" >> config.mak
echo "BUILD_SHARED=$shared" >> config.mak
echo "BUILD_STATIC=$static" >> config.mak
echo "BUILD_MSVC=$msvc" >> config.mak
-echo "DO_STRIP=$strip" >> config.mak
echo "prefix: $PREFIX"
echo "libdir: $libdir"
@@ -174,9 +180,10 @@ echo "incdir: $incdir"
echo "ar: $ar"
echo "cc: $cc"
echo "ranlib: $ranlib"
+echo "strip: $strip"
echo "static: $static"
echo "shared: $shared"
enabled shared && {
echo "msvc: $msvc";
- echo "strip: $strip";
+ echo "strip: $stripping";
}