]> git.ipfire.org Git - thirdparty/libtool.git/commitdiff
Fix deplibs check fallback for 64-bit Windows and Windows CE.
authorPierre Ossman <ossman@ossman.lkpg.cendio.se>
Mon, 22 Feb 2010 21:44:04 +0000 (22:44 +0100)
committerRalf Wildenhues <Ralf.Wildenhues@gmx.de>
Sun, 28 Feb 2010 04:46:16 +0000 (05:46 +0100)
* libltdl/m4/libtool.m4 (_LT_CHECK_MAGIC_METHOD): Accept file formats
'pe-arm-wince' and 'pe-x86-64'.  Add note about consistency with ...
* libltdl/config/ltmain.m4sh (func_win32_libid): ... the respective
pattern here; sync pattern from the former.
* tests/deplibs-mingw.at (deplibs without file command): New
file, new test.
* Makefile.am (TESTSUITE_AT): Update.
* NEWS: Update.

Signed-off-by: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
ChangeLog
Makefile.am
NEWS
libltdl/config/ltmain.m4sh
libltdl/m4/libtool.m4
tests/deplibs-mingw.at [new file with mode: 0644]

index 8445fbed19e6db97302a7176a3750169117f7123..19873a18160791cc38b736960d974a15740593a4 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,16 @@
+2010-02-28  Pierre Ossman  <ossman@ossman.lkpg.cendio.se>  (tiny change)
+            Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
+
+       Fix deplibs check fallback for 64-bit Windows and Windows CE.
+       * libltdl/m4/libtool.m4 (_LT_CHECK_MAGIC_METHOD): Accept file formats
+       'pe-arm-wince' and 'pe-x86-64'.  Add note about consistency with ...
+       * libltdl/config/ltmain.m4sh (func_win32_libid): ... the respective
+       pattern here; sync pattern from the former.
+       * tests/deplibs-mingw.at (deplibs without file command): New
+       file, new test.
+       * Makefile.am (TESTSUITE_AT): Update.
+       * NEWS: Update.
+
 2010-02-24  Scott McCreary  <scottmc2@gmail.com>  (tiny change)
 
        Update search path on Haiku for legacy system directory.
index 29a639a627e8d3edb1db5164c7d97a2f904e1e13..a7de46d5275563c43d989bbe615ddd38c1777b5f 100644 (file)
@@ -504,7 +504,8 @@ TESTSUITE_AT        = tests/testsuite.at \
                  tests/configure-iface.at \
                  tests/stresstest.at \
                  tests/cmdline_wrap.at \
-                 tests/darwin.at
+                 tests/darwin.at \
+                 tests/deplibs-mingw.at
 
 EXTRA_DIST     += $(srcdir)/$(TESTSUITE) $(TESTSUITE_AT) $(srcdir)/tests/package.m4
 
diff --git a/NEWS b/NEWS
index 61638fdb0150b3c4cd0a0881dc4a2f349ce79aea..00ab5c14df74b27f5c4689d345b7e2a3d31aa0dc 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -64,6 +64,7 @@ New in 2.2.8 2010-??-??: git version 2.2.7a, Libtool team:
     when using the compiler driver to link programs. Now "-Wc," is stripped
     just as it is when linking libraries through the compiler driver.
   - Symbol versioning works with the GNU gold linker now.
+  - Fixes for detection of shared library dependencies on MinGW systems.
 
 * Miscellaneous changes:
 
index 56b74977f5cbf63572f4382ea4fa9eaa36edd92c..8fcedc91b71e1c52eec900f18f7668df4daa0914 100644 (file)
@@ -2189,8 +2189,9 @@ func_win32_libid ()
     win32_libid_type="x86 archive import"
     ;;
   *ar\ archive*) # could be an import, or static
+    # Keep the egrep pattern in sync with the one in _LT_CHECK_MAGIC_METHOD.
     if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null |
