Bug #77011 [ReO]: configure cannot detect iconv library on Mojave (macOS 10.14)

From: Date: Sat, 20 Apr 2019 16:45:20 +0000
Subject: Bug #77011 [ReO]: configure cannot detect iconv library on Mojave (macOS 10.14)
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-220536@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=77011&edit=1 ID: 77011 Updated by: nikic@php.net Reported by: axnnoindexr11 at gmail dot com Summary: configure cannot detect iconv library on Mojave (macOS 10.14) Status: Re-Opened Type: Bug Package: Compile Failure Operating System: macOS 10.14 PHP Version: 7.3.0RC3 Block user comment: N Private report: N New Comment: @petk: I don't believe we plan to apply that PR. We should only add handling for this in places which have not already been fixed by pkg-config migration. Previous Comments: ------------------------------------------------------------------------ [2019-04-20 13:25:10] petk@php.net The following pull request has been associated: Patch Name: Support shared libraries of macOS SDKs On GitHub: https://github.com/php/php-src/pull/3616 Patch: https://github.com/php/php-src/pull/3616.patch ------------------------------------------------------------------------ [2019-04-20 13:24:29] petk@php.net Reopening since the fix was only a quickfix for now to be able to test PHP-7.4 and master branches on macos systems. More proper fix is also coming up for PHP-7.2 and above for latest macos systems thanks to https://github.com/php/php-src/pull/3616 ------------------------------------------------------------------------ [2019-04-20 13:22:49] petk@php.net Automatic comment on behalf of gabriel.couto@memed.com.br Revision: http://git.php.net/?p=php-src.git;a=commit;h=e28db2276b3d73bcdbf256bd7efffff3e8f874e0 Log: Fixed bug #77011 ------------------------------------------------------------------------ [2019-04-09 00:53:39] The following pull request has been associated: Patch Name: Fix #77011: configure cannot detect iconv library on Mojave (macOS 10.14) On GitHub: https://github.com/php/php-src/pull/4016 Patch: https://github.com/php/php-src/pull/4016.patch ------------------------------------------------------------------------ [2018-10-14 19:42:04] axnnoindexr11 at gmail dot com Description: ------------ In Mojave, remove /usr/include and put system headers on only /Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include: https://developer.apple.com/documentation/xcode_release_notes/xcode_10_release_notes#3035624 Yesterday, I tried to compile PHP with iconv bundled Mojave, but ./configure reports an error: Please reinstall the iconv library. I researched the reason and I found that shared libraries bundled Mojave have strange extensions, .tbd. ``` $ xcrun --show-sdk-path /Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk $ ls $(xcrun --show-sdk-path)/usr/include/iconv.h /Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include/iconv.h $ ls $(xcrun --show-sdk-path)/usr/lib/libiconv.* /Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/lib/libiconv.2.4.0.tbd /Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/lib/libiconv.2.tbd /Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/lib/libiconv.tbd $ ls /usr/include ls: cannot access '/usr/include': No such file or directory $ ls /usr/lib/libiconv.* /usr/lib/libiconv.2.4.0.dylib /usr/lib/libiconv.2.dylib /usr/lib/libiconv.dylib ``` configure of PHP check only .dylib for macOS libraries. Actually, .tbd is also a shared library extension for macOS and make works well after I applied simple patch that also checks .tbd. I want to add .tbd extension support for configure. Test script: --------------- /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" brew update && brew install autoconf pkg-config bison sqlite ./buildconf env PATH=$(brew --prefix bison)/bin:$PATH ./configure \ --without-pear \ --enable-fpm \ --with-mysqli \ --with-sqlite3=$(brew --prefix sqlite) \ --with-pdo-sqlite=$(brew --prefix sqlite) \ --with-iconv=$(xcrun --show-sdk-path)/usr Expected result: ---------------- No errors Actual result: -------------- ... checking size of short... (cached) 2 checking size of int... (cached) 4 checking size of long... (cached) 8 checking size of long long... (cached) 8 checking size of long int... 8 checking checking if we're at 64-bit platform... yes checking for iconv support... yes configure: error: Please reinstall the iconv library. ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=77011&edit=1

« previous php.bugs (#220536) next »