Boost logo

Boost-Build :

From: Alex Besogonov (cyberax_at_[hidden])
Date: 2006-03-11 17:48:29


Good <time-of-day>!

Despite all Reece Dunn's hard work with PCH support there are still some
problems:
1. No PCH for GCC (and unofficial patch for gcc.jam v1.57 doesn't apply
cleanly any more). We need at least some 'dummy' PCH support (something
like in rc.jam for FreeBSD/Linux).

2. Properties are not propagated from PCH files, so workarounds have to
be used. For example:
===============
# Coverage report tool
import pch ;
import cast ;
import verbatim ;

path-constant TEMPLATE_DIR : ./templates ;

project report-tool
        : requirements
                <include>. <include>$(LIB-TOP)/boost
        ;

alias boost-libs-used
        :
                /boost/serialization//boost_serialization
# Static linkage to work around GCC bug.
/boost/program_options//boost_program_options/<link>static
                /boost/filesystem//boost_filesystem
                /boost/regex//boost_regex
        ;

# HTML templates
lib html-templates : [ GLOB $(TEMPLATE_DIR) : *.verbatim ] : <link>static ;

# PCH file
pch precompiled : [ cast _ pcheader : coverage-prec.hpp ]
                coverage-prec.cpp
        :
                <define>BOOST_ALL_NO_LIB=1
                <define>BOOST_FILESYSTEM_DYN_LINK=1
                <define>BOOST_SERIALIZATION_DYN_LINK=1
        ;

#Coverage library
lib coverage-lib
        :
                precompiled
                coverage_repo.cpp
                file_name_resolver.cpp
        :
                <link>static
        ;

# Main application executable
exe scanner-tool
        :
                precompiled
                file-scanner.cpp
                gcov-processor.cpp
                coverage-lib
                boost-libs-used
        ;

===============
Without <define>s in precompiled header options autolink will kick and
cause all sorts of problems. If I include 'boost-libs-used' target in
'precompiled' then Boost libraries are not found during 'scanner-tool'
linkage.

PS: here are some small patches to verbatim.jam and inline-file.py
The patch to inline-file.py fixes superfluous '\n' at the end of
'verbatimized' file and the patch to verbatim.jam adds support for
additional lookup of 'inline-file.py' script.

-- 
With respect,
             Alex Besogonov (cyberax_at_[hidden])

Index: inline_file.py
===================================================================
RCS file: /cvsroot/boost/boost/tools/build/v2/example/customization/inline_file.py,v
retrieving revision 1.1
diff -r1.1 inline_file.py
23c23
< return '\"' + result + '\\n\"'

---
>     return result
26a27
>     last = ''
29c30,34
<         result = result + quote_line(i) + "\n"
---
>         if (last != '' ):
>             result = result + '\"' + last + '\\n\"'+ "\n"
>         last = quote_line(i)
> 
>     result = result + '\"' + last + '\"' + "\n"	

Index: verbatim.jam
===================================================================
RCS file: /cvsroot/boost/boost/tools/build/v2/example/customization/verbatim.jam,v
retrieving revision 1.3
diff -r1.3 verbatim.jam
46a47,51
> # Find inline script.
> local path-to-files = [ modules.peek : BOOST_BUILD_PATH ] ;
> path-to-files ?= . ;
> inline-script = [ GLOB $(path-to-files) : inline_file.py ] ;
>
50c55
< actions inline-file

---
> actions inline-file bind inline-script
52c57
<     "./inline_file.py" $(<) $(>)
---
>     $(inline-script) $(<) $(>)

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