PHP_CRYPT_R_STYLE
fi
+AC_CACHE_CHECK([for aarch64 CRC32 API], ac_cv_func___crc32d,
+[AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <arm_acle.h>]],[[__crc32d(0, 0);]])],[ac_cv_func___crc32d=yes],[ac_cv_func___crc32d="no"])])
+if test "$ac_cv_func___crc32d" = "yes"; then
+ AC_DEFINE([HAVE_AARCH64_CRC32], [1], [Define when aarch64 CRC32 API is available.])
+fi
+
dnl Check for asm goto support.
AC_CACHE_CHECK([for asm goto], ac_cv__asm_goto,
[AC_RUN_IFELSE([AC_LANG_SOURCE([[
#include "basic_functions.h"
#include "crc32.h"
-#if defined(__aarch64__) && defined(HAVE_SYS_AUXV_H)
+#if HAVE_AARCH64_CRC32
# include <arm_acle.h>
# if defined(__linux__)
# include <sys/auxv.h>
crc = crcinit^0xFFFFFFFF;
-#if defined(__aarch64__) && defined(HAVE_SYS_AUXV_H)
+#if HAVE_AARCH64_CRC32
if (has_crc32_insn()) {
crc = crc32_aarch64(crc, p, nr);
RETURN_LONG(crc^0xFFFFFFFF);