Boost logo

Boost-Build :

Subject: [Boost-build] Difficulty with pre-built lib declaration
From: Ian Emmons (iemmons_at_[hidden])
Date: 2008-12-19 15:00:02


I have created a jam file to build a shared library, and this jam file
works very nicely on my Macintosh. Now I'm trying to get it to work
on a Windows machine with Visual Studio 2005 (msvc-8.0), and I'm
running into a few problems. In order to keep the communications
simple, I will describe one problem in this post and the others in
separate missives.

I have a lib target that lists a pre-built library as a dependency:

lib Parliament
    : [ glob *.cpp : Utf8StaticInitGen.cpp ]
       /site-config//BerkeleyDB
       /site-config//JavaJNI
    : <include>.
       <define>BUILDING_KBCORE
       <define>PARLIAMENT_RSRC_AS_UTF16
       <define>_REENTRANT
       <threading>multi
       <implicit-dependency>parliament/generated/
com_bbn_parliament_jni_Config.h
       <implicit-dependency>parliament/generated/
com_bbn_parliament_jni_HiResTimer.h
       <implicit-dependency>parliament/generated/
com_bbn_parliament_jni_KbInstance.h
       <implicit-dependency>parliament/generated/
com_bbn_parliament_jni_StmtIterator.h
    : # default build
    : <include>.
       <define>PARLIAMENT_RSRC_AS_UTF16
       <define>_REENTRANT
       <threading>multi
    ;

Mostly this works, but the dependency on "/site-config//BerkeleyDB" is
causing problems. If I define that target (in site-config.jam) like
this:

path-constant BdbDir : D:/dev/KB/lib/bdb ;
constant BdbVersion : 47 ;
lib BerkeleyDB
    : # no sources
    : <name>libdb$(BdbVersion)d
       <search>"$(BdbDir)/lib/x64-vs2005"
    : # no default build
    : <include>"$(BdbDir)/include"
    ;

then everything works fine. The problem is that I have several builds
of this pre-built library (variations on different versions of MSVC,
debug versus release, and 32- versus 64-bit) and so I would like to
define the library target this way:

path-constant BdbDir : D:/dev/KB/lib/bdb ;
constant BdbVersion : 47 ;
lib BerkeleyDB
    : # no sources
    : <variant>debug:<name>libdb$(BdbVersion)d
       <variant>release:<name>libdb$(BdbVersion)
       <toolset>msvc-9.0,<address-model>64:<search>"$(BdbDir)/lib/x64-
vs2008"
       <toolset>msvc-8.0,<address-model>64:<search>"$(BdbDir)/lib/x64-
vs2005"
       <toolset>msvc-9.0,<address-model>32:<search>"$(BdbDir)/lib/
Win32-vs2008"
       <toolset>msvc-8.0,<address-model>32:<search>"$(BdbDir)/lib/
Win32-vs2005"
       <toolset>msvc-7.1,<address-model>32:<search>"$(BdbDir)/lib/
Win32-vs2003"
    : # no default build
    : <include>"$(BdbDir)/include"
    ;

However, this definition causes bjam to output the following error:

D:/bin/boost-build/kernel\class.jam:93: in new
*** argument error
* rule object(searched-lib-target)@196.__init__ ( name : project :
shared ? : search * : action )
* called with: ( BerkeleyDB libdb47d : object(project-target)@10 :
true : : object(null-action)@195 : : : : )
* extra argument libdb47d
D:/bin/boost-build/tools\builtin.jam:341:see definition of rule
'__init__' being called
D:/bin/boost-build/tools\builtin.jam:575: in object(searched-lib-
generator)@6.run
D:/bin/boost-build/build\generators.jam:840: in try-one-generator-really
D:/bin/boost-build/build\generators.jam:902: in try-one-generator
D:/bin/boost-build/build\generators.jam:1110: in construct-really
D:/bin/boost-build/build\generators.jam:1186: in generators.construct
D:/bin/boost-build/tools\builtin.jam:481: in object(lib-generator)@5.run
D:/bin/boost-build/build\generators.jam:840: in try-one-generator-really
D:/bin/boost-build/build\generators.jam:902: in try-one-generator
D:/bin/boost-build/build\generators.jam:1110: in construct-really
D:/bin/boost-build/build\generators.jam:1186: in generators.construct
D:/bin/boost-build/build\targets.jam:1408: in construct
D:/bin/boost-build/build\targets.jam:1252: in object(typed-
target)@17.generate
D:/bin/boost-build/build\targets.jam:765: in generate-really
D:/bin/boost-build/build\targets.jam:738: in object(main-
target)@187.generate
D:/bin/boost-build/build\targets.jam:895: in targets.generate-from-
reference
D:/bin/boost-build/build\targets.jam:1170: in generate-dependencies
D:/bin/boost-build/build\targets.jam:1224: in object(typed-
target)@48.generate
D:/bin/boost-build/build\targets.jam:765: in generate-really
D:/bin/boost-build/build\targets.jam:738: in object(main-
target)@61.generate
D:/bin/boost-build/build\targets.jam:255: in object(project-
target)@44.generate
D:/bin/boost-build\build-system.jam:414: in load
D:\bin\boost-build\kernel\modules.jam:261: in import
D:\bin\boost-build\kernel\bootstrap.jam:132: in boost-build
D:\bin\boost-build\boost-build.jam:1: in module scope

Does anybody have a idea what I'm doing wrong in my declaration of the
BerkeleyDB pre-built library target?

Thanks,

Ian


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