Browse Source

rework prereq check

The new prereq check is completely implemented in
POSIX shell in scripts/prereq.sh.

It combines the old features from Makefile, scan-tools.sh,
scan-pkgs.sh, reloc.sh and some wrappers for tools.

The big benefit is to have all portability stuff in one place.
Furthermore we can compile GNU make and bash on the fly, for
systems lacking the required tools.
All changes on the host are detected on the fly, no make
prereq required anymore.

The build process is separated in following three phases:
1. small wrapper Makefile is used for BSD make or GNU make
2. prereq.sh is called, doing all checking, calling Makefile.adk
3. old logic in Makefile.adk or mk/build.mk is used

Tested successfully on Linux, MacOS X, Cygwin, FreeBSD, OpenBSD
and NetBSD.

An old depmaker bug was fixed, only optional host tools are compiled.
For example, even when a host provides xz, a local xz was compiled
in the past, because other packages had a build dependency on it.

Signed-off-by: Waldemar Brodkorb <wbx@openadk.org>
Waldemar Brodkorb 8 years ago
parent
commit
a94d74d9c8

+ 1 - 2
.gitignore

@@ -30,12 +30,11 @@
 /toolchain_*/
 /.ADK_HAVE_DOT_CONFIG
 /.tmpconfig.h
-/.prereq_done
 /.config*
 /.busyboxcfg
 /.rebuild.*
 /.defconfig
-/.adkinit
+/.firstrun
 /.menu
 /all.config
 /target_*/

+ 0 - 27
BSDmakefile

@@ -1,27 +0,0 @@
-# This file is part of the OpenADK project. OpenADK is copyrighted
-# material, please see the LICENCE file in the top-level directory.
-
-ADK_TOPDIR=		${.CURDIR}
-PWD=		${.CURDIR}
-
-.include "${.CURDIR}/Makefile.inc"
-
-.if defined(package) && !empty(package)
-subdir:=	package/${package}
-.  if !make(clean)
-_subdir_dep:=	${ADK_TOPDIR}/.config
-.  endif
-.endif
-
-.if defined(subdir) && !empty(subdir)
-_subdir:=	${.TARGETS}
-${.TARGETS}: _subdir
-
-_subdir: ${_subdir_dep}
-	cd ${.CURDIR}/${subdir} && ADK_TOPDIR=${.CURDIR} DEVELOPER=1 \
-	    ${GMAKE} ADK_VERBOSE=1 ${.MFLAGS} ${_subdir}
-
-.  include "${.CURDIR}/prereq.mk"
-.else
-.  include "${.CURDIR}/Makefile"
-.endif

+ 4 - 4
Config.in

@@ -10,7 +10,7 @@ config ADK_MODULES
 	default y
 
 config ADK_HAVE_DOT_CONFIG
-	boolean
+	bool
 	default y
 
 source "target/config/Config.in.appliances"
@@ -44,7 +44,7 @@ menu "Package options"
 	visible if !ADK_CHOOSE_APPLIANCE
 
 config ADK_LEAVE_ETC_ALONE
-	boolean "do not install anything into /etc"
+	bool "do not install anything into /etc"
 	default n
 	help
 	  Enabling this option will prevent the ADK from installing anything
@@ -60,7 +60,7 @@ config ADK_LEAVE_ETC_ALONE
 	  on will almost certainly render the resulting system unusable.
 
 config ADK_INSTALL_PACKAGE_INIT_SCRIPTS
-	boolean "ship custom init-scripts along with packages"
+	bool "ship custom init-scripts along with packages"
 	default y
 	depends on !ADK_LEAVE_ETC_ALONE
 	help
@@ -72,7 +72,7 @@ config ADK_INSTALL_PACKAGE_INIT_SCRIPTS
 	  off will almost certainly render the resulting system unusable.
 
 config ADK_INSTALL_PACKAGE_NETWORK_SCRIPTS
-	boolean "ship custom network-scripts along with packages"
+	bool "ship custom network-scripts along with packages"
 	default y
 	depends on !ADK_LEAVE_ETC_ALONE
 	help

+ 0 - 24
GNUmakefile

@@ -1,24 +0,0 @@
-# This file is part of the OpenADK project. OpenADK is copyrighted
-# material, please see the LICENCE file in the top-level directory.
-
-ADK_TOPDIR:=	$(shell pwd)
-PWD:=		${ADK_TOPDIR}
-
-include Makefile.inc
-
-ifneq (${package},)
-subdir:=	package/${package}
-_subdir_dep:=	${ADK_TOPDIR}/.config
-endif
-
-ifneq (${subdir},)
-${MAKECMDGOALS}: _subdir
-
-_subdir: ${_subdir_dep}
-	cd ${subdir} && ADK_TOPDIR=${ADK_TOPDIR} DEVELOPER=1 \
-	    make ADK_VERBOSE=1 ${MAKEFLAGS} ${MAKECMDGOALS}
-
-include prereq.mk
-else
-include Makefile
-endif

+ 4 - 217
Makefile

@@ -1,221 +1,8 @@
 # This file is part of the OpenADK project. OpenADK is copyrighted
 # material, please see the LICENCE file in the top-level directory.
 
-_UNLIMIT=	__limit=$$(ulimit -dH 2>/dev/null); \
-		test -n "$$__limit" && ulimit -Sd $$__limit; ulimit -n 1024;
+# GNU make and BSD make compatible make file wrapper
+MAKECMDGOALS+= ${.TARGETS}
 
-all: .prereq_done checkreloc
-	@${_UNLIMIT} ${GMAKE_INV} all
-
-v: .prereq_done
-	@(echo; echo "Build started on $$(LC_ALL=C LANGUAGE=C date)"; \
-	    set -x; ${_UNLIMIT} ${GMAKE_FMK} ADK_VERBOSE=1 all) 2>&1 | tee -a make.log
-
-help:
-	@echo 'Configuration targets:'
-	@echo '  config       - Update current config utilising a line-oriented program'
-	@echo '  menuconfig   - Update current config utilising a menu based program'
-	@echo '                 (default when .config does not exist)'
-	@echo '  oldconfig    - Update current config utilising a provided .configs base'
-	@echo '  defconfig    - New config with defaults'
-	@echo '  allmodconfig - New config selecting all symbols with m'
-	@echo '  allyesconfig - New config selecting all symbols with y'
-	@echo '  allnoconfig  - New config where all options are answered with no'
-	@echo ''
-	@echo 'Help targets:'
-	@echo '  help         - Print this help text'
-	@echo '  pkg-help     - Print help about selectively compiling single packages'
-	@echo '  dev-help     - Print help for developers / package maintainers'
-	@echo ''
-	@echo 'Common targets:'
-	@echo '  download     - fetches all needed distfiles'
-	@echo '  kernelconfig - view the target kernel configuration'
-	@echo ''
-	@echo 'Cleaning targets:'
-	@echo '  clean        - Remove firmware and build directories'
-	@echo '  cleandir     - Same as "clean", but also remove all built toolchains'
-	@echo '  cleansystem  - Same as "cleandir", but only remove active system'
-	@echo '  cleankernel  - Remove kernel dir, useful if you changed any kernel patches'
-	@echo '  distclean    - Same as "cleandir", but also remove downloaded'
-	@echo '                 distfiles and .config'
-	@echo ''
-	@echo 'Other generic targets:'
-	@echo '  all          - Build everything as specified in .config'
-	@echo '                 (default if .config exists)'
-	@echo '  v            - Same as "all" but with logging to make.log enabled'
-
-pkg-help:
-	@echo 'Package specific targets (use with "package=<pkg-name>" parameter):'
-	@echo '  fetch        - Download the necessary distfile'
-	@echo '  extract      - Same as "fetch", but also extract the distfile'
-	@echo '  patch        - Same as "extract", but also patch the source'
-	@echo '  build        - Same as "patch", but also build the binaries'
-	@echo '  fake         - Same as "build", but also install the binaries'
-	@echo '  package      - Same as "fake", but also create the package'
-	@echo '  clean        - Deinstall and remove the build area'
-	@echo '  distclean    - Same as "clean", but also remove the distfiles'
-	@echo ''
-	@echo 'Short package rebuilding guide:'
-	@echo '  run "make package=<pkgname> clean" to remove all generated binaries'
-	@echo '  run "make package=<pkgname> package" to build everything and create the package(s)'
-	@echo ''
-	@echo 'This does not automatically resolve package dependencies!'
-
-dev-help:
-	@echo 'Fast way of updating package patches:'
-	@echo '  run "make package=<pkgname> clean" to start with a good base'
-	@echo '  run "make package=<pkgname> patch" to fetch, unpack and patch the source'
-	@echo '  edit the package sources at build_dir/w-<pkgname>-*/<pkgname>-<version>'
-	@echo '  run "make package=<pkgname> update-patches" to regenerate patch files'
-	@echo ''
-	@echo 'All changed patches will be opened with your $$EDITOR,'
-	@echo 'so you can add a description and verify the modifications.'
-	@echo ''
-	@echo 'Adding a new package:'
-	@echo 'make PKG=foo VER=1.0 newpackage'
-	@echo 'Adding a new simple library package:'
-	@echo 'make PKG=foo VER=1.0 TYPE=lib newpackage'
-	@echo 'Adding a new simple program package:'
-	@echo 'make PKG=foo VER=1.0 TYPE=prog newpackage'
-
-clean: .prereq_done
-	-@rm -f nohup.out
-	@${GMAKE_INV} clean
-
-config: .prereq_done
-	@${GMAKE_INV} _config W=
-
-oldconfig: .prereq_done
-	@${GMAKE_INV} _config W=--oldconfig
-
-download: .prereq_done
-	@${GMAKE_INV} toolchain/download
-	@${GMAKE_INV} dep
-	@${GMAKE_INV} package/download
-
-cleankernel kernelclean: .prereq_done
-	-@${GMAKE_INV} cleankernel
-
-cleandir dirclean: .prereq_done
-	-@${GMAKE_INV} cleandir
-	@-rm -f make.log .prereq_done
-
-cleansystem: .prereq_done
-	-@${GMAKE_INV} cleansystem
-	@-rm -f make.log .prereq_done
-
-distclean cleandist:
-	-@${GMAKE_INV} distclean
-	@-rm -f make.log .prereq_done
-
-image: .prereq_done
-	@${GMAKE_INV} image
-
-targethelp: .prereq_done
-	@${GMAKE_INV} targethelp
-
-kernelconfig: .prereq_done
-	@${GMAKE_INV} kernelconfig
-
-newpackage: .prereq_done
-	@${GMAKE_INV} newpackage
-
-image_clean imageclean cleanimage: .prereq_done
-	@${GMAKE_INV} image_clean
-
-menuconfig: .prereq_done
-	@${GMAKE_INV} menuconfig
-
-defconfig: .prereq_done
-	@${GMAKE_INV} defconfig
-
-allnoconfig: .prereq_done
-	@${GMAKE_INV} KCONFIG_ALLCONFIG=all.config _config W=--allnoconfig
-
-allyesconfig: .prereq_done
-	@${GMAKE_INV} KCONFIG_ALLCONFIG=all.config _config W=--allyesconfig
-
-allmodconfig: .prereq_done
-	@${GMAKE_INV} KCONFIG_ALLCONFIG=all.config _config W=--allmodconfig
-
-package_index: .prereq_done
-	@${GMAKE_INV} package_index
-
-buildall: .prereq_done
-	@${GMAKE_INV} buildall
-
-check: .prereq_done
-	@${GMAKE_INV} check
-
-check-gcc: .prereq_done
-	@${GMAKE_INV} check-gcc
-
-check-g++: .prereq_done
-	@${GMAKE_INV} check-g++
-
-menu: .prereq_done
-	@${GMAKE_INV} menu
-
-dep: .prereq_done
-	@${GMAKE_INV} dep
-
-world: .prereq_done
-	@${GMAKE_INV} world
-
-prereq:
-	@rm -f .prereq_done
-	@${GMAKE} .prereq_done
-
-prereq-noerror:
-	@rm -f .prereq_done
-	@${GMAKE} .prereq_done NO_ERROR=1
-
-NO_ERROR=0
-.prereq_done:
-	@-rm -rf .prereq_done
-	@if ! bash --version 2>&1 | grep -F 'GNU bash' >/dev/null 2>&1; then \
-		echo "GNU bash needs to be installed."; \
-		exit 1; \
-	fi
-	@echo "ADK_TOPDIR:=$$(readlink -nf . 2>/dev/null || pwd -P)" >prereq.mk
-	@echo "BASH:=$$(which bash)" >>prereq.mk
-	@if [ -z "$$(which gmake 2>/dev/null )" ]; then \
-		echo "GMAKE:=$$(which make)" >>prereq.mk ;\
-	else \
-		echo "GMAKE:=$$(which gmake)" >>prereq.mk ;\
-	fi
-	@echo "GNU_HOST_NAME:=$$(${CC} -dumpmachine)" >>prereq.mk
-	@echo "ARCH_FOR_BUILD:=$$(${CC} -dumpmachine | sed \
-	    -e 's/x86_64-linux-gnux32/x32/' \
-	    -e s'/-.*//' \
-	    -e 's/sparc.*/sparc/' \
-	    -e 's/armeb.*/armeb/g' \
-	    -e 's/arm.*/arm/g' \
-	    -e 's/m68k.*/m68k/' \
-	    -e 's/sh[234]/sh/' \
-	    -e 's/mips-.*/mips/' \
-	    -e 's/mipsel-.*/mipsel/' \
-	    -e 's/i[3-9]86/x86/' \
-	    )" >>prereq.mk
-	@echo 'HOST_CC:=${CC}' >>prereq.mk
-	@echo 'HOST_CXX:=${CXX}' >>prereq.mk
-	@echo 'LANGUAGE:=C' >>prereq.mk
-	@echo 'LC_ALL:=C' >>prereq.mk
-	@echo 'MAKE:=$${GMAKE}' >>prereq.mk
-	@echo "OStype:=$$(env uname)" >>prereq.mk
-	@echo "_PATH:=$$PATH" >>prereq.mk
-	@echo "PATH:=\$${ADK_TOPDIR}/scripts:/usr/sbin:$$PATH" >>prereq.mk
-	@echo "SHELL:=$$(which bash)" >>prereq.mk
-	@echo "GIT:=$$(which git 2>/dev/null)" >>prereq.mk
-	@env NO_ERROR=${NO_ERROR} BASH="$$(which bash)" \
-		CC='${CC}' CPPFLAGS='${CPPFLAGS}' \
-	    	bash scripts/scan-tools.sh
-	@echo '===> Prerequisites checked successfully.'
-	@touch .adkinit
-	@touch $@
-
-checkreloc:
-	@bash scripts/reloc.sh
-
-.PHONY: prereq prereq-noerror checkreloc
-# DO NOT DELETE
+all v help targethelp kernelconfig image menuconfig download clean cleankernel cleansystem cleandir distclean hostclean hostpackage fetch package extract patch dep menu:
+	@./scripts/prereq.sh ${MAKECMDGOALS}

+ 179 - 0
Makefile.adk

