Skip to content

Commit 40217b2

Browse files
authored
Autotools: Move auto_cflags marker to PHP_INIT_BUILD_SYSTEM (php#15487)
The "hacky" auto_cflags variable is otherwise set only for the Oracle Developer Studio compiler (which is at this point also non-usable) and perhaps might be removed in the future but this is for now moved to the PHP_INIT_BUILD_SYSTEM for consistent settings between the php-src build and phpize. The PHP_INIT_BUILD_SYSTEM is now also called sooner in phpize to match the php-src build.
1 parent b6d7c01 commit 40217b2

File tree

3 files changed

+11
-6
lines changed

3 files changed

+11
-6
lines changed

build/php.m4

+10
Original file line numberDiff line numberDiff line change
@@ -128,10 +128,20 @@ AC_DEFUN([PHP_INIT_BUILD_SYSTEM],
128128
php_shtool=$srcdir/build/shtool
129129
T_MD=$($php_shtool echo -n -e %B)
130130
T_ME=$($php_shtool echo -n -e %b)
131+
132+
dnl Create empty Makefile placeholders.
131133
> Makefile.objects
132134
> Makefile.fragments
135+
136+
dnl Mark whether the CFLAGS are set to automatic default value by Autoconf, or
137+
dnl they are manually modified by the environment variable from outside. E.g.
138+
dnl './configure CFLAGS=...'. Set this before the AC_PROG_CC, where Autoconf
139+
dnl adjusts the CFLAGS variable, so the checks can modify CFLAGS.
140+
AS_VAR_IF([CFLAGS],, [auto_cflags=1])
141+
133142
dnl Required programs.
134143
PHP_PROG_AWK
144+
135145
dnl Run at the end of the configuration, before creating the config.status.
136146
AC_CONFIG_COMMANDS_PRE(
137147
[dnl Directory for storing shared objects of extensions.

configure.ac

-3
Original file line numberDiff line numberDiff line change
@@ -100,9 +100,6 @@ dnl ----------------------------------------------------------------------------
100100

101101
PHP_INIT_BUILD_SYSTEM
102102

103-
dnl We want this one before the checks, so the checks can modify CFLAGS.
104-
AS_VAR_IF([CFLAGS],, [auto_cflags=1])
105-
106103
abs_srcdir=`(cd $srcdir; pwd)`
107104
abs_builddir=`pwd`
108105

scripts/phpize.m4

+1-3
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ AC_DEFUN([PHP_ALWAYS_SHARED],[
2626
test "[$]$1" = "no" && $1=yes
2727
])dnl
2828

29-
AS_VAR_IF([CFLAGS],, [auto_cflags=1])
29+
PHP_INIT_BUILD_SYSTEM
3030

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

68-
PHP_INIT_BUILD_SYSTEM
69-
7068
AC_MSG_CHECKING([for PHP prefix])
7169
AC_MSG_RESULT([$prefix])
7270
AC_MSG_CHECKING([for PHP includes])

0 commit comments

Comments
 (0)