Skip to content

Commit 24a390a

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 d03bb95 commit 24a390a

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
@@ -1351,12 +1351,14 @@ LIBZEND_BASIC_CHECKS
13511351
LIBZEND_DLSYM_CHECK
13521352
LIBZEND_OTHER_CHECKS
13531353

1354+
CORE_INCLUDES="$CORE_INCLUDES -I\$(top_builddir)/main -I\$(top_builddir)"
13541355
INCLUDES="$INCLUDES -I\$(top_builddir)/TSRM"
13551356
INCLUDES="$INCLUDES -I\$(top_builddir)/Zend"
13561357

13571358
if test "$abs_srcdir" != "$abs_builddir"; then
1358-
INCLUDES="$INCLUDES -I\$(top_srcdir)/main -I\$(top_srcdir)/Zend"
1359-
INCLUDES="$INCLUDES -I\$(top_srcdir)/TSRM -I\$(top_builddir)/"
1359+
CORE_INCLUDES="$CORE_INCLUDES -I\$(top_srcdir)/main -I\$(top_srcdir)"
1360+
INCLUDES="$INCLUDES -I\$(top_srcdir)/Zend"
1361+
INCLUDES="$INCLUDES -I\$(top_srcdir)/TSRM"
13601362
fi
13611363

13621364
ZEND_EXTRA_LIBS="$LIBS"
@@ -1542,6 +1544,7 @@ PHP_SUBST_OLD(EXTRA_LDFLAGS)
15421544
PHP_SUBST_OLD(EXTRA_LDFLAGS_PROGRAM)
15431545
PHP_SUBST_OLD(EXTRA_LIBS)
15441546
PHP_SUBST_OLD(ZEND_EXTRA_LIBS)
1547+
PHP_SUBST_OLD(CORE_INCLUDES)
15451548
PHP_SUBST_OLD(INCLUDES)
15461549
PHP_SUBST_OLD(EXTRA_INCLUDES)
15471550
PHP_SUBST_OLD(INSTALL_IT)

0 commit comments

Comments
 (0)