diff options
author | Charles Pigott <charlespigott@googlemail.com> | 2018-09-24 22:17:55 +0100 |
---|---|---|
committer | Patric Stout <truebrain@openttd.org> | 2019-01-05 17:39:11 +0100 |
commit | 0e7af55ef704757dfee40c1799359df01b937ebb (patch) | |
tree | afa21252ce8fdf6458eeda00c8fe9276ff4758df | |
parent | b8b6954fb58aac07d05dabe63918f0392c5672d1 (diff) | |
download | openttd-0e7af55ef704757dfee40c1799359df01b937ebb.tar.xz |
Fix: [OSX] Check all search paths for iconv.h
-rw-r--r-- | config.lib | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/config.lib b/config.lib index 894a22c17..2d2f864d7 100644 --- a/config.lib +++ b/config.lib @@ -2927,10 +2927,16 @@ detect_iconv() { # Try to find iconv.h, seems to only thing to detect iconv with if [ "$with_iconv" = "1" ] || [ "$with_iconv" = "" ] || [ "$with_iconv" = "2" ]; then - iconv=`ls -1 /usr/include 2>/dev/null | grep "iconv.h"` - if [ -z "$iconv" ]; then - iconv=`ls -1 /usr/local/include 2>/dev/null | grep "iconv.h"` - fi + # Iterate over search paths + iconv="" + search_paths=`LC_ALL=C $cxx_host $OSX_SYSROOT $CFLAGS -E - -v </dev/null 2>&1 | \ + $awk '/#include <...> search starts here:/{flag=1;next}/End of search list./{flag=0}flag'` + for path in $search_paths; do + iconv=`ls -1 $path 2>/dev/null | grep "iconv.h"` + if [ -n "$iconv" ]; then + break + fi + done else # Make sure it exists iconv=`ls $with_iconv/include/iconv.h 2>/dev/null` |