Skip to content

Commit 11accb5

Browse files
authored
Preferably include from build dir (#13516)
* 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 * Fix extension include path for out of tree builds * Include config.h with the brackets form `#include "config.h"` searches in the directory containing the including-file before any other include path. This can include the wrong config.h when building out of tree and a config.h exists in the source tree. Using `#include <config.h>` uses exclusively the include path, and gives priority to the build dir.
1 parent 604e0a7 commit 11accb5

File tree

193 files changed

+202
-202
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

193 files changed

+202
-202
lines changed

TSRM/TSRM.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@
1515

1616
#if !defined(__CYGWIN__) && defined(_WIN32)
1717
# define TSRM_WIN32
18-
# include "Zend/zend_config.w32.h"
18+
# include <Zend/zend_config.w32.h>
1919
#else
20-
# include "main/php_config.h"
20+
# include <main/php_config.h>
2121
#endif
2222

2323
#include <stdint.h>

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 = $(INCLUDES) $(EXTRA_INCLUDES) $(CPPFLAGS) $(PHP_FRAMEWORKPATH)
76

87
all: $(all_targets)
98
@echo

configure.ac

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1353,13 +1353,14 @@ LIBZEND_BASIC_CHECKS
13531353
LIBZEND_DLSYM_CHECK
13541354
LIBZEND_OTHER_CHECKS
13551355

1356-
INCLUDES="$INCLUDES -I\$(top_builddir)/TSRM"
1357-
INCLUDES="$INCLUDES -I\$(top_builddir)/Zend"
1358-
1359-
if test "$abs_srcdir" != "$abs_builddir"; then
1360-
INCLUDES="$INCLUDES -I\$(top_srcdir)/main -I\$(top_srcdir)/Zend"
1361-
INCLUDES="$INCLUDES -I\$(top_srcdir)/TSRM -I\$(top_builddir)/"
1362-
fi
1356+
PHP_ADD_INCLUDE([$abs_srcdir], [1])
1357+
PHP_ADD_INCLUDE([$abs_srcdir/main], [1])
1358+
PHP_ADD_INCLUDE([$abs_builddir], [1])
1359+
PHP_ADD_INCLUDE([$abs_builddir/main], [1])
1360+
PHP_ADD_INCLUDE([$abs_builddir/TSRM])
1361+
PHP_ADD_INCLUDE([$abs_builddir/Zend])
1362+
PHP_ADD_INCLUDE([$abs_srcdir/Zend])
1363+
PHP_ADD_INCLUDE([$abs_srcdir/TSRM])
13631364

13641365
ZEND_EXTRA_LIBS="$LIBS"
13651366
unset LIBS

ext/bcmath/bcmath.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
*/
1616

1717
#ifdef HAVE_CONFIG_H
18-
#include "config.h"
18+
#include <config.h>
1919
#endif
2020

2121
#include "php.h"

ext/bz2/bz2.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
*/
1616

1717
#ifdef HAVE_CONFIG_H
18-
#include "config.h"
18+
#include <config.h>
1919
#endif
2020

2121
#include "php.h"

ext/bz2/bz2_filter.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
*/
1616

1717
#ifdef HAVE_CONFIG_H
18-
#include "config.h"
18+
#include <config.h>
1919
#endif
2020

2121
#include "php.h"

ext/calendar/calendar.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
*/
1919

2020
#ifdef HAVE_CONFIG_H
21-
#include "config.h"
21+
#include <config.h>
2222
#endif
2323

2424
#include "php.h"

ext/com_dotnet/com_com.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
*/
1616

1717
#ifdef HAVE_CONFIG_H
18-
#include "config.h"
18+
#include <config.h>
1919
#endif
2020

2121
#include "php.h"

ext/com_dotnet/com_dotnet.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
*/
1616

1717
#ifdef HAVE_CONFIG_H
18-
#include "config.h"
18+
#include <config.h>
1919
#endif
2020

2121
#include "php.h"

ext/com_dotnet/com_extension.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
*/
1616

1717
#ifdef HAVE_CONFIG_H
18-
#include "config.h"
18+
#include <config.h>
1919
#endif
2020

2121
#include <intsafe.h>

ext/com_dotnet/com_handlers.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
*/
1616

1717
#ifdef HAVE_CONFIG_H
18-
#include "config.h"
18+
#include <config.h>
1919
#endif
2020

2121
#include "php.h"

ext/com_dotnet/com_iterator.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
*/
1616

1717
#ifdef HAVE_CONFIG_H
18-
#include "config.h"
18+
#include <config.h>
1919
#endif
2020

2121
#include "php.h"

ext/com_dotnet/com_misc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
*/
1616

1717
#ifdef HAVE_CONFIG_H
18-
#include "config.h"
18+
#include <config.h>
1919
#endif
2020

2121
#include "php.h"

ext/com_dotnet/com_olechar.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
*/
1717

1818
#ifdef HAVE_CONFIG_H
19-
#include "config.h"
19+
#include <config.h>
2020
#endif
2121

2222
#include "php.h"

ext/com_dotnet/com_persist.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
* (can wait till 5.1) */
2121

2222
#ifdef HAVE_CONFIG_H
23-
#include "config.h"
23+
#include <config.h>
2424
#endif
2525

2626
#include "php.h"

ext/com_dotnet/com_saproxy.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
* */
2323

2424
#ifdef HAVE_CONFIG_H
25-
#include "config.h"
25+
#include <config.h>
2626
#endif
2727

2828
#include "php.h"

ext/com_dotnet/com_typeinfo.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
*/
1717

1818
#ifdef HAVE_CONFIG_H
19-
#include "config.h"
19+
#include <config.h>
2020
#endif
2121

2222
#include "php.h"

ext/com_dotnet/com_variant.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
*/
1616

1717
#ifdef HAVE_CONFIG_H
18-
#include "config.h"
18+
#include <config.h>
1919
#endif
2020

2121
#include "php.h"

ext/com_dotnet/com_wrapper.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
* using IDispatchEx */
1919

2020
#ifdef HAVE_CONFIG_H
21-
#include "config.h"
21+
#include <config.h>
2222
#endif
2323

2424
#include "php.h"

ext/ctype/ctype.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
*/
1616

1717
#ifdef HAVE_CONFIG_H
18-
#include "config.h"
18+
#include <config.h>
1919
#endif
2020

2121
#include "php.h"

ext/curl/interface.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
#define ZEND_INCLUDE_FULL_WINDOWS_HEADERS
1818

1919
#ifdef HAVE_CONFIG_H
20-
#include "config.h"
20+
#include <config.h>
2121
#endif
2222

2323
#include "php.h"

ext/curl/multi.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
#define ZEND_INCLUDE_FULL_WINDOWS_HEADERS
1818

1919
#ifdef HAVE_CONFIG_H
20-
#include "config.h"
20+
#include <config.h>
2121
#endif
2222

2323
#include "php.h"

ext/curl/share.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
#define ZEND_INCLUDE_FULL_WINDOWS_HEADERS
1818

1919
#ifdef HAVE_CONFIG_H
20-
#include "config.h"
20+
#include <config.h>
2121
#endif
2222

2323
#include "php.h"

ext/dba/dba.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
*/
1717

1818
#ifdef HAVE_CONFIG_H
19-
#include "config.h"
19+
#include <config.h>
2020
#endif
2121

2222
#include "php.h"

ext/dba/dba_cdb.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
*/
1717

1818
#ifdef HAVE_CONFIG_H
19-
#include "config.h"
19+
#include <config.h>
2020
#endif
2121

2222
#include "php.h"

ext/dba/dba_db1.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
*/
1616

1717
#ifdef HAVE_CONFIG_H
18-
#include "config.h"
18+
#include <config.h>
1919
#endif
2020

2121
#include "php.h"

ext/dba/dba_db2.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
*/
1616

1717
#ifdef HAVE_CONFIG_H
18-
#include "config.h"
18+
#include <config.h>
1919
#endif
2020

2121
#include "php.h"

ext/dba/dba_db3.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
*/
1616

1717
#ifdef HAVE_CONFIG_H
18-
#include "config.h"
18+
#include <config.h>
1919
#endif
2020

2121
#include "php.h"

ext/dba/dba_db4.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
*/
1717

1818
#ifdef HAVE_CONFIG_H
19-
#include "config.h"
19+
#include <config.h>
2020
#endif
2121

2222
#include "php.h"

ext/dba/dba_dbm.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
*/
1616

1717
#ifdef HAVE_CONFIG_H
18-
#include "config.h"
18+
#include <config.h>
1919
#endif
2020

2121
#include "php.h"

ext/dba/dba_flatfile.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
*/
1616

1717
#ifdef HAVE_CONFIG_H
18-
#include "config.h"
18+
#include <config.h>
1919
#endif
2020

2121
#include "php.h"

ext/dba/dba_gdbm.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
*/
1616

1717
#ifdef HAVE_CONFIG_H
18-
#include "config.h"
18+
#include <config.h>
1919
#endif
2020

2121
#include "php.h"

ext/dba/dba_inifile.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
*/
1616

1717
#ifdef HAVE_CONFIG_H
18-
#include "config.h"
18+
#include <config.h>
1919
#endif
2020

2121
#include "php.h"

ext/dba/dba_lmdb.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
*/
1616

1717
#ifdef HAVE_CONFIG_H
18-
#include "config.h"
18+
#include <config.h>
1919
#endif
2020

2121
#include "php.h"

ext/dba/dba_ndbm.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
*/
1616

1717
#ifdef HAVE_CONFIG_H
18-
#include "config.h"
18+
#include <config.h>
1919
#endif
2020

2121
#include "php.h"

ext/dba/dba_qdbm.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
*/
1616

1717
#ifdef HAVE_CONFIG_H
18-
#include "config.h"
18+
#include <config.h>
1919
#endif
2020

2121
#include "php.h"

ext/dba/dba_tcadb.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
*/
1616

1717
#ifdef HAVE_CONFIG_H
18-
#include "config.h"
18+
#include <config.h>
1919
#endif
2020

2121
#include "php.h"

ext/dom/attr.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
*/
1717

1818
#ifdef HAVE_CONFIG_H
19-
#include "config.h"
19+
#include <config.h>
2020
#endif
2121

2222
#include "php.h"

ext/dom/cdatasection.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
*/
1717

1818
#ifdef HAVE_CONFIG_H
19-
#include "config.h"
19+
#include <config.h>
2020
#endif
2121

2222
#include "php.h"

ext/dom/characterdata.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
*/
1717

1818
#ifdef HAVE_CONFIG_H
19-
#include "config.h"
19+
#include <config.h>
2020
#endif
2121

2222
#include "php.h"

ext/dom/comment.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
*/
1717

1818
#ifdef HAVE_CONFIG_H
19-
#include "config.h"
19+
#include <config.h>
2020
#endif
2121

2222
#include "php.h"

ext/dom/document.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
*/
1717

1818
#ifdef HAVE_CONFIG_H
19-
#include "config.h"
19+
#include <config.h>
2020
#endif
2121

2222
#include "php.h"

0 commit comments

Comments
 (0)