-
Notifications
You must be signed in to change notification settings - Fork 7.8k
Autotools: Refactor builtin checks #14835
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LCTM
@devnexen I'll append something more here what I had in mind so it's clearer. Basically, what is in this PR at the moment is the state that is currently in the master branch build system. Coming up soon. |
This creates a single M4 macro PHP_CHECK_BUILTIN and deprecates other PHP_CHECK_BUILTIN_* macros. Checks are wrapped in AC_CACHE_CHECK and CPP macros PHP_HAVE_BUILTIN_* are defined to 1 if builtin is found and to 0 if not.
This syncs all PHP_HAVE_BUILTIN_ symbols to be either undefined or defined (to value 1) and syncs all #if/ifdef/defined usages of them in the php-src code. This way it is simpler to use them because they don't need to be defined to value 0 on Windows, for example.
Ok, so now there are two commits: 2nd commit changes the PHP_HAVE_BUILTIN_* symbols to be undefined or defined to 1. I'm still not sure what to do with the previous PHP_CHECK_BUILTIN_* macros. Perhaps they could simply be removed as they don't behave the same anymore. For the PHP extensions out there I haven't found any extension that uses these PHP_CHECK_BUILTIN_* M4 macros so I think removal of them is pretty safe (it's like these are more php-src internal related checks only). |
Open source extensions out there don't seem to use the macros, so the 3rd commit also removes all PHP_CHECK_BUILTIN_* M4 macros which simplifies things a bit. It is even simpler and safer to not have macro with the same name if it defines symbols differently. Ok, now I'm done here and this is ready for review :D |
This creates a single M4 macro PHP_CHECK_BUILTIN with passed arguments.
Here are some issues but not so much problematic I think. These
PHP_HAVE_BUILTIN_*
are defined to 0 or to 1. So all the current checks with#ifdef PHP_HAVE_BUILTIN_*
are probably typos in the php-src. I'm not sure if it was intentional to use #ifdef anywhere to explicitly target *nix or Windows with these.I think it might be easiest to change them to an undefined/1 style (like other Autoconf defined CPP macros) so they don't need to be defined on Windows to 0. Sounds good?