scripts: remove . from $PATH
Add CT_SanitizePath function which removes entries referring to ., /tmp
and non-existing directories from $PATH, and call it early in the
build script.
If . is in PATH, gcc-4.4.4 build breaks:
[ALL ] checking what assembler to use...
/tmp/build/targets/arm-unknown-linux-uclibcgnueabi/build/gcc-core-static/arm-unknown-linux-uclibcgnueabi/bin/as
...
[ALL ] config.status: creating as
i.e. "as" is supposed to be the arm-unknown-linux-uclibcgnueabi cross assembler,
but config.status creates a local "as" script which is calling the
host assembler.
Signed-off-by: Johannes Stezenbach <js@sig21.net>
[Yann E. MORIN: style fixes + explanations]
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
(transplanted from 20dd8cef1c8adff0aa3e78ae6d7acfbc45ed5a83)
1 GCC trunk now has multiple internal headers directories, one
2 containing the self-contained GCC-provided headers and one containing
3 the <limits.h> (not self-contained but including libc's <limits.h> or
4 a fixed version thereof) and the fixed headers; more such directories
5 may be added in future.
7 When glibc uses -nostdinc, it needs to use -isystem options for all
8 these internal directories. This patch teaches it about the
9 include-fixed directory (and is harmless with old GCC versions without
12 2007-03-18 Joseph Myers <joseph@codesourcery.com>
14 * configure.in: Also pass -isystem option for GCC's include-fixed
16 * configure: Regenerate.
19 --- glibc-2.3.6.ori/configure.in 2008-10-22 14:55:58.000000000 +0200
20 +++ glibc-2.3.6/configure.in 2008-10-22 14:56:15.000000000 +0200
22 # thing on a system that doesn't need fixincludes. (Not presently a problem.)
23 if test -n "$sysheaders"; then
24 ccheaders=`$CC -print-file-name=include`
25 - SYSINCLUDES="-nostdinc -isystem $ccheaders \
26 + SYSINCLUDES="-nostdinc -isystem $ccheaders -isystem $ccheaders-fixed \
27 -isystem `echo $sysheaders | sed 's/:/ -isystem /g'`"
30 --- glibc-2.3.6.ori/configure 2008-10-22 15:11:37.000000000 +0200
31 +++ glibc-2.3.6/configure 2008-10-22 15:11:54.000000000 +0200
33 # thing on a system that doesn't need fixincludes. (Not presently a problem.)
34 if test -n "$sysheaders"; then
35 ccheaders=`$CC -print-file-name=include`
36 - SYSINCLUDES="-nostdinc -isystem $ccheaders \
37 + SYSINCLUDES="-nostdinc -isystem $ccheaders -isystem $ccheaders-fixed \
38 -isystem `echo $sysheaders | sed 's/:/ -isystem /g'`"