From: nmlgc Date: Tue, 20 Jun 2017 20:12:42 +0000 (+0200) Subject: configure: For Windows builds, add the CROSS_PREFIX to $RC and $STRIP. X-Git-Tag: 1.9.9-b1~660^2~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=35922b1807074fb5d73de803c74b4d6a4209c560;p=thirdparty%2Fzlib-ng.git configure: For Windows builds, add the CROSS_PREFIX to $RC and $STRIP. zlib's original win32/Makefile.gcc did the same, but this was removed in 7d17132436431d5f62cf5089623073d72d07deb0. It is kind of essential for cross-compiling a Win32 build on Linux, since `windres` most certainly doesn't exist, and the regular `strip` may not be able to handle DLLs. It should probably actually be something like RC="${RC-${CROSS_PREFIX}windres}" and STRIP="${STRIP-${CROSS_PREFIX}strip}" to be consistent with the assignments of $AR, $RANLIB and $NM, but this didn't work for some reason. --- diff --git a/configure b/configure index 44f022de9..083743030 100755 --- a/configure +++ b/configure @@ -305,10 +305,10 @@ if test "$gcc" -eq 1 && ($cc $CFLAGS -c $test.c) >> configure.log 2>&1; then LDSHAREDFLAGS="-shared -Wl,--out-implib,${IMPORTLIB},--version-script,${SRCDIR}/zlib.map" LDSHAREDLIBC="" DEFFILE='win32/zlib.def' - RC='windres' + RC="${CROSS_PREFIX}windres" RCFLAGS='--define GCC_WINDRES' RCOBJS='zlibrc.o' - STRIP='strip' + STRIP="${CROSS_PREFIX}strip" EXE='.exe' ;; MSYS* | msys*) ARFLAGS="rcs" @@ -324,10 +324,10 @@ if test "$gcc" -eq 1 && ($cc $CFLAGS -c $test.c) >> configure.log 2>&1; then LDSHAREDFLAGS="-shared -Wl,--out-implib,${IMPORTLIB}" LDSHAREDLIBC="" DEFFILE='win32/zlib.def' - RC='windres' + RC="${CROSS_PREFIX}windres" RCFLAGS='--define GCC_WINDRES' RCOBJS='zlibrc.o' - STRIP='strip' + STRIP="${CROSS_PREFIX}strip" EXE='.exe' ;; MINGW* | mingw*) ARFLAGS="rcs" @@ -344,7 +344,7 @@ if test "$gcc" -eq 1 && ($cc $CFLAGS -c $test.c) >> configure.log 2>&1; then LDSHAREDFLAGS="-shared -Wl,--out-implib=${IMPORTLIB} -Wl,--version-script=${SRCDIR}/zlib.map" LDSHAREDLIBC="" DEFFILE='win32/zlib.def' - RC='windres' + RC="${CROSS_PREFIX}windres" RCFLAGS='--define GCC_WINDRES' if [ "$CC" == "mingw32-gcc" ]; then case $ARCH in @@ -352,7 +352,7 @@ if test "$gcc" -eq 1 && ($cc $CFLAGS -c $test.c) >> configure.log 2>&1; then esac; fi RCOBJS='zlibrc.o' - STRIP='strip' + STRIP="${CROSS_PREFIX}strip" EXE='.exe' ;; QNX*) # This is for QNX6. I suppose that the QNX rule below is for QNX2,QNX4 # (alain.bonnefoy@icbt.com)