Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Autotools: Refactor --enable-apcu-spinlocks #516

Merged
merged 1 commit into from
Sep 2, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 13 additions & 17 deletions config.m4
Original file line number Diff line number Diff line change
Expand Up @@ -50,18 +50,12 @@ AC_ARG_ENABLE([apcu-mmap],
])
AC_MSG_RESULT($PHP_APCU_MMAP)

PHP_APCU_SPINLOCK=no
AC_MSG_CHECKING(if APCu should utilize spinlocks before flocks)
AC_ARG_ENABLE([apcu-spinlocks],
PHP_ARG_ENABLE([apcu-spinlocks],
[if APCu should utilize spinlocks before flocks],
[AS_HELP_STRING([--enable-apcu-spinlocks],
[Use spinlocks before flocks])],
[ if test "x$enableval" = "xno"; then
PHP_APCU_SPINLOCK=no
else
PHP_APCU_SPINLOCK=yes
fi
])
AC_MSG_RESULT($PHP_APCU_SPINLOCK)
[no],
[no])

if test "$PHP_APCU_RWLOCKS" != "no"; then
AC_CACHE_CHECK([whether the target compiler supports builtin atomics], PHP_cv_APCU_GCC_ATOMICS, [
Expand Down Expand Up @@ -193,13 +187,15 @@ if test "$PHP_APCU" != "no"; then

if test "$PHP_APCU_RWLOCKS" = "no"; then
if test "$PHP_APCU_MUTEX" = "no"; then
if test "$PHP_APCU_SPINLOCK" != "no"; then
AC_DEFINE(APC_SPIN_LOCK, 1, [ ])
AC_MSG_WARN([APCu spin locking enabled])
else
AC_DEFINE(APC_FCNTL_LOCK, 1, [ ])
AC_MSG_WARN([APCu file locking enabled])
fi
AS_VAR_IF([PHP_APCU_SPINLOCKS], [no], [
AC_DEFINE([APC_FCNTL_LOCK], [1],
[Define to 1 if APCu file locking is enabled.])
AC_MSG_WARN([APCu file locking enabled])
], [
AC_DEFINE([APC_SPIN_LOCK], [1],
[Define to 1 if APCu spin locking is enabled.])
AC_MSG_WARN([APCu spin locking enabled])
])
fi
fi

Expand Down
Loading