-
Notifications
You must be signed in to change notification settings - Fork 7.9k
[WIP] Migrate more checks to the pkg-config macro #3654
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
Will look at doing even more things. /cc @nikic |
The |
@@ -11,21 +11,10 @@ PHP_ARG_WITH(pcre-jit,,[ --with-pcre-jit Enable PCRE JIT functionality | |||
|
|||
if test "$PHP_PCRE_REGEX" != "yes" && test "$PHP_PCRE_REGEX" != "no"; then | |||
|
|||
# FIXME: don't define "I'm not bundled" as only versions installed in /usr |
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.
Not sure what the best way to do this is. PCRE is always present and should default to the bundled lib. Maybe replace the existing --with-pcre-regex=DIR
by a --disable-bundled-pcre
flag?
Why does acinclude.m4's This could use PKG_CHECK_VAR for the latter, but it sort of complicates the logic on both counts... |
@eli-schwartz From what I can tell INCDIR is not necessary if this is reduced just to the pkg-config code. It should be fine to drop it and only use INCS. |
bae4a43
to
de96953
Compare
eb267ab
to
4800539
Compare
curl 7.15.1 in December 2006 first added pkg-config support, which is earlier than the minimum supported version for php. This should therefore be uiversally supported.
logic is still entwined with bundling code
This check was added in 0db3738 and greps for a private implementation detail of the postgres headers, removed in postgres/postgres@3c4768d It hasn't worked as intended for 12 years, and can safely be assumed to not be needed.
d79ef88
to
941a1da
Compare
I have no clue why the openssl change fails to compile, when it works locally... also forcing travis to test each commit is painful. :( |
openssl 0.9.8 in July 2005 first added pkg-config support, which is earlier than the minimum supported version for php. This should therefore be uiversally supported.
One thing I'm wondering about is the option naming. Should these options stay as |
By convention it probably makes sense to stick with this even when dropping the *-dir=DIR part. Fix the travis script, which is either way using the wrong version, with *-dir See: php#3632 (comment) https://autotools.io/autoconf/arguments.html
23f76f4
to
aa93cc0
Compare
It really should be switched back: https://autotools.io/autoconf/arguments.html |
Convention so far was that Where the package was bundled and shipped with php-src (like P.S.: I'm in favor of improvements and moving the build system further otherwise. It's essential, and pkg-config seems very good addition in general otherwise :) |
I was under the impression, that we're using Wrt. |
|
||
if test "$PHP_OPENSSL_DIR" = "yes"; then | ||
PHP_OPENSSL_DIR="/usr/local/ssl /usr/local /usr /usr/local/openssl" | ||
if test -n "$OPENSSL_CFLAGS"; then |
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.
These test -n
calls are probably redundant, PHP_EVAL_LIBLINE
/PHP_EVAL_INCLUDE
should be able to handle an empty string.
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.
That's convenient. :)
PCRE2_INC=`$PKG_CONFIG --cflags libpcre2-8` | ||
fi | ||
PKG_CHECK_MODULES([PCRE2], [libpcre2-8 >= 10.30], , | ||
AC_MSG_ERROR(PCRE2 version 10.30 or later is required to compile php with PCRE2 support)) | ||
fi | ||
|
||
dnl PCRE2 in a non standard prefix should still have its config tool. |
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.
The /usr
check above and the whole if below can be dropped, as that's also fallback code.
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.
So this would automatically try to find the system version, then fallback on bundled code only if the system one isn't found?
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.
There's two level of checks there, first for yes/no, then for /usr
, so unless --with-pcre-regex
is specified with a directory, it would still use the bundled library.
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.
And then it ignores the argument entirely? I'm thinking it's best to check for "external" here.
Or... yes would look for external libraries and fall back on the bundled one, external/internal could force one or the other. If we want to get fancy, that is.
Any opinions on how to handle the option for bundled PCRE? Should we replace |
If we go with the first or third, we need two options, to also allow |
@eli-schwartz PCRE in particular is a required extension, which cannot be disabled. Though we should also consider what we'll do with extensions that have bundled libraries but are optional. For example we have |
Overall I like |
"Include Perl Compatible Regular Expressions support." ==> "sorry, you tried to disable this option that you're allowed to disable, so we will now abort with fatal configure errors". Yeah, that should be fixed. :p Let's go with --enable/--disable-bundled-regex. |
+1 for |
@petk The option to specify a path will no longer exist, because the path will now be provided through PKG_CONFIG_PATH or a similar environment variable. That's why the question is coming up at all :) I don't strongly care either way how this is called, I'm fine with both |
Got it. Took me a while but yes, then the new key sounds like a good way to go. :) Basically, php configure options already use |
fi | ||
if test "$PHP_OPENSSL" = "yes"; then | ||
PKG_CHECK_MODULES([OPENSSL], [openssl >= 1.0.1], [found_openssl=yes], | ||
[AC_MSG_ERROR([OpenSSL version 1.0.1 or greater required.])]) |
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.
Something I missed before... PHP_SETUP_OPENSSL is also used in places where openssl is an optional extension, while this will make it a hard error. This should be using $2 and $3 as the success/failure actions.
openssl part merged in fe8fdfa, with tweaks to not always make this an error. I hope I got that right, as this ifelse() stuff is magic to me. And with that, everything in this PR should be merged... we still have quite a few extensions to migrate to pkg-config though. |
Awesome! Thanks. May or may not get around to porting the rest in a third PR, but time will tell. :) |
Followup on #3632.
Now that there's a nice pkg.m4 macro to use, start using it more consistently.
Currently implemented: