]> git.ipfire.org Git - thirdparty/zlib-ng.git/commitdiff
riscv: features: add check for asm/hwprobe.h in build systems
authorIcenowy Zheng <uwu@icenowy.me>
Wed, 28 Jan 2026 15:34:45 +0000 (23:34 +0800)
committerHans Kristian Rosbach <hk-github@circlestorm.org>
Sun, 1 Feb 2026 12:06:43 +0000 (13:06 +0100)
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 <uwu@icenowy.me>
CMakeLists.txt
configure

index c89f69cade468e23c4207500942717950b4432e6..2d8a9d7a8384431761602081ee75256cbc2c7cce 100644 (file)
@@ -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
index b1d32c587f124711f8e78f93c4ec20df2e19b41a..d28650546c51c7224cb085c5c7f76edeff3e9412 100755 (executable)
--- 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
+#include <asm/hwprobe.h>
+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