On 2013-09-10 15:00, Ozkan Sezer wrote: > On 9/10/13, Peter Rosin <p...@lysator.liu.se> wrote: >> On 2013-09-10 12:52, Ozkan Sezer wrote: >>> That effectively cripples libtool for cross-compilers. Can the behavior >>> be refined instead? Can you contact Charles Wilson about this? >> >> He should be reading this list, if he has time... >> >> Anyway, does this work? >> > > No, it does not. With this patch applied, I see > sys_lib_search_path_spec="/opt/W64_180676/lib/gcc " > .. in the libtool --config output.
Crap, I didn't do any final test and managed to exclude a couple of critical changes, and I did a couple of silly mistakes too. Sorry about that. Attached is what I should have sent the first time... > (Note that, this is not a multilib compiler: it targets only win64.) Even so, I believe that it outputs ../lib64 when you -print-multi-os-directory, right? Cheers, Peter
diff --git a/m4/libtool.m4 b/m4/libtool.m4 index 4418a1c..b0ec76a 100644 --- a/m4/libtool.m4 +++ b/m4/libtool.m4 @@ -2238,31 +2238,46 @@ if test yes = "$GCC"; then lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` 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" + lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/;/$lt_multi_os_dir" else test -d "$lt_sys_path" && \ - lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" + lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/;" fi done lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk ' BEGIN {RS = " "; FS = "/|\n";} { - lt_foo = ""; - lt_count = 0; + lt_canon_foo = ""; + lt_canon_count = 0; + lt_multi_foo = ""; + lt_multi_count = 0; + lt_multi = 1; for (lt_i = NF; lt_i > 0; lt_i--) { - if ($lt_i != "" && $lt_i != ".") { + if ($lt_i == ";") { + lt_multi = 0; + continue; + } + if ($lt_i == "" || $lt_i == ".") continue; + if (!lt_multi) { if ($lt_i == "..") { - lt_count++; + lt_canon_count++; + } else if (lt_canon_count == 0) { + lt_canon_foo = "/" $lt_i lt_canon_foo; } else { - if (lt_count == 0) { - lt_foo = "/" $lt_i lt_foo; - } else { - lt_count--; - } + lt_canon_count--; } } + if ($lt_i == "..") { + lt_multi_count++; + } else if (lt_multi_count == 0) { + lt_multi_foo = "/" $lt_i lt_multi_foo; + } else { + lt_multi_count--; + } } - if (lt_foo != "") { lt_freq[[lt_foo]]++; } - if (lt_freq[[lt_foo]] == 1) { print lt_foo; } + if (lt_canon_foo != "") { lt_canon_freq[[lt_canon_foo]]++; } + if (lt_canon_freq[[lt_multi_foo]]) { lt_multi_foo = lt_canon_foo; } + if (lt_multi_foo != "") { lt_multi_freq[[lt_multi_foo]]++; } + if (lt_multi_freq[[lt_multi_foo]] == 1) { print lt_multi_foo; } }'` # AWK program above erroneously prepends '/' to C:/dos/paths # for these hosts.
_______________________________________________ https://lists.gnu.org/mailman/listinfo/libtool