]> git.lyx.org Git - lyx.git/commitdiff
Make scons work on mingw/windows, from Bo Peng (ben.bob@gmail.com)
authorBo Peng <bpeng@lyx.org>
Tue, 9 May 2006 13:01:45 +0000 (13:01 +0000)
committerBo Peng <bpeng@lyx.org>
Tue, 9 May 2006 13:01:45 +0000 (13:01 +0000)
* SConstruct: force the use of g++ under windows, and use the right libraries
* config/qt4.py: check QtGui4 etc as well.
* src/SConscript: link to the right libraries
* src/tex2lyx/SConscript: use the right libraries
* src/frontends/qt3/SConscript: manually moc .h files under windows

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@13814 a592a061-630c-0410-9148-cb99ea01b6c8

SConstruct
config/qt4.py
src/SConscript
src/frontends/qt3/SConscript
src/tex2lyx/SConscript

index debe41c47cd70e45809d3cd350f92e1caefc5adb..69936445c397f286ffd39fec4060b9acd554b277 100644 (file)
@@ -258,6 +258,13 @@ env['ENV']['HOME'] = os.environ.get('HOME')
 env['ENV']['PKG_CONFIG_PATH'] = os.environ.get('PKG_CONFIG_PATH')
 env['TOP_SRC_DIR'] = Dir('.').abspath
 
+# under windows, scons is confused by .C/.c and uses gcc instead of 
+# g++. I am forcing the use of g++ here. This is expected to change
+# after lyx renames all .C files to .cpp
+if platform_name in ['win32', 'cygwin']:
+  env['CC'] = 'g++'
+  env['LINK'] = 'g++'
+
 #
 # frontend, mode, BUILDDIR and LOCALLIBPATH=BUILDDIR/libs
 # 
@@ -675,12 +682,19 @@ try:
       env['QT_LIB'] = ['QtCore4', 'QtGui4', 'Qt3Support4']
     else:
       env['QT_LIB'] = ['QtCore', 'QtGui', 'Qt3Support']
-    env['EXTRA_LIBS'] = env['QT_LIB']
+    env['EXTRA_LIBS'] = [x for x in env['QT_LIB']]
 except:
   print "Can not locate qt tools"
   print "What I get is "
   print "  QTDIR: ", env['QTDIR']
 
+if platform_name == 'win32':
+  env['SYSTEM_LIBS'] = ['shlwapi', 'zlib1']
+elif platform_name == 'cygwin':
+  env['SYSTEM_LIBS'] = ['shlwapi', 'z']
+else:
+  env['SYSTEM_LIBS'] = ['z']
+
 #
 # Build parameters CPPPATH etc
 #
index 593b01838688af1f565c3c2a759b34fca89bede4..8b3bc7f23b5aad26b3af2079f4084817c65de780 100644 (file)
@@ -332,6 +332,9 @@ def enable_modules(self, modules, debug=False) :
                'QtUiTools',
                'QtUiTools_debug',
        ]
+       # under windows, they are named QtCore4 etc
+       validModules += [x+'4' for x in validModules]
+       pclessModules += [x+'4' for x in pclessModules]
        invalidModules=[]
        for module in modules:
                if module not in validModules :
index 88fa708dd726c4543fb9a6b319419ebf22c66a0e..1b5a48f91ec8685d8f88cd75bc8e39c7aea25fb7 100644 (file)
@@ -166,9 +166,9 @@ lyx = env.Program(
     env['frontend'],
     'controllers', 
     'graphics', 
-    'supports',
-    'z' ] + 
+    'supports'] + 
     env['EXTRA_LIBS'] +
+    env['SYSTEM_LIBS'] +
     env['BOOST_LIBRARIES']
 )
 
index 1c96687bf289396fb402c39bd1c2e6a57c56c174..a5f4d4a8c9e1864ed53758d23ef94378a5261108 100644 (file)
@@ -9,6 +9,7 @@
 # Full author contact details are available in file CREDITS.
 
 Import('env')
+import os, sys
 
 print "Entering src/frontends/qt3"
 
@@ -97,6 +98,7 @@ ui_files = Split('''
   QVSpaceDialogBase.ui 
   QWrapDialogBase.ui
 ''')
+
   
 moc_files = Split('''
   BulletsModule.C
@@ -157,7 +159,15 @@ moc_files = Split('''
   socket_callback.C
   validators.C
 ''')
-  
+
+# under windows, because of the .C/.c confusion
+# moc_files are not moced automatically.
+# I am doing it manually here, until lyx changes
+# file extension from .C to .cpp
+moced_files = []
+if os.name == 'nt' or sys.platform == 'cygwin':
+  moced_files = [qtenv.Moc(x.replace('.C', '.h')) for x in moc_files]
+
 qt3 = qtenv.StaticLibrary(
   target = '$LOCALLIBPATH/qt3',
   source = Split('''
@@ -222,7 +232,7 @@ qt3 = qtenv.StaticLibrary(
     qscreen.C 
     qt_helpers.C 
   ''') +
-  moc_files + 
+  moc_files + moced_files + 
   ['ui/' + x for x in ui_files]
 )
 
index bc5bba1fd90fa652524911a03f48cc04b871e3ad..f1828fa345c5afa259fbdc55f3fd08cb46c62291 100644 (file)
@@ -30,10 +30,7 @@ tex2lyx_env.fileCopy('lyxtextclass.C', '#$BUILDDIR/lyxtextclass.C')
   
 tex2lyx = tex2lyx_env.Program(
   target = 'tex2lyx',
-  LIBS = [
-    'supports', 
-    'z',
-  ] + env['BOOST_LIBRARIES'],
+  LIBS = ['supports'] + env['BOOST_LIBRARIES'] + env['SYSTEM_LIBS'],
   source = Split('''
     FloatList.C 
     Floating.C