Skip to content

Autotools: Normalize 2nd arg in PHP_ADD_SOURCES_X #15088

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 29, 2024

Conversation

petk
Copy link
Member

@petk petk commented Jul 23, 2024

By using m4_normalize(m4_expand([...])), the arguments can be split into newlines without using backslashes and it makes working with lists of files a bit easier.

Tested:

  • variables inside the argument
  • M4 macro expansions
  • dnl comments
  • newlines, leading and trailing spaces and tabs, sequences of backslash-then-newline, multiple spaces, tabs, newlines, backslash-then-newline, empty spaces
  • quoted/unquoted arguments
  • ...

Unfortunately, this wasn't ready sooner... But I'm not yet sure if to target PHP-8.4 so probably it's safer to target version after PHP-8.4.

By using `m4_normalize(m4_expand([...]))`, the arguments can be split
into newlines without using backslashes and it makes working with lists
of files a bit easier.

Tested:
- variables inside the argument
- M4 macro expansions
- dnl comments
- any sequence of newlines, backslash-then-newline, multiple spaces,
  tabs...
- quoted/unquoted arguments

This now works for PHP_NEW_EXTENSION, PHP_ADD_SOURCES, PHP_ADD_SOURCES_X,
and PHP_SELECT_SAPI. The m4_normalize() usage is left in the php-src
config.m4 files following the 0a0d2d0
for PECL extensions until phpize will be available on all supported
versions (minimum PHP 8.4).
@petk petk force-pushed the patch-normalize-sources branch from 5022f5c to 19a75a6 Compare August 28, 2024 23:51
@petk
Copy link
Member Author

petk commented Aug 28, 2024

I'll retest and merge this also for PHP-8.4. I think everything will work ok as all edge cases that I could think of were checked.

@petk petk merged commit 7edb9a0 into php:master Aug 29, 2024
9 of 10 checks passed
@petk petk deleted the patch-normalize-sources branch August 29, 2024 00:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant