From: Icenowy Zheng Date: Wed, 28 Jan 2026 15:34:45 +0000 (+0800) Subject: riscv: features: add check for asm/hwprobe.h in build systems X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a9ca4467b28387f75c33557b7e52fe9ade883706;p=thirdparty%2Fzlib-ng.git riscv: features: add check for asm/hwprobe.h in build systems Currently the check follows the practice of arm_acle.h. It's checked in the configure script only when riscv_features is built, but always checked for CMake. Signed-off-by: Icenowy Zheng --- diff --git a/CMakeLists.txt b/CMakeLists.txt index c89f69cad..2d8a9d7a8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -458,6 +458,10 @@ check_include_file(linux/auxvec.h HAVE_LINUX_AUXVEC_H) if(HAVE_LINUX_AUXVEC_H) add_definitions(-DHAVE_LINUX_AUXVEC_H) endif() +check_include_file(asm/hwprobe.h HAVE_ASM_HWPROBE_H) +if(HAVE_ASM_HWPROBE_H) + add_definitions(-DHAVE_ASM_HWPROBE_H) +endif() # # Check to see if we have large file support diff --git a/configure b/configure index b1d32c587..d28650546 100755 --- a/configure +++ b/configure @@ -2185,6 +2185,16 @@ EOF ARCH_STATIC_OBJS="${ARCH_STATIC_OBJS} riscv_features.o" ARCH_SHARED_OBJS="${ARCH_SHARED_OBJS} riscv_features.lo" + cat > $test.c < +EOF + if try $CC -c $CFLAGS $test.c; then + echo "Checking for asm/hwprobe.h... Yes." | tee -a configure.log + CFLAGS="${CFLAGS} -DHAVE_ASM_HWPROBE_H" + SFLAGS="${SFLAGS} -DHAVE_ASM_HWPROBE_H" + else + echo "Checking for asm/hwprobe.h... No." | tee -a configure.log + fi fi if test $buildrvv -eq 1; then check_rvv_compiler_flag