diff --git a/configure b/configure index e7c478f536..0d5ffc60aa 100755 --- a/configure +++ b/configure @@ -2962,14 +2962,16 @@ fi # auto-detect default include and library search paths gccout=`$TEST_COMPILER $SYSROOT_FLAG $TEST_COMPILER_CXXFLAGS -xc++ -E -v - < /dev/null 2>&1 > /dev/null` +# extract from one line like 'LIBRARY_PATH=/one/path:/another/path:...' libdirs=`echo "$gccout" | sed -n -e 's/^LIBRARY_PATH=\(.*\)/\1/p'` -DEFAULT_LIBDIRS=`IFS=${HOST_DIRLIST_SEP}; for i in $libdirs; do test -d "$i" && cd "$i" && pwd; done | sort -u` +DEFAULT_LIBDIRS=`IFS=${HOST_DIRLIST_SEP}; for i in $libdirs; do test -d "$i" && cd "$i" && pwd; done` +# extract from indented lines between '#include <...> search starts here:' and 'End of search list.' DEFAULT_INCDIRS=`echo "$gccout" | awk ' /^End of search/ { yup=0 } / \(framework directory\)$/ { next } yup { print substr($0, 2) } /^\#include