From ba14e905f3c473c776a1e4185adfb5bc9edb7bc8 Mon Sep 17 00:00:00 2001 From: Lephenixnoir Date: Thu, 14 Jan 2021 19:14:12 +0100 Subject: [PATCH] add an `any` configuration that uses existing GCC installs --- .gitignore | 1 + README.md | 6 ++++++ configure.sh | 9 +++++++++ giteapc-config-any.make | 4 ++++ giteapc.make | 4 +--- 5 files changed, 21 insertions(+), 3 deletions(-) create mode 100644 giteapc-config-any.make diff --git a/.gitignore b/.gitignore index 23f45e2..792f670 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,7 @@ # Everything but the scripts * !giteapc.make +!giteapc-config-any.make !configure.sh !build.sh !install.sh diff --git a/README.md b/README.md index b71d0bc..a370c25 100644 --- a/README.md +++ b/README.md @@ -11,3 +11,9 @@ You can also install manually. First install [`sh-elf-binutils`](https://gitea.p ``` % make -f giteapc.make configure build install PREFIX=$HOME/.local ``` + +An `any` configuration is provided in case GCC is already installed externally, to have this package installed without rebuilding it. + +``` +% giteapc install Lephenixnoir/sh-elf-gcc:any +``` diff --git a/configure.sh b/configure.sh index 1aeaceb..2469dd8 100755 --- a/configure.sh +++ b/configure.sh @@ -19,6 +19,15 @@ if [[ -f "$existing_gcc" ]]; then fi fi +# Aggressive parameter to avoid rebuilds + +if [[ ! -z "$ACCEPT_ANY" ]]; then + if command -v sh-elf-gcc >/dev/null 2>&1; then + echo "$TAG sh-elf-gcc in PATH and ACCEPT_ANY is set, skipping build" + exit 0 + fi +fi + # Download archive if [[ -f "$ARCHIVE" ]]; then diff --git a/giteapc-config-any.make b/giteapc-config-any.make new file mode 100644 index 0000000..5b11e6f --- /dev/null +++ b/giteapc-config-any.make @@ -0,0 +1,4 @@ +# Accept any version installed anywhere; try as hard as possible to not build +ACCEPT_ANY=1 + +export ACCEPT_ANY diff --git a/giteapc.make b/giteapc.make index d293f94..b52caff 100644 --- a/giteapc.make +++ b/giteapc.make @@ -4,9 +4,7 @@ PREFIX ?= $(GITEAPC_PREFIX) VERSION = 10.2.0 -ifneq ($(GITEAPC_CONFIG),) -include giteapc-config-$(GITEAPC_CONFIG).make -endif +-include giteapc-config.make configure: @ ./configure.sh $(VERSION) "$(PREFIX)"