diff --git a/sapi/fpm/config.m4 b/sapi/fpm/config.m4 index 51de63df75a80..f1c02727ca124 100644 --- a/sapi/fpm/config.m4 +++ b/sapi/fpm/config.m4 @@ -489,9 +489,11 @@ if test "$PHP_FPM" != "no"; then if test "$PHP_FPM_ACL" != "no" ; then AC_CHECK_HEADERS([sys/acl.h]) - AC_COMPILE_IFELSE([AC_LANG_SOURCE([[#include - int main(void) - { + dnl *BSD has acl_* built into libc, macOS doesn't have user/group support. + LIBS_save="$LIBS" + AC_SEARCH_LIBS([acl_free], [acl], [ + AC_MSG_CHECKING([for acl user/group permissions support]) + AC_LINK_IFELSE([AC_LANG_PROGRAM([#include ], [ acl_t acl; acl_entry_t user, group; acl = acl_init(1); @@ -500,39 +502,14 @@ if test "$PHP_FPM" != "no"; then acl_create_entry(&acl, &group); acl_set_tag_type(user, ACL_GROUP); acl_free(acl); - return 0; - } - ]])], [ - AC_CHECK_LIB(acl, acl_free, - [PHP_ADD_LIBRARY(acl) - have_fpm_acl=yes - ],[ - AC_RUN_IFELSE([AC_LANG_SOURCE([[#include - int main(void) - { - acl_t acl; - acl_entry_t user, group; - acl = acl_init(1); - acl_create_entry(&acl, &user); - acl_set_tag_type(user, ACL_USER); - acl_create_entry(&acl, &group); - acl_set_tag_type(user, ACL_GROUP); - acl_free(acl); - return 0; - } - ]])],[have_fpm_acl=yes],[have_fpm_acl=no],[have_fpm_acl=no]) - ]) - ], [ - have_fpm_acl=no + ])], [ + AC_MSG_RESULT([yes]) + AC_DEFINE([HAVE_FPM_ACL], [1], [Whether FPM has acl support]) + ], [ + AC_MSG_RESULT([no]) + LIBS="$LIBS_save" + ]) ]) - - AC_MSG_CHECKING([for acl user/group permissions support]) - if test "$have_fpm_acl" = "yes"; then - AC_MSG_RESULT([yes]) - AC_DEFINE([HAVE_FPM_ACL], 1, [do we have acl support?]) - else - AC_MSG_RESULT([no]) - fi fi if test "x$PHP_FPM_APPARMOR" != "xno" ; then