Use the paths found by ./configure in the ct-ng.in makefile script and its fragments.
/trunk/kconfig/kconfig.mk | 2 1 1 0 +-
/trunk/samples/samples.mk | 18 9 9 0 +++++++++---------
/trunk/config/config.mk | 10 5 5 0 +++++-----
/trunk/ct-ng.in | 22 13 9 0 +++++++++++++---------
4 files changed, 28 insertions(+), 24 deletions(-)
1.1 --- a/config/config.mk Sun Jan 25 22:59:55 2009 +0000
1.2 +++ b/config/config.mk Mon Jan 26 18:36:02 2009 +0000
1.3 @@ -84,11 +84,11 @@
1.4 echo ""; \
1.5 for entry in $(5); do \
1.6 file="$(4)/$${entry}.in"; \
1.7 - _entry=$$(echo "$${entry}" |sed -r -s -e 's/[-.+]/_/g;'); \
1.8 + _entry=$$(echo "$${entry}" |$(sed) -r -s -e 's/[-.+]/_/g;'); \
1.9 echo "config $(3)_$${_entry}"; \
1.10 echo " bool"; \
1.11 printf " prompt \"$${entry}"; \
1.12 - if grep -E '^# +EXPERIMENTAL$$' $${file} >/dev/null 2>&1; then \
1.13 + if $(grep) -E '^# +EXPERIMENTAL$$' $${file} >/dev/null 2>&1; then \
1.14 echo " (EXPERIMENTAL)\""; \
1.15 echo " depends on EXPERIMENTAL"; \
1.16 else \
1.17 @@ -99,7 +99,7 @@
1.18 echo "endchoice"; \
1.19 for entry in $(5); do \
1.20 file="$(4)/$${entry}.in"; \
1.21 - _entry=$$(echo "$${entry}" |sed -r -s -e 's/[-.+]/_/g;'); \
1.22 + _entry=$$(echo "$${entry}" |$(sed) -r -s -e 's/[-.+]/_/g;'); \
1.23 echo ""; \
1.24 echo "if $(3)_$${_entry}"; \
1.25 echo "config $(3)"; \
1.26 @@ -127,11 +127,11 @@
1.27 echo ""; \
1.28 for entry in $(5); do \
1.29 file="$(4)/$${entry}.in"; \
1.30 - _entry=$$(echo "$${entry}" |sed -r -s -e 's/[-.+]/_/g;'); \
1.31 + _entry=$$(echo "$${entry}" |$(sed) -r -s -e 's/[-.+]/_/g;'); \
1.32 echo "menuconfig $(3)_$${_entry}"; \
1.33 echo " bool"; \
1.34 printf " prompt \"$${entry}"; \
1.35 - if grep -E '^# +EXPERIMENTAL$$' $${file} >/dev/null 2>&1; then \
1.36 + if $(grep) -E '^# +EXPERIMENTAL$$' $${file} >/dev/null 2>&1; then \
1.37 echo " (EXPERIMENTAL)\""; \
1.38 echo " depends on EXPERIMENTAL"; \
1.39 else \
2.1 --- a/ct-ng.in Sun Jan 25 22:59:55 2009 +0000
2.2 +++ b/ct-ng.in Mon Jan 26 18:36:02 2009 +0000
2.3 @@ -6,12 +6,8 @@
2.4 # Don't use built-in rules, we know what we're doing
2.5 MAKEFLAGS += --no-print-directory --no-builtin-rules
2.6
2.7 -# Some distributions (eg. Ubuntu) thought it wise to point /bin/sh to
2.8 -# a truly POSIX-conforming shell, ash in this case. This is not so good
2.9 -# as we, smart (haha!) developers (as smart we ourselves think we are),
2.10 -# got used to bashisms, and are enclined to easiness... So force use of
2.11 -# bash. (Note: this is ugly, but ./configure checks for it).
2.12 -export SHELL=/bin/bash
2.13 +# Don't go parallel
2.14 +.NOTPARALLEL:
2.15
2.16 # This is where ct-ng is:
2.17 export CT_NG:=$(lastword $(MAKEFILE_LIST))
2.18 @@ -26,9 +22,17 @@
2.19 # This is crosstool-NG version string
2.20 export CT_VERSION:=@@CT_VERSION@@
2.21
2.22 -# Don't go parallel
2.23 -.NOTPARALLEL:
2.24 +# Paths found by ./configure
2.25 +include $(CT_LIB_DIR)/paths.mk
2.26
2.27 +# Some distributions (eg. Ubuntu) thought it wise to point /bin/sh to
2.28 +# a truly POSIX-conforming shell, ash in this case. This is not so good
2.29 +# as we, smart (haha!) developers (as smart we ourselves think we are),
2.30 +# got used to bashisms, and are enclined to easiness... So force use of
2.31 +# bash.
2.32 +export SHELL=$(bash)
2.33 +
2.34 +# Make the restart/stop steps availabe to scripts/crostool-NG.sh
2.35 export CT_STOP:=$(STOP)
2.36 export CT_RESTART:=$(RESTART)
2.37
2.38 @@ -123,7 +127,7 @@
2.39 $(SILENT)$(CT_LIB_DIR)/scripts/crosstool-NG.sh
2.40
2.41 build.%:
2.42 - $(SILENT)$(MAKE) -rf $(CT_NG) $(shell echo "$(@)" |sed -r -e 's|^([^.]+)\.([[:digit:]]+)$$|\1 CT_JOBS=\2|;')
2.43 + $(SILENT)$(MAKE) -rf $(CT_NG) $(shell echo "$(@)" |$(sed) -r -e 's|^([^.]+)\.([[:digit:]]+)$$|\1 CT_JOBS=\2|;')
2.44
2.45 PHONY += tarball
2.46 #tarball:
3.1 --- a/kconfig/kconfig.mk Sun Jan 25 22:59:55 2009 +0000
3.2 +++ b/kconfig/kconfig.mk Mon Jan 26 18:36:02 2009 +0000
3.3 @@ -131,7 +131,7 @@
3.4 %.dep: %.c $(CT_LIB_DIR)/kconfig/kconfig.mk
3.5 $(check_kconfig_dir)
3.6 @$(ECHO) " DEP $@"
3.7 - $(SILENT)$(HOST_CC) $(CFLAGS) $(EXTRA_CFLAGS) -MM $< |sed -r -e 's|([^:]+.o)( *:+)|$(<:.c=.o) $@\2|;' >$@
3.8 + $(SILENT)$(HOST_CC) $(CFLAGS) $(EXTRA_CFLAGS) -MM $< |$(sed) -r -e 's|([^:]+.o)( *:+)|$(<:.c=.o) $@\2|;' >$@
3.9
3.10 # Build C files
3.11 %.o: %.c $(CT_LIB_DIR)/kconfig/kconfig.mk
4.1 --- a/samples/samples.mk Sun Jan 25 22:59:55 2009 +0000
4.2 +++ b/samples/samples.mk Mon Jan 26 18:36:02 2009 +0000
4.3 @@ -39,7 +39,7 @@
4.4 # print the list of all available samples
4.5 PHONY += list-samples
4.6 list-samples: .FORCE
4.7 - @echo $(CT_SAMPLES) |sed -r -e 's/ /\n/g;' |sort
4.8 + @echo $(CT_SAMPLES) |$(sed) -r -e 's/ /\n/g;' |sort
4.9
4.10 wiki-samples:
4.11 $(SILENT)$(CT_LIB_DIR)/scripts/showSamples.sh -w $(CT_SAMPLES)
4.12 @@ -76,7 +76,7 @@
4.13 echo ; \
4.14 echo '***********************************************************'; \
4.15 )
4.16 - $(SILENT)if grep -E '^CT_EXPERIMENTAL=y$$' .config >/dev/null 2>&1; then \
4.17 + $(SILENT)if $(grep) -E '^CT_EXPERIMENTAL=y$$' .config >/dev/null 2>&1; then \
4.18 echo ; \
4.19 echo 'WARNING! This sample may enable experimental features.'; \
4.20 echo ' Please be sure to review the configuration prior'; \
4.21 @@ -97,12 +97,12 @@
4.22 define build_sample
4.23 @$(ECHO) ' CONF $(1)'
4.24 $(SILENT)cp $(call sample_dir,$(1))/crosstool.config .config
4.25 - $(SILENT)sed -i -r -e 's:^(CT_PREFIX_DIR=).*$$:\1"$(2)":;' .config
4.26 - $(SILENT)sed -i -r -e 's:^.*(CT_LOG_(WARN|INFO|EXTRA|DEBUG|ALL)).*$$:# \1 is not set:;' .config
4.27 - $(SILENT)sed -i -r -e 's:^.*(CT_LOG_ERROR).*$$:\1=y:;' .config
4.28 - $(SILENT)sed -i -r -e 's:^(CT_LOG_LEVEL_MAX)=.*$$:\1="ERROR":;' .config
4.29 - $(SILENT)sed -i -r -e 's:^.*(CT_LOG_TO_FILE).*$$:\1=y:;' .config
4.30 - $(SILENT)sed -i -r -e 's:^.*(CT_LOG_PROGRESS_BAR).*$$:\1=y:;' .config
4.31 + $(SILENT)$(sed) -i -r -e 's:^(CT_PREFIX_DIR=).*$$:\1"$(2)":;' .config
4.32 + $(SILENT)$(sed) -i -r -e 's:^.*(CT_LOG_(WARN|INFO|EXTRA|DEBUG|ALL)).*$$:# \1 is not set:;' .config
4.33 + $(SILENT)$(sed) -i -r -e 's:^.*(CT_LOG_ERROR).*$$:\1=y:;' .config
4.34 + $(SILENT)$(sed) -i -r -e 's:^(CT_LOG_LEVEL_MAX)=.*$$:\1="ERROR":;' .config
4.35 + $(SILENT)$(sed) -i -r -e 's:^.*(CT_LOG_TO_FILE).*$$:\1=y:;' .config
4.36 + $(SILENT)$(sed) -i -r -e 's:^.*(CT_LOG_PROGRESS_BAR).*$$:\1=y:;' .config
4.37 $(SILENT)$(MAKE) -rf $(CT_NG) V=0 oldconfig
4.38 @$(ECHO) ' BUILD $(1)'
4.39 $(SILENT)$(MAKE) -rf $(CT_NG) V=0 build
4.40 @@ -131,5 +131,5 @@
4.41
4.42 # Build all samples, overiding the number of // jobs per sample
4.43 build-all.%:
4.44 - $(SILENT)$(MAKE) -rf $(CT_NG) V=$(V) $(shell echo "$(@)" |sed -r -e 's|^([^.]+)\.([[:digit:]]+)$$|\1 CT_JOBS=\2|;')
4.45 + $(SILENT)$(MAKE) -rf $(CT_NG) V=$(V) $(shell echo "$(@)" |$(sed) -r -e 's|^([^.]+)\.([[:digit:]]+)$$|\1 CT_JOBS=\2|;')
4.46