Skip to content

Commit 14d9aad

Browse files
committed
Autotools: Enable adding a list of paths in PHP_ADD_INCLUDE
This enables adding multiple include paths. For example: PHP_ADD_INCLUDE([ $abs_srcdir $abs_builddir $abs_srcdir/main $abs_builddir/main ], [1])
1 parent 2f3224e commit 14d9aad

File tree

2 files changed

+16
-15
lines changed

2 files changed

+16
-15
lines changed

UPGRADING.INTERNALS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,8 @@ PHP 8.4 INTERNALS UPGRADE NOTES
196196
- M4 macros PHP_NEW_EXTENSION, PHP_ADD_SOURCES, PHP_ADD_SOURCES_X,
197197
PHP_SELECT_SAPI now have the source files and flags arguments normalized so
198198
the list of items can be passed as a blank-or-newline-separated list.
199+
- M4 macro PHP_ADD_INCLUDE now takes also a blank-or-newline-separated list
200+
of include directories instead of a single directory.
199201
- TSRM/tsrm.m4 file and its TSRM_CHECK_PTHREADS M4 macro have been removed.
200202
- Added pkg-config support to find libpq for the pdo_pgsql and pgsql
201203
extensions. The libpq paths can be customized with the PGSQL_CFLAGS and

build/php.m4

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -467,21 +467,20 @@ AC_DEFUN([PHP_UTILIZE_RPATHS],[
467467
])
468468

469469
dnl
470-
dnl PHP_ADD_INCLUDE(path [,before])
471-
dnl
472-
dnl Add an include path. If before is 1, add in the beginning of INCLUDES.
473-
dnl
474-
AC_DEFUN([PHP_ADD_INCLUDE],[
475-
if test "$1" != "/usr/include"; then
476-
PHP_EXPAND_PATH($1, ai_p)
477-
PHP_RUN_ONCE(INCLUDEPATH, $ai_p, [
478-
if test "$2"; then
479-
INCLUDES="-I$ai_p $INCLUDES"
480-
else
481-
INCLUDES="$INCLUDES -I$ai_p"
482-
fi
483-
])
484-
fi
470+
dnl PHP_ADD_INCLUDE(paths [,before])
471+
dnl
472+
dnl Add blank-or-newline-separated list of include paths. If "before" is given,
473+
dnl paths are prepended to the beginning of INCLUDES.
474+
dnl
475+
AC_DEFUN([PHP_ADD_INCLUDE], [
476+
for path in m4_normalize(m4_expand([$1])); do
477+
AS_IF([test "$path" != "/usr/include"], [
478+
PHP_EXPAND_PATH([$path], [ai_p])
479+
PHP_RUN_ONCE([INCLUDEPATH], [$ai_p], [m4_ifnblank([$2],
480+
[INCLUDES="-I$ai_p $INCLUDES"],
481+
[INCLUDES="$INCLUDES -I$ai_p"])])
482+
])
483+
done
485484
])
486485

487486
dnl

0 commit comments

Comments
 (0)