-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Support shared libraries of macOS SDKs #3616
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
Comment on behalf of petk at php.net: Labelling... Thank you for the pull request @mizunashi-mana |
05dc659
to
149b8b0
Compare
P.S. |
@mizunashi-mana that seems to have been a temporary glitch by Apple and it shouldn't happen anymore from what I've heard |
I guess this one will also fix https://bugs.php.net/bug.php?id=77342. |
We are currently porting library detection code to rely exclusively on pkg-config (not all extensions are ported yet). I believe that will also resolve this issue, right? |
@nikic I agree and that is better solution. |
Hello. So, currently on macOS systems PHP can be installed thanks to the awesome brew packages which contain patches to bypass these annoyances. Otherwise, the default macOS installation goes through with minor adjustments for the PHP 7.4 (via configure options). And in the future macOS versions (Catalina) this won't work anymore if I'm not mistaken due to not using the I'd suggest to apply something like https://github.com/kabel/php-src/commit/0e000cc9ab94008f5554514ef5014ef892c3279b to PHP-7.4+ but with a bit more automation behind (using a configure option is a nice trick but a bit redundant if such location can be determined by the build system). Maybe what this pull request does. We'll need to adjust only few extensions now due to the pkg-config usage except the ones where include path needs change. As irresponsible as it sounds, I wouldn't patch PHP 7.3 and 7.2 due to already good patches in the brew system and too messy code in there that can break everything even with a minor fix... Thank you @kabel and @javian for helping out here with current pull requests and bug reports in this direction... Let me check what I can come up with here. |
Ping. |
@GrahamCampbell What's the current state of this issue? pkg-config migration should have obsoleted the majority of this patch, but I don't know what is still relevant here. |
Sorry, I have less time now... There are many changes from this PR. We should survey current status for this problem with PHP 7.4+ before discussion how to patch completely. However, I can't do... |
Our current position is that this is better solved on a case by case basis using the improved pkg-config support we use/have, in addition this appears to have gone stale, and the author backed out because of time constraints, so closing now. |
resolve https://bugs.php.net/bug.php?id=77011
From Mojave (macOS 10.14), it was deprecated
/usr/include
and we should use SDK paths explicitly: https://developer.apple.com/documentation/xcode_release_notes/xcode_10_release_notes#3035624.Although we can restore
/usr/include
by /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg,Therefore, we should support SDK paths for users building PHP from sources (e.g. Homebrew, php-build, phpbrew and etc.) Because the shared libraries of SDK paths use
.tbd
as file extension, we also should support new extension;.tbd
.This patch includes
.tbd
and SDK paths support and some fixes to resolve prefix correctly.I tested this patch in some situations:
On macOS Mojave with configure options of php-build:
On macOS Mojave with configure options of Homebrew's php formula:
On docker debian stable(stretch) image with configure options of php-build:
apt update && apt install -y make autoconf gcc g++ pkg-config \ libc-dev \ bison \ re2c \ libbz2-dev \ libcurl4-openssl-dev \ libedit-dev \ libfreetype6-dev \ libicu-dev \ libjpeg62-turbo-dev \ libpng-dev \ libsqlite3-dev \ libssl-dev \ libtidy-dev \ libwebp-dev \ libxml2-dev \ libxpm-dev \ libxslt1-dev \ libzip-dev \ zlib1g-dev make clean ./buildconf --force ./configure \ --without-pear \ --enable-bcmath \ --enable-cgi \ --enable-exif \ --enable-fpm \ --enable-ftp \ --enable-intl \ --enable-mbstring \ --enable-pcntl \ --enable-phpdbg \ --enable-shmop \ --enable-soap \ --enable-sockets \ --enable-sysvsem \ --enable-sysvshm \ --enable-xmlreader \ --enable-zip \ --disable-debug \ --with-bz2 \ --with-curl \ --with-freetype-dir \ --with-gd \ --with-jpeg-dir \ --with-kerberos \ --with-libzip \ --with-mysqli=mysqlnd \ --with-openssl \ --with-pdo-mysql=mysqlnd \ --with-pdo-sqlite \ --with-tidy \ --with-webp-dir \ --with-xmlrpc \ --with-xpm-dir \ --with-xsl \ --with-zlib \ --with-zlib-dir \ --with-libedit \ --with-png-dir make