From 8d00477b6a2ca690b66bb0f2b08b02fd7c64849a Mon Sep 17 00:00:00 2001 From: Lephenixnoir Date: Thu, 14 Jan 2021 18:33:28 +0100 Subject: [PATCH] add an `any` configuration that uses existing binutils 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 105340c..9599551 100644 --- a/README.md +++ b/README.md @@ -11,3 +11,9 @@ You can also install binutils manually by running the GiteaPC Makefile with a ma ``` % make -f giteapc.make configure build install PREFIX=$HOME/.local ``` + +An `any` configuration is provided in case you already have binutils installed somewhere and want to keep using it. This will turn this repository into a no-op while still satisfying requirements for other repositories. You can do this as long as you have `sh-elf-as` in your PATH: + +``` +% giteapc install Lephenixnoir/sh-elf-binutils:any +``` diff --git a/configure.sh b/configure.sh index 85cf175..a4efb20 100755 --- a/configure.sh +++ b/configure.sh @@ -19,6 +19,15 @@ if [[ -f "$existing_as" ]]; then fi fi +# Aggressive parameter to avoid rebuilds + +if [[ ! -z "$ACCEPT_ANY" ]]; then + if command -v sh-elf-as >/dev/null 2>&1; then + echo "$TAG Found sh-elf-as in PATH and ACCEPT_ANY is set, skipping build" + exit 0 + fi +fi + # Check dependencies for binutils and GCC if command -v apt >/dev/null 2>&1; 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 e6f10f8..cd1160e 100644 --- a/giteapc.make +++ b/giteapc.make @@ -3,9 +3,7 @@ PREFIX ?= $(GITEAPC_PREFIX) VERSION = 2.35.1 -ifneq ($(GITEAPC_CONFIG),) -include giteapc-config-$(GITEAPC_CONFIG).make -endif +-include giteapc-config.make configure: @ ./configure.sh $(VERSION) "$(PREFIX)"