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

Rafaël Carré funman at videolan.org
Thu Aug 30 18:05:47 CEST 2012


Hello,

Le 2012-08-30 17:51, Edward Wang a écrit :
> 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 |   13 ++++++++++---
>  1 files changed, 10 insertions(+), 3 deletions(-)
> 
> diff --git a/extras/package/win32/package.mak b/extras/package/win32/package.mak
> index a0d2eda..c5a7fe6 100644
> --- a/extras/package/win32/package.mak
> +++ b/extras/package/win32/package.mak
> @@ -75,9 +75,16 @@ 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` ;\
> +	OIFS=$$IFS ;\
> +	IFS=':' ;\
> +	for x in $$library_path_list ;\
> +	do \
> +		cp "$$x/libstdc++-6.dll" "$$x/libgcc_s_sjlj-1.dll" "$(win32_destdir)/" ; true ;\
> +	done ;\
> +	IFS=$$OIFS

You don't need to save IFS variable since single Makefile statements are
run in a subshell

>  
>  # SDK
>  	mkdir -p "$(win32_destdir)/sdk/lib/"
> 




More information about the vlc-devel mailing list