Fix -std option in configure script

Signed-off-by: Vladislav Shchapov <vladislav@shchapov.ru>
GitOrigin-RevId: d27ff46e8acbbcbd20f2959342ea12434abfe768
Change-Id: I4e07fadada2a763db53760222fce106284a1d798
diff --git a/configure b/configure
index 1c7a1ea..620aebd 100755
--- a/configure
+++ b/configure
@@ -300,7 +300,9 @@
 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