Skip to content

Autotools: Move auto_cflags marker to PHP_INIT_BUILD_SYSTEM #15487

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

Merged
merged 2 commits into from
Aug 19, 2024
Merged
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
10 changes: 10 additions & 0 deletions build/php.m4
Original file line number Diff line number Diff line change
Expand Up @@ -128,10 +128,20 @@ AC_DEFUN([PHP_INIT_BUILD_SYSTEM],
php_shtool=$srcdir/build/shtool
T_MD=$($php_shtool echo -n -e %B)
T_ME=$($php_shtool echo -n -e %b)
dnl Create empty Makefile placeholders.
> Makefile.objects
> Makefile.fragments
dnl Mark whether the CFLAGS are set to automatic default value by Autoconf, or
dnl they are manually modified by the environment variable from outside. E.g.
dnl './configure CFLAGS=...'. Set this before the AC_PROG_CC, where Autoconf
dnl adjusts the CFLAGS variable, so the checks can modify CFLAGS.
AS_VAR_IF([CFLAGS],, [auto_cflags=1])
dnl Required programs.
PHP_PROG_AWK
dnl Run at the end of the configuration, before creating the config.status.
AC_CONFIG_COMMANDS_PRE(
[dnl Directory for storing shared objects of extensions.
Expand Down
3 changes: 0 additions & 3 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,6 @@ dnl ----------------------------------------------------------------------------

PHP_INIT_BUILD_SYSTEM

dnl We want this one before the checks, so the checks can modify CFLAGS.
AS_VAR_IF([CFLAGS],, [auto_cflags=1])

abs_srcdir=`(cd $srcdir; pwd)`
abs_builddir=`pwd`

Expand Down
4 changes: 1 addition & 3 deletions scripts/phpize.m4
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ AC_DEFUN([PHP_ALWAYS_SHARED],[
test "[$]$1" = "no" && $1=yes
])dnl

AS_VAR_IF([CFLAGS],, [auto_cflags=1])
PHP_INIT_BUILD_SYSTEM

abs_srcdir=`(cd $srcdir && pwd)`
abs_builddir=`pwd`
Expand Down Expand Up @@ -65,8 +65,6 @@ PHP_EXECUTABLE=`$PHP_CONFIG --php-binary 2>/dev/null`
AS_VAR_IF([prefix],,
[AC_MSG_ERROR([Cannot find php-config. Please use --with-php-config=PATH])])

PHP_INIT_BUILD_SYSTEM

AC_MSG_CHECKING([for PHP prefix])
AC_MSG_RESULT([$prefix])
AC_MSG_CHECKING([for PHP includes])
Expand Down