From: Bo Peng Date: Tue, 9 May 2006 13:01:45 +0000 (+0000) Subject: Make scons work on mingw/windows, from Bo Peng (ben.bob@gmail.com) X-Git-Tag: 1.6.10~13246 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=97e53edb811195cba9c765512699019950990bd4;p=lyx.git Make scons work on mingw/windows, from Bo Peng (ben.bob@gmail.com) * 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 --- diff --git a/SConstruct b/SConstruct index debe41c47c..69936445c3 100644 --- a/SConstruct +++ b/SConstruct @@ -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 # diff --git a/config/qt4.py b/config/qt4.py index 593b018386..8b3bc7f23b 100644 --- a/config/qt4.py +++ b/config/qt4.py @@ -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 : diff --git a/src/SConscript b/src/SConscript index 88fa708dd7..1b5a48f91e 100644 --- a/src/SConscript +++ b/src/SConscript @@ -166,9 +166,9 @@ lyx = env.Program( env['frontend'], 'controllers', 'graphics', - 'supports', - 'z' ] + + 'supports'] + env['EXTRA_LIBS'] + + env['SYSTEM_LIBS'] + env['BOOST_LIBRARIES'] ) diff --git a/src/frontends/qt3/SConscript b/src/frontends/qt3/SConscript index 1c96687bf2..a5f4d4a8c9 100644 --- a/src/frontends/qt3/SConscript +++ b/src/frontends/qt3/SConscript @@ -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] ) diff --git a/src/tex2lyx/SConscript b/src/tex2lyx/SConscript index bc5bba1fd9..f1828fa345 100644 --- a/src/tex2lyx/SConscript +++ b/src/tex2lyx/SConscript @@ -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