windows: Compile with -mno-ms-bitfields if option not set explicitly
authorMartin Willi <martin@revosec.ch>
Tue, 3 Jun 2014 09:06:50 +0000 (11:06 +0200)
committerMartin Willi <martin@revosec.ch>
Wed, 4 Jun 2014 13:53:13 +0000 (15:53 +0200)
-mms-bitfields is the default in newer MinGWs, but it breaks
__attribute__((packed)).

configure.ac

index 20e4032..d069a16 100644 (file)
@@ -746,6 +746,11 @@ AC_COMPILE_IFELSE(
                windows=true
                openssl_lib=eay32
                AC_SUBST(PTHREADLIB, "")
+               # explicitly disable ms-bitfields, as it breaks __attribute__((packed))
+               case "$CFLAGS" in
+                       *ms-bitfields*) ;;
+                       *) CFLAGS="$CFLAGS -mno-ms-bitfields" ;;
+               esac
        ],
        [
                AC_MSG_RESULT([no])