From 4c0c1732213f343f73c3bcf1e1129ec2af3184e3 Mon Sep 17 00:00:00 2001 From: Hamish Coleman Date: Sun, 25 Jun 2023 09:42:39 +0100 Subject: [PATCH] Check if we have been configured before running most of Make --- Makefile | 10 +++++++++- config.mak.in | 4 ++++ configure.ac | 3 ++- scripts/hack_fakeautoconf.sh | 1 + 4 files changed, 16 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 60b5b5d..e3ab9ee 100644 --- a/Makefile +++ b/Makefile @@ -1,3 +1,5 @@ +# Our default make target +all: export CC export AR @@ -6,7 +8,13 @@ export LDFLAGS export LDLIBS export TOOLS_ADDITIONAL -include config.mak +-include config.mak + +ifndef CONFIG_HOST +# TODO: +# dont error if we are installing build-deps or other non-compile action +$(error Please run ./configure) +endif #Ultrasparc64 users experiencing SIGBUS should try the following gcc options #(thanks to Robert Gibbon) diff --git a/config.mak.in b/config.mak.in index 7622aad..997e8e8 100644 --- a/config.mak.in +++ b/config.mak.in @@ -1,3 +1,7 @@ +# Global configuration, included in top Makefile and exported from there. +# @configure_input@ + +CONFIG_HOST=@host@ PACKAGE_VERSION=@PACKAGE_VERSION@ CC=@CC@ AR=@AR@ diff --git a/configure.ac b/configure.ac index b1fede6..8b7377a 100644 --- a/configure.ac +++ b/configure.ac @@ -4,6 +4,7 @@ dnl> Do not add anything above AC_DEFINE([PACKAGE_BUILDDATE], "[m4_esyscmd([scripts/version.sh date | tr -d '\n'])]", [Last change date]) +AC_CANONICAL_HOST AC_PROG_CC AC_CHECK_TOOL([AR], [ar], [false]) AC_CHECK_TOOL([WINDRES], [windres], [false]) @@ -106,7 +107,7 @@ AS_IF([test "x$enable_pthread" != xno], ) - +AC_SUBST(host) AC_SUBST(WINDRES) AC_SUBST(TOOLS_ADDITIONAL) AC_CONFIG_HEADERS(include/config.h) diff --git a/scripts/hack_fakeautoconf.sh b/scripts/hack_fakeautoconf.sh index dd01a6d..7cbd385 100755 --- a/scripts/hack_fakeautoconf.sh +++ b/scripts/hack_fakeautoconf.sh @@ -17,6 +17,7 @@ EOF chmod a+x configure cat >config.mak <