[vlc-commits] configure: Simplify mingw flag checks

Marvin Scholz git at videolan.org
Wed Feb 21 21:27:45 CET 2018


vlc | branch: master | Marvin Scholz <epirat07 at gmail.com> | Thu Nov 30 11:05:53 2017 +0100| [2aea8b85a2b013dd4bee5a88a6400bd364df50db] | committer: Marvin Scholz

configure: Simplify mingw flag checks

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=2aea8b85a2b013dd4bee5a88a6400bd364df50db
---

 configure.ac | 24 +++++++++---------------
 1 file changed, 9 insertions(+), 15 deletions(-)

diff --git a/configure.ac b/configure.ac
index 4e7f8db990..705e71ca41 100644
--- a/configure.ac
+++ b/configure.ac
@@ -541,21 +541,15 @@ dnl Check for broken versions of mingw-runtime compatability library
     ])
 
     dnl Check for fnative-struct or mms-bitfields support for mingw32
-    VLC_SAVE_FLAGS
-    CFLAGS="${CFLAGS} -mms-bitfields"
-    CXXFLAGS="${CXXFLAGS} -mms-bitfields"
-    AC_CACHE_CHECK([if \$CC accepts -mms-bitfields],
-        [ac_cv_c_mms_bitfields],
-        [AC_TRY_COMPILE([],,ac_cv_c_mms_bitfields=yes, ac_cv_c_mms_bitfields=no)])
-    if test "${ac_cv_c_mms_bitfields}" = "no"; then
-        VLC_RESTORE_FLAGS
-        CFLAGS="${CFLAGS} -fnative-struct"
-        CXXFLAGS="${CXXFLAGS} -fnative-struct"
-        AC_CACHE_CHECK([if \$CC accepts -fnative-struct],
-            [ac_cv_c_fnative_struct],
-            [AC_TRY_COMPILE([],,ac_cv_c_fnative_struct=yes, ac_cv_c_fnative_struct=no)])
-        "${ac_cv_c_fnative_struct}" = "no" && VLC_RESTORE_FLAGS
-    fi
+    AX_CHECK_COMPILE_FLAG([-mms-bitfields], [
+        AX_APPEND_FLAG([-mms-bitfields], [CFLAGS])
+        AX_APPEND_FLAG([-mms-bitfields], [CXXFLAGS])
+    ], [
+        AX_CHECK_COMPILE_FLAG([-fnative-struct], [
+            AX_APPEND_FLAG([-fnative-struct], [CFLAGS])
+            AX_APPEND_FLAG([-fnative-struct], [CXXFLAGS])
+        ])
+    ])
 ])
 
 



More information about the vlc-commits mailing list