improve alignment autoconf test (#1129) (#1139)
Replace the deprecated AC_TRY_RUN with AC_RUN_IFELSE. Also, standardize the
variable name and allow for caching of the result.
diff --git a/configure.ac b/configure.ac
index 6b331d5..2c8e246 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2696,7 +2696,8 @@
# check for systems that require aligned memory access
AC_MSG_CHECKING(aligned memory access is required)
-AC_TRY_RUN([
+AC_CACHE_VAL(ac_cv_aligned_required,
+[AC_RUN_IFELSE([AC_LANG_SOURCE([[
int main()
{
char s[16];
@@ -2708,18 +2709,16 @@
if (*p1 == *p2)
return 1;
return 0;
-}
- ],
- [aligned_required=no],
- [aligned_required=yes],
- [aligned_required=yes])
-
-if test "$aligned_required" = yes ; then
+}]])],
+[ac_cv_aligned_required=no],
+[ac_cv_aligned_required=yes],
+[ac_cv_aligned_required=yes])
+])
+AC_MSG_RESULT($ac_cv_aligned_required)
+if test "$ac_cv_aligned_required" = yes ; then
AC_DEFINE([HAVE_ALIGNED_REQUIRED], [1],
[Define if aligned memory access is required])
fi
-AC_MSG_RESULT($aligned_required)
-
# str, bytes and memoryview hash algorithm
AH_TEMPLATE(Py_HASH_ALGORITHM,