From 55d169005f184591a6eb4a57af3608ebae94e317 Mon Sep 17 00:00:00 2001 From: Steve Bennett Date: Sun, 19 Mar 2023 15:49:13 +1000 Subject: build: allow build without math functions if sin(), etc. aren't available, just build without math functions unless --math is explicitly given Signed-off-by: Steve Bennett --- auto.def | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/auto.def b/auto.def index 36ab1e3..3fcf884 100644 --- a/auto.def +++ b/auto.def @@ -415,10 +415,13 @@ if {[opt-bool maintainer]} { define JIM_MAINTAINER } if {[opt-bool-unless-minimal math]} { - msg-result "Enabling math functions" - define JIM_MATH_FUNCTIONS - cc-check-function-in-lib sin m - define-append LDLIBS [get-define lib_sin] + if {[cc-check-function-in-lib sin m]} { + msg-result "Enabling math functions" + define JIM_MATH_FUNCTIONS + define-append LDLIBS [get-define lib_sin] + } elseif {[opt-bool -nodefault math] > 0} { + user-error "Math functions are not available" + } } if {[opt-bool-unless-minimal ipv6]} { msg-result "Enabling IPv6" -- cgit v1.1