gconvert: Don't differentiate between GNU iconv and macOS iconv

Both provide iconv_open, and in fact, we weren't using the difference
anywhere in glib at all.
This commit is contained in:
Nirbheek Chauhan 2019-04-04 05:12:35 +05:30
parent 2f066aeb51
commit ace32cd8e2
3 changed files with 3 additions and 21 deletions

View File

@ -52,14 +52,6 @@
#include "glibintl.h"
#if defined(USE_LIBICONV_GNU) && !defined (_LIBICONV_H)
#error GNU libiconv in use but included iconv.h not from libiconv
#endif
#if !defined(USE_LIBICONV_GNU) && defined (_LIBICONV_H) \
&& !defined (__APPLE_CC__) && !defined (__LP_64__)
#error GNU libiconv not in use but included iconv.h is from libiconv
#endif
/**
* SECTION:conversions

View File

@ -1690,9 +1690,6 @@ glibconfig_conf.set10('G_HAVE_GROWING_STACK', growing_stack)
# Tests for iconv
#
# USE_LIBICONV_GNU: Using GNU libiconv
# USE_LIBICONV_NATIVE: Using a native impl of iconv in a separate library
#
# We should never use the MinGW C library's iconv because it may not be
# available in the actual runtime environment. On Windows, we always use
# the built-in implementation
@ -1701,7 +1698,6 @@ if host_system == 'windows'
libiconv = []
# We have a #include "win_iconv.c" in gconvert.c on Windows, so we don't need
# any external library for it
glib_conf.set('USE_LIBICONV_NATIVE', true)
if iconv_opt != 'auto'
warning('-Diconv was set to @0@, which was ignored')
endif
@ -1711,13 +1707,7 @@ else
libiconv = []
found_iconv = true
endif
if not found_iconv and ['auto', 'native'].contains(iconv_opt) and cc.has_header_symbol('iconv.h', 'iconv_open')
glib_conf.set('USE_LIBICONV_NATIVE', true)
libiconv = [cc.find_library('iconv')]
found_iconv = true
endif
if not found_iconv and ['auto', 'gnu'].contains(iconv_opt) and cc.has_header_symbol('iconv.h', 'libiconv_open')
glib_conf.set('USE_LIBICONV_GNU', true)
if not found_iconv and ['auto', 'external'].contains(iconv_opt) and cc.has_header_symbol('iconv.h', 'iconv_open')
libiconv = [cc.find_library('iconv')]
found_iconv = true
endif

View File

@ -5,9 +5,9 @@ option('runtime_libdir',
option('iconv',
type : 'combo',
choices : ['auto', 'libc', 'native', 'gnu'],
choices : ['auto', 'libc', 'external'],
value : 'auto',
description : 'iconv implementation to use (\'libc\' = \'Part of the C stdlib\'; \'gnu\' = \'GNU\'s iconv\'; \'native\' = \'A separate iconv\'; \'auto\' = \'Auto-detect which iconv is available\')')
description : 'iconv implementation to use (\'libc\' = \'Part of the C library\'; \'external\' = \'External libiconv\'; \'auto\' = \'Auto-detect which iconv is available\')')
option('charsetalias_dir',
type : 'string',