configure: Don't pass MSVC compiler options -M[TD] to armasm
authorMartin Storsjö <martin@martin.st>
Sun, 10 Aug 2014 11:40:09 +0000 (14:40 +0300)
committerMartin Storsjö <martin@martin.st>
Sun, 10 Aug 2014 18:29:06 +0000 (21:29 +0300)
The -MD option (for enabling a dynamically linked crt) gets interpreted
as a cpp option for generating dependency information (into a file named
'-.d', when preprocessing to a pipe). We shouldn't be passing
any and all C compiler flags to armasm (which is a plain assembler,
only with cpp bolted on via gas-preprocessor), but these are the
main conflicting ones.

Signed-off-by: Martin Storsjö <martin@martin.st>
configure

index 411af5e0b100a72b081c1a254a58bf011a313b44..a5ad34c2277b00f4c5968c1f21480d83413f099d 100755 (executable)
--- a/configure
+++ b/configure
@@ -2614,6 +2614,17 @@ EOF
     die "Sanity test failed."
 fi
 
+armasm_flags(){
+    for flag; do
+        case $flag in
+            # Filter out MSVC cl.exe options from cflags that shouldn't
+            # be passed to gas-preprocessor
+            -M[TD]*)                                            ;;
+            *)                  echo $flag                      ;;
+        esac
+   done
+}
+
 ccc_flags(){
     for flag; do
         case $flag in
@@ -2886,6 +2897,7 @@ probe_cc(){
         _ident=$($_cc | head -n1)
         # 4509: "This form of conditional instruction is deprecated"
         _flags="-nologo -ignore 4509"
+        _flags_filter=armasm_flags
     elif $_cc 2>&1 | grep -q Microsoft; then
         _type=msvc
         _ident=$($cc 2>&1 | head -n1)