Skip to contentSkip to conversation

configure: add --disable-zlib-test

PATCH Applied Alon Levy 2 participants 2 messages Jul 26, 2011 – Jul 29, 2011

lore
Share & tools
lore

Alon Levy

author
#0 lore raw

PATCH 1/1 configure: add --disable-zlib-test

This is required for building libcacard which doesn't itself require zlib without bringing in this requirement to the build environment.

---
I'd like this to go into 0.15.0 too, it makes building libcacard possible without zlib-devel being installed.

---
 configure |   23 ++++++++++++++---------
 1 files changed, 14 insertions(+), 9 deletions(-)
configure +14 -9
index 88159ac..5fc0f82 100755
@@ -178,6 +178,7 @@ rbd=""
 smartcard=""
 smartcard_nss=""
 opengl=""
+zlib="yes"
 
 # parse CC options first
 for opt do
@@ -743,6 +744,8 @@ for opt do
   ;;
   --enable-smartcard-nss) smartcard_nss="yes"
   ;;
+  --disable-zlib-test) zlib="no"
+  ;;
   *) echo "ERROR: unknown option $opt"; show_help="yes"
   ;;
   esac
@@ -1172,18 +1175,20 @@ fi
 ##########################################
 # zlib check
 
-cat > $TMPC << EOF
+if test "$zlib" != "no" ; then
+    cat > $TMPC << EOF
 #include <zlib.h>
 int main(void) { zlibVersion(); return 0; }
 EOF
-if compile_prog "" "-lz" ; then
-    :
-else
-    echo
-    echo "Error: zlib check failed"
-    echo "Make sure to have the zlib libs and headers installed."
-    echo
-    exit 1
+    if compile_prog "" "-lz" ; then
+        :
+    else
+        echo
+        echo "Error: zlib check failed"
+        echo "Make sure to have the zlib libs and headers installed."
+        echo
+        exit 1
+    fi
 fi
 
 ##########################################
Signature · 1 line
1.7.6
#1 lore raw
Quoted 4 lines · Alon Levy

This is required for building libcacard which doesn't itself require zlib without bringing in this requirement to the build environment.

Applied. Thanks.

Regards,

Anthony Liguori

Quoted 58 lines

---
I'd like this to go into 0.15.0 too, it makes building libcacard possible without zlib-devel being installed.

---
  configure |   23 ++++++++++++++---------
  1 files changed, 14 insertions(+), 9 deletions(-)
configure +14 -9
index 88159ac..5fc0f82 100755
@@ -178,6 +178,7 @@ rbd=""
  smartcard=""
  smartcard_nss=""
  opengl=""
+zlib="yes"
 
  # parse CC options first
  for opt do
@@ -743,6 +744,8 @@ for opt do
    ;;
    --enable-smartcard-nss) smartcard_nss="yes"
    ;;
+  --disable-zlib-test) zlib="no"
+  ;;
    *) echo "ERROR: unknown option $opt"; show_help="yes"
    ;;
    esac
@@ -1172,18 +1175,20 @@ fi
  ##########################################
  # zlib check
 
-cat>  $TMPC<<  EOF
+if test "$zlib" != "no" ; then
+    cat>  $TMPC<<  EOF
  #include<zlib.h>
  int main(void) { zlibVersion(); return 0; }
  EOF
-if compile_prog "" "-lz" ; then
-    :
-else
-    echo
-    echo "Error: zlib check failed"
-    echo "Make sure to have the zlib libs and headers installed."
-    echo
-    exit 1
+    if compile_prog "" "-lz" ; then
+        :
+    else
+        echo
+        echo "Error: zlib check failed"
+        echo "Make sure to have the zlib libs and headers installed."
+        echo
+        exit 1
+    fi
  fi
 
  ##########################################