From d274182ade805b3fdd566de9754257fdcd8cafc3 Mon Sep 17 00:00:00 2001 From: Leonid Plyushch Date: Sun, 11 Aug 2019 15:27:01 +0300 Subject: [PATCH] add support for on-device bootstrapping of "make" --- packages/make/build.sh | 17 +++++++++++++++++ scripts/setup-termux.sh | 2 +- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/packages/make/build.sh b/packages/make/build.sh index 8093c50f4..bfe7c1150 100644 --- a/packages/make/build.sh +++ b/packages/make/build.sh @@ -17,3 +17,20 @@ termux_step_pre_configure() { TERMUX_PKG_EXTRA_CONFIGURE_ARGS+=" ac_cv_func_pselect=no" fi } + +termux_step_make() { + # Allow to bootstrap make if building on device without make installed. + if [ -n "$TERMUX_ON_DEVICE_BUILD" ] && [ -z "$(command -v make)" ]; then + ./build.sh + else + make -j $TERMUX_MAKE_PROCESSES $QUIET_BUILD + fi +} + +termux_step_make_install() { + if [ -n "$TERMUX_ON_DEVICE_BUILD" ] && [ -z "$(command -v make)" ]; then + ./make -j 1 install + else + make -j 1 install + fi +} diff --git a/scripts/setup-termux.sh b/scripts/setup-termux.sh index 35d4d099d..1a7791a91 100755 --- a/scripts/setup-termux.sh +++ b/scripts/setup-termux.sh @@ -24,7 +24,7 @@ PACKAGES+=" golang" PACKAGES+=" gperf" PACKAGES+=" libtool" PACKAGES+=" m4" -PACKAGES+=" make" # Used for all Makefile projects and to build itself. +PACKAGES+=" make" # Used for all Makefile-based projects. PACKAGES+=" ninja" # Used by default to build all CMake projects. PACKAGES+=" perl" PACKAGES+=" pkg-config"