* FAQ: updated FAQ with config file issues.
[vlc.git] / configure.ac.in
index 150c26a..da470c4 100644 (file)
@@ -98,7 +98,6 @@ case "x${target_os}" in
   x*mingw32*)
     SYS=mingw32
     AC_CHECK_TOOL(WINDRES, windres, :)
-    CFLAGS_save="${CFLAGS_save} -fnative-struct"; CFLAGS="${CFLAGS_save}"
     CPPFLAGS_save="${CPPFLAGS_save} -D_OFF_T_ -D_off_t=long"; CPPFLAGS="${CPPFLAGS_save}"
     LDFLAGS_vlc="${LDFLAGS_vlc} -lws2_32 -lnetapi32 -mwindows -Xlinker --force-exe-suffix"
     LDFLAGS_ipv4="${LDFLAGS_ipv4} -lws2_32"
@@ -144,15 +143,31 @@ AM_CONDITIONAL(HAVE_WIN32, test "x${SYS}" = "xmingw32")
 AC_MSG_CHECKING(for suffix of libraries)
 AC_MSG_RESULT(${LIBEXT})
 
+dnl Check for fnative-struct or mms-bitfields support for mingw32
+if test x$SYS = xmingw32
+then
+    AC_CACHE_CHECK([if \$CC accepts -mms-bitfields],
+        [ac_cv_c_mms_bitfields],
+        [CFLAGS="${CFLAGS_save} -mms-bitfields"
+         AC_TRY_COMPILE([],,ac_cv_c_mms_bitfields=yes, ac_cv_c_mms_bitfields=no)])
+    if test x"$ac_cv_c_mms_bitfields" != x"no"; then
+        CFLAGS_mingw32_special="-mms-bitfields"
+    else
+        CFLAGS_mingw32_special="-fnative-struct"
+    fi
+
+    CFLAGS_save="${CFLAGS_save} ${CFLAGS_mingw32_special}"; CFLAGS="${CFLAGS_save}"
+fi
+
 dnl Flags for plugin compilation
 case "x${SYS}" in
   xmingw32|xcygwin)
-    CFLAGS_pics="${CFLAGS_pics} -fnative-struct"
-    CXXFLAGS_pics="${CXXFLAGS_pics} -fnative-struct"
-    OBJCFLAGS_pics="${OBJCFLAGS_pics} -fnative-struct"
-    CFLAGS_plugins="${CFLAGS_plugins} -fnative-struct"
-    CXXFLAGS_plugins="${CXXFLAGS_plugins} -fnative-struct"
-    OBJCFLAGS_plugins="${OBJCFLAGS_plugins} -fnative-struct"
+    CFLAGS_pics="${CFLAGS_pics} ${CFLAGS_mingw32_special}"
+    CXXFLAGS_pics="${CXXFLAGS_pics} ${CFLAGS_mingw32_special}"
+    OBJCFLAGS_pics="${OBJCFLAGS_pics} ${CFLAGS_mingw32_special}"
+    CFLAGS_plugins="${CFLAGS_plugins} ${CFLAGS_mingw32_special}"
+    CXXFLAGS_plugins="${CXXFLAGS_plugins} ${CFLAGS_mingw32_special}"
+    OBJCFLAGS_plugins="${OBJCFLAGS_plugins} ${CFLAGS_mingw32_special}"
     ;;
   x*)
     CFLAGS_pics="${CFLAGS_pics} -fPIC"