Hi Peter, * Peter O'Gorman wrote on Wed, Jan 30, 2008 at 09:16:38AM CET: > Not much response last time, here we go again.
Sorry about the delay. > Ok to apply to branch-1-5 and forward port to HEAD? Nits below. FWIW, on Debian x86_64, this patch causes for me /usr/lib to appear in the front, with both 64bit mode (./configure) and 32bit mode (./configure CPPFLAGS=-m32 LDFLAGS=-m32). For Debian, the latter is wrong, /usr/lib64 is a symlink to /usr/lib. Before the patch, both modes looked better. A general question: do all these changes to multilib path searching not also increase the set of paths we search? Because that will rather significantly affect libtool performance in some cases. > +# Need LDFLAGS, but not with -L. > +_lt_ldflags= > +for _ld_flag in "$LDFLAGS"; do > + case "$_ld_flag" in > + -L*) ;; > + *) _lt_ldflags="$_ld_flag $_lt_ldflags" ;; > + esac > +done > +echo 'int main() { return 1;}' > conftest.c > +_lt_verbose_search_libs=`$CC $CFLAGS $CPPFLAGS $_lt_ldflags -o conftest -v > conftest.c 2>&1 | awk ' Please list CPPFLAGS before CFLAGS. > +BEGIN {lt_space=0;} /-L/ { > + for (lt_x=1; lt_x <= NF; lt_x++) { > + if ( substr($lt_x,1,2) == "-L") { > + lt_y=substr($lt_x,3,length($lt_x) -2); > + if (lt_space > 0) { print " "; } > + print lt_y; > + lt_space++; > + } > + } > +}' | awk ' > +BEGIN {RS=" "; FS="/|\n";} { For Solaris awk, FS must contain one character only. You could AC_REQUIRE([AC_PROG_AWK]) and use $AWK. Hmm, I see that this idiom was used before this patch already. Still, it will not do TRT on Solaris. Wait... this whole awk processing of paths used to be GNU/Linux only, now it is for all systems, but $GCC only. > + lt_foo=""; > + lt_count=0; > + for (lt_i = NF; lt_i > 0; lt_i--) { > + if ($lt_i != "" && $lt_i != ".") { > + if ($lt_i == "..") { > + lt_count++; > + } else { > + if (lt_count == 0) { > + lt_foo="/" $lt_i lt_foo; > + } else { > + lt_count--; > + } > + } > + } > + } > + if (lt_foo != "") { lt_freq[[lt_foo]]++; } > + if (lt_freq[[lt_foo]] == 1) { print lt_foo; } > +}'` > +rm -rf conftest* > +for _lt_verbose_search_lib in $_lt_verbose_search_libs; do > + case " $sys_lib_search_path_spec " in > + *" "$_lt_verbose_search_lib" "*) ;; > + *) sys_lib_search_path_spec="$_lt_verbose_search_lib > $sys_lib_search_path_spec" ;; > + esac > +done > +])