From d8c14d2cb6414ff9d3710d9126386cee51a1d189 Mon Sep 17 00:00:00 2001 From: Andrew Clayton Date: Mon, 6 Jan 2025 22:20:54 +0000 Subject: [PATCH] auto/make: Make GNU make mandatory There is breakage on non-GNU make systems due to the OTEL stuff using 'ifeq'. We had previously handled this by only using such constructs (and enabling certain features, such as D= & E=) when using GNU make. OTEL added this unconditionally. It's used to set the target build directory appropriately depending on whether we are doing debug or release builds. Unfortunately it seems there is no way to control this via cargo/rustc command line arguments or environment variables. For BSD make we could use '.if' etc but then trying to handle these two systems (and possibly more) in the build scripts is going to be unwieldy. Let's just bite the bullet and make (no pun intended) GNU make mandatory to build Unit, it's the default on Linux (I'm sure there's an exception somewhere...) and it seems the default on macOS. On other systems it's readily available via gmake(1). This also brings build feature parity to all systems out the box. As it happens, this also fixes issues with using gmake... Fixes: 9d3dcb800 ("otel: add build tooling to include otel code") Link: Signed-off-by: Andrew Clayton --- auto/make | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/auto/make b/auto/make index ec09f0164..dc9123989 100644 --- a/auto/make +++ b/auto/make @@ -36,14 +36,7 @@ manpage: $NXT_BUILD_DIR/share/man/man8/unitd.8 END - -NXT_OS=$(uname -s) -NXT_GNU_MAKE=$(make --version | grep GNU || true) - -# Requires GNU make. On OpenIndiana at least we have to use gmake -if [ -n "$NXT_GNU_MAKE" ] || [ $NXT_OS = "SunOS" ]; then - - cat << END >> $NXT_MAKEFILE +cat << END >> $NXT_MAKEFILE # By default compiler etc output is hidden, use # make V=1 ... # to show it. @@ -78,10 +71,9 @@ endif END -fi - # potentially set otel lib location if [ $NXT_OTEL = YES ]; then + cat << END >> $NXT_MAKEFILE ifeq (\$D,1) @@ -91,6 +83,7 @@ else endif END + fi # The include paths list.