ext/{lexbor,uri}: Fix build/install interface #20506
Open
+74
−14
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
As much as I dislike adding another global include flag to php-config script or to install even more headers, this is now needed to fix then also, I believe.
Changes in the PR:
Currently, ext/uri API is designed in a way that no 3rd party uriparser headers are needed to use ext/uri headers in some other extension.
ext/lexbor now also installs all 3rd party ext/lexbor/lexbor headers. They are currently needed by ext/dom and ext/uri.
Added lexbor include flag to php-config script.
The ext/uri/uriparser/include can be (currently) only specified for the ext/uri sources and not globally for all other extensions.
Creating redundant ext/lexbor/lexbor/css/tokenizer directory at configure step removed (this was probably used in some older lexbor version).
In the future it would be much cooler to go similar to how the ext/pcre/pcre2lib is done regarding the headers. Or in current case, how the ext/uri is done - like a perfect example of using 3rd party library, having it bundled (optionally) but no uriparser headers need to be installed to use PHP C API.
BTW, to use PHP, a list of all include flags is getting extremely long. This is completely redundant I believe and could be simplified to only
includes="-I$include_dir"at some point if there is some goal to have a nice PHP C API:Edit: This is done now only due to the
ext/uri/uri_parser_whatwg.hwhich includes thelexbor/url/url.hand this is a public header. If this header could be somehow refactored, then ext/lexbor include flag could be most likely removed from the php-config scripts. So only ext/dom has customly could have an -Iext/lexbor flag.