[glib/glib-2-60: 1/2] meson: Hotfix for iconv detection on macOS



commit fcf68f8f317fbc8af531fc0ffa9d7d7c22b7e21e
Author: Nirbheek Chauhan <nirbheek centricular com>
Date:   Thu Apr 11 18:00:05 2019 +0530

    meson: Hotfix for iconv detection on macOS
    
    macOS/iOS do not ship iconv inside the C library, so don't try to look
    for that at all when targetting macOS or iOS.
    
    The proper fix involved changing the options and will be merged in
    master: https://gitlab.gnome.org/GNOME/glib/merge_requests/759

 meson.build | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
---
diff --git a/meson.build b/meson.build
index af0103c13..682a0e8fd 100644
--- a/meson.build
+++ b/meson.build
@@ -1680,13 +1680,20 @@ glibconfig_conf.set10('G_HAVE_GROWING_STACK', growing_stack)
 # We should never use the MinGW C library's iconv. On Windows we use the
 # GNU implementation that ships with MinGW.
 
+iconv_opt = get_option('iconv')
+
+# On Darwin, the libc doesn't provide iconv. Instead, the OS provides libiconv
+# as a separate (non-GNU) library. Set the option to 'native'.
+if host_system == 'darwin' and iconv_opt == 'libc'
+  iconv_opt = 'native'
+endif
+
 # On Windows, just always use the built-in implementation
 if host_system == 'windows'
   libiconv = []
   glib_conf.set('USE_LIBICONV_NATIVE', true)
 else
   found_iconv = false
-  iconv_opt = get_option('iconv')
   if iconv_opt == 'libc'
     if cc.has_function('iconv_open')
       libiconv = []


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]