summaryrefslogtreecommitdiffstats
path: root/configure.ac
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2017-04-14 16:59:34 (GMT)
committerGitHub <noreply@github.com>2017-04-14 16:59:34 (GMT)
commit2e30eb6a98fb9b47e840528b41f1fc4446c69f36 (patch)
tree87b42f56d6540e5f270e217889eb1c8c0a0fcf71 /configure.ac
parent7ac96ec60e944bbfa290c869225dc48b542b6884 (diff)
downloadcpython-2e30eb6a98fb9b47e840528b41f1fc4446c69f36.zip
cpython-2e30eb6a98fb9b47e840528b41f1fc4446c69f36.tar.gz
cpython-2e30eb6a98fb9b47e840528b41f1fc4446c69f36.tar.bz2
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.
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac19
1 files changed, 9 insertions, 10 deletions
diff --git a/configure.ac b/configure.ac
index 6b331d5..2c8e246 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2696,7 +2696,8 @@ esac
# 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 @@ int main()
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,