From d3cb9892b3db67beade0636fa02e4e9ec145407c Mon Sep 17 00:00:00 2001 From: Andrew Clayton Date: Thu, 9 Jan 2025 03:55:44 +0000 Subject: [PATCH] auto/make: Fix various issues with building OTEL There were at least a couple of issues with building OTEL support. It only worked with GNU make due to the use of ifeq, even gmake had some issues. Debug builds were broken due to trying to pass --debug to cargo which is the default and isn't a valid option. This 'fixes' things by doing 'release' builds of OTEL by default. Passing D=1 to make will generate 'debug' builds but this as previously with D= etc, only works with GNU make. Fixes: 9d3dcb800 ("otel: add build tooling to include otel code") Link: Signed-off-by: Andrew Clayton --- auto/make | 22 +++++----------------- 1 file changed, 5 insertions(+), 17 deletions(-) diff --git a/auto/make b/auto/make index 2468ea39e..c0e96d408 100644 --- a/auto/make +++ b/auto/make @@ -21,8 +21,9 @@ AR = $AR EXTRA_CFLAGS = CFLAGS = $NXT_CFLAGS $NXT_CC_OPT $CFLAGS \$(EXTRA_CFLAGS) -RUST_FLAGS = -NXT_OTEL_LIB_STATIC = + +RUST_FLAGS = --release +NXT_OTEL_LIB_STATIC = $NXT_OTEL_LIB_DIR/target/release/libotel.a NXT_EXEC_LINK = $NXT_EXEC_LINK $NXT_LD_OPT NXT_SHARED_LOCAL_LINK = $NXT_SHARED_LOCAL_LINK $NXT_LD_OPT @@ -63,9 +64,8 @@ D := 0 ifeq (\$D,1) CFLAGS += -O0 - RUST_FLAGS += --debug -else - RUST_FLAGS += --release + RUST_FLAGS = + NXT_OTEL_LIB_STATIC = $NXT_OTEL_LIB_DIR/target/debug/libotel.a endif # Optionally disable -Werror with @@ -80,18 +80,6 @@ END fi -# potentially set otel lib location -if [ $NXT_OTEL = YES ]; then -cat << END >> $NXT_MAKEFILE - -ifeq (\$D,1) - NXT_OTEL_LIB_STATIC = $NXT_OTEL_LIB_DIR/target/debug/libotel.a -else - NXT_OTEL_LIB_STATIC = $NXT_OTEL_LIB_DIR/target/release/libotel.a -endif - -END -fi # The include paths list.