rsimd

Make SIMD instruction sets easier to use
git clone git://git.meso-star.fr/rsimd.git
Log | Files | Refs | README | LICENSE

commit af9cf56003198872241361f452b30d136b48d66a
parent 8fd5c49e6929baa4e838003ee18a31f32d7cbbe0
Author: Vincent Forest <vincent.forest@meso-star.com>
Date:   Tue, 10 Oct 2023 16:30:54 +0200

Make the make.sh script independent of the make utility

This was true, except for the config_simd function, which relies on the
make command to obtain the values of macros defined in the config.mk
file. The value of the MAKE Makefile macro must be used, even in the
shell script. To this end, we have passed its value as an argument to
the config_simd function, which can then use the correct make command.

Until this correction, the build process failed when using the NetBSD
bmake command with the -j option.

Diffstat:
MMakefile | 2+-
Mmake.sh | 9++++++---
2 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/Makefile b/Makefile @@ -58,7 +58,7 @@ $(LIBNAME_STATIC): $(OBJ) @echo "config done" > $@ .simd: make.sh config.mk - @$(SHELL) make.sh config_simd > $@ + @$(SHELL) make.sh config_simd $(MAKE) > $@ .SUFFIXES: .c .d .o .c.d: diff --git a/make.sh b/make.sh @@ -21,14 +21,17 @@ # Print the value of a variable in config.mk showvar() { + var="$1" + shift 1 + # To avoid messages from Make being displayed instead of the value of the # queried variable, we redirect its output to /dev/null and open a new file # descriptor to stdout to print the variable -<< EOF make -f 3>&1 1>/dev/null 2>&1 - || kill -HUP $$ +<< EOF "$@" -f 3>&1 1>/dev/null 2>&1 - || kill -HUP $$ .POSIX: include config.mk showvar: - @1>&3 echo \$(${1}) + @1>&3 echo \$(${var}) EOF exec 3<&- # Close file descriptor 3 } @@ -44,7 +47,7 @@ check_cpuflag() ################################################################################ config_simd() { - simd_width="$(showvar SIMD_WIDTH)" + simd_width="$(showvar SIMD_WIDTH "$@")" avx="$(check_cpuflag avx)" if [ -z "${simd_width}" ] \ && [ -n "${avx}" ]; then