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

Edward Wang edward.c.wang at compdigitec.com
Thu Aug 30 18:52:32 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.
---
 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 a0d2eda..8966b05 100644
--- a/extras/package/win32/package.mak
+++ b/extras/package/win32/package.mak
@@ -75,9 +75,14 @@ if !HAVE_WINCE
 endif
 
 # 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