@@ -0,0 +1,179 @@
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+ADK_TOPDIR:=	$(shell pwd)
+GMAKE_FMK=	${MAKE} -f $(PWD)/mk/build.mk
+GMAKE_INV=	${GMAKE_FMK} --no-print-directory
+
+_UNLIMIT=	__limit=$$(ulimit -dH 2>/dev/null); \
+		test -n "$$__limit" && ulimit -Sd $$__limit; ulimit -n 1024;
+
+ifneq (${package},)
+subdir:=	package/${package}
+_subdir_dep:=	${ADK_TOPDIR}/.config
+endif
+
+ifneq (${subdir},)
+${MAKECMDGOALS}: _subdir
+
+_subdir: ${_subdir_dep}
+	cd ${subdir} && ADK_TOPDIR=${ADK_TOPDIR} DEVELOPER=1 \
+	    $(MAKE) ADK_VERBOSE=1 ${MAKECMDGOALS}
+
+endif
+
+all:
+	@${_UNLIMIT} $(GMAKE_INV) world
+
+v:
+	@(echo; echo "Build started on $$(LC_ALL=C LANGUAGE=C date)"; \
+	    set -x; ${_UNLIMIT} ${GMAKE_FMK} ADK_VERBOSE=1 all) 2>&1 | tee -a make.log
+
+help:
+	@echo 'Configuration targets:'
+	@echo '  config       - Update current config utilising a line-oriented program'
+	@echo '  menuconfig   - Update current config utilising a menu based program'
+	@echo '                 (default when .config does not exist)'
+	@echo '  oldconfig    - Update current config utilising a provided .configs base'
+	@echo '  defconfig    - New config with defaults'
+	@echo '  allmodconfig - New config selecting all symbols with m'
+	@echo '  allyesconfig - New config selecting all symbols with y'
+	@echo '  allnoconfig  - New config where all options are answered with no'
+	@echo ''
+	@echo 'Help targets:'
+	@echo '  help         - Print this help text'
+	@echo '  pkg-help     - Print help about selectively compiling single packages'
+	@echo '  dev-help     - Print help for developers / package maintainers'
+	@echo ''
+	@echo 'Common targets:'
+	@echo '  download     - fetches all needed distfiles'
+	@echo '  kernelconfig - view the target kernel configuration'
+	@echo ''
+	@echo 'Cleaning targets:'
+	@echo '  clean        - Remove firmware and build directories'
+	@echo '  cleandir     - Same as "clean", but also remove all built toolchains'
+	@echo '  cleansystem  - Same as "cleandir", but only remove active system'
+	@echo '  cleankernel  - Remove kernel dir, useful if you changed any kernel patches'
+	@echo '  distclean    - Same as "cleandir", but also remove downloaded'
+	@echo '                 distfiles and .config'
+	@echo ''
+	@echo 'Other generic targets:'
+	@echo '  all          - Build everything as specified in .config'
+	@echo '                 (default if .config exists)'
+	@echo '  v            - Same as "all" but with logging to make.log enabled'
+
+pkg-help:
+	@echo 'Package specific targets (use with "package=<pkg-name>" parameter):'
+	@echo '  fetch        - Download the necessary distfile'
+	@echo '  extract      - Same as "fetch", but also extract the distfile'
+	@echo '  patch        - Same as "extract", but also patch the source'
+	@echo '  build        - Same as "patch", but also build the binaries'
+	@echo '  fake         - Same as "build", but also install the binaries'
+	@echo '  package      - Same as "fake", but also create the package'
+	@echo '  clean        - Deinstall and remove the build area'
+	@echo '  distclean    - Same as "clean", but also remove the distfiles'
+	@echo ''
+	@echo 'Short package rebuilding guide:'
+	@echo '  run "make package=<pkgname> clean" to remove all generated binaries'
+	@echo '  run "make package=<pkgname> package" to build everything and create the package(s)'
+	@echo ''
+	@echo 'This does not automatically resolve package dependencies!'
+
+dev-help:
+	@echo 'Fast way of updating package patches:'
+	@echo '  run "make package=<pkgname> clean" to start with a good base'
+	@echo '  run "make package=<pkgname> patch" to fetch, unpack and patch the source'
+	@echo '  edit the package sources at build_dir/w-<pkgname>-*/<pkgname>-<version>'
+	@echo '  run "make package=<pkgname> update-patches" to regenerate patch files'
+	@echo ''
+	@echo 'All changed patches will be opened with your $$EDITOR,'
+	@echo 'so you can add a description and verify the modifications.'
+	@echo ''
+	@echo 'Adding a new package:'
+	@echo 'make PKG=foo VER=1.0 newpackage'
+	@echo 'Adding a new simple library package:'
+	@echo 'make PKG=foo VER=1.0 TYPE=lib newpackage'
+	@echo 'Adding a new simple program package:'
+	@echo 'make PKG=foo VER=1.0 TYPE=prog newpackage'
+
+clean:
+	@${GMAKE_INV} clean
+
+config:
+	@${GMAKE_INV} _config W=
+
+oldconfig:
+	@${GMAKE_INV} _config W=--oldconfig
+
+download:
+	@${GMAKE_INV} toolchain/download
+	@${GMAKE_INV} dep
+	@${GMAKE_INV} package/download
+
+cleankernel:
+	-@${GMAKE_INV} cleankernel
+
+cleandir:
+	-@${GMAKE_INV} cleandir
+
+cleansystem:
+	-@${GMAKE_INV} cleansystem
+
+distclean:
+	-${GMAKE_INV} distclean
+
+image:
+	@${GMAKE_INV} image
+
+targethelp:
+	@${GMAKE_INV} targethelp
+
+kernelconfig:
+	@${GMAKE_INV} kernelconfig
+
+newpackage:
+	@${GMAKE_INV} newpackage
+
+image_clean imageclean cleanimage:
+	@${GMAKE_INV} image_clean
+
+menuconfig:
+	@${GMAKE_INV} menuconfig
+
+defconfig:
+	@${GMAKE_INV} defconfig
+
+allnoconfig:
+	@${GMAKE_INV} KCONFIG_ALLCONFIG=all.config _config W=--allnoconfig
+
+allyesconfig:
+	@${GMAKE_INV} KCONFIG_ALLCONFIG=all.config _config W=--allyesconfig
+
+allmodconfig:
+	@${GMAKE_INV} KCONFIG_ALLCONFIG=all.config _config W=--allmodconfig
+
+package_index:
+	@${GMAKE_INV} package_index
+
+buildall:
+	@${GMAKE_INV} buildall
+
+check:
+	@${GMAKE_INV} check
+
+check-gcc:
+	@${GMAKE_INV} check-gcc
+
+check-g++:
+	@${GMAKE_INV} check-g++
+
+menu:
+	@${GMAKE_INV} menu
+
+dep:
+	@${GMAKE_INV} dep
+
+world:
+	@${GMAKE_INV} world
+
+# DO NOT DELETE

+ 0 - 4
Makefile.inc

@@ -1,4 +0,0 @@
-CC?=		gcc
-GMAKE?=		env ${GMAKE_ENV} $(PWD)/scripts/make
-GMAKE_FMK=	${GMAKE} -f $(PWD)/mk/build.mk
-GMAKE_INV=	${GMAKE_FMK} --no-print-directory

+ 5 - 6
README

@@ -4,26 +4,25 @@ OpenADK - An embedded Linux construction kit
 This is a menu based buildsystem for your embedded Linux system.
 
 Before you can start you need to install some software:
-- bash
 - gcc or clang
 - g++ or clang++
 - binutils 
-- GNU make
+- make
 - tar
 - gzip
-- wget
 - perl
+- curl or wget
 - c library headers
 - ncurses library and header
-- zlib library and header
 
 There is a check for the required versions of these software in advance, though.
-(to re-issue the checks, use "make prereq").
+Most of the needed software for the build process to succeed will
+be compiled before the target build starts.
 
 Please use "make menuconfig" to choose your target architecture and
 embedded system and configure like you want to.
 
-Simply running 'make' will build the firmware for your embedded system.  The
+Simply running 'make' will build the firmware for your embedded system. The
 buildsystem will download all sources, build the toolchain, the kernel and all
 applications.
 

+ 5 - 5
adk/config/Makefile

@@ -69,19 +69,19 @@ MCONF_OBJS=$(patsubst %.c,%.o, $(MCONF_SRC))
 SHARED_OBJS=$(patsubst %.c,%.o, $(SHARED_SRC))
 
 conf: $(CONF_OBJS) $(SHARED_OBJS)
-	@$(HOST_CC) $(HOST_CFLAGS) $^ -o $@
+	@$(HOST_CC) $(HOST_CFLAGS) $^ -o $@ 2>/dev/null
 
 mconf: $(MCONF_OBJS) $(SHARED_OBJS)
-	@$(HOST_CC) $(HOST_CFLAGS) $^ -o $@ $(LIBS)
+	@$(HOST_CC) $(HOST_CFLAGS) $^ -o $@ $(LIBS) 2>/dev/null
 
 $(CONF_OBJS): %.o : %.c $(SHARED_DEPS)
-	@$(HOST_CC) $(HOST_CFLAGS) -I. -c $< -o $@
+	@$(HOST_CC) $(HOST_CFLAGS) -I. -c $< -o $@ 2>/dev/null
 
 $(MCONF_OBJS): %.o : %.c $(SHARED_DEPS)
-	@$(HOST_CC) $(HOST_CFLAGS) -I. -c $< -o $@
+	@$(HOST_CC) $(HOST_CFLAGS) -I. -c $< -o $@ 2>/dev/null
 
 glob.o: glob.c $(SHARED_DEPS)
-	@$(HOST_CC) $(HOST_CFLAGS) -I. -c glob.c -o $@
+	@$(HOST_CC) $(HOST_CFLAGS) -I. -c glob.c -o $@ 2>/dev/null
 
 lkc_defs.h: lkc_proto.h
 	@sed < $< > $@ 's/P(\([^,]*\),.*/#define \1 (\*\1_p)/'

+ 49 - 3
adk/tools/depmaker.c

