-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 29.04.2014 14:34, YIRAN LI wrote: > Hi friends, > > I'm now moving my ffmpeg build from MinGW to Mingw-w64 because the latter > supports delay load. To be a bit more specific, ffmpeg could dynamically > link to many external libraries, but I want these external libs be > downloaded and used only when they are used (functions called). > > For example, there'a libspeex for which I configured with ./configure > --enable-static=no --prefix=/mingw, so these files are generated > libspeex-1.dll, libspeex.dll.a libspeex.la. > > According to this article > http://mingw-users.1079350.n2.nabble.com/Delayloading-windows- > libraries-Finally-the-real-deal-td7472183.html, > > what I need to do is: > > 1. gendef libspeex-1.dll to get the libspeex-1.def 2. dlltool --def > libspeex-1.def --output-delaylib libspeex.dll.a > > so the old libspeex.dll.a is replaced by the newly generated one, and > 'make install' will install header files and all lib files into mingw > folder.
A more elegant (or braindead, YMMV) solution is to hack configure.ac of the package in question and add this for *-*-mingw* hosts: archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --output-def - -Xlinker $lib.def && $DLLTOOL --dllname $soname --def $lib.def - --output-delaylib $lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base; $DLLTOOL --dllname $soname --def $output_objdir/$soname.def --output-delaylib $lib' This code is a verbatim copy of libtool that is patched to create a delay-load import library instead of the normal import library. This takes advantage of the fact that libtool does have a .def file at hand already, and thus there's no need to call gendef. > > But what I want to know is, what's the libspeex.la ? Should I also > regenerate it or just install the old ones? .la files are libtool helpers. IMO they are useful (roughly as useful as libtool itself) when you build a package, and Makefile.am files SHOULD refer to .la files by name when needing to link to a library produced within the same package. However, they are a hindrance when linking package libraries from outside (as they remember all kinds of nasty details, absolute paths and such). Therefore i strongly recommend against installing .la files (i routinely purge anything a package installs, looking for .la files and deleting them with extreme prejudice). dll.a import (with or without delay-loading) libraries in /mingw/lib should be enough (and for anything more complex there's pkgconfig). - -- O< ascii ribbon - stop html email! - www.asciiribbon.org -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (MingW32) iQEcBAEBAgAGBQJTX4+cAAoJEOs4Jb6SI2CwMLsIAMGDB4a1QWb0RO7A4OrjF0XX S00vzJcKV3cY+S5iN4SIlgJSxqyXEAq79DjYzVCvtMvNyY0RhVDvmFxU5rPCFtNU N5fDTEEdeya/z08zIzfENIrCRRH70yYskKYWDJXlqCxXOBVfozaPOFawJEoEMd6x 1DXCkvVO6ivlSfPM/qMwTSRJbFHAp3Ia+MyicFtxmXZK2bJ6KRMdJU2G2Ntei+xG MWpc6zud6sLjqTweeWEzdod2ThEY6/o9TR+0Z12JR2sFeTfSaUDEpGEq6Wsi+poP maVZk/qb3yKZT8iy+zTPWRnvvl90ZQJbAFT/9Ckrgmq+wfev8GKarUnGG9VI6DI= =2L2j -----END PGP SIGNATURE----- ------------------------------------------------------------------------------ "Accelerate Dev Cycles with Automated Cross-Browser Testing - For FREE Instantly run your Selenium tests across 300+ browser/OS combos. Get unparalleled scalability from the best Selenium testing platform available. Simple to use. Nothing to install. Get started now for free." http://p.sf.net/sfu/SauceLabs _______________________________________________ Mingw-w64-public mailing list Mingw-w64-public@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mingw-w64-public