From a94d74d9c875b4a1c07945bf9af282221d0178b3 Mon Sep 17 00:00:00 2001 From: Waldemar Brodkorb Date: Sun, 13 Dec 2015 17:18:40 +0100 Subject: 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 --- mk/host-bottom.mk | 33 ++++++++++++--------------------- 1 file changed, 12 insertions(+), 21 deletions(-) (limited to 'mk/host-bottom.mk') diff --git a/mk/host-bottom.mk b/mk/host-bottom.mk index caba52f3e..e28b1daf1 100644 --- a/mk/host-bottom.mk +++ b/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} -- cgit v1.2.3