if(BASEARCH_ARM_FOUND)
add_definitions(-DARM_FEATURES)
if(${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
- if(NOT "${ARCH}" MATCHES "aarch64")
+ if("${ARCH}" MATCHES "aarch64")
+ check_c_source_compiles(
+ "#include <sys/auxv.h>
+ int main() {
+ return (getauxval(AT_HWCAP) & HWCAP_CRC32);
+ }"
+ ARM_AUXV_HAS_CRC32
+ )
+ if(ARM_AUXV_HAS_CRC32)
+ add_definitions(-DARM_AUXV_HAS_CRC32)
+ else()
+ message(STATUS "HWCAP_CRC32 not present in sys/auxv.h; cannot detect support at runtime.")
+ endif()
+ else()
check_c_source_compiles(
"#include <sys/auxv.h>
int main() {
message(STATUS "HWCAP2_CRC32 not present in sys/auxv.h; cannot detect support at runtime.")
endif()
endif()
- else()
- check_c_source_compiles(
- "#include <sys/auxv.h>
- int main() {
- return (getauxval(AT_HWCAP) & HWCAP_CRC32);
- }"
- ARM_AUXV_HAS_CRC32
- )
- if(ARM_AUXV_HAS_CRC32)
- add_definitions(-DARM_AUXV_HAS_CRC32)
- else()
- message(STATUS "HWCAP_CRC32 not present in sys/auxv.h; cannot detect support at runtime.")
- endif()
- endif()
- if(NOT "${ARCH}" MATCHES "aarch64")
check_c_source_compiles(
"#include <sys/auxv.h>
int main() {
ARCH_SHARED_OBJS="${ARCH_SHARED_OBJS} arm_features.lo"
if test $LINUX -eq 1; then
- if test "$ARCH" != "aarch64"; then
+ if test "$ARCH" = "aarch64"; then
+ cat > $test.c <<EOF
+#include <sys/auxv.h>
+int main() {
+ return (getauxval(AT_HWCAP) & HWCAP_CRC32);
+}
+EOF
+ if try $CC -c $CFLAGS $test.c; then
+ CFLAGS="${CFLAGS} -DARM_AUXV_HAS_CRC32"
+ SFLAGS="${SFLAGS} -DARM_AUXV_HAS_CRC32"
+ else
+ echo "HWCAP_CRC32 not present in sys/auxv.h; cannot detect support at runtime." | tee -a configure.log
+ fi
+ else
cat > $test.c <<EOF
#include <sys/auxv.h>
int main() {
echo "HWCAP2_CRC32 not present in sys/auxv.h; cannot detect support at runtime." | tee -a configure.log
fi
fi
- else
- cat > $test.c <<EOF
-#include <sys/auxv.h>
-int main() {
- return (getauxval(AT_HWCAP) & HWCAP_CRC32);
-}
-EOF
- if try $CC -c $CFLAGS $test.c; then
- CFLAGS="${CFLAGS} -DARM_AUXV_HAS_CRC32"
- SFLAGS="${SFLAGS} -DARM_AUXV_HAS_CRC32"
- else
- echo "HWCAP_CRC32 not present in sys/auxv.h; cannot detect support at runtime." | tee -a configure.log
- fi
- fi
- if test "$ARCH" != "aarch64"; then
cat > $test.c <<EOF
#include <sys/auxv.h>
int main() {