Boost logo

Boost-Build :

From: pal.tw (pal.tw_at_[hidden])
Date: 2003-07-17 10:59:50


English is not my mother language. Some words may be read
so ridiculously. But I hope most of you understand what I sad.:-)
Recently I tried Boost.Build V2 to build the "ImageMagick" project,
and found something strange. I don't know if they are reasonable,
or would be changed in the future. So I post it here, maybe someone
will discuss it.

1. The built-in rule "GLOB" has the prototype like
"rule GLOB ( directories + : patterns + : downcase-opt ? )",
but [BBv2] rule "path.glob" has "rule glob ( dir : patterns + )".
So I can't execute the following instructions successfully.
#---------------------------------------------------------------------
SOURCE_FILES = jp2 jpc base ;
SOURCE_FILES =
[ path.glob $(SOURCE_ROOT)/jp2/src/libjasper/$(SOURCE_FILES) : *.c ] ;
SOURCE_FILES = [ MATCH .*(jp2/src/libjasper/.*) : $(SOURCE_FILES) ] ;
#---------------------------------------------------------------------

So I modify the "path.jam" file as the following.
#---------------------------------------------------------------------
rule glob ( dir : patterns + )
{
return [ sequence.transform make : [ GLOB [ native $(dir) ] :
$(patterns) ] ] ;
}
#---------------------------------------------------------------------
to
#---------------------------------------------------------------------
rule glob ( dir + : patterns + )
{
local result ;
for local i in $(dir)
{
i = [ GLOB [ native $(i) ] : $(patterns) ] ;
result += [ sequence.transform make : $(i) ] ;
}
return $(result) ;
}
#---------------------------------------------------------------------
Is it more useful?
Could I suggest to change the prototype of "path.glob" rule?

2. I write some jamfiles, a snippet likes
#---------------------------------------------------------------------
lib Magick : magick/$(SOURCE_FILES) coders/$(SOURCE_CODERS)
magick/ImageMagick.rc libbz2 zlib libxml freetype liblcms
libjpeg libjasper libpng libtiff libwmf fpxlib
/System//advapi32 /System//user32 /System//gdi32
: <link>shared:<define>_MAGICKLIB_ <include>$(SOURCE_ROOT)
;
#---------------------------------------------------------------------
"libbz2", "zlib", "libxml" ... etc. are all the main-target
in this project, and "Magick" wants to link them.
When I made the "Magick" target, a terrible thing happened.
#---------------------------------------------------------------------
D:\Programming\build\ImageMagick>bjam Magick
...patience...
...found 1161 targets...
...updating 201 targets...
msvc.compile.c actions too long (max 2047):

call "c:\program files\microsoft visual studio\vc98
\bin\vcvars32.bat" > nul
;
cl /Zm800 -nologo -TC -DNDEBUG -DWINVER=0x0400 -D_MAGICKLIB_ -
D_VISUALC_ -D_WI
N32_DCOM -D_WINDOWS /Ogity /O2 /Gs /Ob2 /MD -DCRTAPI1=_cdecl -
DCRTAPI2=_cdecl -
DWIN32 -D_WIN32 -D_X86_=1 -W3 -I"D:\Programming\Source\ImageMagick-
5.5.7" -I"D
:\Programming\Source\ImageMagick-5.5.7\bzlib" -
I"D:\Programming\Source\ImageMagi
ck-5.5.7\fpx\fpx" -I"D:\Programming\Source\ImageMagick-5.5.7\jp2
\src\libjasper\i
nclude" -I"D:\Programming\Source\ImageMagick-5.5.7\jpeg" -
I"D:\Programming\Sourc
e\ImageMagick-5.5.7\lcms\include" -
I"D:\Programming\Source\ImageMagick-5.5.7\lib
xml\include" -I"D:\Programming\Source\ImageMagick-5.5.7\png" -
I"D:\Programming\S
ource\ImageMagick-5.5.7\tiff\libtiff" -
I"D:\Programming\Source\ImageMagick-5.5.7
\ttf\include" -I"D:\Programming\Source\ImageMagick-5.5.7
\wmf\include" -I"D:\Prog
ramming\Source\ImageMagick-5.5.7\zlib" -
I"..\out\ImageMagick\bin\msvc\release\ex
ception-handling-off\rtti-off\threading-multi" -
I"..\out\ImageMagick\bin\msvc\re
lease\exception-handling-off\rtti-off\threading-multi\main-target-
Magick" -I"..\
out\ImageMagick\bin\msvc\release\exception-handling-off\rtti-
off\threading-multi
\main-target-freetype" -
I"..\out\ImageMagick\bin\msvc\release\exception-handling
-off\rtti-off\threading-multi\main-target-libbz2" -
I"..\out\ImageMagick\bin\msvc
\release\exception-handling-off\rtti-off\threading-multi\main-target-
libjpeg" -I
"..\out\ImageMagick\bin\msvc\release\exception-handling-off\rtti-
off\threading-m
ulti\main-target-liblcms" -
I"..\out\ImageMagick\bin\msvc\release\exception-handl
ing-off\rtti-off\threading-multi\main-target-libpng" -
I"..\out\ImageMagick\bin\m
svc\release\exception-handling-off\rtti-off\threading-multi\main-
target-libtiff"
-I"..\out\ImageMagick\bin\msvc\release\exception-handling-off\rtti-
off\threadin
g-multi\main-target-libxml" -
I"..\out\ImageMagick\bin\msvc\release\rtti-off\thre
ading-multi\main-target-fpxlib" -
I"..\out\ImageMagick\bin\msvc\release\exception
-handling-off\link-static\rtti-off\threading-multi\main-target-
libjasper" -I"..\
out\ImageMagick\bin\msvc\release\exception-handling-off\link-
static\rtti-off\thr
eading-multi\main-target-libwmf" -c -
Fo"..\out\ImageMagick\bin\msvc\release\exc
eption-handling-off\rtti-off\threading-multi\main-target-
Magick\static.obj" "..
\..\Source\ImageMagick-5.5.7\magick\static.c"
#---------------------------------------------------------------------
It seems that it adds all the output paths of the main-targets
source to the include-paths. At the other hand, the "compile"
action doesn't use a command file since the actions would exceed
the limit of the command shell.

I tried to trace the [BBv2] code for a while, but I was lost
in these codes. They are too hard to understand without more
documents. ~_~
And I have no much time to find out what happened.

3. The "msvc" toolset always use the "vcvars32.bat" file to setup
the "msvc" environment variables, such as include-paths,
library-paths ..etc. But no way to setup the location of
the Platform SDK. This make me not to use the lastest system
service released from Microsoft.

Does anybody know the convenient way to setup the location
of Platform SDK? When using "msvc" toolset, let [BBv2] search
the location of the Platform SDK first, and then the compiler's
location. Of course, not to modify the "msvc.jam" or
"vcvars32.bat" files directly. ^_^

4. I saw someone suggested separating out common rules for OS.
Hmmm, what about common features of a platform?
A platform, I mean, includes OS and the computer architecture,
such as CPU type. For example, Microsoft Windows may run in
different computer system, such as "i386", "ALPHA", "IA64",
"ALPHA64". and there are a little different compiler and
linker options among them.

So does gcc, there are so many varints could run in so many
platform. Some features are particular in some platform,
and must be point out by defining some symbols or applying
some compiler options no matter what compiler we use.
And It may be also useful for cross-compilation.

 


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