-       $EGREP 'file format (pe-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' >/dev/null; then
+       $EGREP 'file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' >/dev/null; then
       win32_nmres=`eval $NM -f posix -A $1 |
        $SED -n -e '
            1,100{
index b538fa636e79ff65d4e415f5a99631789cab59ad..f99e618f1c47728c45d44ec5fe19ba6877379bf2 100644 (file)
@@ -3009,7 +3009,8 @@ mingw* | pw32*)
     lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
     lt_cv_file_magic_cmd='func_win32_libid'
   else
-    lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'
+    # Keep this pattern in sync with the one in func_win32_libid.
+    lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)'
     lt_cv_file_magic_cmd='$OBJDUMP -f'
   fi
   ;;
diff --git a/tests/deplibs-mingw.at b/tests/deplibs-mingw.at
new file mode 100644 (file)
index 0000000..68e8386
--- /dev/null
@@ -0,0 +1,93 @@
+# deplibs-mingw.at --                         -*- Autotest -*-
+
+#   Copyright (C) 2010 Free Software Foundation, Inc.
+#
+#   This file is part of GNU Libtool.
+#
+# GNU Libtool is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2 of
+# the License, or (at your option) any later version.
+#
+# GNU Libtool is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GNU Libtool; see the file COPYING.  If not, a copy
+# can be downloaded from  http://www.gnu.org/licenses/gpl.html,
+# or obtained by writing to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+####
+
+# Check that deplibs are detected correctly even if there is no `file'
+# command installed.
+
+AT_SETUP([deplibs without file command])
+AT_KEYWORDS([libtool])
+
+cwd=`pwd`
+instdir=$cwd/inst
+libdir=$instdir/lib
+bindir=$instdir/bin
+LDFLAGS="$LDFLAGS -no-undefined"
+
+mkdir inst inst/bin inst/lib
+
+AT_DATA([a.c],
+[[int a () { return 0; }
+]])
+AT_DATA([b.c],
+[[extern int a ();
+int b () { return a (); }
+]])
+
+for file in a.c b.c; do
+  $LIBTOOL --mode=compile $CC $CPPFLAGS $CFLAGS -c $file
+done
+AT_CHECK([$LIBTOOL --mode=link $CC $CFLAGS $LDFLAGS -o liba.la a.lo -rpath $libdir],
+        [], [ignore], [ignore])
+AT_CHECK([library_names= && . ./liba.la && if test -z "$library_names"; then exit 77; fi ],
+        [], [ignore], [ignore])
+AT_CHECK([$LIBTOOL --mode=install cp liba.la $libdir], [], [ignore], [ignore])
+AT_CHECK([$LIBTOOL --mode=clean rm -f liba.la], [], [ignore], [ignore])
+rm -f $libdir/liba.la
+
+# check once with `file' (if present) and once without, if on MinGW.
+for try in with-file without-file; do
+  AT_CHECK([$LIBTOOL --mode=link $CC $CFLAGS $LDFLAGS -o libb.la b.lo -rpath $libdir ]dnl
+          [-L$libdir -la],
+          [], [ignore], [ignore])
+  AT_CHECK([library_names= && . ./libb.la && if test -z "$library_names"; then exit 99; fi ],
+          [], [ignore], [ignore])
+
+  case $host_os in
+  mingw*)
+    if file /; then
+      mkdir bin new-libtool
+
+      cat >bin/file <<\EOF
+#! /bin/sh
+exit 1
+EOF
+      chmod +x bin/file
+      PATH=`pwd`/bin${PATH_SEPARATOR-:}$PATH
+      cd new-libtool
+      AT_CHECK(["$abs_top_srcdir"/configure $configure_options || exit 77],
+              [], [ignore], [ignore])
+      cd ..
+      LIBTOOL=new-libtool/libtool
+      export LIBTOOL
+      # Check whether the generated script is usable; otherwise, skip.
+      AT_CHECK([$LIBTOOL --mode=link $CC $CFLAGS $LDFLAGS -o libunrelated.la a.lo -rpath $libdir] dnl
+              [|| exit 77], [], [ignore], [ignore])
+    else
+      break;
+    fi;;
+  *)
+    break;;
+  esac
+done
+
+AT_CLEANUP