@@ -1,7 +1,7 @@
 /*
  * depmaker - create package/Depends.mk for OpenADK buildsystem
  *
- * Copyright (C) 2010-2014 Waldemar Brodkorb <wbx@openadk.org>
+ * Copyright (C) 2010-2015 Waldemar Brodkorb <wbx@openadk.org>
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -67,8 +67,9 @@ static int check_symbol(char *symbol) {
 /*@null@*/
 static char *parse_line(char *package, char *pkgvar, char *string, int checksym, int pprefix, int system, int *prefixp) {
 
-	char *key, *value, *dep, *key_sym, *pkgdeps;
+	char *key, *value, *dep, *key_sym, *pkgdeps, *depvar;
 	char temp[MAXLINE];
+	int i;
 
 	string[strlen(string)-1] = '\0';
 	if ((key = strtok(string, ":=")) == NULL) {
@@ -121,6 +122,51 @@ static char *parse_line(char *package, char *pkgvar, char *string, int checksym,
 	value = strtok(NULL, "=\t");
 	dep = strtok(value, " ");
 	while (dep != NULL) {
+		/* check only for optional host tools, if they are required to build */
+		if (checksym == 2) {
+			if ((depvar = malloc(MAXLINE)) != NULL)
+				memset(depvar, 0, MAXLINE);
+			else {
+				perror("Can not allocate memory.");
+				exit(EXIT_FAILURE);
+			}
+			strncat(depvar, dep, strlen(dep)-5);
+			if ((strncmp(depvar, "bc", 2) == 0) ||
+				(strncmp(depvar, "file", 4) == 0) ||
+				(strncmp(depvar, "gawk", 4) == 0) ||
+				(strncmp(depvar, "grep", 4) == 0) ||
+				(strncmp(depvar, "patch", 5) == 0) ||
+				(strncmp(depvar, "sed", 3) == 0) ||
+				(strncmp(depvar, "xz", 2) == 0)) {
+
+				/* transform to uppercase variable name */
+				for (i=0; i<(int)strlen(depvar); i++) {
+					if (depvar[i] == '+')
+						depvar[i] = 'X';
+					if (depvar[i] == '-')
+						depvar[i] = '_';
+					depvar[i] = toupper(depvar[i]);
+				}
+
+				/* extract symbol */
+				if ((key_sym = malloc(MAXLINE)) != NULL)
+					memset(key_sym, 0, MAXLINE);
+				else {
+					perror("Can not allocate memory.");
+					exit(EXIT_FAILURE);
+				}
+				if (snprintf(key_sym, MAXLINE, "ADK_HOST_BUILD_%s", depvar) < 0)
+						perror("Can not create string variable.");
+
+				if (check_symbol(key_sym) != 0) {
+					free(key_sym);
+					free(depvar);
+					return(NULL);
+				}
+				free(key_sym);
+				free(depvar);
+			}
+		}
 		if (*prefixp == 0) {
 			*prefixp = 1;
 			if (snprintf(temp, MAXLINE, "%s-compile: %s-compile", package, dep) < 0)
@@ -295,7 +341,7 @@ int main() {
 				} else if (strncmp(buf, "HOST_BUILDDEP", 13) == 0) {
 					asprintf(&string, "%s-host", pkgdirp->d_name);
 					// check retval; string for NULL
-					tmp = parse_line(string, NULL, buf, 0, 0, 0, &hprefix);
+					tmp = parse_line(string, NULL, buf, 2, 0, 0, &hprefix);
 					if (tmp && *tmp) {
 						asprintf(&string, "%s%s",
 						    hpkgdeps ? hpkgdeps : "",

+ 37 - 79
mk/build.mk

@@ -1,9 +1,6 @@
 # This file is part of the OpenADK project. OpenADK is copyrighted
 # material, please see the LICENCE file in the top-level directory.
 
-ADK_TOPDIR=$(shell pwd)
-export ADK_TOPDIR
-
 CONFIG_CONFIG_IN = Config.in
 CONFIG = adk/config
 DEFCONFIG=		ADK_DEBUG=n \
@@ -95,9 +92,7 @@ noconfig_targets:=	menuconfig \
 			defconfig
 
 POSTCONFIG=		-@\
-	if [ -f .adkinit ];then rm .adkinit;\
-	else \
-	if [ -f .config.old ];then \
+	if [ ! -f .firstrun ]; then \
 		$(ADK_TOPDIR)/adk/tools/pkgrebuild;\
 		rebuild=0; \
 		cleandir=0; \
@@ -133,22 +128,14 @@ POSTCONFIG=		-@\
 			cleandir=1;\
 			rebuild=1;\
 		fi; \
-		if [ "$$(grep ^ADK_TARGET_ARCH .config|md5sum)" != "$$(grep ^ADK_TARGET_ARCH .config.old|md5sum)" ];then \
-			cleandir=1;\
-			rebuild=1;\
-		fi; \
-		if [ "$$(grep ^ADK_TARGET_SYSTEM .config|md5sum)" != "$$(grep ^ADK_TARGET_SYSTEM .config.old|md5sum)" ];then \
-			cleandir=1;\
-			rebuild=1;\
-		fi; \
 		if [ $$cleandir -eq 1 ];then \
-			echo "You should rebuild with 'make cleandir'";\
+			echo "You should rebuild with 'make cleansystem'";\
 		fi; \
 		if [ $$rebuild -eq 1 ];then \
 			cp .config .config.old;\
 		fi; \
 	fi; \
-	fi
+	if [ -f .firstrun ]; then rm .firstrun; fi
 
 # Pull in the user's configuration file
 ifeq ($(filter $(noconfig_targets),$(MAKECMDGOALS)),)
@@ -161,8 +148,9 @@ include $(ADK_TOPDIR)/rules.mk
 all: world
 
 ${ADK_TOPDIR}/package/Depends.mk: ${ADK_TOPDIR}/.config $(wildcard ${ADK_TOPDIR}/package/*/Makefile) $(ADK_TOPDIR)/adk/tools/depmaker
-	@echo "Generating dependencies ..."
+	@printf " --->  generating dependencies.. "
 	$(ADK_TOPDIR)/adk/tools/depmaker > ${ADK_TOPDIR}/package/Depends.mk
+	@printf "done\n"
 
 .NOTPARALLEL:
 .PHONY: all world clean cleandir cleansystem distclean image_clean
@@ -170,7 +158,6 @@ ${ADK_TOPDIR}/package/Depends.mk: ${ADK_TOPDIR}/.config $(wildcard ${ADK_TOPDIR}
 world:
 	@mkdir -p $(DL_DIR) $(HOST_BUILD_DIR) $(BUILD_DIR) $(TARGET_DIR) $(FW_DIR) \
 		$(STAGING_HOST_DIR) $(TOOLCHAIN_BUILD_DIR) $(STAGING_PKG_DIR)/stamps
-	${BASH} ${ADK_TOPDIR}/scripts/scan-pkgs.sh
 ifeq ($(ADK_TARGET_TOOLCHAIN),y)
 ifeq ($(ADK_TOOLCHAIN_ONLY),y)
 	$(MAKE) -f mk/build.mk package/hostcompile toolchain/final package/compile
@@ -192,12 +179,17 @@ ifeq ($(ADK_TARGET_PACKAGE_OPKG),y)
 endif
 
 ${STAGING_TARGET_DIR} ${STAGING_TARGET_DIR}/etc ${STAGING_HOST_DIR}:
-	@mkdir -p ${STAGING_TARGET_DIR}/{bin,etc,lib,usr/bin,usr/include,usr/lib/pkgconfig} \
-		${STAGING_HOST_DIR}/{usr/bin,usr/lib,usr/include}
-	@for i in lib64 lib32 libx32;do \
-		cd ${STAGING_TARGET_DIR}/; ln -sf lib $$i; \
+	mkdir -p ${STAGING_TARGET_DIR}/bin
+	mkdir -p ${STAGING_TARGET_DIR}/etc
+	mkdir -p ${STAGING_TARGET_DIR}/usr/bin
+	mkdir -p ${STAGING_TARGET_DIR}/lib
+	mkdir -p ${STAGING_HOST_DIR}/usr/bin
+	mkdir -p ${STAGING_HOST_DIR}/usr/lib
+	mkdir -p ${STAGING_HOST_DIR}/usr/include
+	@for i in lib64 lib32 libx32; do \
+		cd ${STAGING_TARGET_DIR}; ln -sf lib $$i; \
 		cd ${STAGING_TARGET_DIR}/usr; ln -sf lib $$i; \
-		cd ${STAGING_HOST_DIR}/; ln -sf lib $$i; \
+		cd ${STAGING_HOST_DIR}; ln -sf lib $$i; \
 		cd ${STAGING_HOST_DIR}/usr; ln -sf lib $$i; \
 	done
 
@@ -237,7 +229,6 @@ newpackage:
 	@echo "Edit package/$(PKG)/Makefile to complete"
 
 root_clean:
-	@$(TRACE) root_clean
 	rm -rf $(TARGET_DIR)
 	mkdir -p $(TARGET_DIR)
 	touch $(TARGET_DIR)/.adk
@@ -248,7 +239,7 @@ root_clean:
 # dependencies information.
 
 clean:
-	@$(TRACE) clean
+	@printf " --->  cleaning target build directories and files.. "
 	$(MAKE) -C $(CONFIG) clean
 	for f in $$(ls ${STAGING_PKG_DIR}/ 2>/dev/null |grep -v [A-Z]|grep -v stamps 2>/dev/null); do  \
 		while read file ; do \
@@ -259,19 +250,23 @@ clean:
 	rm -rf $(BUILD_DIR) $(FW_DIR) $(TARGET_DIR) \
 	    	${ADK_TOPDIR}/package/pkglist.d
 	rm -f ${ADK_TOPDIR}/package/Depends.mk
+	@printf "done\n"
 
 cleankernel:
-	@$(TRACE) cleankernel
+	@printf " --->  cleaning kernel build directories.. "
 	@rm -rf $(TOOLCHAIN_BUILD_DIR)/w-linux* $(BUILD_DIR)/linux
+	@printf "done\n"
 
 cleandir:
-	@$(TRACE) cleandir
+	@printf " --->  cleaning all build directories and files.. "
 	@$(MAKE) -C $(CONFIG) clean $(MAKE_TRACE) 
 	@rm -rf $(BUILD_DIR_PFX) $(FW_DIR_PFX) $(TARGET_DIR_PFX) \
 	    ${ADK_TOPDIR}/package/pkglist.d ${ADK_TOPDIR}/package/pkgconfigs.d
 	@rm -rf $(TOOLCHAIN_DIR_PFX) $(STAGING_HOST_DIR_PFX)
 	@rm -rf $(STAGING_TARGET_DIR_PFX) $(STAGING_PKG_DIR_PFX)
-	@rm -f .menu .tmpconfig.h .rebuild* ${ADK_TOPDIR}/package/Depends.mk ${ADK_TOPDIR}/prereq.mk
+	@rm -f .menu .tmpconfig.h .rebuild*
+	@rm -f ${ADK_TOPDIR}/package/Depends.mk ${ADK_TOPDIR}/prereq.mk
+	@printf "done\n"
 
 cleansystem:
 	@$(TRACE) cleansystem
@@ -280,20 +275,22 @@ cleansystem:
 	    ${ADK_TOPDIR}/package/pkglist.d ${ADK_TOPDIR}/package/pkgconfigs.d
 	@rm -rf $(TOOLCHAIN_DIR) $(STAGING_TARGET_DIR) $(STAGING_PKG_DIR) $(TOOLCHAIN_BUILD_DIR)
 	@rm -f .menu .tmpconfig.h .rebuild* ${ADK_TOPDIR}/package/Depends.mk ${ADK_TOPDIR}/prereq.mk
+	@printf "done\n"
 
 distclean:
-	@$(TRACE) distclean
+	@printf " --->  cleaning build directories, files and downloads.. "
 	@$(MAKE) -C $(CONFIG) clean $(MAKE_TRACE)
 	@rm -rf $(TOOLCHAIN_DIR_PFX) $(STAGING_HOST_DIR_PFX)
 	@rm -rf $(STAGING_TARGET_DIR_PFX) $(STAGING_PKG_DIR_PFX)
 	@rm -rf $(BUILD_DIR_PFX) $(FW_DIR_PFX) $(TARGET_DIR_PFX) $(DL_DIR)
 	@rm -rf package/pkglist.d package/pkgconfigs.d
-	@rm -f .adkinit .config* .defconfig .tmpconfig.h all.config prereq.mk
-	@rm -f .menu package/Depends.mk .ADK_HAVE_DOT_CONFIG .rebuild.*
+	@rm -f .config* .defconfig .tmpconfig.h all.config prereq.mk
+	@rm -f .firstrun .menu package/Depends.mk .ADK_HAVE_DOT_CONFIG .rebuild.*
 	@rm -f target/*/Config.in.arch* target/*/Config.in.system*
 	@rm -f package/Config.in.auto* package/Config.in.appliances
 	@rm -f target/config/Config.in.prereq target/config/Config.in.scripts
 	@rm -f adk/tools/pkgmaker adk/tools/depmaker adk/tools/pkgrebuild
+	@printf "done\n"
 
 else # ! ifeq ($(strip $(ADK_HAVE_DOT_CONFIG)),y)
 
@@ -301,7 +298,6 @@ ifeq ($(filter-out distclean,${MAKECMDGOALS}),)
 include ${ADK_TOPDIR}/mk/vars.mk
 else
 include $(ADK_TOPDIR)/prereq.mk
-export HOST_CC HOST_CXX BASH MAKE LANGUAGE LC_ALL OStype PATH QEMU SHELL
 endif
 
 all: menuconfig
@@ -450,50 +446,8 @@ defconfig: .menu $(CONFIG)/conf
 	@if [ ! -z "$(ADK_APPLIANCE)" ];then \
 		$(CONFIG)/conf --defconfig=.defconfig $(CONFIG_CONFIG_IN); \
 	fi
-ifeq (${OStype},Linux)
-	@echo ADK_HOST_LINUX=y >> $(ADK_TOPDIR)/.config
-endif
-ifeq (${OStype},FreeBSD)
-	@echo ADK_HOST_FREEBSD=y >> $(ADK_TOPDIR)/.config
-endif
-ifeq (${OStype},MirBSD)
-	@echo ADK_HOST_MIRBSD=y >> $(ADK_TOPDIR)/.config
-endif
-ifeq (${OStype},OpenBSD)
-	@echo ADK_HOST_OPENBSD=y >> $(ADK_TOPDIR)/.config
-endif
-ifeq (${OStype},NetBSD)
-	@echo ADK_HOST_NETBSD=y >> $(ADK_TOPDIR)/.config
-endif
-ifeq (${OStype},Darwin)
-	@echo ADK_HOST_DARWIN=y >> $(ADK_TOPDIR)/.config
-endif
-ifneq (,$(filter CYGWIN%,${OStype}))
-	@echo ADK_HOST_CYGWIN=y >> $(ADK_TOPDIR)/.config
-endif
 
 allconfig:
-ifeq (${OStype},Linux)
-	@echo ADK_HOST_LINUX=y > $(ADK_TOPDIR)/all.config
-endif
-ifeq (${OStype},FreeBSD)
-	@echo ADK_HOST_FREEBSD=y > $(ADK_TOPDIR)/all.config
-endif
-ifeq (${OStype},MirBSD)
-	@echo ADK_HOST_MIRBSD=y > $(ADK_TOPDIR)/all.config
-endif
-ifeq (${OStype},OpenBSD)
-	@echo ADK_HOST_OPENBSD=y > $(ADK_TOPDIR)/all.config
-endif
-ifeq (${OStype},NetBSD)
-	@echo ADK_HOST_NETBSD=y > $(ADK_TOPDIR)/all.config
-endif
-ifeq (${OStype},Darwin)
-	@echo ADK_HOST_DARWIN=y > $(ADK_TOPDIR)/all.config
-endif
-ifneq (,$(filter CYGWIN%,${OStype}))
-	@echo ADK_HOST_CYGWIN=y > $(ADK_TOPDIR)/all.config
-endif
 	@if [ ! -z "$(ADK_APPLIANCE)" ];then \
 		grep "^config" target/config/Config.in.appliances \
 			|grep -i "_$(ADK_APPLIANCE)"\$$ \
@@ -541,19 +495,21 @@ _config: $(CONFIG)/conf allconfig .menu
 	@$(CONFIG)/conf ${W} $(CONFIG_CONFIG_IN)
 	${POSTCONFIG}
 
-distclean:
+distclean cleandir:
+	@printf " --->  cleaning build directories, files and downloads.. "
 	@$(MAKE) -C $(CONFIG) clean
 	@rm -rf $(BUILD_DIR_PFX) $(FW_DIR_PFX) $(TARGET_DIR_PFX) $(DL_DIR)
 	@rm -rf $(TOOLCHAIN_DIR_PFX) $(STAGING_TARGET_DIR_PFX)
 	@rm -rf $(STAGING_HOST_DIR_PFX) $(STAGING_TARGET_DIR_PFX) $(STAGING_PKG_DIR_PFX)
 	@rm -rf package/pkglist.d package/pkgconfigs.d
-	@rm -f .adkinit .config* .defconfig .tmpconfig.h all.config
+	@rm -f .config* .defconfig .tmpconfig.h all.config
 	@rm -f .menu .rebuild.* package/Depends.mk .ADK_HAVE_DOT_CONFIG prereq.mk
 	@rm -f target/*/Config.in.arch*
 	@rm -f target/*/Config.in.system*
 	@rm -f package/Config.in.auto* package/Config.in.appliances
 	@rm -f target/config/Config.in.prereq target/config/Config.in.scripts
 	@rm -f adk/tools/pkgmaker adk/tools/depmaker adk/tools/pkgrebuild
+	@printf "done\n"
 
 endif # ! ifeq ($(strip $(ADK_HAVE_DOT_CONFIG)),y)
 
@@ -573,14 +529,16 @@ $(ADK_TOPDIR)/adk/tools/depmaker: $(ADK_TOPDIR)/adk/tools/depmaker.c
 	@$(HOST_CC) $(HOST_CFLAGS) -o $@ $(ADK_TOPDIR)/adk/tools/depmaker.c
 
 menu .menu: $(wildcard package/*/Makefile) $(wildcard target/*/systems) $(wildcard target/*/systems/*) $(ADK_TOPDIR)/adk/tools/pkgmaker $(ADK_TOPDIR)/adk/tools/pkgrebuild $(wildcard target/appliances/*)
-	@echo "Generating menu structure ..."
-	@$(BASH) $(ADK_TOPDIR)/scripts/create-menu
+	@printf " --->  generating menu structure.. "
+	@$(SHELL) $(ADK_TOPDIR)/scripts/create-menu
 	@$(ADK_TOPDIR)/adk/tools/pkgmaker
 	@:>.menu
+	@printf "done\n"
 
 dep: $(ADK_TOPDIR)/adk/tools/depmaker
-	@echo "Generating dependencies ..."
+	@printf " --->  generating dependencies.. "
 	@$(ADK_TOPDIR)/adk/tools/depmaker > ${ADK_TOPDIR}/package/Depends.mk
+	@printf "done\n"
 
 .PHONY: menu dep
 

+ 1 - 1
mk/buildhlp.mk

@@ -82,7 +82,7 @@ ${WRKDIST}/.prepared: ${WRKDIST}/.extract_done
 		$(MAKE_TRACE)
 	@${MAKE} post-patch $(MAKE_TRACE)
 	# always use latest config.sub/config.guess from OpenADK scripts directory
-	cd ${WRKDIST}; \
+	@cd ${WRKDIST}; \
 	    for i in $$(find . -name config.sub);do \
 		if [ -f $$i ]; then \
 			${CP} ${SCRIPT_DIR}/config.sub $$i; \

+ 3 - 3
mk/fetch.mk

@@ -31,7 +31,7 @@ ifneq ($(ADK_DISABLE_CHECKSUM),y)
 	@if [ ! -e $(firstword ${FULLDISTFILES}).nohash ]; then \
 	OK=n; \
 	allsums="$(strip ${PKG_HASH})"; \
-	(PATH='$(HOST_PATH)' sha256sum ${FULLDISTFILES}; echo exit) | while read sum name; do \
+	($${SHA256} ${FULLDISTFILES}; echo exit) | while read sum name; do \
 		if [[ $$sum = exit ]]; then \
 			[[ $$OK = n ]] && echo >&2 "==> No distfile found!" || :; \
 			[[ $$OK = 1 ]] || exit 1; \
@@ -81,9 +81,9 @@ $(1):
 		;; \
 	    http://*|https://*|ftp://*) \
 		for site in $${PKG_SITES} $${MASTER_SITE_BACKUP}; do \
-			: echo "$${FETCH_CMD} $$$$site$$$$filename"; \
+			: echo "$${FETCHCMD} $$$$site$$$$filename"; \
 			rm -f "$$$$filename"; \
-			if $${FETCH_CMD} $$$$site$$$$filename; then \
+			if $${FETCHCMD} $$$$filename $$$$site$$$$filename; then \
 				: check the size here; \
 				[[ ! -e $$$$filename ]] || exit 0; \
 			fi; \

+ 12 - 21
mk/host-bottom.mk

@@ -6,10 +6,10 @@ host-extract: ${_HOST_PATCH_COOKIE}
 hostpre-configure:
 host-configure:
 ${_HOST_CONFIGURE_COOKIE}: ${_HOST_PATCH_COOKIE}
-	@mkdir -p ${WRKBUILD}
-	@$(CMD_TRACE) "host configuring... "
+	mkdir -p ${WRKBUILD}
+	@$(CMD_TRACE) "configuring.. "
 ifneq (,$(filter autogen,${AUTOTOOL_STYLE}))
-	@$(CMD_TRACE) "autotool configuring... "
+	@$(CMD_TRACE) "autotool configuring.. "
 	@cd ${WRKSRC}; env ${AUTOTOOL_ENV} $(BASH) autogen.sh $(MAKE_TRACE)
 endif
 ifneq (,$(filter autoreconf,${AUTOTOOL_STYLE}))
@@ -17,17 +17,6 @@ ifneq (,$(filter autoreconf,${AUTOTOOL_STYLE}))
 	@rm -rf ${WRKSRC}/autom4te.cache
 	@touch ${WRKDIR}/.autoreconf_done
 endif
-	@cd ${WRKBUILD}; \
-	    for i in $$(find . -name config.sub);do \
-		if [ -f $$i ]; then \
-			${CP} ${SCRIPT_DIR}/config.sub $$i; \
-		fi; \
-	    done; \
-	    for i in $$(find . -name config.guess);do \
-		if [ -f $$i ]; then \
-			${CP} ${SCRIPT_DIR}/config.guess $$i; \
-	        fi; \
-	    done;
 	@${MAKE} hostpre-configure $(MAKE_TRACE)
 ifeq (${HOST_STYLE},)
 	cd ${WRKBUILD}; \
@@ -70,7 +59,7 @@ ifeq (${HOST_STYLE},manual)
 	${MAKE} host-configure $(MAKE_TRACE)
 endif
 ifeq (${HOST_STYLE},perl)
-	@$(CMD_TRACE) "configuring perl module... "
+	@$(CMD_TRACE) "configuring perl module.. "
 	cd ${WRKBUILD}; \
 		PATH='${HOST_PATH}' \
 		PERL_MM_USE_DEFAULT=1 \
@@ -83,7 +72,7 @@ endif
 host-build:
 ${_HOST_BUILD_COOKIE}: ${_HOST_CONFIGURE_COOKIE}
 ifneq (${HOST_STYLE},manual)
-	@$(CMD_TRACE) "host compiling... "
+	@$(CMD_TRACE) "compiling.. "
 	cd ${WRKBUILD} && env ${HOST_MAKE_ENV} ${MAKE} -f ${MAKE_FILE} \
 	    ${HOST_MAKE_FLAGS} ${HOST_ALL_TARGET} $(MAKE_TRACE)
 endif
@@ -93,7 +82,7 @@ endif
 hostpost-install:
 host-install: ${ALL_HOSTINST}
 ${_HOST_FAKE_COOKIE}: ${_HOST_BUILD_COOKIE}
-	@$(CMD_TRACE) "host installing... "
+	@$(CMD_TRACE) "installing.. "
 	@mkdir -p ${HOST_WRKINST}
 ifeq (${HOST_STYLE},)
 	cd ${WRKBUILD} && env ${HOST_MAKE_ENV} ${MAKE} -f ${MAKE_FILE} \
@@ -113,16 +102,18 @@ endif
 		$(SED) "s,^prefix=.*,prefix=$(STAGING_HOST_DIR)/usr," $$a; \
 		chmod u+x $(STAGING_HOST_DIR)/usr/bin/$$(basename $$a); \
 	done
-	@touch $@
+	touch $@
 
 ${_HOST_COOKIE}:
+	printf wbxdebug
 	exec ${MAKE} hostpackage
 
 ifeq ($(HOST_LINUX_ONLY),)
 hostpackage: ${ALL_HOSTDIRS}
-	@touch ${_HOST_COOKIE}
+	touch ${_HOST_COOKIE}
 endif
 
 hostclean:
-	@$(CMD_TRACE) "cleaning... "
-	rm -rf ${WRKDIR} ${STAGING_PKG_DIR}/stamps/${PKG_NAME}*-host
+	@$(CMD_TRACE) "cleaning.. "
+	rm -r ${STAGING_PKG_DIR}/stamps/${PKG_NAME}*-host
+	rm -rf ${WRKDIR} 

+ 3 - 2
mk/image.mk

@@ -107,15 +107,16 @@ ROOTFSUSERTARBALL=	${ADK_TARGET_SYSTEM}-${ADK_TARGET_LIBC}-${ADK_TARGET_FS}.tar.
 ROOTFSISO=		${ADK_TARGET_SYSTEM}-${ADK_TARGET_LIBC}.iso
 
 kernel-package: kernel-strip
-	$(TRACE) target/$(ADK_TARGET_ARCH)-create-kernel-package
+	$(START_TRACE) "target/$(ADK_TARGET_ARCH)-create-kernel-package.. "
 	rm -rf $(KERNEL_PKGDIR)
 	@mkdir -p $(KERNEL_PKGDIR)/boot
 	cp $(BUILD_DIR)/$(TARGET_KERNEL) $(KERNEL_PKGDIR)/boot/kernel
 	@${BASH} ${SCRIPT_DIR}/make-ipkg-dir.sh ${KERNEL_PKGDIR} \
 	    ../linux/kernel.control ${KERNEL_VERSION} ${ADK_TARGET_CPU_ARCH}
 	$(PKG_BUILD) $(KERNEL_PKGDIR) $(PACKAGE_DIR) $(MAKE_TRACE)
-	$(TRACE) target/$(ADK_TARGET_ARCH)-install-kernel-package
 	$(PKG_INSTALL) $(KERNEL_PKG) $(MAKE_TRACE)
+	$(CMD_TRACE) " done"
+	$(END_TRACE)
 
 ${FW_DIR}/${ROOTFSTARBALL}: ${TARGET_DIR}/.adk kernel-package
 	cd ${TARGET_DIR}; find . | sed -n '/^\.\//s///p' | \

+ 18 - 7
mk/kernel-build.mk

@@ -34,13 +34,12 @@ ADK_DEPMOD:=true
 endif
 
 $(LINUX_DIR)/.prepared: $(TOOLCHAIN_BUILD_DIR)/w-$(PKG_NAME)-$(PKG_VERSION)-$(PKG_RELEASE)/linux-$(KERNEL_FILE_VER)/.patched
-	$(TRACE) target/kernel-prepare
 	ln -sf $(TOOLCHAIN_BUILD_DIR)/w-$(PKG_NAME)-$(PKG_VERSION)-$(PKG_RELEASE)/linux-$(KERNEL_FILE_VER) $(LINUX_DIR)
 	mkdir -p $(LINUX_BUILD_DIR)/kmod-control
 	touch $@
 
 $(LINUX_DIR)/.config: $(LINUX_DIR)/.prepared $(BUILD_DIR)/.kernelconfig
-	$(TRACE) target/$(ADK_TARGET_ARCH)-kernel-configure
+	$(START_TRACE) "target/$(ADK_TARGET_ARCH)-kernel-configure.. "
 	-for f in $(TARGETS);do if [ -f $$f ];then rm $$f;fi;done
 ifeq ($(ADK_TARGET_KERNEL_USE_DEFCONFIG),y)
 	${KERNEL_MAKE_ENV} $(MAKE) -C "${LINUX_DIR}" ${KERNEL_MAKE_OPTS} $(ADK_TARGET_KERNEL_DEFCONFIG) $(MAKE_TRACE)
@@ -50,23 +49,31 @@ else
 	${KERNEL_MAKE_ENV} $(MAKE) -C "${LINUX_DIR}" ${KERNEL_MAKE_OPTS} KCONFIG_ALLCONFIG=mini.config allnoconfig $(MAKE_TRACE)
 endif
 	touch -c $(LINUX_DIR)/.config
+	$(CMD_TRACE) " done"
+	$(END_TRACE)
 
 $(LINUX_DIR)/$(KERNEL_FILE): $(LINUX_DIR)/.config
-	$(TRACE) target/$(ADK_TARGET_ARCH)-kernel-compile
+	$(START_TRACE) "target/$(ADK_TARGET_ARCH)-kernel-compile.. "
 	${KERNEL_MAKE_ENV} $(MAKE) -C "${LINUX_DIR}" ${KERNEL_MAKE_OPTS} -j${ADK_MAKE_JOBS} $(KERNEL_TARGET) $(MAKE_TRACE)
 	touch -c $(LINUX_DIR)/$(KERNEL_FILE)
+	$(CMD_TRACE) " done"
+	$(END_TRACE)
 
 $(LINUX_BUILD_DIR)/modules: $(LINUX_DIR)/$(KERNEL_FILE)
-	$(TRACE) target/$(ADK_TARGET_ARCH)-kernel-modules-compile
+	$(START_TRACE) "target/$(ADK_TARGET_ARCH)-kernel-modules-compile.. "
 	${KERNEL_MAKE_ENV} $(MAKE) -C "${LINUX_DIR}" ${KERNEL_MAKE_OPTS} -j${ADK_MAKE_JOBS} modules $(MAKE_TRACE)
-	$(TRACE) target/$(ADK_TARGET_ARCH)-kernel-modules-install
+	$(CMD_TRACE) " done"
+	$(END_TRACE)
+	$(START_TRACE) "target/$(ADK_TARGET_ARCH)-kernel-modules-install.. "
 	rm -rf $(LINUX_BUILD_DIR)/modules
 	${KERNEL_MAKE_ENV} $(MAKE) -C "${LINUX_DIR}" ${KERNEL_MAKE_OPTS} \
 		DEPMOD=$(ADK_DEPMOD) \
 		INSTALL_MOD_PATH=$(LINUX_BUILD_DIR)/modules \
 		modules_install $(MAKE_TRACE)
+	$(CMD_TRACE) " done"
+	$(END_TRACE)
 ifneq ($(ADK_RUNTIME_DEV_UDEV),y)
-	$(TRACE) target/$(ADK_TARGET_ARCH)-create-packages
+	$(START_TRACE) "target/$(ADK_TARGET_ARCH)-create-packages.. "
 	@mkdir -p ${PACKAGE_DIR}
 	PATH='${HOST_PATH}' ${BASH} ${SCRIPT_DIR}/make-module-ipkgs.sh \
 		"${ADK_TARGET_CPU_ARCH}" \
@@ -74,6 +81,8 @@ ifneq ($(ADK_RUNTIME_DEV_UDEV),y)
 		"${LINUX_BUILD_DIR}" \
 		"${PKG_BUILD}" \
 		"${PACKAGE_DIR}"
+	$(CMD_TRACE) " done"
+	$(END_TRACE)
 endif
 
 prepare:
@@ -83,12 +92,14 @@ else
 compile: $(LINUX_DIR)/$(KERNEL_FILE)
 endif
 install: compile
-	$(TRACE) target/${ADK_TARGET_ARCH}-modules-install
+	$(START_TRACE) "target/${ADK_TARGET_ARCH}-modules-install.. "
 ifeq ($(ADK_TARGET_PACKAGE_IPKG)$(ADK_TARGET_PACKAGE_OPKG),y)
 	$(PKG_INSTALL) $(wildcard ${PACKAGE_DIR}/kmod-*) $(MAKE_TRACE)
 else
 	$(foreach pkg,$(wildcard ${PACKAGE_DIR}/kmod-*),$(shell $(PKG_INSTALL) $(pkg)))
 endif
+	$(CMD_TRACE) " done"
+	$(END_TRACE)
 
 clean:
 	rm -rf $(LINUX_BUILD_DIR)

+ 8 - 3
mk/kernel-vars.mk

@@ -10,9 +10,14 @@ KERNEL_MAKE_OPTS:=	V=1 \
 			DISABLE_PAX_PLUGINS=y \
 			CONFIG_SHELL='${SHELL}'
 
-# regex for relocs needs pcre on Darwin
-ifeq (${OStype},Darwin)
-KERNEL_MAKE_OPTS+=	HOSTCFLAGS='$(HOST_CPPFLAGS) ${HOST_CFLAGS}' HOSTLDFLAGS='-lpcreposix'
+# regex for relocs needs pcre
+ifeq ($(OS_FOR_BUILD),Darwin)
+KERNEL_MAKE_OPTS+=	HOSTLDFLAGS='-lpcreposix'
+endif
+
+# non-Linux platforms need elf.h
+ifneq ($(OS_FOR_BUILD),Linux)
+KERNEL_MAKE_OPTS+=	HOSTCFLAGS='$(HOST_CPPFLAGS) ${HOST_CFLAGS}'
 KERNEL_MAKE_OPTS+=	HOST_EXTRACFLAGS='-I ${ADK_TOPDIR}/adk/include -DKBUILD_NO_NLS'
 else
 KERNEL_MAKE_OPTS+=	HOSTCFLAGS='${HOST_CFLAGS}'

+ 0 - 16
mk/os.mk

@@ -1,16 +0,0 @@
-# This file is part of the OpenADK project. OpenADK is copyrighted
-# material, please see the LICENCE file in the top-level directory.
-
-# operating system quirks
-ifeq (${OStype},Darwin)
-HOST_CC:=clang -fbracket-depth=1024
-HOST_CXX:=clang++ -fbracket-depth=1024
-else
-ifeq (${OStype},FreeBSD)
-HOST_CC:=clang -fbracket-depth=1024
-HOST_CXX:=clang++ -fbracket-depth=1024
-else
-HOST_CC:=${CC}
-HOST_CXX:=${CXX}
-endif
-endif

+ 2 - 2
mk/package.mk

@@ -299,12 +299,12 @@ endef
 
 install-targets:
 install:
-	@$(CMD_TRACE) "installing... "
+	@$(CMD_TRACE) "installing.. "
 	@$(MAKE) install-targets $(MAKE_TRACE)
 
 clean-targets:
 clean:
-	@$(CMD_TRACE) "cleaning... "
+	@$(CMD_TRACE) "cleaning.. "
 	@$(MAKE) clean-targets $(MAKE_TRACE)
 	rm -rf ${WRKDIR} ${ALL_IPKGS} ${_IPKGS_COOKIE}
 

+ 10 - 10
mk/pkg-bottom.mk

@@ -24,19 +24,19 @@ do-configure:
 post-configure:
 ${_CONFIGURE_COOKIE}: ${_PATCH_COOKIE}
 ifneq (,$(filter bootstrap,${AUTOTOOL_STYLE}))
-	@$(CMD_TRACE) "autotool configuring... "
+	@$(CMD_TRACE) "autotool configuring.. "
 	@cd ${WRKSRC}; env ${AUTOTOOL_ENV} $(BASH) bootstrap.sh $(MAKE_TRACE)
 endif
 ifneq (,$(filter autogen,${AUTOTOOL_STYLE}))
-	@$(CMD_TRACE) "autotool configuring... "
+	@$(CMD_TRACE) "autotool configuring.. "
 	@cd ${WRKSRC}; env ${AUTOTOOL_ENV} $(BASH) autogen.sh $(MAKE_TRACE)
 endif
 ifneq (,$(filter autoconf,${AUTOTOOL_STYLE}))
-	@$(CMD_TRACE) "autotool configuring... "
+	@$(CMD_TRACE) "autotool configuring.. "
 	@cd ${WRKSRC}; env ${AUTOTOOL_ENV} autoconf $(MAKE_TRACE)
 endif
 ifneq (,$(filter autoreconf,${AUTOTOOL_STYLE}))
-	@$(CMD_TRACE) "autotool configuring... "
+	@$(CMD_TRACE) "autotool configuring.. "
 	@cd ${WRKSRC}; env ${AUTOTOOL_ENV} autoreconf -vif $(MAKE_TRACE)
 	@rm -rf ${WRKSRC}/autom4te.cache
 	@touch ${WRKDIR}/.autoreconf_done
@@ -47,7 +47,7 @@ endif
 ifneq ($(filter manual,${CONFIG_STYLE}),)
 	env ${CONFIGURE_ENV} ${MAKE} do-configure $(MAKE_TRACE)
 else ifneq ($(filter cmake,${CONFIG_STYLE}),)
-	@$(CMD_TRACE) "configuring cmake... "
+	@$(CMD_TRACE) "configuring cmake.. "
 	sed -e "s#@@TARGET_CC@@#$(TARGET_CC)#" \
 	 	-e "s#@@TARGET_CXX@@#$(TARGET_CXX)#" \
 		-e "s#@@TARGET_CFLAGS@@#$(TARGET_CFLAGS)#" \
@@ -61,19 +61,19 @@ else ifneq ($(filter cmake,${CONFIG_STYLE}),)
 			-DCMAKE_TOOLCHAIN_FILE="$(SCRIPT_DIR)/toolchain.cmake" \
 			${CMAKE_FLAGS} ${WRKSRC}) $(MAKE_TRACE)
 else ifneq ($(filter minimal,${CONFIG_STYLE}),)
-	@$(CMD_TRACE) "configuring... "
+	@$(CMD_TRACE) "configuring.. "
 	cd ${WRKBUILD}; rm -f config.{cache,status}; \
 	    env ${CONFIGURE_ENV} \
 	    ${BASH} ${WRKSRC}/${CONFIGURE_PROG} \
 	    ${CONFIGURE_ARGS} $(MAKE_TRACE)
 else ifneq ($(filter basic,${CONFIG_STYLE}),)
-	@$(CMD_TRACE) "configuring... "
+	@$(CMD_TRACE) "configuring.. "
 	cd ${WRKBUILD}; rm -f config.{cache,status}; \
 	    env ${CONFIGURE_ENV} \
 	    ${BASH} ${WRKSRC}/${CONFIGURE_PROG} ${CONFIGURE_TRIPLE} \
 	    ${CONFIGURE_ARGS} $(MAKE_TRACE)
 else ifneq ($(filter perl,${CONFIG_STYLE}),)
-	@$(CMD_TRACE) "configuring perl module... "
+	@$(CMD_TRACE) "configuring perl module.. "
 	if [ -f ${WRKBUILD}/Makefile.PL ]; then \
 		cd ${WRKBUILD}; \
 			PATH='${HOST_PATH}' \
@@ -88,7 +88,7 @@ else ifneq ($(filter perl,${CONFIG_STYLE}),)
 			perl-host Build.PL; \
 	fi
 else ifeq ($(strip ${CONFIG_STYLE}),)
-	@$(CMD_TRACE) "configuring... "
+	@$(CMD_TRACE) "configuring.. "
 	cd ${WRKBUILD}; rm -f config.{cache,status}; \
 	    env ${CONFIGURE_ENV} \
 	    ${BASH} ${WRKSRC}/${CONFIGURE_PROG} ${CONFIGURE_TRIPLE} \
@@ -125,7 +125,7 @@ do-build:
 post-build:
 ${_BUILD_COOKIE}: ${_CONFIGURE_COOKIE}
 	@env ${MAKE_ENV} ${MAKE} pre-build $(MAKE_TRACE)
-	@$(CMD_TRACE) "compiling... "
+	@$(CMD_TRACE) "compiling.. "
 ifneq ($(filter manual,${BUILD_STYLE}),)
 	env ${MAKE_ENV} ${MAKE} ${MAKE_FLAGS} do-build $(MAKE_TRACE)
 else ifeq ($(strip ${BUILD_STYLE}),)

+ 2 - 2
mk/vars.mk

@@ -426,9 +426,9 @@ QUIET:=
 else
 QUIET:=			--quiet
 endif
-FETCH_CMD?=		PATH='${HOST_PATH}' wget --timeout=$(ADK_WGET_TIMEOUT) -t 3 --no-check-certificate $(QUIET)
+FETCHCMD?=		PATH='${HOST_PATH}' wget --timeout=$(ADK_WGET_TIMEOUT) -t 3 --no-check-certificate $(QUIET)
 
-ifneq (,$(filter CYGWIN%,${OStype}))
+ifneq (,$(filter CYGWIN%,${OS_FOR_BUILD}))
 EXEEXT:=		.exe
 endif
 

+ 5 - 5
package/Makefile

@@ -50,19 +50,19 @@ install: base-files-install $(INSTALL_ICONV) $(INSTALL_PACKAGES)
 endif
 
 %-download:
-	$(START_TRACE) "package/$(patsubst %-download,%,$@)-download: "
+	$(START_TRACE) "package/$(patsubst %-download,%,$@)-download.. "
 	$(MAKE) -C $(patsubst %-download,%,$@) fetch
 	$(CMD_TRACE) " done"
 	$(END_TRACE)
 
 %-host-compile:
-	$(START_TRACE) "package/$(patsubst %-host-compile,%,$@)-host-compile: "
+	$(START_TRACE) "package/$(patsubst %-host-compile,%,$@)-host.. "
 	$(MAKE) -C $(patsubst %-host-compile,%,$@) hostpackage
 	$(CMD_TRACE) " done"
 	$(END_TRACE)
 
 %-compile:
-	$(START_TRACE) "package/$(patsubst %-compile,%,$@)-compile: "
+	$(START_TRACE) "package/$(patsubst %-compile,%,$@)-compile.. "
 	@if test -f $(ADK_TOPDIR)/.rebuild.$(patsubst %-compile,%,$@); then \
 		$(MAKE) -C $(patsubst %-compile,%,$@) clean ; \
 		rm $(ADK_TOPDIR)/.rebuild.$(patsubst %-compile,%,$@) ; \
@@ -72,13 +72,13 @@ endif
 	$(END_TRACE)
 
 %-install:
-	$(START_TRACE) "package/$(patsubst %-install,%,$@)-install: "
+	$(START_TRACE) "package/$(patsubst %-install,%,$@)-install.. "
 	$(MAKE) -C $(patsubst %-install,%,$@) install
 	$(CMD_TRACE) " done"
 	$(END_TRACE)
 
 %-clean:
-	$(START_TRACE) "package/$(patsubst %-clean,%,$@)-clean: "
+	$(START_TRACE) "package/$(patsubst %-clean,%,$@)-clean.. "
 	$(MAKE) -C $(patsubst %-clean,%,$@) clean
 	$(CMD_TRACE) " done"
 	$(END_TRACE)

+ 1 - 1
package/adk-helper/src/makedevs.c

@@ -31,7 +31,7 @@
 #include <stdarg.h>
 #include <sys/stat.h>
 #include <sys/types.h>
-#if !defined(__APPLE__) && !defined(__FreeBSD__)
+#if !defined(__APPLE__) && !defined(__FreeBSD__) && !defined(__OpenBSD__) && !defined(__NetBSD__)
 #include <sys/sysmacros.h>     /* major() and minor() */
 #endif
 #include <ftw.h>

+ 1 - 1
package/busybox/Makefile

@@ -11,7 +11,7 @@ PKG_DESCR:=		core utilities for embedded systems
 PKG_SECTION:=		base/apps
 PKG_BUILDDEP:=		bzip2-host
 PKG_URL:=		http://www.busybox.net/
-PKG_SITES:=		http://www.busybox.net/downloads/
+PKG_SITES:=		https://www.busybox.net/downloads/
 
 DISTFILES:=		${PKG_NAME}-${PKG_VERSION}.tar.bz2
 

+ 3 - 3
package/glib/Makefile

@@ -14,7 +14,7 @@ PKG_BUILDDEP:=		glib-host libffi gettext-tiny zlib libelf dbus
 HOST_BUILDDEP:=		libffi-host gettext-tiny-host python2-host
 PKG_NEEDS:=		threads
 PKG_URL:=		http://www.gtk.org/
-PKG_SITES:=		http://ftp.gnome.org/pub/gnome/sources/glib/$(PKG_EXTRAVER)/
+PKG_SITES:=		http://gensho.acc.umu.se/pub/gnome/sources/glib/$(PKG_EXTRAVER)/
 PKG_NOPARALLEL:=	1
 PKG_OPTS:=		dev noscripts
 
@@ -36,10 +36,10 @@ CONFIGURE_ENV+=		glib_cv_long_long_format=ll \
 			ac_cv_func_posix_getgrgid_r=yes
 
 HOST_STYLE:=		auto
-ifneq ($(OStype),CYGWIN)
+ifneq ($(OS_FOR_BUILD),CYGWIN)
 HOST_CFLAGS+=		-fPIC
 endif
-ifneq ($(OStype),Darwin)
+ifneq ($(OS_FOR_BUILD),Darwin)
 HOST_CONFIGURE_ARGS+=	--with-libiconv=no
 endif
 HOST_CONFIGURE_ARGS+=	--disable-fam \

+ 2 - 2
package/openssl/Makefile

@@ -70,10 +70,10 @@ ifeq ($(ADK_TARGET_ARCH_X86_64),y)
 CONFIG:=		linux-x86_64
 endif
 
-ifneq (,$(filter CYGWIN%,${OStype}))
+ifneq (,$(filter CYGWIN%,${OS_FOR_BUILD}))
 HOSTCONFIG:=		Cygwin-x86_64
 endif
-ifeq ($(OStype),Darwin)
+ifeq ($(OS_FOR_BUILD),Darwin)
 HOSTCONFIG:=		darwin64-x86_64-cc
 endif
 

+ 3 - 2
package/pkgconf/Makefile

@@ -9,6 +9,7 @@ PKG_RELEASE:=		1
 PKG_HASH:=		8f5f48e52ddef0c3cbffe93f32d5148041e0030b8798b49b0b5fe72f4968d7ec
 PKG_DESCR:=		smart pkg-config replacement
 PKG_SECTION:=		dev/tools
+HOST_BUILDDEP:=		sed-host
 PKG_URL:=		https://github.com/pkgconf/pkgconf
 PKG_SITES:=		http://rabbit.dereferenced.org/~nenolod/distfiles/
 
@@ -23,9 +24,9 @@ $(eval $(call PKG_template,PKGCONF,pkgconf,$(PKG_VERSION)-${PKG_RELEASE},${PKG_D
 hostpost-install:
 	$(CP) ./files/pkg-config $(STAGING_HOST_DIR)/usr/bin
 ifeq ($(ADK_TARGET_USE_STATIC_LIBS),y)
-	$(SED) "s#@@OPTS@@#--static#" $(STAGING_HOST_DIR)/usr/bin/pkg-config
+	PATH="$(HOST_PATH)" $(SED) "s#@@OPTS@@#--static#" $(STAGING_HOST_DIR)/usr/bin/pkg-config
 else
-	$(SED) "s#@@OPTS@@##" $(STAGING_HOST_DIR)/usr/bin/pkg-config
+	PATH="$(HOST_PATH)" $(SED) "s#@@OPTS@@##" $(STAGING_HOST_DIR)/usr/bin/pkg-config
 endif
 	(cd $(STAGING_HOST_DIR)/usr/bin && ln -sf pkg-config $(GNU_TARGET_NAME)-pkg-config)
 

+ 0 - 1
package/squashfs/Makefile

@@ -8,7 +8,6 @@ PKG_VERSION:=		4.2
 PKG_RELEASE:=		1
 PKG_HASH:=		d9e0195aa922dbb665ed322b9aaa96e04a476ee650f39bbeadb0d00b24022e96
 PKG_DESCR:=		squashfs filesystem utilities
-HOST_BUILDDEP:=		xz-host
 PKG_SECTION:=		sys/fs
 PKG_SITES:=		${MASTER_SITE_SOURCEFORGE:=squashfs/}
 

+ 1 - 1
package/xz/Makefile

@@ -10,9 +10,9 @@ PKG_HASH:=		73df4d5d34f0468bd57d09f2d8af363e95ed6cc3a4a86129d2f2c366259902a2
 PKG_DESCR:=		compression utility
 PKG_SECTION:=		app/archive
 PKG_DEPENDS:=		libxz
+HOST_BUILDDEP:=		heirloom-cpio-host
 PKG_URL:=		http://tukaani.org/xz/
 PKG_SITES:=		http://tukaani.org/xz/
-PKG_OPTS:=		dev
 PKG_LIBNAME:=		libxz
 PKG_OPTS:=		dev
 PKG_BB:=		1

+ 2 - 3
rules.mk

@@ -2,7 +2,6 @@
 # material, please see the LICENCE file in the top-level directory.
 
 include $(ADK_TOPDIR)/prereq.mk
-include $(ADK_TOPDIR)/mk/os.mk
 -include $(ADK_TOPDIR)/.config
 
 ifeq ($(ADK_VERBOSE),1)
@@ -15,9 +14,9 @@ MAKE_TRACE:=
 EXTRA_MAKEFLAGS:=
 SET_DASHX:=		set -x
 else
-START_TRACE:=		echo -n "---> "
+START_TRACE:=		echo -n " ---> "
 END_TRACE:=		echo
-TRACE:=			echo "---> "
+TRACE:=			echo " ---> "
 CMD_TRACE:=		echo -n
 PKG_TRACE:=		echo "------> "
 EXTRA_MAKEFLAGS:=	-s

+ 0 - 67
scripts/adkprepare.sh

@@ -1,67 +0,0 @@
-#!/bin/sh
-# This file is part of the OpenADK project. OpenADK is copyrighted
-# material, please see the LICENCE file in the top-level directory.
-
-os=$(uname)
-ver=$(uname -r)
-arch=$(uname -m)
-
-linux() {
-	echo "Preparing Linux for OpenADK is not implemented, yet"
-	exit 1
-}
-
-darwin() {
-	echo "Preparing MacOS X for OpenADK, is not implemented, yet"
-	exit 1
-}
-
-openbsd() {
-	echo "Preparing OpenBSD for OpenADK"
-	PKG_PATH="ftp://ftp.openbsd.org/pub/OpenBSD/${ver}/packages/${arch}/"
-	export PKG_PATH
-	pkg_add -v gmake
-	pkg_add -v bash
-	pkg_add -v wget
-	pkg_add -v gtar--
-	pkg_add -v gawk
-	pkg_add -v gsed
-}
-
-netbsd() {
-	echo "Preparing NetBSD for OpenADK"
-	PKG_PATH="ftp://ftp.netbsd.org/pub/pkgsrc/packages/NetBSD/${arch}/${ver}/All/"
-	export PKG_PATH
-	pkg_add -vu gmake
-	pkg_add -vu bash
-	pkg_add -vu wget
-	pkg_add -vu gtar
-	pkg_add -vu gsed
-	pkg_add -vu gawk
-}
-
-freebsd() {
-	echo "Preparing FreeBSD for OpenADK"
-	pkg_add -r gmake bash wget gtar gsed gawk
-}
-
-case $os in 
-	Linux)
-		linux
-		;;
-	FreeBSD)
-		freebsd
-		;;
-	OpenBSD)
-		openbsd
-		;;
-	NetBSD)
-		netbsd
-		;;
-	Darwin)
-		darwin
-		;;
-	*)
-		echo "OS not supported"
-		;;
-esac

+ 0 - 33
scripts/bulk-qemu.sh

@@ -1,33 +0,0 @@
-#!/bin/sh
-
-if [ ! -z $1 ];then
-	c=$1
-else
-	c="uclibc-ng glibc musl uclibc"
-fi
-
-for libc in $c; do
-	for arch in $(cat toolchain/$libc/arch.lst);do
-		echo "Cleaning old stuff"
-		make cleandir
-		echo "Building $libc for $arch"
-		DEFAULT="ADK_VERBOSE=1 ADK_APPLIANCE=new ADK_TARGET_ARCH=$arch ADK_TARGET_SYSTEM=qemu-$arch ADK_TARGET_LIBC=$libc ADK_TARGET_FS=initramfspiggyback"
-		case $arch in
-		mips|microblaze)
-			for endian in little big;do
-				make $DEFAULT ADK_TARGET_ENDIAN=$endian defconfig all
-				cp -a firmware firmware.$arch.$endian
-			done
-			;;
-		*)
-			make $DEFAULT defconfig all
-			cp -a firmware firmware.$arch
-			;;
-		esac
-		if [ $? -ne 0 ];then
-			echo "build failed"
-			exit 1
-		fi
-		make cleandir
-	done
-done

+ 0 - 30
scripts/bulk-toolchain.sh

@@ -1,30 +0,0 @@
-#!/bin/sh
-
-if [ ! -z $1 ];then
-	c=$1
-else
-	c="uclibc-ng glibc musl uclibc"
-fi
-
-for libc in $c; do
-	for arch in $(cat toolchain/$libc/arch.lst);do
-		echo "Cleaning old stuff"
-		make cleandir
-		echo "Building $libc for $arch"
-		DEFAULT="VERBOSE=1 ADK_TARGET_ARCH=$arch ADK_TARGET_SYSTEM=toolchain-$arch ADK_TARGET_LIBC=$libc"
-		case $arch in
-		mips|microblaze|sh)
-			for endian in little big;do
-				make $DEFAULT ADK_TARGET_ENDIAN=$endian defconfig all
-			done
-			;;
-		*)
-			make $DEFAULT defconfig all
-			;;
-		esac
-		if [ $? -ne 0 ];then
-			echo "build failed"
-			exit 1
-		fi
-	done
-done

+ 0 - 1
scripts/create-menu

@@ -1,4 +1,3 @@
-#!/usr/bin/env bash
 # This file is part of the OpenADK project. OpenADK is copyrighted
 # material, please see the LICENCE file in the top-level directory.
 

+ 0 - 206
scripts/gcc-bisect.sh

@@ -1,206 +0,0 @@
-#!/bin/sh
-rm -rf host_x86_64-linux-gnu target_sparc_glibc
-rm -rf gcc-*
-mkdir host_x86_64-linux-gnu
-mkdir target_sparc_glibc
-
-tar xvf binutils-2.24.tar.bz2
-cd binutils-2.24
-./configure \
-		--prefix=/home/wbx/smoke/host_x86_64-linux-gnu \
-		--target=sparc-openadk-linux-gnu \
-		--with-sysroot=/home/wbx/smoke/target_sparc_glibc \
-		--disable-dependency-tracking \
-		--disable-libtool-lock \
-		--disable-nls \
-		--disable-werror \
-		--disable-plugins \
-		--disable-libssp --disable-multilib
-make -j4 all
-make install
-cd ..
-
-tar xvf gmp-5.1.3.tar.xz
-cd gmp-5.1.3
-cp configfsf.guess config.guess
-PATH="/home/wbx/smoke/host_x86_64-linux-gnu/usr/bin:$PATH" \
-		./configure \
-		--prefix=/home/wbx/smoke/host_x86_64-linux-gnu \
-		--with-pic \
-		--disable-shared \
-		--enable-static
-make -j4 all
-make install
-cd ..
-
-tar xvf mpfr-3.1.2.tar.xz
-cd mpfr-3.1.2
-./configure \
-		--prefix=/home/wbx/smoke/host_x86_64-linux-gnu \
-		--with-gmp-build=/home/wbx/smoke/gmp-5.1.3 \
-		--disable-shared \
-		--enable-static
-make -j4 all
-make install
-cd ..
-
-tar xvf mpc-0.8.2.tar.gz
-cd mpc-0.8.2
-./configure \
-		--prefix=/home/wbx/smoke/host_x86_64-linux-gnu \
-		--with-gmp=/home/wbx/smoke/host_x86_64-linux-gnu \
-		--disable-shared \
-		--enable-static
-make -j4 all
-make install
-make install
-cd ..
-
-tar xvf libelf-0.8.13.tar.gz
-cd libelf-0.8.13
-./configure \
-		--prefix=/home/wbx/smoke/host_x86_64-linux-gnu \
-		--disable-nls \
-		--disable-shared \
-		--enable-static
-make -j4 all
-make install
-cd ..
-
-rm -rf host_x86_64-linux-gnu/sparc-openadk-linux-gnu/{lib,sys-include}
-cd host_x86_64-linux-gnu/sparc-openadk-linux-gnu/
-ln -sf ../../target_sparc_glibc/usr/include sys-include
-ln -sf ../../target_sparc_glibc/lib lib
-cd -
-
-mkdir gcc-minimal
-cd gcc-minimal
-CFLAGS="-O0 -g0" \
-CXXFLAGS="-O0 -g0" \
-PATH="/home/wbx/smoke/host_x86_64-linux-gnu/bin:$PATH" \
-../gcc/configure \
-	--prefix=/home/wbx/smoke/host_x86_64-linux-gnu --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=sparc-openadk-linux-gnu --with-gmp=/home/wbx/smoke/host_x86_64-linux-gnu --with-mpfr=/home/wbx/smoke/host_x86_64-linux-gnu --with-libelf=/home/wbx/smoke/host_x86_64-linux-gnu --disable-__cxa_atexit --with-gnu-ld --with-gnu-as --enable-tls --disable-libsanitizer --disable-libitm --disable-libmudflap --disable-libgomp --disable-decimal-float --disable-libstdcxx-pch --disable-ppl-version-check --disable-cloog-version-check --without-system-zlib --without-ppl --without-cloog --without-isl --disable-nls --enable-target-optspace \
-			--enable-languages=c \
-			--disable-multilib \
-			--disable-lto \
-			--disable-libssp \
-			--disable-shared \
-			--without-headers
-PATH="/home/wbx/smoke/host_x86_64-linux-gnu/bin:$PATH" make -j4 all-gcc
-if [ $? -ne 0 ];then
-	echo failed
-	exit
-fi
-PATH="/home/wbx/smoke/host_x86_64-linux-gnu/bin:$PATH" make install-gcc
-if [ $? -ne 0 ];then
-	echo failed
-	exit
-fi
-cd ..
-
-cd linux-3.13.6
-make V=1 ARCH=sparc CROSS_COMPILE="/home/wbx/smoke/host_x86_64-linux-gnu/bin/sparc-openadk-linux-gnu-" CC="/home/wbx/smoke/host_x86_64-linux-gnu/bin/sparc-openadk-linux-gnu-gcc" HOSTCC="cc" CONFIG_SHELL='/bin/bash' HOSTCFLAGS='-O2 -Wall' INSTALL_HDR_PATH=/home/wbx/smoke/target_sparc_glibc/usr headers_install
-cd ..
-
-cd glibc-2.19-header
-libc_cv_forced_unwind=yes \
-libc_cv_cc_with_libunwind=yes \
-libc_cv_c_cleanup=yes \
-libc_cv_gnu99_inline=yes \
-libc_cv_initfini_array=yes \
-PATH="/home/wbx/smoke/host_x86_64-linux-gnu/bin:$PATH" ../glibc-2.19/configure \
-	--prefix=/home/wbx/smoke/target_sparc_glibc/usr \
-	--with-sysroot=/home/wbx/smoke/target_sparc_glibc \
-	--build=x86_64-linux-gnu --host=sparc-openadk-linux-gnu --with-headers=/home/wbx/smoke/target_sparc_glibc/usr/include --disable-sanity-checks --disable-nls --without-cvs --disable-profile --disable-debug --without-gd --disable-nscd --with-__thread --with-tls --enable-kernel="2.6.32" --enable-add-ons
-PATH="/home/wbx/smoke/host_x86_64-linux-gnu/bin:$PATH" make cross-compiling=yes PARALLELMFLAGS="-j1" install-headers
-if [ $? -ne 0 ];then
-	echo failed
-	exit
-fi
-cd ..
-touch target_sparc_glibc/usr/include/gnu/stubs.h
-
-mkdir gcc-initial
-cd gcc-initial
-CFLAGS="-O0 -g0" \
-CXXFLAGS="-O0 -g0" \
-PATH="/home/wbx/smoke/host_x86_64-linux-gnu/bin:$PATH" ../gcc/configure \
-	--prefix=/home/wbx/smoke/host_x86_64-linux-gnu --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=sparc-openadk-linux-gnu --with-gmp=/home/wbx/smoke/host_x86_64-linux-gnu --with-mpfr=/home/wbx/smoke/host_x86_64-linux-gnu --with-libelf=/home/wbx/smoke/host_x86_64-linux-gnu --disable-__cxa_atexit --with-gnu-ld --with-gnu-as --enable-tls --disable-libsanitizer --disable-libitm --disable-libmudflap --disable-libgomp --disable-decimal-float --disable-libstdcxx-pch --disable-ppl-version-check --disable-cloog-version-check --without-system-zlib --without-ppl --without-cloog --without-isl --disable-nls --enable-target-optspace \
-			 --disable-biarch --disable-multilib --enable-libssp --enable-lto \
-			--enable-languages=c \
-			--disable-shared \
-			--disable-threads \
-			--with-sysroot=/home/wbx/smoke/target_sparc_glibc
-PATH="/home/wbx/smoke/host_x86_64-linux-gnu/bin:$PATH" make all-gcc
-if [ $? -ne 0 ];then
-	echo failed
-	exit
-fi
-PATH="/home/wbx/smoke/host_x86_64-linux-gnu/bin:$PATH" make all-target-libgcc
-if [ $? -ne 0 ];then
-	echo failed
-	exit
-fi
-PATH="/home/wbx/smoke/host_x86_64-linux-gnu/bin:$PATH" make install-gcc install-target-libgcc
-if [ $? -ne 0 ];then
-	echo failed
-	exit
-fi
-cd ..
-
-cd glibc-2.19-final
-PATH="/home/wbx/smoke/host_x86_64-linux-gnu/bin:$PATH" SHELL='/bin/bash' BUILD_CC=cc CFLAGS="-mcpu=v8 -fwrapv -fno-ident -fomit-frame-pointer -O2 -pipe -fno-unwind-tables -fno-asynchronous-unwind-tables -g3" CC="/home/wbx/smoke/host_x86_64-linux-gnu/bin/sparc-openadk-linux-gnu-gcc" CXX="/home/wbx/smoke/host_x86_64-linux-gnu/bin/sparc-openadk-linux-gnu-g++" AR="/home/wbx/smoke/host_x86_64-linux-gnu/bin/sparc-openadk-linux-gnu-ar" RANLIB="/home/wbx/smoke/host_x86_64-linux-gnu/bin/sparc-openadk-linux-gnu-ranlib" libc_cv_forced_unwind=yes libc_cv_cc_with_libunwind=yes libc_cv_c_cleanup=yes libc_cv_gnu99_inline=yes libc_cv_initfini_array=yes  \
-../glibc-2.19/configure \
-	--prefix=/usr \
-	--enable-shared \
-	--enable-stackguard-randomization \
-	--build=x86_64-linux-gnu --host=sparc-openadk-linux-gnu --with-headers=/home/wbx/smoke/target_sparc_glibc/usr/include --disable-sanity-checks --disable-nls --without-cvs --disable-profile --disable-debug --without-gd --disable-nscd --with-__thread --with-tls --enable-kernel="2.6.32" --enable-add-ons 
-PATH="/home/wbx/smoke/host_x86_64-linux-gnu/bin:$PATH" make all
-PATH="/home/wbx/smoke/host_x86_64-linux-gnu/bin:$PATH" make install_root=/home/wbx/smoke/target_sparc_glibc install
-if [ $? -ne 0 ];then
-	echo failed
-	exit
-fi
-cd ..
-
-mkdir gcc-final
-cd gcc-final
-../gcc/configure \
-	--prefix=/home/wbx/smoke/host_x86_64-linux-gnu --with-bugurl="http://www.openadk.org/" --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=sparc-openadk-linux-gnu --with-gmp=/home/wbx/smoke/host_x86_64-linux-gnu --with-mpfr=/home/wbx/smoke/host_x86_64-linux-gnu --with-libelf=/home/wbx/smoke/host_x86_64-linux-gnu --disable-__cxa_atexit --with-gnu-ld --with-gnu-as --enable-tls --disable-libsanitizer --disable-libitm --disable-libmudflap --disable-libgomp --disable-decimal-float --disable-libstdcxx-pch --disable-ppl-version-check --disable-cloog-version-check --without-system-zlib --without-ppl --without-cloog --without-isl --disable-nls --enable-target-optspace \
-			 --disable-biarch --disable-multilib --enable-libssp --enable-lto \
-			--enable-languages=c,c++ \
-			--with-build-sysroot='${prefix}/../target_sparc_glibc' \
-			--with-sysroot='${prefix}/../target_sparc_glibc' \
-			--enable-shared
-make -j4 all
-if [ $? -ne 0 ];then
-	echo failed
-	exit
-fi
-make install
-if [ $? -ne 0 ];then
-	echo failed
-	exit
-fi
-cd ..
-
-cd linux-3.13.6/
-cat > mini.config <<EOF
-CONFIG_SPARC=y
-CONFIG_SPARC32=y
-CONFIG_SBUS=y
-CONFIG_SBUSCHAR=y
-CONFIG_PCI=y
-CONFIG_PCI_SYSCALL=y
-CONFIG_PCIC_PCI=y
-CONFIG_OF=y
-CONFIG_NET_VENDOR_AMD=y
-CONFIG_SUNLANCE=y
-CONFIG_SERIAL_CONSOLE=y
-CONFIG_SERIAL_SUNCORE=y
-CONFIG_SERIAL_SUNZILOG=y
-CONFIG_SERIAL_SUNZILOG_CONSOLE=y
-EOF
-
-PATH="/home/wbx/smoke/host_x86_64-linux-gnu/bin:$PATH" make V=1 ARCH=sparc CROSS_COMPILE="/home/wbx/smoke/host_x86_64-linux-gnu/bin/sparc-openadk-linux-gnu-" CC="/home/wbx/smoke/host_x86_64-linux-gnu/bin/sparc-openadk-linux-gnu-gcc" HOSTCC="cc" CONFIG_SHELL='/bin/bash' HOSTCFLAGS='-O2 -Wall' KCONFIG_ALLCONFIG=mini.config allnoconfig 
-PATH="/home/wbx/smoke/host_x86_64-linux-gnu/bin:$PATH" make V=1 ARCH=sparc CROSS_COMPILE="/home/wbx/smoke/host_x86_64-linux-gnu/bin/sparc-openadk-linux-gnu-" CC="/home/wbx/smoke/host_x86_64-linux-gnu/bin/sparc-openadk-linux-gnu-gcc" HOSTCC="cc" CONFIG_SHELL='/bin/bash' HOSTCFLAGS='-O2 -Wall' -j4 zImage

+ 0 - 9
scripts/make

@@ -1,9 +0,0 @@
-#!/usr/bin/env bash
-# This file is part of the OpenADK project. OpenADK is copyrighted
-# material, please see the LICENCE file in the top-level directory.
-
-if [ -z "$(which gmake 2>/dev/null)" ];then
-	/usr/bin/make "$@"
-else
-	gmake "$@"
-fi

+ 643 - 0
scripts/prereq.sh

@@ -0,0 +1,643 @@
+#!/bin/sh
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+# resolve prerequisites for OpenADK build
+
+topdir=$(pwd)
+target="$@"
+flags="$MAKEFLAGS"
+out=0
+
+mirror=http://distfiles.openadk.org
+makever=4.1
+bashver=4.3.30
+
+# detect operating system
+os=$(env uname)
+osver=$(env uname -r)
+printf " --->  $os $osver for build detected.\n"
+
+# check if the filesystem is case sensitive
+rm -f foo
+echo >FOO
+if [ -e foo ]; then
+  printf "ERROR: OpenADK cannot be built in a case-insensitive file system."
+  case $os in
+    CYG*)
+      printf "Building OpenADK on $os needs a small registry change."
+      printf "http://cygwin.com/cygwin-ug-net/using-specialnames.html"
+      ;;
+    Darwin*)
+      printf "Building OpenADK on $os needs a case-sensitive disk partition."
+      printf "For Snow Leopard and above you can use diskutil to resize your existing disk."
+      printf "Example: sudo diskutil resizeVolume disk0s2 90G 1 jhfsx adk 30G"
+      printf "For older versions you might consider to use a disk image:"
+      printf "hdiutil create -type SPARSE -fs 'Case-sensitive Journaled HFS+' -size 30g ~/openadk.dmg"
+      ;;
+  esac
+  rm -f FOO
+  exit 1
+fi
+rm -f FOO
+
+# do we have a download tool?
+tools="curl wget"
+for tool in $tools; do
+  printf " --->  checking if $tool is installed.. "
+  if which $tool >/dev/null; then
+    printf "found\n"
+    case $tool in
+      curl)
+        FETCHCMD="$(which $tool) -k -f -s -o "
+        ;;
+      wget)
+        FETCHCMD="$(which $tool) --no-check-certificate -q -O "
+        ;;
+    esac
+    break
+  else
+    printf "not found\n"
+    continue
+  fi
+done
+if [ -z "$FETCHCMD" ]; then
+  printf "ERROR: no download tool found. Fatal error.\n"
+  exit 1
+fi
+
+# do we have a checksum tool?
+tools="sha256sum sha256 cksum shasum"
+for tool in $tools; do
+  printf " --->  checking if $tool is installed.. "
+  if which $tool >/dev/null 2>/dev/null; then
+    printf "found\n"
+    # check if cksum is usable
+    case $tool in
+      sha256sum)
+        SHA256=$(which $tool)
+        ;;
+      sha256)
+        SHA256="$(which $tool) -q"
+        ;;
+      cksum)
+        if cksum -q >/dev/null 2>/dev/null; then
+          SHA256="$(which $tool) -q -a sha256"
+        else
+          continue
+        fi
+        ;;
+      shasum)
+        SHA256="$(which $tool) -a 256"
+        ;;
+    esac
+    break
+  else
+    printf "not found\n"
+    continue
+  fi
+done
+if [ -z "$SHA256" ]; then
+  printf "ERROR: no checksum tool found. Fatal error.\n"
+  exit 1
+fi
+
+# create download dir
+if [ ! -d $topdir/dl ]; then
+  mkdir -p $topdir/dl
+fi
+
+# check for c compiler
+compilerbins="cc gcc clang"
+for compilerbin in $compilerbins; do
+  printf " --->  checking if $compilerbin is installed.. "
+  if which $compilerbin >/dev/null; then
+    printf "found\n"
+    CC=$compilerbin
+    break
+  fi
+done
+
+# check for c++ compiler
+compilerbins="c++ g++ clang++"
+for compilerbin in $compilerbins; do
+  printf " --->  checking if $compilerbin is installed.. "
+  if which $compilerbin >/dev/null; then
+    printf "found\n"
+    CXX=$compilerbin
+    break
+  fi
+done
+
+gnu_host_name=$(${CC} -dumpmachine)
+
+# relocation of topdir?
+olddir=$(grep "^ADK_TOPDIR" prereq.mk 2>/dev/null |cut -d '=' -f 2)
+newdir=$(pwd)
+
+if [ ! -z "$olddir" ]; then
+  if [ "$olddir" != "$newdir" ]; then
+    printf " --->  adk directory was relocated, fixing .."
+    sed -i -e "s#$olddir#$newdir#g" $(find target_* -name \*.pc|xargs) 2>/dev/null
+    sed -i -e "s#$olddir#$newdir#g" $(find host_${gnu_host_name} -type f|xargs) 2>/dev/null
+    sed -i -e "s#$olddir#$newdir#g" $(find target_*/scripts -type f|xargs) 2>/dev/null
+    sed -i -e "s#$olddir#$newdir#" target_*/etc/ipkg.conf 2>/dev/null
+    sleep 2
+    printf "done\n"
+  fi
+fi
+
+
+case :$PATH: in
+  (*:$topdir/host_${gnu_host_name}/bin:*) ;;
+  (*) export PATH=$topdir/host_${gnu_host_name}/bin:$PATH ;;
+esac
+
+# check for GNU make
+makebins="gmake make"
+for makebin in $makebins; do
+  printf " --->  checking if $makebin is installed.. "
+  if which $makebin >/dev/null 2>/dev/null; then
+    printf "found\n"
+    printf " --->  checking if it is GNU make.. "
+    $makebin --version 2>/dev/null| grep GNU >/dev/null
+    if [ $? -eq 0 ]; then
+      printf "yes\n"
+      MAKE=$(which $makebin)
+      break
+    else
+      # we need to build GNU make
+      printf "no\n"
+      printf " --->  compiling missing GNU make.. "
+      cd dl
+      $FETCHCMD make-${makever}.tar.gz $mirror/make-${makever}.tar.gz
+      if [ $? -ne 0 ]; then
+        printf "ERROR: failed to download make from $mirror\n"
+        exit 1
+      fi
+      cd ..
+      mkdir tmp
+      cd tmp
+      tar xzf ../dl/make-${makever}.tar.gz
+      cd make-$makever
+      ./configure --prefix=$topdir/host_$gnu_host_name/
+      make
+      make install
+      cd ..
+      cd ..
+      rm -rf tmp
+      MAKE=$topdir/host_$gnu_host_name/bin/make
+      makebin=$topdir/host_$gnu_host_name/bin/make
+      printf " done\n"
+    fi
+  else
+    printf "not found\n"
+    continue
+  fi
+done
+
+# check for bash
+printf " --->  checking if bash is installed.. "
+if which bash >/dev/null; then
+  printf "found\n"
+else
+  # we need to build GNU bash
+  printf "not found\n"
+  printf " --->  compiling missing GNU bash.. "
+  cd dl
+  $FETCHCMD bash-${bashver}.tar.gz $mirror/bash-${bashver}.tar.gz
+  if [ $? -ne 0 ]; then
+    printf "ERROR: failed to download make from $mirror\n"
+    exit 1
+  fi
+  cd ..
+  mkdir tmp
+  cd tmp
+  tar xzf ../dl/bash-${bashver}.tar.gz
+  cd bash-${bashver}
+  ./configure --prefix=$topdir/host_$gnu_host_name/
+  make
+  make install
+  cd ..
+  cd ..
+  rm -rf tmp
+  printf " done\n"
+fi
+
+# skip the script if distclean / cleandir
+if [ "$target" = "distclean" -o "$target" = "cleandir" ]; then
+  touch prereq.mk
+  $makebin ADK_TOPDIR=$topdir -s -f Makefile.adk $flags $target
+  exit 0
+fi
+
+printf " --->  checking if perl is installed.. "
+if ! which perl >/dev/null 2>&1; then
+  echo You must install perl to continue.
+  echo
+  out=1
+  printf "not found\n"
+fi
+printf "found\n"
+
+# creating prereq.mk
+echo "ADK_TOPDIR:=$(readlink -nf . 2>/dev/null || pwd -P)" > $topdir/prereq.mk
+echo "BASH:=$(which bash)" >> $topdir/prereq.mk
+echo "SHELL:=$(which bash)" >> $topdir/prereq.mk
+echo "GMAKE:=$MAKE" >> $topdir/prereq.mk
+echo "MAKE:=$MAKE" >> $topdir/prereq.mk
+echo "FETCHCMD:=$FETCHCMD" >> $topdir/prereq.mk
+echo "SHA256:=$SHA256" >> $topdir/prereq.mk
+echo "GNU_HOST_NAME:=${gnu_host_name}" >> $topdir/prereq.mk
+echo "OS_FOR_BUILD:=${os}" >> $topdir/prereq.mk
+echo "ARCH_FOR_BUILD:=$(${CC} -dumpmachine | sed \
+    -e 's/x86_64-linux-gnux32/x32/' \
+    -e s'/-.*//' \
+    -e 's/sparc.*/sparc/' \
+    -e 's/armeb.*/armeb/g' \
+    -e 's/arm.*/arm/g' \
+    -e 's/m68k.*/m68k/' \
+    -e 's/sh[234]/sh/' \
+    -e 's/mips-.*/mips/' \
+    -e 's/mipsel-.*/mipsel/' \
+    -e 's/i[3-9]86/x86/' \
+    )" >>prereq.mk
+
+if [ "$CC" = "clang" ]; then
+  echo "HOST_CC:=${CC} -fbracket-depth=1024" >> $topdir/prereq.mk
+else
+  echo "HOST_CC:=${CC}" >> $topdir/prereq.mk
+fi
+if [ "$CXX" = "clang++" ]; then
+  echo "HOST_CXX:=${CXX} -fbracket-depth=1024" >> $topdir/prereq.mk
+else
+  echo "HOST_CXX:=${CXX}" >> $topdir/prereq.mk
+fi
+
+echo 'LANGUAGE:=C' >> $topdir/prereq.mk
+echo 'LC_ALL:=C' >> $topdir/prereq.mk
+echo "_PATH:=$PATH" >> $topdir/prereq.mk
+echo "PATH:=${topdir}/scripts:/usr/sbin:$PATH" >> $topdir/prereq.mk
+echo "GIT:=$(which git 2>/dev/null)" >> $topdir/prereq.mk
+echo "export ADK_TOPDIR GIT SHA256 BASH SHELL" >> $topdir/prereq.mk
+
+# check if compiler works
+cat >Makefile.tmp <<'EOF'
+include ${ADK_TOPDIR}/prereq.mk
+all: test
+
+test: test.c
+	@${HOST_CC} ${HOST_CFLAGS} -o $@ $^ ${LDADD}
+EOF
+cat >test.c <<-'EOF'
+	#include <stdio.h>
+	int
+	main()
+	{
+		printf("YES");
+		return (0);
+	}
+EOF
+
+$MAKE --no-print-directory ADK_TOPDIR=$topdir -f Makefile.tmp 2>&1
+X=$(./test)
+if [ $X != YES ]; then
+  echo "$X" | sed 's/^/| /'
+  echo Cannot compile a simple test programme.
+  echo You must install a host make and C compiler.
+  echo
+  out=1
+fi
+rm test.c test Makefile.tmp 2>/dev/null
+
+# error out on any required prerequisite
+if [ $out -ne 0 ]; then
+  exit $out
+fi
+
+host_build_bc=0
+if which bc >/dev/null 2>&1; then
+  if ! echo quit|bc -q 2>/dev/null >/dev/null; then
+    host_build_bc=1
+  else 
+    if bc -v 2>&1| grep -q BSD >/dev/null 2>&1; then
+      host_build_bc=1
+    fi 
+  fi
+else
+  host_build_bc=1
+fi
+
+host_build_bison=0
+if ! which bison >/dev/null 2>&1; then
+  host_build_bison=1
+fi
+
+host_build_bzip2=0
+if ! which bzip2 >/dev/null 2>&1; then
+  host_build_bzip2=1
+fi
+
+host_build_file=0
+if ! which file >/dev/null 2>&1; then
+  host_build_file=1
+fi
+
+host_build_flex=0
+if ! which flex >/dev/null 2>&1; then
+  host_build_flex=1
+fi
+
+host_build_m4=0
+if ! which m4 >/dev/null 2>&1; then
+  host_build_m4=1
+fi
+
+host_build_mksh=0
+if ! which mksh >/dev/null 2>&1; then
+  host_build_mksh=1
+fi
+
+host_build_patch=0
+if ! which patch >/dev/null 2>&1; then
+  host_build_patch=1
+fi
+
+host_build_pkgconf=0
+if ! which pkgconf >/dev/null 2>&1; then
+  host_build_pkgconf=1
+fi
+
+host_build_tar=0
+if which tar >/dev/null 2>&1; then
+  if ! tar --version 2>/dev/null|grep GNU >/dev/null;then
+    host_build_tar=1
+  fi
+else
+  host_build_tar=1
+fi
+
+host_build_findutils=0
+if which xargs >/dev/null 2>&1; then
+  if ! xargs --version 2>/dev/null|grep GNU >/dev/null;then
+    host_build_findutils=1
+  fi
+fi
+
+if which find >/dev/null 2>&1; then
+  if ! find --version 2>/dev/null|grep GNU >/dev/null;then
+    host_build_findutils=1
+  fi
+fi
+
+host_build_grep=0
+if which grep >/dev/null 2>&1; then
+  if ! grep --version 2>/dev/null|grep GNU >/dev/null;then
+    host_build_grep=1
+  fi
+fi
+
+host_build_gawk=0
+if ! which gawk >/dev/null 2>&1; then
+  host_build_gawk=1
+fi
+
+host_build_sed=0
+if which sed >/dev/null 2>&1; then
+  if ! sed --version 2>/dev/null|grep GNU >/dev/null;then
+    host_build_sed=1
+  fi
+fi
+
+host_build_xz=0
+if ! which xz >/dev/null 2>&1; then
+  host_build_xz=1
+fi
+
+# optional
+host_build_cdrtools=0
+if ! which mkisofs >/dev/null 2>&1; then
+  host_build_cdrtools=1
+fi
+
+host_build_ccache=0
+if ! which ccache >/dev/null 2>&1; then
+  host_build_ccache=1
+fi
+
+host_build_genext2fs=0
+if ! which genext2fs >/dev/null 2>&1; then
+  host_build_genext2fs=1
+fi
+
+host_build_lzma=0
+if ! which lzma >/dev/null 2>&1; then
+  host_build_lzma=1
+fi
+
+host_build_lz4=0
+if ! which lz4c >/dev/null 2>&1; then
+  host_build_lz4=1
+fi
+
+host_build_lzop=0
+if ! which lzop >/dev/null 2>&1; then
+  host_build_lzop=1
+fi
+
+host_build_qemu=0
+if ! which qemu-img >/dev/null 2>&1; then
+  host_build_qemu=1
+fi
+
+echo "config ADK_HOST_BUILD_TOOLS" > $topdir/target/config/Config.in.prereq
+printf "\t%s\n" "bool" >> $topdir/target/config/Config.in.prereq
+printf "\t%s\n" "default y" >> $topdir/target/config/Config.in.prereq
+# 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_gawk -eq 1 ]; then
+  printf "\t%s\n" "select ADK_HOST_BUILD_GAWK" >> $topdir/target/config/Config.in.prereq
+fi
+if [ $host_build_grep -eq 1 ]; then
+  printf "\t%s\n" "select ADK_HOST_BUILD_GREP" >> $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_mksh -eq 1 ]; then
+  printf "\t%s\n" "select ADK_HOST_BUILD_MKSH" >> $topdir/target/config/Config.in.prereq
+fi
+if [ $host_build_patch -eq 1 ]; then 
+  printf "\t%s\n" "select ADK_HOST_BUILD_PATCH" >> $topdir/target/config/Config.in.prereq
+fi
+if [ $host_build_pkgconf -eq 1 ]; then
+  printf "\t%s\n" "select ADK_HOST_BUILD_PKGCONF" >> $topdir/target/config/Config.in.prereq
+fi
+if [ $host_build_findutils -eq 1 ]; then
+  printf "\t%s\n" "select ADK_HOST_BUILD_FINDUTILS" >> $topdir/target/config/Config.in.prereq
+fi
+if [ $host_build_sed -eq 1 ]; then
+  printf "\t%s\n" "select ADK_HOST_BUILD_SED" >> $topdir/target/config/Config.in.prereq
+fi
+if [ $host_build_tar -eq 1 ]; then
+  printf "\t%s\n" "select ADK_HOST_BUILD_TAR" >> $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_cdrtools -eq 1 ]; then
+  printf "\t%s\n" "select ADK_HOST_BUILD_CDRTOOLS if ADK_HOST_NEED_CDRTOOLS" >> $topdir/target/config/Config.in.prereq
+fi
+if [ $host_build_genext2fs -eq 1 ]; then
+  printf "\t%s\n" "select ADK_HOST_BUILD_GENEXT2FS if ADK_HOST_NEED_GENEXT2FS" >> $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_lz4 -eq 1 ]; then
+  printf "\t%s\n" "select ADK_HOST_BUILD_LZ4 if ADK_HOST_NEED_LZ4" >> $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
+if [ $host_build_qemu -eq 1 ]; then
+  printf "\t%s\n" "select ADK_HOST_BUILD_QEMU if ADK_HOST_NEED_QEMU" >> $topdir/target/config/Config.in.prereq
+fi
+
+# create Host OS symbols
+case $os in
+  Linux)
+    printf "\nconfig ADK_HOST_LINUX\n" >> $topdir/target/config/Config.in.prereq
+    printf "\tbool\n" >> $topdir/target/config/Config.in.prereq
+    printf "\tdefault y\n" >> $topdir/target/config/Config.in.prereq
+    ;;
+  Darwin)
+    printf "\nconfig ADK_HOST_DARWIN\n" >> $topdir/target/config/Config.in.prereq
+    printf "\tbool\n" >> $topdir/target/config/Config.in.prereq
+    printf "\tdefault y\n" >> $topdir/target/config/Config.in.prereq
+    ;;
+  OpenBSD)
+    printf "\nconfig ADK_HOST_OPENBSD\n" >> $topdir/target/config/Config.in.prereq
+    printf "\tbool\n" >> $topdir/target/config/Config.in.prereq
+    printf "\tdefault y\n" >> $topdir/target/config/Config.in.prereq
+    ;;
+  FreeBSD)
+    printf "\nconfig ADK_HOST_FREEBSD\n" >> $topdir/target/config/Config.in.prereq
+    printf "\tbool\n" >> $topdir/target/config/Config.in.prereq
+    printf "\tdefault y\n" >> $topdir/target/config/Config.in.prereq
+    ;;
+  NetBSD)
+    printf "\nconfig ADK_HOST_NETBSD\n" >> $topdir/target/config/Config.in.prereq
+    printf "\tbool\n" >> $topdir/target/config/Config.in.prereq
+    printf "\tdefault y\n" >> $topdir/target/config/Config.in.prereq
+    ;;
+  MirBSD)
+    printf "\nconfig ADK_HOST_MIRBSD\n" >> $topdir/target/config/Config.in.prereq
+    printf "\tbool\n" >> $topdir/target/config/Config.in.prereq
+    printf "\tdefault y\n" >> $topdir/target/config/Config.in.prereq
+    ;;
+  Cygwin*)
+    printf "\nconfig ADK_HOST_CYGWIN\n" >> $topdir/target/config/Config.in.prereq
+    printf "\tbool\n" >> $topdir/target/config/Config.in.prereq
+    printf "\tdefault y\n" >> $topdir/target/config/Config.in.prereq
+    ;;
+esac
+
+if [ ! -f $topdir/.config ]; then
+  # create a config if no exist
+  touch .firstrun
+  $makebin ADK_TOPDIR=$topdir --no-print-directory -f Makefile.adk menuconfig
+else
+  # scan host-tool prerequisites of certain packages before building.
+  . $topdir/.config
+  if [ -n "$ADK_PACKAGE_KODI" ]; then
+    NEED_JAVA="$NEED_JAVA kodi"
+  fi
+
+  if [ -n "$ADK_PACKAGE_ICU4C" ]; then
+    NEED_STATIC_LIBSTDCXX="$NEED_STATIC_LIBSTDCXX icu4c"
+  fi
+
+  if [ -n "$ADK_PACKAGE_XKEYBOARD_CONFIG" ]; then
+    NEED_XKBCOMP="$NEED_XKBCOMP xkeyboard-config"
+  fi
+
+  if [ -n "$ADK_PACKAGE_FONT_BITSTREAM_100DPI" ]; then
+    NEED_MKFONTDIR="$NEED_MKFONTDIR font-bitstream-100dpi"
+  fi
+
+  if [ -n "$ADK_PACKAGE_FONT_BITSTREAM_75DPI" ]; then
+    NEED_MKFONTDIR="$NEED_MKFONTDIR font-bitstream-75dpi"
+  fi
+
+  if [ -n "$ADK_PACKAGE_FONT_ADOBE_100DPI" ]; then
+    NEED_MKFONTDIR="$NEED_MKFONTDIR font-adobe-100dpi"
+  fi
+
+  if [ -n "$ADK_PACKAGE_FONT_ADOBE_75DPI" ]; then
+    NEED_MKFONTDIR="$NEED_MKFONTDIR font-adobe-75dpi"
+  fi
+
+  if [ -n "$NEED_MKFONTDIR" ]; then
+    if ! which mkfontdir >/dev/null 2>&1; then
+      printf "You need mkfontdir to build $NEED_MKFONTDIR"
+      out=1
+    fi
+  fi
+
+  if [ -n "$NEED_XKBCOMP" ]; then
+    if ! which xkbcomp >/dev/null 2>&1; then
+      printf "You need xkbcomp to build $NEED_XKBCOMP"
+      out=1
+    fi
+  fi
+
+  if [ -n "$NEED_JAVA" ]; then
+    if ! which java >/dev/null 2>&1; then
+      printf "You need java to build $NEED_JAVA"
+      out=1
+    fi
+  fi
+
+  if [ -n "$NEED_STATIC_LIBSTDCXX" ]; then
+cat >test.c <<-'EOF'
+	#include <stdio.h>
+	int
+	main()
+	{
+		return (0);
+	}
+EOF
+    if ! $CXX -static-libstdc++ -o test test.c 2>/dev/null ; then
+      printf "You need static version of libstdc++ installed to build $NEED_STATIC_LIBSTDCXX"
+      out=1
+      rm test test.c 2>/dev/null
+    fi
+  fi
+
+  # error out
+  if [ $out -ne 0 ]; then
+    exit $out
+  fi
+
+  # start build
+  $makebin ADK_TOPDIR=$topdir --no-print-directory -f Makefile.adk $flags $target
+fi

