[vlc-devel] [PATCH] package: win32: Don't use linker script for import libraries

Martin Storsjö martin at martin.st
Wed Oct 9 10:50:38 CEST 2019


Previously, the original linker generated import libraries were
copied into the lib directory with names "libvlc.lib" and
"libvlccore.lib", only to be overwritten by dlltool in the next
step.

The duplication appeared in ab72243a1f1; before that, the files
were copied keeping their original names.

Later, 4ab7dfbf8fc added import libraries containing only linker
script, with names vlc.lib and vlccore.lib (which are picked up by
GNU ld but are an uncommon naming pattern for mingw libraries), as
a convenience for mingw toolchains, being able to only specify
-lvlc -lvlccore.

Instead of providing libraries (with the intention of being used
by mingw tools) with the more foreign (to mingw) names "vlc.lib"
and "vlccore.lib", name them "libvlc.dll.a" and "libvlccore.dll.a",
and make them a copy of the dlltool generated import library instead
of being a linker script (for compatibility with lld).
---
We could also just keep them named "vlc.lib"/"vlccore.lib", but I don't
see the point in that, if they are only there for the purpose of being
found and used by mingw tools.
---
 extras/package/win32/package.mak | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/extras/package/win32/package.mak b/extras/package/win32/package.mak
index 1ce3d8c58f..e31dad9e19 100644
--- a/extras/package/win32/package.mak
+++ b/extras/package/win32/package.mak
@@ -29,12 +29,10 @@ package-win-sdk: package-win-install
 	mkdir -p "$(win32_destdir)/sdk/lib/"
 	cp -r $(prefix)/include "$(win32_destdir)/sdk"
 	cp -r $(prefix)/lib/pkgconfig "$(win32_destdir)/sdk/lib"
-	cp -rv $(prefix)/lib/libvlc.dll.a "$(win32_destdir)/sdk/lib/libvlc.lib"
-	cp -rv $(prefix)/lib/libvlccore.dll.a "$(win32_destdir)/sdk/lib/libvlccore.lib"
 	$(DLLTOOL) -D libvlc.dll -l "$(win32_destdir)/sdk/lib/libvlc.lib" -d "$(top_builddir)/lib/.libs/libvlc.dll.def"
-	echo "INPUT(libvlc.lib)" > "$(win32_destdir)/sdk/lib/vlc.lib"
+	cp -rv "$(win32_destdir)/sdk/lib/libvlc.lib" "$(win32_destdir)/sdk/lib/libvlc.dll.a"
 	$(DLLTOOL) -D libvlccore.dll -l "$(win32_destdir)/sdk/lib/libvlccore.lib" -d "$(top_builddir)/src/.libs/libvlccore.dll.def"
-	echo "INPUT(libvlccore.lib)" > "$(win32_destdir)/sdk/lib/vlccore.lib"
+	cp -rv "$(win32_destdir)/sdk/lib/libvlccore.lib" "$(win32_destdir)/sdk/lib/libvlccore.dll.a"
 
 package-win-common: package-win-install package-win-sdk
 # Executables, major libs
-- 
2.17.1



More information about the vlc-devel mailing list