Skip to content

Commit 4ba80ec

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]) [skip ci] Sync macro naming in changelog
1 parent e358634 commit 4ba80ec

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
@@ -200,6 +200,8 @@ PHP 8.4 INTERNALS UPGRADE NOTES
200200
- Autoconf macros PHP_NEW_EXTENSION, PHP_ADD_SOURCES, PHP_ADD_SOURCES_X,
201201
PHP_SELECT_SAPI now have the source files and flags arguments normalized so
202202
the list of items can be passed as a blank-or-newline-separated list.
203+
- Autoconf macro PHP_ADD_INCLUDE now takes also a blank-or-newline-separated
204+
list of include directories instead of a single directory.
203205
- TSRM/tsrm.m4 file and its TSRM_CHECK_PTHREADS macro have been removed.
204206
- Added pkg-config support to find libpq for the pdo_pgsql and pgsql
205207
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)