+ 0 - 18
scripts/reloc.sh

@@ -1,18 +0,0 @@
-#!/usr/bin/env bash
-# execute this after relocation of adk directory
-
-olddir=$(grep "^ADK_TOPDIR" prereq.mk 2>/dev/null |cut -d '=' -f 2)
-newdir=$(pwd)
-
-if [ ! -z "$olddir" ];then
-  if [ "$olddir" != "$newdir" ];then
-	echo "adk directory relocated!"
-	echo "old directory: $olddir"
-	echo "new directory: $newdir"
-	sed -i -e "s#$olddir#$newdir#g" $(find target_* -name \*.pc|xargs)
-	sed -i -e "s#$olddir#$newdir#g" $(find target_* -name \*.la|xargs)
-	sed -i -e "s#$olddir#$newdir#g" $(find target_*/scripts -type f|xargs)
-	sed -i -e "s#$olddir#$newdir#" target_*/etc/ipkg.conf
-	sed -i -e "s#$olddir#$newdir#" prereq.mk
-  fi
-fi

+ 0 - 91
scripts/scan-pkgs.sh

@@ -1,91 +0,0 @@
-# This file is part of the OpenADK project. OpenADK is copyrighted
-# material, please see the LICENCE file in the top-level directory.
-#
-# Scan host-tool prerequisites of certain packages before building.
-
-if test -z "$BASH_VERSION"; then
-	foo=`$BASH -c 'echo "$BASH_VERSION"'`
-else
-	foo=$BASH_VERSION
-fi
-
-if test -z "$foo"; then
-	echo OpenADK requires GNU bash to be installed.
-	exit 1
-fi
-
-test -z "$BASH_VERSION$KSH_VERSION" && exec $BASH $0 "$@"
-
-[[ -n $BASH_VERSION ]] && shopt -s extglob
-topdir=$(readlink -nf $(dirname $0)/.. 2>/dev/null || (cd $(dirname $0)/..; pwd -P))
-OStype=$(uname)
-out=0
-
-. $topdir/.config
-
-if [[ -n $ADK_PACKAGE_KODI ]]; then
-	NEED_JAVA="$NEED_JAVA kodi"
-fi
-
-if [[ -n $ADK_PACKAGE_ICU4C ]]; then
-	NEED_STATIC_LIBSTDCXX="$NEED_STATIC_LIBSTDCXX icu4c"
-fi
-
-if [[ -n $ADK_PACKAGE_XKEYBOARD_CONFIG ]]; then
-	NEED_XKBCOMP="$NEED_XKBCOMP xkeyboard-config"
-fi
-
-if [[ -n $ADK_PACKAGE_FONT_BITSTREAM_100DPI ]]; then
-	NEED_MKFONTDIR="$NEED_MKFONTDIR font-bitstream-100dpi"
-fi
-
-if [[ -n $ADK_PACKAGE_FONT_BITSTREAM_75DPI ]]; then
-	NEED_MKFONTDIR="$NEED_MKFONTDIR font-bitstream-75dpi"
-fi
-
-if [[ -n $ADK_PACKAGE_FONT_ADOBE_100DPI ]]; then
-	NEED_MKFONTDIR="$NEED_MKFONTDIR font-adobe-100dpi"
-fi
-
-if [[ -n $ADK_PACKAGE_FONT_ADOBE_75DPI ]]; then
-	NEED_MKFONTDIR="$NEED_MKFONTDIR font-adobe-75dpi"
-fi
-
-if [[ -n $NEED_MKFONTDIR ]]; then
-	if ! which mkfontdir >/dev/null 2>&1; then
-		echo >&2 You need mkfontdir to build $NEED_MKFONTDIR
-		out=1
-	fi
-fi
-
-if [[ -n $NEED_XKBCOMP ]]; then
-	if ! which xkbcomp >/dev/null 2>&1; then
-		echo >&2 You need xkbcomp to build $NEED_XKBCOMP
-		out=1
-	fi
-fi
-
-if [[ -n $NEED_JAVA ]]; then
-	if ! which java >/dev/null 2>&1; then
-		echo >&2 You need java to build $NEED_JAVA
-		out=1
-	fi
-fi
-
-if [[ -n $NEED_STATIC_LIBSTDCXX ]]; then
-cat >test.c <<-'EOF'
-	#include <stdio.h>
-	int
-	main()
-	{
-		return (0);
-	}
-EOF
-	if ! g++ -static-libstdc++ -o test test.c ; then
-		echo >&2 You need static version of libstdc++ installed to build $NEED_STATIC_LIBSTDCXX
-		out=1
-		rm test 2>/dev/null
-	fi
-fi
-
-exit $out

