diff options
Diffstat (limited to 'config-figure-this-out-for-me.mk')
-rw-r--r-- | config-figure-this-out-for-me.mk | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/config-figure-this-out-for-me.mk b/config-figure-this-out-for-me.mk new file mode 100644 index 0000000..2d470f7 --- /dev/null +++ b/config-figure-this-out-for-me.mk @@ -0,0 +1,59 @@ +BASECONFIG !=\ + set -e; \ + if test -n "$(BASECONFIG)"; then \ + printf '%s\n' "$(BASECONFIG)"; \ + else \ + rm -f -- .config.mk.tmp; \ + (set -e; \ + sed 's/^\s*DOWNLOAD\s*=/\x23&/' < config.mk; \ + for testscript in */what-architecture-am-i-using; do \ + if test "$$testscript" = "util/what-architecture-am-i-using"; then \ + continue; \ + fi; \ + os="$$(printf '%s\n' "$$testscript" | cut -d / -f 1 | tr '[a-z]' '[A-Z]')"; \ + support="$${os}_SUPPORT"; \ + q=\'; \ + printf '%s_ != test -z "$$(%s_)" || printf %s%%s\\n%s "$$(%s)"\n' \ + "$$support" "$$support" $$q $$q "$$support"; \ + printf '%s !=\\\n' \ + "$$support"; \ + printf '\tif test -n "$$(%s_)"; then \\\n' \ + "$$support"; \ + printf '\t\tprintf '\''%%s\\n'\'' "$$(%s_)"; \\\n' \ + "$$support"; \ + printf '\telse \\\n'; \ + printf '\t\tset +e; \\\n'; \ + printf '\t\t%s false >/dev/null 2>&1; \\\n' \ + "$${testscript}"; \ + printf '\t\tif test $$$$? -lt 2; then printf %syes\\n%s; else printf %sno\\n%s; fi; \\\n' \ + $$q $$q $$q $$q; \ + printf '\tfi\n'; \ + done \ + ) > .config.mk.tmp; \ + printf '%s\n' .config.mk.tmp; \ + fi; + +include $(BASECONFIG) + +DOWNLOAD !=\ + if test -n "$(DOWNLOAD)"; then printf '%s\n' "$(DOWNLOAD)"; \ + elif curl --version >/dev/null 2>&1; then printf 'curl --\n'; \ + elif wget --version >/dev/null 2>&1; then printf 'wget -O - --\n'; \ + else printf 'curl --\n'; fi + +DEFAULT_OS_SUPPORT_SELECTION != : + +SUPPORTED_ARCHES_ != test -z "$(SUPPORTED_ARCHES_)" || printf '%s\n' "$(SUPPORTED_ARCHES)" + +SUPPORTED_ARCHES !=\ + if test -n "$(SUPPORTED_ARCHES_)"; then printf '%s\n' "$(SUPPORTED_ARCHES_)"; \ + else util/what-architecture-am-i-using true; fi + +DEFAULT_OS_SUPPORT_SELECTION != printf 'no\n' + +IMPORTANT_CFLAGS !=\ + printf '%s\n' $(IMPORTANT_CFLAGS) &&\ + if ! printf '%s\n' $(CC) $(CFLAGS) $(IMPORTANT_CFLAGS) | grep '^-std=c..$$' > /dev/null; then \ + sed -n 's/^.*\(-std=c..\).*$$/\1/p' < .config.mk.tmp | sed 1q; \ + fi + |