libtool-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Mingw-users] libtool, dlls and -lm


From: Ralf Wildenhues
Subject: Re: [Mingw-users] libtool, dlls and -lm
Date: Mon, 19 Dec 2005 14:01:08 +0100
User-agent: Mutt/1.5.11

[ getting libtool-patches into play; this thread is archived at
http://sourceforge.net/mailarchive/forum.php?thread_id=9231830&forum_id=5119 ]

* Pierre Ossman wrote on Mon, Dec 19, 2005 at 01:40:22PM CET:
> Ralf Wildenhues wrote:
> >
> >OK, thanks for doing this.  Now I need the output of
> >  i386-mingw32msvc-objdump -f \
> >    /usr/local/cross-w32/i386-mingw32msvc/lib/libwsock32.a
> >
> >and I should be able to produce a patch then.
> 
> It should be me thanking you for sorting this mess out. libtool is a bit 
> too much voodoo to me. :)

I agree that libtool has a long learning curve (not really steep,
because unfortunately it's hard to learn it quickly); I have not
yet found good ways to improve upon that without major rewrites
(and lots of documentation improvements to which I haven't found
the time yet nor the way to motivate others to do it ;-).

> $ crossenv-w32 i386-mingw32msvc-objdump -f \
>       /usr/local/cross-w32/i386-mingw32msvc/lib/libwsock32.a
> 
> In archive /usr/local/cross-w32/i386-mingw32msvc/lib/libwsock32.a:

OK.  Please try this patch.  It's a bit simple-minded, but should be
fairly safe.  You need to regenerate your configure script (and maybe
also aclocal.m4 and stuff) to pick up the libtool.m4 changes.

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?

Cheers,
Ralf

        * 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*)




reply via email to

[Prev in Thread] Current Thread [Next in Thread]