]> git.ipfire.org Git - thirdparty/zlib-ng.git/commitdiff
Extend logic of multilib handling to work on 64-bit hosts too. 47/head
authorMika Lindqvist <postmaster@raasu.org>
Sun, 23 Aug 2015 15:13:55 +0000 (18:13 +0300)
committerMika Lindqvist <postmaster@raasu.org>
Sun, 23 Aug 2015 15:13:55 +0000 (18:13 +0300)
configure

index 0b9ae30e16beb324f77fe1d44b0d23dff5546ada..dd0a20c4f85244dafca30e2726136e4e7d818dfe 100755 (executable)
--- a/configure
+++ b/configure
@@ -102,6 +102,7 @@ shared=1
 gzfileops=0
 compat=0
 cover=0
+build32=0
 build64=0
 without_optimizations=0
 without_new_strategies=0
@@ -133,7 +134,7 @@ case "$1" in
     -h* | --help)
       echo 'usage:' | tee -a configure.log
       echo '  configure [--zlib-compat] [--prefix=PREFIX]  [--eprefix=EXPREFIX]' | tee -a configure.log
-      echo '    [--static] [--64] [--libdir=LIBDIR] [--sharedlibdir=LIBDIR]' | tee -a configure.log
+      echo '    [--static] [--32] [--64] [--libdir=LIBDIR] [--sharedlibdir=LIBDIR]' | tee -a configure.log
       echo '    [--includedir=INCLUDEDIR] [--archs="-arch i386 -arch x86_64"]' | tee -a configure.log
         exit 0 ;;
     -p*=* | --prefix=*) prefix=`echo $1 | sed 's/.*=//'`; shift ;;
@@ -150,6 +151,7 @@ case "$1" in
     -t | --static) shared=0; shift ;;
     --zlib-compat) compat=1; shift ;;
     --cover) cover=1; shift ;;
+    -3* | --32) build32=1; shift ;;
     -6* | --64) build64=1; shift ;;
     -a*=* | --archs=*) ARCHS=`echo $1 | sed 's/.*=//'`; shift ;;
     --sysconfdir=*) echo "ignored option: --sysconfdir" | tee -a configure.log; shift ;;
@@ -209,7 +211,11 @@ if test "$gcc" -eq 1 && ($cc -c $test.c) >> configure.log 2>&1; then
       else
         ARCH=$GCC_ARCH 
       fi ;;
-    x86_64) ARCH=$GCC_ARCH ;;
+# Honor user choice if gcc is multilib and 32-bit is requested
+    x86_64)
+      if test $build32 -ne 1; then
+        ARCH=$GCC_ARCH
+      fi ;;
   esac
   CFLAGS="${CFLAGS--O3} ${ARCHS} -Wall"
   SFLAGS="${CFLAGS--O3} -fPIC"