From 46f758aebb134e90eeb52c34cd7c2ee827e3559e Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Tue, 26 May 2015 19:54:06 -0400 Subject: [PATCH] Fix a libtool issue with some mingw-w64 cross compilers (thanks, Ozkan!). http://debbugs.gnu.org/cgi/bugreport.cgi?bug=15321 http://git.savannah.gnu.org/gitweb/?p=libtool.git;a=commit;h=0ebb734910bf56186dd0c0e84b1c8be507bad336 Fixes Bugzilla #2722. --- acinclude/libtool.m4 | 17 ++++++++++++----- configure | 17 ++++++++++++----- 2 files changed, 24 insertions(+), 10 deletions(-) diff --git a/acinclude/libtool.m4 b/acinclude/libtool.m4 index c444a5ed05a86..0eb07c8afe50a 100644 --- a/acinclude/libtool.m4 +++ b/acinclude/libtool.m4 @@ -2186,13 +2186,20 @@ if test "$GCC" = yes; then ;; esac # Ok, now we have the path, separated by spaces, we can step through it - # and add multilib dir if necessary. + # and add multilib dir if necessary... lt_tmp_lt_search_path_spec= - lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` + lt_multi_os_dir=/`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` + # ...but if some path already ends with the multilib dir we assume + # that all is fine and trust -print-search-dirs as is (GCC 4.2 or newer). + case "$lt_multi_os_dir; $lt_search_path_spec " in + "/; "* | "/.; "* | "/./; "* | *"$lt_multi_os_dir "* | *"$lt_multi_os_dir/ "*) + lt_multi_os_dir= + ;; + esac for lt_sys_path in $lt_search_path_spec; do - if test -d "$lt_sys_path/$lt_multi_os_dir"; then - lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir" - else + if test -d "$lt_sys_path$lt_multi_os_dir"; then + lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path$lt_multi_os_dir" + elif test -n "$lt_multi_os_dir"; then test -d "$lt_sys_path" && \ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" fi diff --git a/configure b/configure index 19a8a31fd3737..3049e0c2fb609 100755 --- a/configure +++ b/configure @@ -9912,13 +9912,20 @@ if test "$GCC" = yes; then ;; esac # Ok, now we have the path, separated by spaces, we can step through it - # and add multilib dir if necessary. + # and add multilib dir if necessary... lt_tmp_lt_search_path_spec= - lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` + lt_multi_os_dir=/`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` + # ...but if some path already ends with the multilib dir we assume + # that all is fine and trust -print-search-dirs as is (GCC 4.2 or newer). + case "$lt_multi_os_dir; $lt_search_path_spec " in + "/; "* | "/.; "* | "/./; "* | *"$lt_multi_os_dir "* | *"$lt_multi_os_dir/ "*) + lt_multi_os_dir= + ;; + esac for lt_sys_path in $lt_search_path_spec; do - if test -d "$lt_sys_path/$lt_multi_os_dir"; then - lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir" - else + if test -d "$lt_sys_path$lt_multi_os_dir"; then + lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path$lt_multi_os_dir" + elif test -n "$lt_multi_os_dir"; then test -d "$lt_sys_path" && \ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" fi