Skip to content

Autotools: Replace backticks with $(...) in php.m4 #15642

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 30, 2024

Conversation

petk
Copy link
Member

@petk petk commented Aug 29, 2024

This is a follow-up of GH-15639

@petk petk force-pushed the patch-backticks-2 branch from e8db79c to 7a95607 Compare August 30, 2024 21:31
@petk petk merged commit 75c7974 into php:master Aug 30, 2024
8 of 10 checks passed
@petk petk deleted the patch-backticks-2 branch August 30, 2024 21:32
@nikic
Copy link
Member

nikic commented Aug 31, 2024

This broke the apcu build with:

/usr/bin/ld: cannot find  -c: No such file or directory
collect2: error: ld returned 1 exit status

Old:

/bin/bash /home/nikic/php/php-src/libtool --silent --preserve-dup-deps --tag=CC --mode=compile gcc-12 -Iext/apcu/ -I/home/nikic/php/php-src/ext/apcu/ -I/home/nikic/php/php-src/main -I/home/nikic/php/php-src -I/home/nikic/php/php-src/ext/date/lib -I/usr/include/libxml2 -I/home/nikic/php/php-src/ext/mbstring/libmbfl -I/home/nikic/php/php-src/ext/mbstring/libmbfl/mbfl -I/home/nikic/php/php-src/TSRM -I/home/nikic/php/php-src/Zend  -D_GNU_SOURCE  -fno-common -Wstrict-prototypes -Wformat-truncation -Wlogical-op -Wduplicated-cond -Wno-clobbered -Wall -Wextra -Wno-unused-parameter -Wno-sign-compare -g -ffp-contract=off -fvisibility=hidden -O0 -Wimplicit-fallthrough=1 -DZEND_SIGNALS -Werror   -D_GNU_SOURCE -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1 -Wall -Wextra -Wno-unused-parameter -c /home/nikic/php/php-src/ext/apcu/apc.c -o ext/apcu/apc.lo  -MMD -MF ext/apcu/apc.dep -MT ext/apcu/apc.lo

New:

/bin/bash /home/nikic/php/php-src/libtool --silent --preserve-dup-deps --tag=CC --mode=compile gcc-12 -Iext/apcu/ -I/home/nikic/php/php-src/ext/apcu/ -I/home/nikic/php/php-src/main -I/home/nikic/php/php-src -I/home/nikic/php/php-src/ext/date/lib -I/usr/include/libxml2 -I/home/nikic/php/php-src/ext/mbstring/libmbfl -I/home/nikic/php/php-src/ext/mbstring/libmbfl/mbfl -I/home/nikic/php/php-src/TSRM -I/home/nikic/php/php-src/Zend  -D_GNU_SOURCE  -fno-common -Wstrict-prototypes -Wformat-truncation -Wlogical-op -Wduplicated-cond -Wno-clobbered -Wall -Wextra -Wno-unused-parameter -Wno-sign-compare -g -ffp-contract=off -fvisibility=hidden -O0 -Wimplicit-fallthrough=1 -DZEND_SIGNALS -Werror   \ -c /home/nikic/php/php-src/ext/apcu/apc.c -o ext/apcu/apc.lo  -MMD -MF ext/apcu/apc.dep -MT ext/apcu/apc.lo

Note the extra backslash before \.

@nikic
Copy link
Member

nikic commented Aug 31, 2024

It looks like a lot of the backtick expressions converted here contain \, which has notoriously different semantics between backticks and $().

@petk
Copy link
Member Author

petk commented Aug 31, 2024

Ah, I see. The apcu is using a Makefile variable in the config.m4.

@petk
Copy link
Member Author

petk commented Aug 31, 2024

I'll recheck this one. Yes, basically no simple way here but to go back to the backticks in php.m4 here:

  ifelse($5,,ac_extra=,[ac_extra=$(echo "$5"|$SED s#@ext_srcdir@#$ext_srcdir#g|$SED s#@ext_builddir@#$ext_builddir#g)])

From a quick PECL extensions check there is only APCU still having this \\$(APCU_CFLAGS) anomaly in there. For example, the GD extension's similar usage of CFLAGS was changed in PHP-8.4.

petk added a commit to petk/apcu that referenced this pull request Aug 31, 2024
This replaces the "hacky" Makefile variable usage in config.m4 with a
regular shell variable.

Issue initially noted at php/php-src#15642
nikic pushed a commit to krakjoe/apcu that referenced this pull request Aug 31, 2024
This replaces the "hacky" Makefile variable usage in config.m4 with a
regular shell variable.

Issue initially noted at php/php-src#15642
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.

3 participants