Skip to content

Commit eb76a83

Browse files
authored
Remove PHP atomic includes and PHP_DEFINE M4 macro (#13372)
PHP_DEFINE was introduced with the PHP 5 build system 9d9d39a and then refactored via 350de12. This was once used to put defined constants into a single file to have more fine-graned dependencies (atomic includes). Since no known PHP extension is using this and it makes very little sense to use this, this M4 macro can be removed in favor of the Autoconf native way using AC_DEFINE and the usual included files php_config.h and config.h. - Generated unused include directory removed - Remove include dir from DEFS - Remove also include dir from PDO checks
1 parent 250547c commit eb76a83

File tree

6 files changed

+4
-22
lines changed

6 files changed

+4
-22
lines changed

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,6 @@ Makefile.fragments
7979
Makefile.objects
8080

8181
# Directories for shared object files and headers generated by `./configure`
82-
include/
8382
libs/
8483
modules/
8584

UPGRADING.INTERNALS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ PHP 8.4 INTERNALS UPGRADE NOTES
6363
- Symbol DARWIN has been removed (use __APPLE__ to target Darwin systems).
6464
- Symbol MISSING_FCLOSE_DECL and M4 macro PHP_MISSING_FCLOSE_DECL removed.
6565
- Symbol HAVE_BSD_ICONV has been removed.
66+
- M4 macro PHP_DEFINE (atomic includes) removed (use AC_DEFINE and config.h).
6667

6768
c. Windows build system changes
6869
- The configure options --with-oci8-11g, --with-oci8-12c, --with-oci8-19 have

build/Makefile.global

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ mkinstalldirs = $(top_srcdir)/build/shtool mkdir -p
22
INSTALL = $(top_srcdir)/build/shtool install -c
33
INSTALL_DATA = $(INSTALL) -m 644
44

5-
DEFS = -I$(top_builddir)/include -I$(top_builddir)/main -I$(top_srcdir)
5+
DEFS = -I$(top_builddir)/main -I$(top_srcdir)
66
COMMON_FLAGS = $(DEFS) $(INCLUDES) $(EXTRA_INCLUDES) $(CPPFLAGS) $(PHP_FRAMEWORKPATH)
77

88
all: $(all_targets)
@@ -135,7 +135,6 @@ distclean: clean
135135
if test "$(srcdir)" != "$(builddir)"; then \
136136
rm -f ext/phar/phar/phar.inc; \
137137
fi
138-
$(EGREP) define'.*include/php' $(top_srcdir)/configure | $(SED) 's/.*>//'|xargs rm -f
139138

140139
prof-gen:
141140
CCACHE_DISABLE=1 $(MAKE) PROF_FLAGS=-fprofile-generate all

build/php.m4

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -69,15 +69,6 @@ AC_DEFUN([PHP_EXPAND_PATH],[
6969
fi
7070
])
7171

72-
dnl
73-
dnl PHP_DEFINE(WHAT [, value[, directory]])
74-
dnl
75-
dnl Creates builddir/include/what.h and in there #define WHAT value.
76-
dnl
77-
AC_DEFUN([PHP_DEFINE],[
78-
[echo "#define ]$1[]ifelse([$2],,[ 1],[ $2])[" > ]ifelse([$3],,[include],[$3])[/php_]translit($1,A-Z,a-z)[.h]
79-
])
80-
8172
dnl
8273
dnl PHP_SUBST(varname)
8374
dnl
@@ -135,12 +126,8 @@ dnl Creates build directories and Makefile placeholders.
135126
dnl
136127
AC_DEFUN([PHP_INIT_BUILD_SYSTEM],[
137128
AC_REQUIRE([PHP_CANONICAL_HOST_TARGET])dnl
138-
test -d include || $php_shtool mkdir include
139129
> Makefile.objects
140130
> Makefile.fragments
141-
dnl We need to play tricks here to avoid matching the grep line itself.
142-
pattern=define
143-
$EGREP $pattern'.*include/php' $srcdir/configure|$SED 's/.*>//'|xargs touch 2>/dev/null
144131
])
145132

146133
dnl
@@ -2115,9 +2102,7 @@ dnl PHP_CHECK_PDO_INCLUDES([found [, not-found]])
21152102
dnl
21162103
AC_DEFUN([PHP_CHECK_PDO_INCLUDES],[
21172104
AC_CACHE_CHECK([for PDO includes], pdo_cv_inc_path, [
2118-
if test -f $abs_srcdir/include/php/ext/pdo/php_pdo_driver.h; then
2119-
pdo_cv_inc_path=$abs_srcdir/ext
2120-
elif test -f $abs_srcdir/ext/pdo/php_pdo_driver.h; then
2105+
if test -f $abs_srcdir/ext/pdo/php_pdo_driver.h; then
21212106
pdo_cv_inc_path=$abs_srcdir/ext
21222107
elif test -f $phpincludedir/ext/pdo/php_pdo_driver.h; then
21232108
pdo_cv_inc_path=$phpincludedir/ext

configure.ac

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1692,7 +1692,7 @@ PHP_SUBST(all_targets)
16921692
PHP_SUBST(install_targets)
16931693
PHP_SUBST(install_binary_targets)
16941694

1695-
PHP_INSTALL_HEADERS([Zend/ TSRM/ include/ main/ main/streams/])
1695+
PHP_INSTALL_HEADERS([Zend/ TSRM/ main/ main/streams/])
16961696
PHP_INSTALL_HEADERS([Zend/Optimizer], [ \
16971697
zend_call_graph.h \
16981698
zend_cfg.h \

docs/unix-build-system.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@
77
especially noticeable on slower systems
88
* slow recursive make replaced with one global Makefile
99
* eases integration of proper dependencies
10-
* adds PHP_DEFINE(what[, value]) which creates a single include-file per what.
11-
This will allow more fine-grained dependencies.
1210
* abandoning the "one library per directory" concept
1311
* improved integration of the CLI
1412
* several new targets:

0 commit comments

Comments
 (0)