[vlc-devel] [PATCH] Win32: Check for the shared libgcc in all LIBRARY_PATHs

Edward Wang edward.c.wang at compdigitec.com
Wed Sep 5 02:46:52 CEST 2012


Some mingw-w64 3.0 toolchains like mine, for example, have those DLLs in the second or possibly third field of LIBRARY_PATH. Skipping these could lead to weird C++ dlopen errors.
---
 Rebased

 extras/package/win32/package.mak |   11 ++++++++---
 1 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/extras/package/win32/package.mak b/extras/package/win32/package.mak
index 7bcab42..9de0d1c 100644
--- a/extras/package/win32/package.mak
+++ b/extras/package/win32/package.mak
@@ -68,9 +68,14 @@ endif
 	cp "$(top_builddir)/npapi-vlc/installed/lib/npvlc.dll" "$(win32_destdir)/"
 
 # Compiler shared DLLs, when using compilers built with --enable-shared
-# If gcc_s_sjlj/stdc++-6 DLLs exist, our C++ modules were linked to them
-	gcc_lib_dir=`$(CXX) -v /dev/null 2>&1 | grep ^LIBRARY_PATH|cut -d= -f2|cut -d: -f1` ; \
-	cp "$${gcc_lib_dir}/libstdc++-6.dll" "$${gcc_lib_dir}/libgcc_s_sjlj-1.dll" "$(win32_destdir)/" ; true
+# The shared DLLs may not necessarily be in the first LIBRARY_PATH, we
+# should check them all.
+	library_path_list=`$(CXX) -v /dev/null 2>&1 | grep ^LIBRARY_PATH|cut -d= -f2` ;\
+	IFS=':' ;\
+	for x in $$library_path_list ;\
+	do \
+		cp "$$x/libstdc++-6.dll" "$$x/libgcc_s_sjlj-1.dll" "$(win32_destdir)/" ; true ;\
+	done
 
 # SDK
 	mkdir -p "$(win32_destdir)/sdk/lib/"
-- 
1.7.5.4




More information about the vlc-devel mailing list