mirror of
git://sourceware.org/git/newlib-cygwin.git
synced 2025-01-20 05:19:21 +08:00
b55e3f1916
ccwrap massages the compiler's standard include directories to remove '/usr/include/w32api', with the intent of allowing it to be overriden by '--with-windows-headers' (See 4c36016b). I'm not 100% convinced that this is always working as desired, since in some places w32api includes are done using <w32api/something.h>, which will find them via the path /usr/include. If this does turn out to be needed, this could also be implemented by constructing the appropriate compiler flags once, rather than on every compiler invocation.
39 lines
707 B
Plaintext
Executable File
39 lines
707 B
Plaintext
Executable File
realdirpath() {
|
|
[ -z "$1" ] && return 1
|
|
(cd "$1" 2>/dev/null && pwd)
|
|
if test $? -ne 0; then
|
|
return 1
|
|
else
|
|
return 0
|
|
fi
|
|
}
|
|
|
|
for d in . .. ../.. ../../..; do
|
|
if test -e "$srcdir/$d/configure.cygwin"; then
|
|
winsup_srcdir=$(realdirpath "$srcdir/$d")
|
|
break
|
|
fi
|
|
done
|
|
|
|
if test -z "$winsup_srcdir"; then
|
|
echo "cannot find directory containing configure.cygwin" 1>&2
|
|
exit 1
|
|
fi
|
|
|
|
case "$srcdir" in
|
|
*/newlib*) lookfor=newlib ;;
|
|
*/winsup*) lookfor=winsup ;;
|
|
*) lookfor=. ;;
|
|
esac
|
|
|
|
for d in . .. ../.. ../../..; do
|
|
if test -d "$d/$lookfor"; then
|
|
target_builddir=$(realdirpath "$d")
|
|
break
|
|
fi
|
|
done
|
|
|
|
if test -z "$target_builddir"; then
|
|
target_builddir=$(pwd)
|
|
fi
|