Skip to content

Autotools: Simplify few PHP_ADD_BUILD_DIR calls #15783

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

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

petk
Copy link
Member

@petk petk commented Sep 7, 2024

The $ext_builddir variable for the current extension is set after the PHP_NEW_EXTENSION is called. But there is also PHP_EXT_BUILDDIR macro which expands to the same value (defined in config-stubs and phpize), a relative path of the current extension or SAPI. This enables calling PHP_ADD_BUILD_DIR before the PHP_NEW_EXTENSION and removes some redundant conditions.

@petk
Copy link
Member Author

petk commented Sep 7, 2024

This is still too ugly. I'll try also something else here.

@petk petk force-pushed the patch-m4-PHP_EXT_BUILDDIR branch from b842773 to d2fba68 Compare September 7, 2024 06:14
@petk
Copy link
Member Author

petk commented Sep 7, 2024

I think this will be a bit better now. These variables ext_srcdir, ext_builddir, ext_dir should be set when including the config m4 file and not when calling the PHP_NEW_EXTENSION. And this fixes also one missed PHP 8.4 bug in ext/gd with the include flag.

@petk petk marked this pull request as ready for review September 7, 2024 06:15
The ext_builddir, ext_srdir, and ext_dir variables for the current
extension are set after the PHP_NEW_EXTENSION is called. This now
assignes them in config-stubs and phpize before including the
extension's or SAPI+'s config m4 file'

For example, this enables calling PHP_ADD_BUILD_DIR and some other
macros before the PHP_NEW_EXTENSION and removes some redundant
conditions.

This also fixes missed bug in gd extension include flag.
@petk petk force-pushed the patch-m4-PHP_EXT_BUILDDIR branch from e85cc37 to 02215c3 Compare September 7, 2024 06:22
@iluuu1994 iluuu1994 assigned iluuu1994 and unassigned iluuu1994 Sep 7, 2024
@petk
Copy link
Member Author

petk commented Sep 7, 2024

I'll target PHP 9 here with this as this config-stubs seems to be still a bit buggy. It echoes content several times when some file isn't found.

@petk petk marked this pull request as draft September 7, 2024 14:05
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.

2 participants