]> git.lyx.org Git - lyx.git/blobdiff - development/scons/scons_utils.py
compile fix
[lyx.git] / development / scons / scons_utils.py
index f8e9f48536420ed475acca995e6b2da3ac099071..6eaa686be75d6761a26155cee922cecd6d009a30 100644 (file)
@@ -58,19 +58,6 @@ def env_subst(target, source, env):
     #st = os.stat(str(source[0]))
     #os.chmod(str(target[0]), stat.S_IMODE(st[stat.ST_MODE]) | stat.S_IWRITE)
 
-
-#
-# glob filenames
-#
-def globSource(dir, pattern, build_dir = None, exclude = [], include = []):
-    ''' glob files, in dir and use build_dir as returned path name '''
-    # exclude 'exclude+include' to avoid duplicate items in files
-    files = include + filter(lambda x: x not in exclude + include, glob.glob1(dir, pattern))
-    if build_dir is None:
-        return files
-    else:
-        return ['%s/%s' % (build_dir, x) for x in files]
-
 #
 # autoconf tests
 #
@@ -254,23 +241,12 @@ int main()
 def checkIconvConst(conf):
     ''' check the declaration of iconv '''
     check_iconv_const = '''
-#include <stdlib.h>
 #include <iconv.h>
-extern
-#ifdef __cplusplus
-"C"
-#endif
-#if defined(__STDC__) || defined(__cplusplus)
-#ifndef LIBICONV_DLL_EXPORTED
-size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
-#endif
-#else
-size_t iconv();
-#endif
-
-int main()
-{
-    return 1;
+// this declaration will fail when there already exists a non const char** 
+// version which returns size_t
+double iconv(iconv_t cd,  char **inbuf, size_t *inbytesleft, char **outbuf, size_t *outbytesleft);
+int main() {
+    return 0; 
 }
 '''
     conf.Message('Check if the declaration of iconv needs const... ')
@@ -279,6 +255,26 @@ int main()
     return ret
 
 
+def checkSizeOfWChar(conf):
+    ''' check the size of wchar '''
+    check_sizeof_wchar = '''
+int i[ ( sizeof(wchar_t)==%d ? 1 : -1 ) ];
+int main()
+{
+    return 0;
+}
+'''
+    conf.Message('Check the size of wchar_t... ')
+    if conf.TryLink(check_sizeof_wchar % 2, '.cpp'):
+        ret = 2
+    elif conf.TryLink(check_sizeof_wchar % 4, '.cpp'):
+        ret = 4
+    else:
+        ret = 0
+    conf.Result(str(ret))
+    return ret
+
+
 def createConfigFile(conf, config_file,
     config_pre = '', config_post = '',
     headers = [], functions = [], types = [], libs = [],