build: Cope with broken libiconv
authorMatthieu Patou <mat@matws.net>
Wed, 8 Dec 2010 21:17:37 +0000 (00:17 +0300)
committerMatthieu Patou <mat@samba.org>
Wed, 8 Dec 2010 22:19:19 +0000 (23:19 +0100)
library iconv needs mbrtowc but some system didn't provide it (ie.
HP-UX 11.0)

Autobuild-User: Matthieu Patou <mat@samba.org>
Autobuild-Date: Wed Dec  8 23:19:19 CET 2010 on sn-devel-104

lib/util/charset/wscript_configure

index e54bfcc92494b60ac709dfaf7c9e91d185b0134b..346d585f5c49eb5d79581e7701ed983013bc748b 100644 (file)
@@ -12,4 +12,8 @@ conf.CHECK_LIB(libs="iconv", shlib=True)
 
 if (conf.CHECK_FUNCS_IN('iconv_open', 'iconv', checklibc=False, headers='iconv.h') or
     conf.CHECK_FUNCS('iconv_open', headers='iconv.h')):
-    conf.DEFINE('HAVE_NATIVE_ICONV', 1)
+    if conf.env['HAVE_LIBICONV']:
+        if conf.CHECK_FUNCS('mbrtowc', headers='wchar.h'):
+            conf.DEFINE('HAVE_NATIVE_ICONV', 1)
+    else:
+        conf.DEFINE('HAVE_NATIVE_ICONV', 1)