Bug #77011 [NEW]: configure cannot detect iconv library on Mojave (macOS 10.14)
| From: | axnnoindexr11 at gmail dot com | Date: | Sun, 14 Oct 2018 19:42:04 +0000 |
| Subject: | Bug #77011 [NEW]: configure cannot detect iconv library on Mojave (macOS 10.14) | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-217561@lists.php.net to get a copy of this message | ||
From: axnnoindexr11 at gmail dot com
Operating system: macOS 10.14
PHP version: 7.3.0RC3
Package: Compile Failure
Bug Type: Bug
Bug description:configure cannot detect iconv library on Mojave (macOS 10.14)
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 bug report at https://bugs.php.net/bug.php?id=77011&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=77011&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=77011&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=77011&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=77011&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=77011&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=77011&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=77011&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=77011&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=77011&r=support
Expected behavior: https://bugs.php.net/fix.php?id=77011&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=77011&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=77011&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=77011&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=77011&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=77011&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=77011&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=77011&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=77011&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=77011&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=77011&r=mysqlcfg