Alexandre Julliard : configure: Try to detect a C99 flag for the cross compiler.

Alexandre Julliard julliard at winehq.org
Fri Mar 25 15:28:08 CDT 2022


Module: wine
Branch: master
Commit: 0aa31b735cc18dbc643cb9ab2849223ae0e89ad6
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=0aa31b735cc18dbc643cb9ab2849223ae0e89ad6

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Fri Mar 25 11:18:37 2022 +0100

configure: Try to detect a C99 flag for the cross compiler.

Similar to what AC_PROC_CC does for the host compiler.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=52723
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 configure    | 35 +++++++++++++++++++++++++++++++++++
 configure.ac | 17 +++++++++++++++++
 2 files changed, 52 insertions(+)

diff --git a/configure b/configure
index 6a3a43a9e97..b2bec4e5b6d 100755
--- a/configure
+++ b/configure
@@ -10707,6 +10707,41 @@ then :
                                   CFLAGS="$CFLAGS $llvm_cflags"
 fi
         fi
+        { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CROSSCC option to enable C99 features" >&5
+printf %s "checking for $CROSSCC option to enable C99 features... " >&6; }
+        if test ${wine_cv_crosscc_c99+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+  wine_cv_crosscc_c99=no
+             for arg in '' '-std=gnu99'
+             do
+                 CC="$CROSSCC $arg"
+                 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+$ac_c_conftest_c99_program
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+  wine_cv_crosscc_c99=$arg
+else $as_nop
+  wine_cv_crosscc_c99=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
+                 test "x$wine_cv_crosscc_c99" != xno && break
+             done
+fi
+
+        case "x$wine_cv_crosscc_c99" in
+          x) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
+printf "%s\n" "none needed" >&6; } ;;
+          xno) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
+printf "%s\n" "unsupported" >&6; } ;;
+          x*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $wine_cv_crosscc_c99" >&5
+printf "%s\n" "$wine_cv_crosscc_c99" >&6; }
+              CROSSCC="$CROSSCC $wine_cv_crosscc_c99" ;;
+        esac
+
         { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the cross-compiler supports -fno-strict-aliasing" >&5
 printf %s "checking whether the cross-compiler supports -fno-strict-aliasing... " >&6; }
 if test ${ac_cv_crosscflags__fno_strict_aliasing+y}
diff --git a/configure.ac b/configure.ac
index 5a85fce12a4..e509b232d11 100644
--- a/configure.ac
+++ b/configure.ac
@@ -913,6 +913,23 @@ then
                                   AC_SUBST(DELAYLOADFLAG,["-Wl,-delayload,"])
                                   CFLAGS="$CFLAGS $llvm_cflags"])
         fi
+        AC_MSG_CHECKING([for $CROSSCC option to enable C99 features])
+        AC_CACHE_VAL([wine_cv_crosscc_c99],
+            [wine_cv_crosscc_c99=no
+             for arg in '' '-std=gnu99'
+             do
+                 CC="$CROSSCC $arg"
+                 AC_COMPILE_IFELSE([AC_LANG_SOURCE([$ac_c_conftest_c99_program])],
+                                   [wine_cv_crosscc_c99=$arg],[wine_cv_crosscc_c99=no])
+                 test "x$wine_cv_crosscc_c99" != xno && break
+             done])
+        case "x$wine_cv_crosscc_c99" in
+          x) AC_MSG_RESULT([none needed]) ;;
+          xno) AC_MSG_RESULT([unsupported]) ;;
+          x*) AC_MSG_RESULT([$wine_cv_crosscc_c99])
+              CROSSCC="$CROSSCC $wine_cv_crosscc_c99" ;;
+        esac
+
         WINE_TRY_CROSSCFLAGS([-fno-strict-aliasing])
         dnl clang needs to be told to fail on unknown options
         WINE_TRY_CROSSCFLAGS([-Werror=unknown-warning-option],[CFLAGS="$CFLAGS -Werror=unknown-warning-option"])




More information about the wine-cvs mailing list