Skip to content

Commit 670bbdb

Browse files
committed
Include from build dir first
This fixes out of tree builds by ensuring that configure artifacts are included from the build dir. Before, out of tree builds would preferably include files from the src dir, as the include path was defined as follows (ignoring includes from ext/ and sapi/) : -I$(top_builddir)/main -I$(top_srcdir) -I$(top_builddir)/TSRM -I$(top_builddir)/Zend -I$(top_srcdir)/main -I$(top_srcdir)/Zend -I$(top_srcdir)/TSRM -I$(top_builddir)/ As a result, an out of tree build would include configure artifacts such as `main/php_config.h` from the src dir. After this change, the include path is defined as follows: -I$(top_builddir)/main -I$(top_builddir) -I$(top_srcdir)/main -I$(top_srcdir) -I$(top_builddir)/TSRM -I$(top_builddir)/Zend -I$(top_srcdir)/Zend -I$(top_srcdir)/TSRM
1 parent 718a8b4 commit 670bbdb

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

build/Makefile.global

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +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)/main -I$(top_srcdir)
6-
COMMON_FLAGS = $(DEFS) $(INCLUDES) $(EXTRA_INCLUDES) $(CPPFLAGS) $(PHP_FRAMEWORKPATH)
5+
COMMON_FLAGS = $(CORE_INCLUDES) $(INCLUDES) $(EXTRA_INCLUDES) $(CPPFLAGS) $(PHP_FRAMEWORKPATH)
76

87
all: $(all_targets)
98
@echo

configure.ac

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1349,12 +1349,14 @@ LIBZEND_BASIC_CHECKS
13491349
LIBZEND_DLSYM_CHECK
13501350
LIBZEND_OTHER_CHECKS
13511351

1352+
CORE_INCLUDES="$CORE_INCLUDES -I\$(top_builddir)/main -I\$(top_builddir)"
13521353
INCLUDES="$INCLUDES -I\$(top_builddir)/TSRM"
13531354
INCLUDES="$INCLUDES -I\$(top_builddir)/Zend"
13541355

13551356
if test "$abs_srcdir" != "$abs_builddir"; then
1356-
INCLUDES="$INCLUDES -I\$(top_srcdir)/main -I\$(top_srcdir)/Zend"
1357-
INCLUDES="$INCLUDES -I\$(top_srcdir)/TSRM -I\$(top_builddir)/"
1357+
CORE_INCLUDES="$CORE_INCLUDES -I\$(top_srcdir)/main -I\$(top_srcdir)"
1358+
INCLUDES="$INCLUDES -I\$(top_srcdir)/Zend"
1359+
INCLUDES="$INCLUDES -I\$(top_srcdir)/TSRM"
13581360
fi
13591361

13601362
ZEND_EXTRA_LIBS="$LIBS"
@@ -1540,6 +1542,7 @@ PHP_SUBST_OLD(EXTRA_LDFLAGS)
15401542
PHP_SUBST_OLD(EXTRA_LDFLAGS_PROGRAM)
15411543
PHP_SUBST_OLD(EXTRA_LIBS)
15421544
PHP_SUBST_OLD(ZEND_EXTRA_LIBS)
1545+
PHP_SUBST_OLD(CORE_INCLUDES)
15431546
PHP_SUBST_OLD(INCLUDES)
15441547
PHP_SUBST_OLD(EXTRA_INCLUDES)
15451548
PHP_SUBST_OLD(INSTALL_IT)

0 commit comments

Comments
 (0)