diff options
author | Yann Ylavic <ylavic@apache.org> | 2023-04-21 12:24:53 +0000 |
---|---|---|
committer | Yann Ylavic <ylavic@apache.org> | 2023-04-21 12:24:53 +0000 |
commit | 805904fe295efa5f480b067d8c60777675ea7368 (patch) | |
tree | b669398f4ac8c38c5a8355e475ffdcf8269c3123 /configure.in | |
parent | 4ab133489c13382e13aea8d34aa0ec404c409f07 (diff) | |
download | apr-805904fe295efa5f480b067d8c60777675ea7368.tar.gz |
atomics: Disentangle 32bit and 64bit atomics configuration.
Allow for --enable-nonportable-atomics=upto32bit to disable 64bit atomic
builtins while still allowing for 32bit ones. yes/no still enables/disables
both (if available in the first place..).
By default (no --enable-nonportable-atomics setting), generic 64bit atomics are
forced for 32bit CPUs/systems, until we figure out how to properly align
apr_uint64_t (at least i[56]86 CPUs which could work with 64bit builtins
actually don't if the data is not 64bit aligned, assuming the same for other
32bit CPUs is safer).
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1909321 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'configure.in')
-rw-r--r-- | configure.in | 29 |
1 files changed, 20 insertions, 9 deletions
diff --git a/configure.in b/configure.in index ea9a9337a..8edcb0845 100644 --- a/configure.in +++ b/configure.in @@ -836,21 +836,28 @@ void main(void) fi fi +force_generic_atomics=no +force_generic_atomics64=no +AC_CHECK_SIZEOF(void*, 4) +if test "x$ac_cv_sizeof_voidp" = "x"; then + force_generic_atomics64=yes +elif test $ac_cv_sizeof_voidp -lt 8; then + force_generic_atomics64=yes +fi AC_ARG_ENABLE(nonportable-atomics, [ --enable-nonportable-atomics Use optimized atomic code which may produce nonportable binaries], -[if test $enableval = yes; then - force_generic_atomics=no - else +[if test "$enableval" = "upto32bit"; then + force_generic_atomics64=yes + elif test "$enableval" != "yes"; then force_generic_atomics=yes fi ], -[force_generic_atomics=no -case $host_cpu in - i[[34]]86) force_generic_atomics=yes;; +[case $host_cpu in + i[[34]]86) + force_generic_atomics=yes + ;; i[[56]]86) - if test $has_atomic_builtins != yes; then - force_generic_atomics=yes - fi + force_generic_atomics64=yes ;; *) case $host in *solaris2.10*) @@ -871,6 +878,10 @@ if test $force_generic_atomics = yes; then AC_DEFINE([USE_ATOMICS_GENERIC], 1, [Define if use of generic atomics is requested]) fi +if test $force_generic_atomics = yes -o $force_generic_atomics64 = yes; then + AC_DEFINE([USE_ATOMICS_GENERIC64], 1, + [Define if use of 64bit generic atomics is requested]) +fi AC_SUBST(proc_mutex_is_global) AC_SUBST(eolstr) |