|
From: | Peter O'Gorman |
Subject: | Re: AC_LIBTOOL_SYS_DYNAMIC_LINKER "gcc -print-search-dirs" problem |
Date: | Fri, 15 Sep 2006 00:22:30 +0900 |
On Sep 14, 2006, at 4:18 AM, Kate Minola wrote:
Ralf, Peter, Why not use the output of "gcc -print-search-dirs" and, for every directory that ends with "lib", append the value returned by "gcc -print-multi-os-directory"? Naturally one will have to "backup" directories such as /usr/lib/gcc/x86_64-linux-gnu/4.0.3/../../.. to realize that it ends with "lib". (Other than writing a program, I do not see an easy way to do this last bit.)
Well, because I would rather use the flags that the compiler actually uses rather than the ones it says it uses, I'm still not sure that my method is best though...
While looking into a patch for this, I notice that sys_lib_search_path_spec is not a tagged var, so we run it for each compiler for each tag, with the latest one it finds being the final answer. Does not seem quite right to me.
I also came up with the awk expression from hell :-)sys_lib_search_path_spec=`$CC $compilerFLAGS $CPPFLAGS $LDFLAGS -v -o conftest /dev/null 2>&1 | $AWK 'BEGIN {RS=" "; FS="/"; } /^-L\// {sub ("-L",""); sub("//","/"); sub("/./","/");sub("/$","");foo="";for (i = NF; i > 0; i--) if ($i == "..") count++;else if (count == 0) if (foo == "")foo=$i; else foo=$i "/" foo; else count--;} { if (foo != "") freq[foo]++; if (freq[foo] == 1)print foo;}'`
Peter
[Prev in Thread] | Current Thread | [Next in Thread] |