Alternatively, just to try whether this works at all, you could
edit the libtool script directly and change
deplibs_check_method="file_magic ^x86 archive import|^x86 DLL"
and
file_magic_cmd="func_win32_libid"
once for each tag (for C: at the beginning of the script; for C++ etc.
at the very end).
Question to libtool folks: OK to apply this patch?
* libtool.m4 (AC_DEPLIBS_CHECK_METHOD) [ mingw, pw32 ]:
If `file' is present, use `func_win32_libid' rather than
`objdump -f', to facilitate cross-compilation.
Reported by Pierre Ossman <address@hidden>.
Index: libtool.m4
===================================================================
RCS file: /cvsroot/libtool/libtool/Attic/libtool.m4,v
retrieving revision 1.314.2.145
diff -u -r1.314.2.145 libtool.m4
--- libtool.m4 18 Dec 2005 22:14:06 -0000 1.314.2.145
+++ libtool.m4 19 Dec 2005 12:47:58 -0000
@@ -2295,9 +2295,15 @@
mingw* | pw32*)
# Base MSYS/MinGW do not provide the 'file' command needed by
- # func_win32_libid shell function, so use a weaker test based on 'objdump'.
- lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture:
i386)?'
- lt_cv_file_magic_cmd='$OBJDUMP -f'
+ # func_win32_libid shell function, so use a weaker test based on 'objdump',
+ # unless we find 'file', for example because we are cross-compiling.
+ if ( file / ) >/dev/null 2>&1; then
+ 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)?'
+ lt_cv_file_magic_cmd='$OBJDUMP -f'
+ fi
;;
darwin* | rhapsody*)