summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWaldemar Brodkorb <wbx@openadk.org>2014-03-30 19:00:41 +0200
committerWaldemar Brodkorb <wbx@openadk.org>2014-03-30 19:00:41 +0200
commit9c8476bd6abc1994ca54b195c92f826de707cc5f (patch)
tree790c72555b836567b0831d1c992d0fadb2cae79b
parentf3df2950b77b1d2cd5ec60820e9b92ff299619c2 (diff)
build hosttools only when not available or required
-rw-r--r--adk/tools/depmaker.c2
-rw-r--r--scripts/scan-tools.sh81
-rw-r--r--target/config/Config.in.tools76
3 files changed, 127 insertions, 32 deletions
diff --git a/adk/tools/depmaker.c b/adk/tools/depmaker.c
index 23d2d2898..9682fb969 100644
--- a/adk/tools/depmaker.c
+++ b/adk/tools/depmaker.c
@@ -174,7 +174,7 @@ int main() {
!(strncmp(pkgdirp->d_name, "glibc", 5) == 0)) {
/* print result to stdout */
printf("package-$(ADK_COMPILE_%s) += %s\n", pkgvar, pkgdirp->d_name);
- printf("hostpackage-$(ADK_HOST_NEED_%s) += %s\n", pkgvar, pkgdirp->d_name);
+ printf("hostpackage-$(ADK_HOST_BUILD_%s) += %s\n", pkgvar, pkgdirp->d_name);
}
if ((pkgdeps = malloc(MAXLINE)) != NULL)
diff --git a/scripts/scan-tools.sh b/scripts/scan-tools.sh
index 8be02f690..f5d101d6e 100644
--- a/scripts/scan-tools.sh
+++ b/scripts/scan-tools.sh
@@ -208,37 +208,84 @@ 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
+# always required, but can be provided by host
+host_build_bc=0
if ! which bc >/dev/null 2>&1; then
echo "No bc found, will build one."
- host_need_bc=1
+ host_build_bc=1
+fi
+
+host_build_bison=0
+if ! which bison >/dev/null 2>&1; then
+ echo "No bison found, will build one."
+ host_build_bison=1
fi
-host_need_bzip2=0
+host_build_bzip2=0
if ! which bzip2 >/dev/null 2>&1; then
echo "No bzip2 found, will build one."
- host_need_bzip2=1
+ host_build_bzip2=1
fi
-host_need_xz=0
+host_build_file=0
+if ! which file >/dev/null 2>&1; then
+ echo "No file found, will build one."
+ host_build_file=1
+fi
+
+host_build_flex=0
+if ! which flex >/dev/null 2>&1; then
+ echo "No flex found, will build one."
+ host_build_m4=1
+fi
+
+host_build_m4=0
+if ! which m4 >/dev/null 2>&1; then
+ echo "No m4 found, will build one."
+ host_build_m4=1
+fi
+
+host_build_xz=0
if ! which xz >/dev/null 2>&1; then
echo "No xz found, will build one."
- host_need_xz=1
+ host_build_xz=1
+fi
+
+# optional
+host_build_ccache=0
+if ! which ccache >/dev/null 2>&1; then
+ echo "No ccache found, will build one when required."
+ host_build_ccache=1
fi
-echo "config ADK_HOST_NEED_TOOLS" > $topdir/target/config/Config.in.prereq
+host_build_lzma=0
+if ! which lzma >/dev/null 2>&1; then
+ echo "No lzma found, will build one when required."
+ host_build_lzma=1
+fi
+
+host_build_lzop=0
+if ! which lzop >/dev/null 2>&1; then
+ echo "No lzop found, will build one when required."
+ host_build_lzop=1
+fi
+
+
+echo "config ADK_HOST_BUILD_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
+# always required
+if [ $host_build_bc -eq 1 ];then printf "\t%s\n" "select ADK_HOST_BUILD_BC" >> $topdir/target/config/Config.in.prereq ;fi
+if [ $host_build_bison -eq 1 ];then printf "\t%s\n" "select ADK_HOST_BUILD_BISON" >> $topdir/target/config/Config.in.prereq ;fi
+if [ $host_build_bzip2 -eq 1 ];then printf "\t%s\n" "select ADK_HOST_BUILD_BZIP2" >> $topdir/target/config/Config.in.prereq ;fi
+if [ $host_build_file -eq 1 ];then printf "\t%s\n" "select ADK_HOST_BUILD_FILE" >> $topdir/target/config/Config.in.prereq ;fi
+if [ $host_build_flex -eq 1 ];then printf "\t%s\n" "select ADK_HOST_BUILD_FLEX" >> $topdir/target/config/Config.in.prereq ;fi
+if [ $host_build_m4 -eq 1 ];then printf "\t%s\n" "select ADK_HOST_BUILD_M4" >> $topdir/target/config/Config.in.prereq ;fi
+if [ $host_build_xz -eq 1 ];then printf "\t%s\n" "select ADK_HOST_BUILD_XZ" >> $topdir/target/config/Config.in.prereq ;fi
+# optional
+if [ $host_build_ccache -eq 1 ];then printf "\t%s\n" "select ADK_HOST_BUILD_CCACHE if ADK_HOST_NEED_CCACHE" >> $topdir/target/config/Config.in.prereq ;fi
+if [ $host_build_lzma -eq 1 ];then printf "\t%s\n" "select ADK_HOST_BUILD_LZMA if ADK_HOST_NEED_LZMA" >> $topdir/target/config/Config.in.prereq ;fi
+if [ $host_build_lzop -eq 1 ];then printf "\t%s\n" "select ADK_HOST_BUILD_LZOP if ADK_HOST_NEED_LZOP" >> $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 c4c0ae23e..0e7816fca 100644
--- a/target/config/Config.in.tools
+++ b/target/config/Config.in.tools
@@ -1,36 +1,59 @@
-config ADK_HOST_NEED_HEIRLOOM_CPIO
+# always required from OpenADK
+config ADK_HOST_BUILD_HEIRLOOM_CPIO
boolean
default y
-config ADK_HOST_NEED_MKCRYPT
+config ADK_HOST_BUILD_MKCRYPT
boolean
default y
-config ADK_HOST_NEED_BC
+# always required, but can be provided by host
+config ADK_HOST_BUILD_BASH
boolean
default n
-config ADK_HOST_NEED_FILE
+config ADK_HOST_BUILD_BC
boolean
default n
-config ADK_HOST_NEED_BZIP2
+config ADK_HOST_BUILD_BISON
boolean
default n
-config ADK_HOST_NEED_CDRTOOLS
+config ADK_HOST_BUILD_BZIP2
boolean
default n
-config ADK_HOST_NEED_SYSLINUX
+config ADK_HOST_BUILD_FILE
+ boolean
+ default n
+
+config ADK_HOST_BUILD_FLEX
boolean
default n
-config ADK_HOST_NEED_SQUASHFS
+config ADK_HOST_BUILD_M4
boolean
default n
-config ADK_HOST_NEED_MTD_UTILS
+config ADK_HOST_BUILD_XZ
+ boolean
+ default n
+
+# optional, but can be provided by host
+config ADK_HOST_NEED_CCACHE
+ boolean
+ default n
+
+config ADK_HOST_BUILD_CCACHE
+ boolean
+ default n
+
+config ADK_HOST_NEED_CDRTOOLS
+ boolean
+ default n
+
+config ADK_HOST_BUILD_CDRTOOLS
boolean
default n
@@ -38,7 +61,7 @@ config ADK_HOST_NEED_GENEXT2FS
boolean
default n
-config ADK_HOST_NEED_LZOP
+config ADK_HOST_BUILD_GENEXT2FS
boolean
default n
@@ -46,15 +69,15 @@ config ADK_HOST_NEED_LZMA
boolean
default n
-config ADK_HOST_NEED_XZ
+config ADK_HOST_BUILD_LZMA
boolean
default n
-config ADK_HOST_NEED_CCACHE
+config ADK_HOST_NEED_LZOP
boolean
default n
-config ADK_HOST_NEED_MKIMAGE
+config ADK_HOST_BUILD_LZOP
boolean
default n
@@ -62,7 +85,32 @@ config ADK_HOST_NEED_MKSH
boolean
default n
-config ADK_HOST_NEED_PCRE
+config ADK_HOST_BUILD_MKSH
+ boolean
+ default n
+
+config ADK_HOST_NEED_SYSLINUX
+ boolean
+ default n
+
+config ADK_HOST_BUILD_SYSLINUX
+ boolean
+ default n
+
+# optional, must be used from OpenADK
+config ADK_HOST_BUILD_MTD_UTILS
+ boolean
+ default n
+
+config ADK_HOST_BUILD_SQUASHFS
+ boolean
+ default n
+
+config ADK_HOST_BUILD_MKIMAGE
+ boolean
+ default n
+
+config ADK_HOST_BUILD_PCRE
boolean
default y if ADK_HOST_DARWIN
default n