/* Enable java profiling */
#undef GPROFNG_JAVA_PROFILING
+/* Define to 1 if you have the <asm/hwprobe.h> header file. */
+#undef HAVE_ASM_HWPROBE_H
+
/* Define to 1 if you have the `clock_gettime' function. */
#undef HAVE_CLOCK_GETTIME
#include <sched.h>
#include <sys/syscall.h>
#include <unistd.h>
+#ifdef HAVE_ASM_HWPROBE_H
#include <asm/hwprobe.h>
#endif
+#endif
/*
* Various routines to handle identification
break;
}
#elif defined(__riscv)
- #ifndef __riscv_hwprobe
+ #if !defined(__riscv_hwprobe) || !defined(HAVE_ASM_HWPROBE_H)
cpi->cpi_vendor = 0;
cpi->cpi_family = 0;
cpi->cpi_model = 0;
cpi->cpi_vendor = res.value;
cpi->cpi_family = 0;
cpi->cpi_model = 0;
- #endif
+ #endif
#endif
return cpi;
}
done
+# For riscv builds inside incomplete environments such as during intermediate
+# steps of cross toolchain building, or with outdated Linux headers.
+for ac_header in asm/hwprobe.h
+do :
+ ac_fn_c_check_header_mongrel "$LINENO" "asm/hwprobe.h" "ac_cv_header_asm_hwprobe_h" "$ac_includes_default"
+if test "x$ac_cv_header_asm_hwprobe_h" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_ASM_HWPROBE_H 1
+_ACEOF
+
+fi
+
+done
+
+
clock_gettime_link=
# At least for glibc, clock_gettime is in librt. But don't
# pull that in if it still doesn't give us the function we want. This
AC_CHECK_DECLS([basename])
AC_CHECK_FUNCS(clock_gettime strsignal)
+# For riscv builds inside incomplete environments such as during intermediate
+# steps of cross toolchain building, or with outdated Linux headers.
+AC_CHECK_HEADERS(asm/hwprobe.h)
+
clock_gettime_link=
# At least for glibc, clock_gettime is in librt. But don't
# pull that in if it still doesn't give us the function we want. This