]> git.ipfire.org Git - thirdparty/zlib-ng.git/commitdiff
Fix -std option in configure script
authorVladislav Shchapov <vladislav@shchapov.ru>
Fri, 3 May 2024 17:03:21 +0000 (22:03 +0500)
committerHans Kristian Rosbach <hk-github@circlestorm.org>
Mon, 6 May 2024 20:50:52 +0000 (22:50 +0200)
Signed-off-by: Vladislav Shchapov <vladislav@shchapov.ru>
configure

index 1c7a1ea4db8b8071b3cfa66d6f5a5521d3921099..620aebd534776738aff6e0a9bc5104be7d359b1f 100755 (executable)
--- a/configure
+++ b/configure
@@ -300,7 +300,9 @@ show $cc -c $test.c
 if test "$gcc" -eq 1 && ($cc $CFLAGS -c $test.c) >> configure.log 2>&1; then
   echo "$cc" | tee -a configure.log
   CC="$cc"
-  CFLAGS="${CFLAGS} -std=c11"
+  if test "${CFLAGS#*"-std="}" = "$CFLAGS" ; then
+    CFLAGS="${CFLAGS} -std=c11"
+  fi
 
   # Re-check ARCH if the compiler is a cross-compiler.
   if $CC -print-multiarch 1> /dev/null 2>&1 && test -n "$($CC -print-multiarch)" 1> /dev/null 2>&1; then