s3-waf: fixed tests for charsets
authorAndrew Tridgell <tridge@samba.org>
Fri, 26 Mar 2010 06:55:25 +0000 (00:55 -0600)
committerAndrew Tridgell <tridge@samba.org>
Tue, 6 Apr 2010 10:27:08 +0000 (20:27 +1000)
Pair-Programmed-With: Kai

buildtools/wafsamba/samba_conftests.py
source3/build/charset.py

index 742959db84dc92933b260782442b00f1d0f62253..ce86ce1221f4d1c9812c5d70011d51e70f9c8344 100644 (file)
@@ -44,7 +44,7 @@ def CHECK_C_PROTOTYPE(conf, function, prototype, define, headers=None):
 
 
 @conf
 
 
 @conf
-def CHECK_CHARSET_EXISTS(conf, charset, outcharset='UCS2-LE', libs=None, headers=None, define=None):
+def CHECK_CHARSET_EXISTS(conf, charset, outcharset='UCS-2LE', headers=None, define=None):
     '''check that a named charset is able to be used with iconv_open() for conversion
     to a target charset
     '''
     '''check that a named charset is able to be used with iconv_open() for conversion
     to a target charset
     '''
@@ -53,15 +53,12 @@ def CHECK_CHARSET_EXISTS(conf, charset, outcharset='UCS2-LE', libs=None, headers
         define = 'HAVE_CHARSET_%s' % charset.upper().replace('-','_')
     return conf.CHECK_CODE('''
                            iconv_t cd = iconv_open("%s", "%s");
         define = 'HAVE_CHARSET_%s' % charset.upper().replace('-','_')
     return conf.CHECK_CODE('''
                            iconv_t cd = iconv_open("%s", "%s");
-                           if (cd == 0 || cd == (iconv_t)-1) {
-                             return -1;
-                             }
-                             return 0;
-                             ''' % (charset, outcharset),
+                           if (cd == 0 || cd == (iconv_t)-1) return -1;
+                           ''' % (charset, outcharset),
                            define=define,
                            execute=True,
                            define=define,
                            execute=True,
-                           libs=libs,
                            msg=msg,
                            msg=msg,
+                           lib='iconv',
                            headers=headers)
 
 
                            headers=headers)
 
 
index fce1f4af31d6ccb96a40cbaca7ee3db6b5489366..d1940c3ef18ffe19d7598f870b92be75ec151443 100644 (file)
@@ -13,19 +13,19 @@ def CHECK_SAMBA3_CHARSET(conf, crossbuild=False):
 
         # check for default dos charset name
         for charset in ['CP850', 'IBM850']:
 
         # check for default dos charset name
         for charset in ['CP850', 'IBM850']:
-            if conf.CHECK_CHARSET_EXISTS(charset):
+            if conf.CHECK_CHARSET_EXISTS(charset, headers='iconv.h'):
                 default_dos_charset=charset
                 break
 
         # check for default display charset name
         for charset in ['ASCII', '646']:
                 default_dos_charset=charset
                 break
 
         # check for default display charset name
         for charset in ['ASCII', '646']:
-            if conf.CHECK_CHARSET_EXISTS(charset):
+            if conf.CHECK_CHARSET_EXISTS(charset, headers='iconv.h'):
                 default_display_charset=charset
                 break
 
         # check for default unix charset name
         for charset in ['UTF-8', 'UTF8']:
                 default_display_charset=charset
                 break
 
         # check for default unix charset name
         for charset in ['UTF-8', 'UTF8']:
-            if conf.CHECK_CHARSET_EXISTS(charset):
+            if conf.CHECK_CHARSET_EXISTS(charset, headers='iconv.h'):
                 default_unix_charset=charset
                 break
 
                 default_unix_charset=charset
                 break