php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #77011 configure cannot detect iconv library on Mojave (macOS 10.14)
Submitted: 2018-10-14 19:42 UTC Modified: -
From: axnnoindexr11 at gmail dot com Assigned:
Status: Open Package: Compile Failure
PHP Version: 7.3.0RC3 OS: macOS 10.14
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2018-10-14 19:42 UTC] 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.

Patches

add-tbd-ext-for-iconv (last revision 2018-10-14 19:42 UTC by )

Add a Patch

Pull Requests

Add a Pull Request

 
PHP Copyright © 2001-2018 The PHP Group
All rights reserved.
Last updated: Mon Dec 10 02:01:24 2018 UTC