You are going to be pleased Bo, this is my first patch for Scons and I haven't even read Python tutorial ;-)
Yeah. You see, anyone can read/write in python..
It turned out I don't have to implement the mingw option because mingw gcc already knows about where its includes and libs lye. In fact, I just have to:
For qt4, Uic needs to be applied explicitly like: resources = [qtenv.Uic4('ui/' + x) for x in ui_files] And then, moc will happen automatically. I do have to patch qt4.py to process .C/.c files.
scons qt_dir=d:/program/Qt/4.1 And everything is compiled correctly.
Good.
Can I commit Bo?
Let me see.
SVN log. * Get rid of Qt3Support linking
This library is not needed any more?
* revert to -lz instead -lzlib1 (I think Enrico was right about libraries ordering and -lz at the end of linking command works fine under mingw).
I guess you are right. So you will use the zlib.z with mingw, not the official zlib1.dll, right?
* remove win32 target from gcc/g++ replacement hack for cygwin
I know it looks ugly there, but I prefer to use it to avoid potential problems. After all, we are all using gcc. BTW, scons claims that it can generate VC++ project files automatically so we may have to handle vc compiler later.
Index: SConstruct =================================================================== --- SConstruct (revision 13823) +++ SConstruct (working copy) @@ -12,7 +12,7 @@ # This is a scons based building system for lyx, you can use it as follows: # (after of course installation of scons from www.scons.org) # 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']: +if platform_name in ['cygwin']: env['CC'] = 'g++' env['LINK'] = 'g++'
OK. If you can confirm qt3 also work.
- for lib in ['QtCore', 'QtGui', 'Qt3Support']: + for lib in ['QtCore', 'QtGui']:
Fine.
@@ -734,9 +734,9 @@ # local qt4 toolset from # http://www.iua.upf.es/~dgarcia/Codders/sconstools.html if platform_name == "win32": - env['QT_LIB'] = ['QtCore4', 'QtGui4', 'Qt3Support4'] + env['QT_LIB'] = ['QtCore4', 'QtGui4'] else: - env['QT_LIB'] = ['QtCore', 'QtGui', 'Qt3Support'] + env['QT_LIB'] = ['QtCore', 'QtGui'] env['EXTRA_LIBS'] += [x for x in env['QT_LIB']]
fine.
if platform_name == 'win32': - env['SYSTEM_LIBS'] = ['shlwapi', 'zlib1'] + env['SYSTEM_LIBS'] = ['shlwapi', 'z'] elif platform_name == 'cygwin': env['SYSTEM_LIBS'] = ['shlwapi', 'z'] else:
Then, you can write: if platform_name in ['win32', 'cygwin']: env['SYSTEM_LIBS'] = ['shlwapi', 'z'] Bo