Skip to content

Autotools: Add PHP_PUSH and PHP_POP #14939

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
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
26 changes: 26 additions & 0 deletions build/php.m4
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,32 @@ dnl ----------------------------------------------------------------------------
dnl Build system helper macros.
dnl ----------------------------------------------------------------------------

dnl
dnl PHP_PUSH([namespace])
dnl
dnl Save a state of the common compilation and linker flag variables (CFLAGS,
dnl CPPFLAGS, LIBS and LDFLAGS) to temporary variables. Optional "namespace" is
dnl a prefix for temporary variable names.
dnl
AC_DEFUN([PHP_PUSH],
[AS_VAR_COPY([$1_php_save_CFLAGS], [CFLAGS])
AS_VAR_COPY([$1_php_save_CPPFLAGS], [CPPFLAGS])
AS_VAR_COPY([$1_php_save_LDFLAGS], [LDFLAGS])
AS_VAR_COPY([$1_php_save_LIBS], [LIBS])])

dnl
dnl PHP_POP([namespace])
dnl
dnl Restore the state of the common compilation and linker flag variables to the
dnl last pushed state using PHP_PUSH. When using "namespace" it will restore the
dnl variables of the last PHP_PUSH([namespace]) call.
dnl
AC_DEFUN([PHP_POP],
[AS_VAR_COPY([CFLAGS], [$1_php_save_CFLAGS])
AS_VAR_COPY([CPPFLAGS], [$1_php_save_CPPFLAGS])
AS_VAR_COPY([LDFLAGS], [$1_php_save_LDFLAGS])
AS_VAR_COPY([LIBS], [$1_php_save_LIBS])])

dnl
dnl PHP_DEF_HAVE(what)
dnl
Expand Down
4 changes: 2 additions & 2 deletions sapi/fpm/config.m4
Original file line number Diff line number Diff line change
Expand Up @@ -454,7 +454,7 @@ if test "$PHP_FPM" != "no"; then
AC_CHECK_HEADERS([sys/acl.h])

dnl *BSD has acl_* built into libc, macOS doesn't have user/group support.
LIBS_save=$LIBS
PHP_PUSH([fpm_acl])
AC_SEARCH_LIBS([acl_free], [acl],
[AC_CACHE_CHECK([for ACL user/group permissions support],
[php_cv_lib_acl_user_group],
Expand All @@ -477,7 +477,7 @@ if test "$PHP_FPM" != "no"; then
[AS_VAR_APPEND([FPM_EXTRA_LIBS], [" $ac_cv_search_acl_free"])])
])
])
LIBS=$LIBS_save
PHP_POP([fpm_acl])
])

if test "x$PHP_FPM_APPARMOR" != "xno" ; then
Expand Down