diff options
author | Waldemar Brodkorb <wbx@openadk.org> | 2014-03-30 18:12:41 +0200 |
---|---|---|
committer | Waldemar Brodkorb <wbx@openadk.org> | 2014-03-30 18:12:41 +0200 |
commit | 3b513e5acf1524d3974e90fdab332c2b794a622f (patch) | |
tree | 60f8324b6855252aa385bfc23025fc6b1a394c49 | |
parent | 44422107fcae7591bc9ee0ca54fa580160345e4a (diff) |
build host tools on demand, when not available on the host
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | mk/buildhlp.mk | 4 | ||||
-rw-r--r-- | mk/vars.mk | 12 | ||||
-rw-r--r-- | scripts/scan-tools.sh | 32 | ||||
-rw-r--r-- | target/config/Config.in.tools | 10 |
5 files changed, 47 insertions, 12 deletions
diff --git a/.gitignore b/.gitignore index b28f3e045..7fb0daba9 100644 --- a/.gitignore +++ b/.gitignore @@ -55,4 +55,5 @@ /target/config/Config.in.system /target/config/Config.in.native /target/config/Config.in.arch +/target/config/Config.in.prereq /target/m68k/aranym.cfg diff --git a/mk/buildhlp.mk b/mk/buildhlp.mk index 5ce3ca4a0..5b76fe5e1 100644 --- a/mk/buildhlp.mk +++ b/mk/buildhlp.mk @@ -46,7 +46,7 @@ endif ifeq ($(EXTRACT_OVERRIDE),1) ${MAKE} do-extract else - ${EXTRACT_CMD} + PATH='${HOST_PATH}' ${EXTRACT_CMD} endif @${MAKE} post-extract $(MAKE_TRACE) touch $@ @@ -62,7 +62,7 @@ endif ifeq ($(EXTRACT_OVERRIDE),1) ${MAKE} do-extract else - ${EXTRACT_CMD} + PATH='${HOST_PATH}' ${EXTRACT_CMD} endif @${MAKE} post-extract $(MAKE_TRACE) touch $@ diff --git a/mk/vars.mk b/mk/vars.mk index 042f519d7..3cf0a9344 100644 --- a/mk/vars.mk +++ b/mk/vars.mk @@ -211,21 +211,21 @@ EXTRACT_CMD= mkdir -p ${WRKDIR}; \ cd ${WRKDIR} && \ for file in ${FULLDISTFILES}; do case $$file in \ *.cpio) \ - cat $$file | $(STAGING_HOST_DIR)/usr/bin/cpio -i -d ;; \ + cat $$file | cpio -i -d ;; \ *.tar) \ tar -xf $$file ;; \ *.cpio.Z | *.cpio.gz | *.cgz | *.mcz) \ - gzip -dc $$file | $(STAGING_HOST_DIR)/usr/bin/cpio -i -d ;; \ + gzip -dc $$file | cpio -i -d ;; \ *.tar.xz | *.txz) \ - $(STAGING_HOST_DIR)/usr/bin/xz -dc $$file | tar -xf - ;; \ + xz -dc $$file | tar -xf - ;; \ *.tar.Z | *.tar.gz | *.taz | *.tgz) \ gzip -dc $$file | tar -xf - ;; \ *.cpio.bz2 | *.cbz) \ - $(STAGING_HOST_DIR)/usr/bin/bzip2 -dc $$file | $(STAGING_HOST_DIR)/usr/bin/cpio -i -d ;; \ + bzip2 -dc $$file | cpio -i -d ;; \ *.tar.bz2 | *.tbz | *.tbz2) \ - $(STAGING_HOST_DIR)/usr/bin/bzip2 -dc $$file | tar -xf - ;; \ + bzip2 -dc $$file | tar -xf - ;; \ *.zip) \ - cat $$file | $(STAGING_HOST_DIR)/usr/bin/cpio -ivd -H zip ;; \ + cat $$file | cpio -ivd -H zip ;; \ *.arm) \ cp $$file ${WRKDIR} ;; \ *) \ diff --git a/scripts/scan-tools.sh b/scripts/scan-tools.sh index c16aff609..8be02f690 100644 --- a/scripts/scan-tools.sh +++ b/scripts/scan-tools.sh @@ -208,6 +208,38 @@ if ! which g++ >/dev/null 2>&1; then out=1 fi +host_need_file=0 +if ! which file >/dev/null 2>&1; then + echo "No file found, will build one." + host_need_file=1 +fi + +host_need_bc=0 +if ! which bc >/dev/null 2>&1; then + echo "No bc found, will build one." + host_need_bc=1 +fi + +host_need_bzip2=0 +if ! which bzip2 >/dev/null 2>&1; then + echo "No bzip2 found, will build one." + host_need_bzip2=1 +fi + +host_need_xz=0 +if ! which xz >/dev/null 2>&1; then + echo "No xz found, will build one." + host_need_xz=1 +fi + +echo "config ADK_HOST_NEED_TOOLS" > $topdir/target/config/Config.in.prereq +printf "\t%s\n" "boolean" >> $topdir/target/config/Config.in.prereq +printf "\t%s\n" "default y" >> $topdir/target/config/Config.in.prereq +if [ $host_need_xz -eq 1 ];then printf "\t%s\n" "select ADK_HOST_NEED_XZ" >> $topdir/target/config/Config.in.prereq ;fi +if [ $host_need_bc -eq 1 ];then printf "\t%s\n" "select ADK_HOST_NEED_BC" >> $topdir/target/config/Config.in.prereq ;fi +if [ $host_need_file -eq 1 ];then printf "\t%s\n" "select ADK_HOST_NEED_FILE" >> $topdir/target/config/Config.in.prereq ;fi +if [ $host_need_bzip2 -eq 1 ];then printf "\t%s\n" "select ADK_HOST_NEED_BZIP2" >> $topdir/target/config/Config.in.prereq ;fi + cd $topdir rm -rf tmp diff --git a/target/config/Config.in.tools b/target/config/Config.in.tools index 8ef6ee2d7..c4c0ae23e 100644 --- a/target/config/Config.in.tools +++ b/target/config/Config.in.tools @@ -2,17 +2,17 @@ config ADK_HOST_NEED_HEIRLOOM_CPIO boolean default y -config ADK_HOST_NEED_BC +config ADK_HOST_NEED_MKCRYPT boolean default y -config ADK_HOST_NEED_MKCRYPT +config ADK_HOST_NEED_BC boolean - default y + default n config ADK_HOST_NEED_FILE boolean - default y + default n config ADK_HOST_NEED_BZIP2 boolean @@ -66,3 +66,5 @@ config ADK_HOST_NEED_PCRE boolean default y if ADK_HOST_DARWIN default n + +source "target/config/Config.in.prereq" |