import/mk: Use libm from the export package when defined.

Nuttx exports libm.a when `CONFIG_LIBM` is enabled. Adjust the application import makefile to pick this up when linking.
This commit is contained in:
Stuart Ianna 2023-10-24 10:22:14 +11:00 committed by Xiang Xiao
parent a21476beab
commit 877509762c

View File

@ -70,12 +70,14 @@ ifeq ($(CONFIG_BUILD_KERNEL),y)
ifeq ($(CONFIG_HAVE_CXX),y)
LDLIBS += -lxx
endif
ifneq ($(CONFIG_LIBM),y)
ifeq ($(CONFIG_LIBM_TOOLCHAIN),y)
LIBM = ${shell "$(CC)" $(ARCHCPUFLAGS) --print-file-name=libm.a}
ifneq ($(LIBM),".")
LDLIBPATH += -L "${shell dirname $(LIBM)}"
LDLIBS += -lm
endif
else ifneq($(CONFIG_LIBM_NONE),)
LDLIBS += -lm
endif
endif