]> git.lyx.org Git - lyx.git/blobdiff - development/scons/SConstruct
Fix byte order problems
[lyx.git] / development / scons / SConstruct
index 88cfb31adbdb567e52e8c1d1d6d7d0172dc922b4..c3923ea71272bac1b281cadc2ac08fba6393049b 100644 (file)
@@ -464,7 +464,7 @@ if use_vc:
     #   in the current code page (number)
     # C4996: foo was decleared deprecated
     CCFLAGS_required.extend(['/TP', '/EHsc'])
-    CCFLAGS_default.extend(['/wd4819', '/wd4996', '/nologo'])
+    CCFLAGS_default.extend(['/wd4819', '/wd4996', '/nologo', '/MD'])
 else:
     if env.has_key('CXX') and env['CXX']:
         env['CC'] = env.subst('$CXX')
@@ -523,25 +523,34 @@ def setEnvVariable(env, name, required = None, default = None, split = True):
                 environment variables
             split: whether or not split obtained variable like '-02 -g'
     '''
-    # first try command line argument (override environment settings)
+    # 1. ARGUMENTS is already set to env[name], override default.
     if ARGUMENTS.has_key(name):
-        default = ARGUMENTS[name]
-        if split:
-            default = default.split()
+        default = None
     # then use environment default
     elif os.environ.has_key(name):
-        print "Acquiring varaible %s from system environment: %s" % (name, os.environ[name])
+        print "Acquiring variable %s from system environment: %s" % (name, os.environ[name])
         default = os.environ[name]
         if split:
             default = default.split()
-    # set variable
-    if required is not None:
-        env[name] = required
-    if default is not None:
-        if env.has_key(name) and env[name] != default:
-            env[name] += default
-        else:
-            env[name] = default
+    # the real value should be env[name] + default + required
+    if split:
+        value = []
+        if env.has_key(name):
+            value = str(env[name]).split()
+        if required is not None:
+            value += required
+        if default is not None:
+            value += default
+    else:
+        value = ""
+        if env.has_key(name):
+            value = str(env[name])
+        if required is not None:
+            value += " " + required
+        if default is not None:
+            value += " " + default
+    env[name] = value
+    # print name, env[name]
 
 setEnvVariable(env, 'DESTDIR', split=False)
 setEnvVariable(env, 'CC')
@@ -1091,6 +1100,10 @@ int count()
             (spell_engine is not None, spell_engine,
                 'Spell engine to use'
             ),
+            # we need to know the byte order for unicode conversions
+            (sys.byteorder == 'big', 'WORDS_BIGENDIAN'
+                'Define to 1 if your processor stores words with the most significant byte first (like Motorola and SPARC, unlike Intel and VAX).'
+            ),
         ],
         extra_items = [
             ('#define PACKAGE "%s%s"' % (package, program_suffix),
@@ -1305,9 +1318,9 @@ env = conf.Finish()
 if frontend == 'qt3':
     # note: env.Tool('qt') my set QT_LIB to qt
     if platform_name == 'win32':
-        qt_libs = ['qt-mt']
-    else:
         qt_libs = ['qt-mt3']
+    else:
+        qt_libs = ['qt-mt']
     frontend_libs = qt_libs
 elif frontend == 'qt4':
     qt_libs = ['QtCore', 'QtGui']
@@ -1329,7 +1342,7 @@ if platform_name in ['win32', 'cygwin']:
     # the final link step needs stdc++ to succeed under mingw
     # FIXME: shouldn't g++ automatically link to stdc++?
     if use_vc:
-        system_libs = [env['ICONV_LIB'], 'shlwapi', 'shell32', 'advapi32', 'zdll']
+        system_libs = [env['ICONV_LIB'], 'ole32', 'shlwapi', 'shell32', 'advapi32', 'zdll']
     else:
         system_libs = [env['ICONV_LIB'], 'shlwapi', 'stdc++', 'z']
 elif platform_name == 'cygwin' and env['X11']:
@@ -1762,7 +1775,7 @@ if build_qt3:
     qt3 = qt3env.StaticLibrary(
         target = '$LOCALLIBPATH/qt3',
         source = ['$BUILDDIR/common/frontends/qt3/%s' % x for x in src_frontends_qt3_files] \
-            + qt3_moced_files + qt3_uiced_cc_files
+            + qt3_uiced_cc_files
     )
     Alias('qt3', qt3)
 
@@ -1798,7 +1811,6 @@ if build_qt4:
         '-DQT_CLEAN_NAMESPACE',
         '-DQT_GENUINE_STR',
         '-DQT_NO_STL',
-        '-DQT3_SUPPORT',
         '-DQT_NO_KEYWORDS',
         ]
     )
@@ -2219,7 +2231,7 @@ if 'install' in targets:
     # ru.gmo ==> ru/LC_MESSAGES/lyxSUFFIX.mo
     for gmo in gmo_files:
         lan = os.path.split(str(gmo))[1].split('.')[0]
-        dest_file = os.path.join(locale_dest_dir, lan, 'LC_MESSAGES', 'lyx' + version_suffix + '.mo')
+        dest_file = os.path.join(locale_dest_dir, lan, 'LC_MESSAGES', 'lyx' + program_suffix + '.mo')
         env.InstallAs(dest_file, gmo)
         Alias('install', dest_file)