Skip to content

Autotools: Move auto_cflags marker to PHP_INIT_BUILD_SYSTEM #15487

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 2 commits into from
Aug 19, 2024

Conversation

petk
Copy link
Member

@petk petk commented Aug 18, 2024

The "hacky" auto_cflags variable is otherwise set only for the Oracle Developer Studio compiler (which is at this point also non-usable) and perhaps might be removed in the future but this is for now moved to the PHP_INIT_BUILD_SYSTEM for consistent settings between the php-src build and phpize.

The PHP_INIT_BUILD_SYSTEM is now also called sooner in phpize to match the php-src build.

The "hacky" auto_cflags variable is otherwise set only for the Oracle
Developer Studio compiler (which is at this point also non-usable) and
perhaps might be removed in the future but this is for now moved to the
PHP_INIT_BUILD_SYSTEM for consistent settings between the php-src build
and phpize.

The PHP_INIT_BUILD_SYSTEM is now also called sooner in phpize to match
the php-src build.
@petk petk merged commit 40217b2 into php:master Aug 19, 2024
2 checks passed
@petk
Copy link
Member Author

petk commented Aug 19, 2024

I've rechecked this. Merging into master branch.

@petk petk deleted the patch-m4-auto-cflags branch August 19, 2024 20:29
@andypost
Copy link
Contributor

Please elaborate, is CFLAGS from environment has preference on passing as argument?

@petk
Copy link
Member Author

petk commented Aug 19, 2024

Please elaborate, is CFLAGS from environment has preference on passing as argument?

Yes. When setting CFLAGS variable in command line ./configure CFLAGS=... will override default Autoconf's CFLAGS value. So it needs to be set to something sensible for the build. One of the issues with Autoconf not appending some user defined CFLAGS. Trying to resolve this via #12050 at some point and using the CFLAGS_EXTRA or something like that. Perhaps PHP_CFLAGS...

@andypost
Copy link
Contributor

Thank you 👍

@petk
Copy link
Member Author

petk commented Aug 20, 2024

@andypost Autoconf actually sets this CFLAGS to very simple values. There are mostly only -g -O2 when GNU C compatible compiler is used (gcc, clang...), or to -g for other compilers. Basically, you can set it to anything on your build as long as some suitable optimization level -O... is used for the production. Yes, we probably should look into this a bit more how to do that a bit more automatically in PHP build system directly but for now it's like this.

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