Autotools: Normalize PHP_ADD_BUILD_DIR 1st argument (#15612)

The m4_normalize(m4_expand([$1])) expands the given argument if it
contains M4 macros, and then trims the items together into a space
separated string in an intuitive way.
This commit is contained in:
Peter Kokot 2024-08-29 00:44:29 +02:00 committed by GitHub
parent 0a0d2d0631
commit fbacc0f936
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 29 additions and 18 deletions

View file

@ -911,12 +911,15 @@ AC_DEFUN([PHP_SELECT_SAPI],[
dnl
dnl PHP_ADD_BUILD_DIR(dirs [, create])
dnl
dnl Add build directories and directories required for the out-of-source builds.
dnl When "create" is given, the provided "dirs" are created immediately upon
dnl macro invocation, instead of deferring it to the PHP_GEN_BUILD_DIRS.
dnl Add blank-or-newline-separated list of build directories or directories
dnl required for the out-of-source builds. When "create" is given, the provided
dnl "dirs" are created immediately upon macro invocation, instead of deferring
dnl them to the PHP_GEN_BUILD_DIRS.
dnl
AC_DEFUN([PHP_ADD_BUILD_DIR],[
ifelse($2,,[BUILD_DIR="$BUILD_DIR $1"], [$php_shtool mkdir -p $1])
AC_DEFUN([PHP_ADD_BUILD_DIR],
[m4_ifblank([$2],
[AS_VAR_APPEND([BUILD_DIR], [" m4_normalize(m4_expand([$1]))"])],
[$php_shtool mkdir -p m4_normalize(m4_expand([$1]))])
])
dnl