|
Boost-Build : |
From: Juergen Hunold (hunold_at_[hidden])
Date: 2005-11-10 14:54:56
Hi !
I sent a similar message to the new list "boost-build_at_[hidden]"
last sunday, but got no feedback. So I'm sending this to
"jamboost_at_[hidden]", too.
I've been playing around with the upcoming Qt-4.1 and got V2 to compile
it. Please find the necessary patch to qt4.jam and types/qt.jam
attached. It does the following:
- add a new pseudo-target "moccable-inc" for "moc and include" header
files.
- rename "moc.cpp"-rule to "moc.inc" because it is now used to handle
both .cpp and .h files for "moc and include"
- fixes a really bad typo (defines added with -I$(DEFINES).
Please find my set of Jamfiles for compiling Qt4.1 attached too.
These still require a full configure; make cycle because of:
- QTDIR/include/global/qconfig.h (generated by configure)
- I still don't build the tools (moc, rcc, uic, qt3to4 etc)
I'll take a look at the Quickbook toolset in order to find out how to
"auto-build" the tools in the next weeks.
Caveats:
- Works and tested on Linux (Debian Unstable) with gcc-4.0.2 and "full"
Qt-configuration including MySQ and especially Freetype2. That means
I'm not sure how to implement the numerous configuration checks of
"configure".
- QtSvg is only compiling because I added a "moccable-cpp" on
qsvgrenderer.cpp in order to add the necessary include paths to the
generated files to INCLUDES. There must some way to add the path to
moc_qsvgrenderer.cpp to INCLUDES, but I'm lost at virtual-targets.jam
- The "[cast _ mocable-h : some_source ]" is not working when put into
the sources of a testsuite, see examples/qtestlib/tutorial1, 2 and 3 for
examples. The good news is that the new
QTestlib seems to be working with to current V2 Test framework in
principle ;-). This is important because KDE4 will use QTestlib a
lot ;-)
- The Jamroot contain commented out "build-project src" and
"build-project examples" lines. Enabling this lines leads to strange
"circular dependencies" warnings due to usage-requierements of the libs.
Example:
- QtGui requires QtCore which is build by build-project src/corelib;
- Qt3Support requires QtGui, QtNetwork, QtSql and QtXml which are built
by similar rules.
- So you can only build from "QTDIR/examples" or "QTDIR/src".
If anything else is unclear, feel free to ask me.
But be aware: This is a test !
So, and now for questions this experiments has raised:
1. How to detect 3rdparty libraries ?
Qt relies on *lots* of libraries. In order to get it compiles, you have
to detect (on Linux)
- X11 with half a dozen extensions (XRender, XRandr, ...)
- OpenGL
- FreeType
2. How to choose which library to use ?
Qt ship its own versions of
- zlib
- bzlib
- freetype
- png
-sqlite
in order to use them if they are not available on the system.
How to I implement the "configure" - switches in bjam.
3. How to select how to build which selection ?
Qt enables you to build several extensions as "plugins" (default) or as
"builtins" or disable them.
The most prominent are of course databases plugins.
I've done some experimening with mysql an sqlite (see Jamroot) but I
don't like the exploding numbers of build-variant (directories) when
you change some extension to "builtin".
I hope I can spent some time on this next weekend and wait for comments.
I've added some simple testcases which hopefully show some strange
behaviour:
The files generated [ cast _ moccable-* : ] are build into the _current_
build directory. I think this means they are not completely "inside"
the target in which they are declared.
Yours,
Jürgen
-- * Dipl.-Math. Jürgen Hunold ! Institut für Verkehrswesen, Eisenbahnbau * voice: ++49 511 762-2529 ! und -betrieb, Universität Hannover * fax : ++49 511 762-3001 ! Appelstrasse 9a, D-30167 Hannover * hunold_at_[hidden] ! www.ive.uni-hannover.de --Boundary-00=_RW6cDxj6OktxR9V Content-Type: application/x-tbz; name="qtjam.tar.bz2" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="qtjam.tar.bz2" [Attachment content not displayed.] --Boundary-00=_RW6cDxj6OktxR9V Content-Type: text/x-diff; charset="utf-8"; name="qt4.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="qt4.diff" cvs diff: Diffing tools/build/v2/tools Index: tools/build/v2/tools/qt4.jam =================================================================== RCS file: /cvsroot/boost/boost/tools/build/v2/tools/qt4.jam,v retrieving revision 1.7 diff -u -r1.7 qt4.jam --- tools/build/v2/tools/qt4.jam 19 Sep 2005 07:48:36 -0000 1.7 +++ tools/build/v2/tools/qt4.jam 10 Nov 2005 19:41:21 -0000 @@ -1,3 +1,4 @@ + # Copyright 2002 Vladimir Prus # Copyright 2005 Alo Sarv # Distributed under the Boost Software License, Version 1.0. (See @@ -86,7 +87,10 @@ # The OBJ result type is a fake here too. generators.register [ new moc-h-generator - qt.moc.cpp : MOCCABLE_CPP : OBJ ] ; + qt4.moc.inc : MOCCABLE_CPP : OBJ ] ; + + generators.register [ new moc-inc-generator + qt4.moc.inc : MOCCABLE_H : OBJ ] ; # Generates .cpp file from qrc file generators.register-standard qt4.rcc : QRC : CPP(qrc_%) ; @@ -233,7 +237,7 @@ name = [ $(sources[0]).name ] ; name = $(name:B) ; - local a = [ new action $(sources[1]) : qt4.moc.cpp : + local a = [ new action $(sources[1]) : qt4.moc.inc : $(property-set) ] ; local target = [ @@ -248,9 +252,39 @@ return [ virtual-target.register $(target) ] ; } - } + } } +class moc-inc-generator : generator +{ + rule __init__ ( * : * ) + { + generator.__init__ $(1) : $(2) : $(3) : $(4) : $(5) : $(6) : $(7) : $(8) : $(9) ; + } + rule run ( project name ? : property-set : sources * ) + { + if ! $(sources[2]) && [ $(sources[1]).type ] = MOCCABLE_H + { + name = [ $(sources[0]).name ] ; + name = $(name:B) ; + + local a = [ new action $(sources[1]) : qt4.moc.inc : + $(property-set) ] ; + + local target = [ + new file-target moc_$(name) : CPP : $(project) : $(a) ] ; + + # Since this generator will return H target, the linking generator + # won't use it at all, and won't set any dependency on it. + # However, we need to target to be seen by bjam, so that dependency + # from sources to this generated header is detected -- if jam does + # not know about this target, it won't do anything. + DEPENDS all : [ $(target).actualize ] ; + + return [ virtual-target.register $(target) ] ; + } + } +} # Query the installation directory # This is needed in at least two scenarios @@ -269,17 +303,16 @@ # Qt4-moc has its c++-parser, so pass INCLUDES and DEFINES. actions moc { - $(.prefix)/bin/moc -I$(INCLUDES) -I$(DEFINES) -f $(>) -o $(<) + $(.prefix)/bin/moc -I$(INCLUDES) -D$(DEFINES) -f $(>) -o $(<) } -# When moccing .cpp files, we don't need -f, otherwise generated +# When moccing files for include only, we don't need -f, otherwise generated # code will include .cpp and we'll get duplicated symbols. -actions moc.cpp +actions moc.inc { - $(.prefix)/bin/moc -I$(INCLUDES) -I$(DEFINES) $(>) -o $(<) + $(.prefix)/bin/moc -I$(INCLUDES) -D$(DEFINES) $(>) -o $(<) } - # Generates source files from resource files actions rcc { cvs diff: Diffing tools/build/v2/tools/types Index: tools/build/v2/tools/types/qt.jam =================================================================== RCS file: /cvsroot/boost/boost/tools/build/v2/tools/types/qt.jam,v retrieving revision 1.2 diff -u -r1.2 qt.jam --- tools/build/v2/tools/types/qt.jam 14 Sep 2005 06:26:45 -0000 1.2 +++ tools/build/v2/tools/types/qt.jam 10 Nov 2005 19:41:21 -0000 @@ -5,5 +5,6 @@ type UI : ui ; type QRC : qrc ; type MOCCABLE_CPP ; +type MOCCABLE_H ; # Result of running moc. type MOC : moc : H ; --Boundary-00=_RW6cDxj6OktxR9V Content-Type: application/x-tbz; name="qt4.tar.bz2" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="qt4.tar.bz2" [Attachment content not displayed.] --Boundary-00=_RW6cDxj6OktxR9V--
Boost-Build list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk