]> git.ipfire.org Git - thirdparty/zlib-ng.git/commitdiff
Add configure test for __builtin_ctzl() support in compiler
authorHans Kristian Rosbach <hk-git@circlestorm.org>
Thu, 6 Nov 2014 19:54:38 +0000 (20:54 +0100)
committerHans Kristian Rosbach <hk-git@circlestorm.org>
Thu, 6 Nov 2014 19:54:38 +0000 (20:54 +0100)
configure

index 6b5d8773b3dc97620021d92565a6bfec3d5bdbf5..0f26657c861da819c7e768e5e85d18a98e682df6 100755 (executable)
--- a/configure
+++ b/configure
@@ -582,6 +582,23 @@ EOF
   fi
 fi
 
+# Check for __builtin_ctzl() support in compiler
+cat > $test.c << EOF
+int main(void)
+{
+    unsigned int zero = 0;
+    long test = __builtin_ctzl(zero);
+    return 0;
+}
+EOF
+if try ${CC} ${CFLAGS} $test.c; then
+    echo "Checking for __builtin_ctzl ... Yes." | tee -a configure.log
+    CFLAGS="$CFLAGS -DHAVE_BUILTIN_CTZL"
+    SFLAGS="$SFLAGS -DHAVE_BUILTIN_CTZL"
+else
+    echo "Checking for __builtin_ztzl ... No." | tee -a configure.log
+fi
+
 # Check for SSE2 intrinsics
 cat > $test.c << EOF
 #include <immintrin.h>