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 # Makefile for each steps
2 # Copyright 2006 Yann E. MORIN <yann.morin.1998@anciens.enib.fr>
4 # ----------------------------------------------------------
5 # This is the steps help entry
8 @echo ' list-steps - List all build steps'
11 @echo ' STOP=step - Stop the build just after this step (list with list-steps)'
12 @echo ' RESTART=step - Restart the build just before this step (list with list-steps)'
14 # ----------------------------------------------------------
17 # Please keep the last line with a '\' and keep the following empy line:
18 # it helps when diffing and merging.
19 CT_STEPS := libc_check_config \
44 # Make the list available to sub-processes (scripts/crosstool-NG.sh needs it)
47 # Print the steps list
50 @echo 'Available build steps, in order:'
51 @for step in $(CT_STEPS); do \
54 @echo 'Use "<step>" as action to execute only that step.'
55 @echo 'Use "+<step>" as action to execute up to that step.'
56 @echo 'Use "<step>+" as action to execute from that step onward.'
58 # ----------------------------------------------------------
59 # This part deals with executing steps
62 $(SILENT)$(MAKE) -rf $(CT_NG) V=$(V) RESTART=$@ STOP=$@ build
64 $(patsubst %,+%,$(CT_STEPS)):
65 $(SILENT)$(MAKE) -rf $(CT_NG) V=$(V) STOP=$(patsubst +%,%,$@) build
67 $(patsubst %,%+,$(CT_STEPS)):
68 $(SILENT)$(MAKE) -rf $(CT_NG) V=$(V) RESTART=$(patsubst %+,%,$@) build