+ 0 - 14
scripts/sha256sum

@@ -1,14 +0,0 @@
-#!/usr/bin/env bash
-# This file is part of the OpenADK project. OpenADK is copyrighted
-# material, please see the LICENCE file in the top-level directory.
-
-if [ -x /usr/bin/sha256sum ]; then
-	/usr/bin/sha256sum "$@"
-elif [ -x /bin/cksum ] && [ $(echo | cksum -a sha256) = 01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b ]; then
-	# we assume the arguments are exactly "-c" or "-c -"
-	x=$(sed 's/^\([0-9a-fA-F]*\) *\([^ ].*\)$/SHA256 (\2) = \1/' | cksum -c -a sha256)
-	[[ $x = *FAILED* ]] && exit 1
-	exit 0
-else
-	shasum -a 256 "$@"
-fi

+ 12 - 7
target/Makefile

@@ -122,19 +122,25 @@ install: $(ADK_TARGET_ARCH)-imageclean $(ADK_TARGET_ARCH)-install $(ADK_TARGET_A
 clean: $(ADK_TARGET_ARCH)-clean $(ADK_TARGET_ARCH)-imageclean
 
 %-clean:
-	$(TRACE) target/$(patsubst %-clean,%,$@)-clean
+	$(START_TRACE) "target/$(patsubst %-clean,%,$@)-clean.. "
 	$(MAKE) -C $(patsubst %-clean,%,$@) clean
+	$(CMD_TRACE) " done"
+	$(END_TRACE)
 
 %-imageclean:
-	$(TRACE) target/$(patsubst %-imageclean,%,$@)-imageclean
+	$(START_TRACE) "target/$(patsubst %-imageclean,%,$@)-imageclean.. "
 	$(MAKE) -C $(patsubst %-imageclean,%,$@) imageclean
+	$(CMD_TRACE) " done"
+	$(END_TRACE)
 
 %-prepare:
-	$(TRACE) target/$(patsubst %-prepare,%,$@)-prepare
+	$(START_TRACE) "target/$(patsubst %-prepare,%,$@)-prepare.. "
 	$(MAKE) -C $(patsubst %-prepare,%,$@) prepare
+	$(CMD_TRACE) " done"
+	$(END_TRACE)
 
 %-imageprepare:
-	$(TRACE) target/$(patsubst %-imageprepare,%,$@)-imageprepare
+	$(START_TRACE) "target/$(patsubst %-imageprepare,%,$@)-imageprepare.. "
 ifeq ($(ADK_RUNTIME_DEV_UDEV),y)
 	# This should be made a package instead
 	$(CP) -a $(BUILD_DIR)/linux-$(ADK_TARGET_ARCH)/modules/lib $(TARGET_DIR)
@@ -146,20 +152,19 @@ endif
 		break; \
 	done
 	$(MAKE) -C $(patsubst %-imageprepare,%,$@) imageprepare
+	$(CMD_TRACE) " done"
+	$(END_TRACE)
 
 %-compile: %-prepare
-	$(TRACE) target/$(patsubst %-compile,%,$@)-compile
 	$(MAKE) -C $(patsubst %-compile,%,$@) compile
 
 %-install: %-compile
-	$(TRACE) target/$(patsubst %-install,%,$@)-install
 	$(MAKE) -C $(patsubst %-install,%,$@) install
 
 %-targethelp:
 	$(MAKE) -C $(patsubst %-targethelp,%,$@) targethelp
 
 %-imageinstall: %-imageprepare
-	$(TRACE) target/$(patsubst %-imageinstall,%,$@)-imageinstall
 	$(MAKE) -C $(patsubst %-imageinstall,%,$@) imageinstall
 	@for x in $$(ls $(ADK_TOPDIR)/scripts/postimage/*.sh 2>/dev/null); do \
 		[[ -x "$$x" ]] && $$x; \

+ 0 - 25
target/config/Config.in.adk

@@ -101,31 +101,6 @@ config ADK_TARGET_PORT
 	help
 	  Port to use for SSH when running make check.
 
-choice 
-prompt "Hostsystem (do not change!)"
-config ADK_HOST_LINUX
-	bool "Linux"
-
-config ADK_HOST_FREEBSD
-	bool "FreeBSD"
-
-config ADK_HOST_MIRBSD
-	bool "MirBSD"
-
-config ADK_HOST_OPENBSD
-	bool "OpenBSD"
-
-config ADK_HOST_NETBSD
-	bool "NetBSD"
-
-config ADK_HOST_DARWIN
-	bool "Darwin"
-
-config ADK_HOST_CYGWIN
-	bool "Cygwin"
-
-endchoice
-
 config ADK_PRELINK
 	prompt "Prelink binaries and libraries in Image"
 	boolean

+ 0 - 1
target/config/Config.in.target

@@ -131,7 +131,6 @@ config ADK_TARGET_ROOTFS_ISO
 	select ADK_HOST_NEED_CDRTOOLS
 	select ADK_HOST_NEED_SYSLINUX
 	select ADK_TARGET_QEMU_WITH_BLOCK if ADK_TARGET_QEMU
-	depends on ADK_HOST_LINUX
 	depends on ADK_TARGET_ARCH_X86
 	help
 	  Use this option to create a bootable ISO image.

+ 2 - 2
target/config/Config.in.tools

@@ -37,11 +37,11 @@ config ADK_HOST_BUILD_LIBTOOL
 
 config ADK_HOST_BUILD_LIBRESSL
 	bool
-	default y
+	default n
 
 config ADK_HOST_BUILD_WGET
 	bool
-	default y
+	default n
 
 # always required, but can be provided by host
 config ADK_HOST_BUILD_BASH

+ 21 - 7
toolchain/Makefile

@@ -61,11 +61,13 @@ gcc-install: $(ELF2FLT) $(CLIB)-install
 gcc-final: gcc-install $(GDB)
 
 %-download:
-	$(TRACE) toolchain/$(patsubst %-download,%,$@)/download
+	$(START_TRACE) "toolchain/$(patsubst %-download,%,$@)/download.. "
 	$(MAKE) -C $(patsubst %-download,%,$@) fetch
+	$(CMD_TRACE) " done"
+	$(END_TRACE)
 
 %-prepare:
-	$(TRACE) toolchain/$(patsubst %-prepare,%,$@)/prepare
+	$(START_TRACE) "toolchain/$(patsubst %-prepare,%,$@)/prepare.. "
 	@if test x"$(patsubst %-prepare,%,$@)" = x"$(CLIB)"; then \
 		$(MAKE) -C $(patsubst %-prepare,%,$@) prepare \
 		    $(MAKE_TRACE); \
@@ -73,9 +75,11 @@ gcc-final: gcc-install $(GDB)
 		$(MAKE) -C $(patsubst %-prepare,%,$@) prepare \
 		    CC='$(HOST_CC)' CFLAGS='$(HOST_CFLAGS)' $(MAKE_TRACE); \
 	fi
+	$(CMD_TRACE) " done"
+	$(END_TRACE)
 
 %-configure: %-prepare
-	$(TRACE) toolchain/$(patsubst %-configure,%,$@)/configure
+	$(START_TRACE) "toolchain/$(patsubst %-configure,%,$@)/configure.. "
 	@if test x"$(patsubst %-configure,%,$@)" = x"$(CLIB)"; then \
 		$(MAKE) -C $(patsubst %-configure,%,$@) configure \
 		    $(MAKE_TRACE); \
@@ -83,9 +87,11 @@ gcc-final: gcc-install $(GDB)
 		$(MAKE) -C $(patsubst %-configure,%,$@) configure \
 		    CC='$(HOST_CC)' CFLAGS='$(HOST_CFLAGS)' $(MAKE_TRACE); \
 	fi
+	$(CMD_TRACE) " done"
+	$(END_TRACE)
 
 %-compile: %-configure
-	$(TRACE) toolchain/$(patsubst %-compile,%,$@)/compile
+	$(START_TRACE) "toolchain/$(patsubst %-compile,%,$@)/compile.. "
 	@if test x"$(patsubst %-compile,%,$@)" = x"$(CLIB)"; then \
 		$(MAKE) -C $(patsubst %-compile,%,$@) compile \
 		    $(MAKE_TRACE); \
@@ -93,9 +99,11 @@ gcc-final: gcc-install $(GDB)
 		$(MAKE) -C $(patsubst %-compile,%,$@) compile \
 		    CC='$(HOST_CC)' CFLAGS='$(HOST_CFLAGS)' CXXFLAGS='$(HOST_STATIC_CXXFLAGS)' $(MAKE_TRACE); \
 	fi
+	$(CMD_TRACE) " done"
+	$(END_TRACE)
 
 %-install: %-compile
-	$(TRACE) toolchain/$(patsubst %-install,%,$@)/install
+	$(START_TRACE) "toolchain/$(patsubst %-install,%,$@)/install.. "
 	@if test x"$(patsubst %-install,%,$@)" = x"$(CLIB)"; then \
 		$(MAKE) -C $(patsubst %-install,%,$@) install \
 		    $(MAKE_TRACE); \
@@ -103,11 +111,17 @@ gcc-final: gcc-install $(GDB)
 		$(MAKE) -C $(patsubst %-install,%,$@) install \
 		    CC='$(HOST_CC)' CFLAGS='$(HOST_CFLAGS)' CXXFLAGS='$(HOST_STATIC_CXXFLAGS)' $(MAKE_TRACE); \
 	fi
+	$(CMD_TRACE) " done"
+	$(END_TRACE)
 
 %-final: %-install
-	$(TRACE) toolchain/$(patsubst %-final,%,$@)/final
+	$(START_TRACE) "toolchain/$(patsubst %-final,%,$@)/final.. "
 	@$(MAKE) -C $(patsubst %-final,%,$@) final $(MAKE_TRACE)
+	$(CMD_TRACE) " done"
+	$(END_TRACE)
 
 %-clean:
-	$(TRACE) toolchain/$(patsubst %-clean,%,$@)/clean
+	$(START_TRACE) "toolchain/$(patsubst %-clean,%,$@)/clean.. "
 	@$(MAKE) -C $(patsubst %-clean,%,$@) clean $(MAKE_TRACE)
+	$(CMD_TRACE) " done"
+	$(END_TRACE)

+ 0 - 1
toolchain/gcc/Makefile

@@ -49,7 +49,6 @@ GCC_CONFOPTS:=		--prefix=$(TOOLCHAIN_DIR)/usr \
 			--disable-libstdcxx-pch \
 			--disable-ppl-version-check \
 			--disable-cloog-version-check \
-			--with-system-zlib \
 			--without-ppl \
 			--without-cloog \
 			--without-isl \