]> git.ipfire.org Git - thirdparty/zlib-ng.git/commitdiff
cleanup multiple test -o expressions by using case
authorSebastian Pop <s.pop@samsung.com>
Tue, 22 Jan 2019 18:18:56 +0000 (12:18 -0600)
committerHans Kristian Rosbach <hk-github@circlestorm.org>
Thu, 24 Jan 2019 11:29:57 +0000 (12:29 +0100)
configure

index fc7611228ec1443a0df19f218c4eeb066461a1f0..4301e836be60b09c112656369aea89fac56f25c1 100755 (executable)
--- a/configure
+++ b/configure
@@ -864,8 +864,9 @@ else
 fi
 
 # Check for SSE2 intrinsics
-if test "${ARCH}" = "i386" -o "${ARCH}" = "i686"; then
-cat > $test.c << EOF
+case "${ARCH}" in
+    i386 | i486 | i586 | i686)
+        cat > $test.c << EOF
 #include <immintrin.h>
 int main(void) {
     __m128i zero = _mm_setzero_si128();
@@ -873,19 +874,20 @@ int main(void) {
     return 0;
 }
 EOF
-if try ${CC} ${CFLAGS} ${sse2flag} $test.c; then
-    echo "Checking for SSE2 intrinsics ... Yes." | tee -a configure.log
-    HAVE_SSE2_INTRIN=1
-else
-    echo "Checking for SSE2 intrinsics ... No." | tee -a configure.log
-    HAVE_SSE2_INTRIN=0
-fi
-
-fi
+        if try ${CC} ${CFLAGS} ${sse2flag} $test.c; then
+            echo "Checking for SSE2 intrinsics ... Yes." | tee -a configure.log
+            HAVE_SSE2_INTRIN=1
+        else
+            echo "Checking for SSE2 intrinsics ... No." | tee -a configure.log
+            HAVE_SSE2_INTRIN=0
+        fi
+        ;;
+esac
 
 # Check for SSE4.2 CRC intrinsics
-if test "${ARCH}" = "i386" -o "${ARCH}" = "i686" -o "${ARCH}" = "x86_64"; then
-cat > $test.c << EOF
+case "${ARCH}" in
+    i386 | i486 | i586 | i686 | x86_64)
+        cat > $test.c << EOF
 int main(void) {
     unsigned crc = 0;
     char c = 'c';
@@ -894,19 +896,20 @@ int main(void) {
     return 0;
 }
 EOF
-if try ${CC} ${CFLAGS} ${sse42flag} $test.c; then
-    echo "Checking for SSE4.2 CRC intrinsics ... Yes." | tee -a configure.log
-    HAVE_SSE42CRC_INTRIN=1
-else
-    echo "Checking for SSE4.2 CRC intrinsics ... No." | tee -a configure.log
-    HAVE_SSE42CRC_INTRIN=0
-fi
-
-fi
+        if try ${CC} ${CFLAGS} ${sse42flag} $test.c; then
+            echo "Checking for SSE4.2 CRC intrinsics ... Yes." | tee -a configure.log
+            HAVE_SSE42CRC_INTRIN=1
+        else
+            echo "Checking for SSE4.2 CRC intrinsics ... No." | tee -a configure.log
+            HAVE_SSE42CRC_INTRIN=0
+        fi
+        ;;
+esac
 
 # Check for PCLMULQDQ intrinsics
-if test "${ARCH}" = "i386" -o "${ARCH}" = "i686" -o "${ARCH}" = "x86_64"; then
-cat > $test.c << EOF
+case "${ARCH}" in
+    i386 | i486 | i586 | i686 | x86_64)
+        cat > $test.c << EOF
 #include <immintrin.h>
 #include <wmmintrin.h>
 int main(void) {
@@ -917,21 +920,21 @@ int main(void) {
     return 0;
 }
 EOF
-if try ${CC} ${CFLAGS} ${pclmulflag} $test.c; then
-    echo "Checking for PCLMULQDQ intrinsics ... Yes." | tee -a configure.log
-    HAVE_PCLMULQDQ_INTRIN=1
-else
-    echo "Checking for PCLMULQDQ intrinsics ... No." | tee -a configure.log
-    HAVE_PCLMULQDQ_INTRIN=0
-fi
-
-# Enable deflate_medium at level 4-6
-if test $without_new_strategies -eq 1; then
-    CFLAGS="${CFLAGS} -DNO_MEDIUM_STRATEGY"
-    SFLAGS="${SFLAGS} -DNO_MEDIUM_STRATEGY"
-fi
+        if try ${CC} ${CFLAGS} ${pclmulflag} $test.c; then
+            echo "Checking for PCLMULQDQ intrinsics ... Yes." | tee -a configure.log
+            HAVE_PCLMULQDQ_INTRIN=1
+        else
+            echo "Checking for PCLMULQDQ intrinsics ... No." | tee -a configure.log
+            HAVE_PCLMULQDQ_INTRIN=0
+        fi
 
-fi
+        # Enable deflate_medium at level 4-6
+        if test $without_new_strategies -eq 1; then
+            CFLAGS="${CFLAGS} -DNO_MEDIUM_STRATEGY"
+            SFLAGS="${SFLAGS} -DNO_MEDIUM_STRATEGY"
+        fi
+        ;;
+esac
 
 #Check whether -mfpu=neon is available
 cat > $test.c << EOF