Fix for mingw with MSVC9.
authorSimon Josefsson <simon@josefsson.org>
Sat, 7 Jan 2012 09:13:28 +0000 (10:13 +0100)
committerSimon Josefsson <simon@josefsson.org>
Sat, 7 Jan 2012 09:13:28 +0000 (10:13 +0100)
* m4/ld-version-script.m4: Check that compiler rejects version
scripts with syntax errors.  Reported by Bruno Haible
<bruno@clisp.org>.

ChangeLog
m4/ld-version-script.m4

index adbab93..2cb5f5f 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2012-01-07  Simon Josefsson  <simon@josefsson.org>
+
+       Fix for mingw with MSVC9.
+       * m4/ld-version-script.m4: Check that compiler rejects version
+       scripts with syntax errors.  Reported by Bruno Haible
+       <bruno@clisp.org>.
+
 2012-01-06  Bruno Haible  <bruno@clisp.org>
 
        Talk about "native Windows API", not "Woe32".
index fd8c043..5ed93ef 100644 (file)
@@ -1,4 +1,4 @@
-# ld-version-script.m4 serial 2
+# ld-version-script.m4 serial 3
 dnl Copyright (C) 2008-2012 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -26,6 +26,12 @@ AC_DEFUN([gl_LD_VERSION_SCRIPT],
     save_LDFLAGS="$LDFLAGS"
     LDFLAGS="$LDFLAGS -Wl,--version-script=conftest.map"
     cat > conftest.map <<EOF
+foo
+EOF
+    AC_LINK_IFELSE([AC_LANG_PROGRAM([], [])],
+                   [accepts_syntax_errors=yes], [accepts_syntax_errors=no])
+    if test "$accepts_syntax_errors" = no; then
+      cat > conftest.map <<EOF
 VERS_1 {
         global: sym;
 };
@@ -34,8 +40,11 @@ VERS_2 {
         global: sym;
 } VERS_1;
 EOF
-    AC_LINK_IFELSE([AC_LANG_PROGRAM([], [])],
-                   [have_ld_version_script=yes], [have_ld_version_script=no])
+      AC_LINK_IFELSE([AC_LANG_PROGRAM([], [])],
+                     [have_ld_version_script=yes], [have_ld_version_script=no])
+    else
+      have_ld_version_script=no
+    fi
     rm -f conftest.map
     LDFLAGS="$save_LDFLAGS"
     AC_MSG_RESULT($have_ld_version_script)