waf: improve iconv checks
authorChristian Ambach <ambi@samba.org>
Wed, 4 Dec 2013 21:50:11 +0000 (22:50 +0100)
committerChristian Ambach <ambi@samba.org>
Fri, 3 Jan 2014 04:04:44 +0000 (05:04 +0100)
there are broken iconv implementations around (e.g. on AIX) that you
can compile against but that refuse any mapping requests

make sure we do the same as the autoconf-based build did and
fall back to our own code

Bug: https://bugzilla.samba.org/show_bug.cgi?id=10308

Signed-off-by: Christian Ambach <ambi@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
source3/build/charset.py

index 44852a6c52a1717b72f12a3980baa4feccb4ee1b..003355773614740884d673b63e8d188f50df8fa9 100644 (file)
@@ -33,6 +33,12 @@ def CHECK_SAMBA3_CHARSET(conf, crossbuild=False):
            default_unix_charset="UTF-8"
             # TODO: this used to warn about the set charset on cross builds
 
+        if default_dos_charset is False or default_unix_charset is False:
+        # we found iconv, but it failed to convert anything (e.g. on AIX)
+            conf.undefine('HAVE_NATIVE_ICONV');
+            default_dos_charset = "ASCII"
+            default_unix_charset = "UTF-8"
+
         conf.DEFINE('DEFAULT_DOS_CHARSET', default_dos_charset, quote=True)
         conf.DEFINE('DEFAULT_UNIX_CHARSET', default_unix_charset, quote=True)