Boost logo

Boost-Build :

From: Roland Schwarz (roland.schwarz_at_[hidden])
Date: 2006-07-24 04:52:52


Vladimir Prus wrote:
> You might want to look at:
>
> http://boost.org/boost-build2/doc/html/bbv2/faq/s02.html
>
Thank you, I knew that.

> If explanations there makes no sense, please post the complete Jamfile.v2, as
> attachment, and I'll take a look.

Altough this explanation does make sense to me, I still do not know how
I should solve for it. I post you my Jamfile.v2.
I would be very glad if you could suggest, what I could do better...

project boost/thread
     : source-location ../src
     : default-build <threading>multi
     ;

lib boost_thread_pthread
        : ## sources ##
            pthread/thread.cpp
            pthread/mutex.cpp
            pthread/condition.cpp
            pthread/exceptions.cpp
            pthread/xtime.cpp
        : ## requirements ##
        ;

lib boost_thread
        : ## sources ##
            linux/thread.cpp
            linux/mutex.cpp
            linux/condition.cpp
            linux/exceptions.cpp
            linux/xtime.cpp
        : ## requirements ##
        ;
Obviously the build system treats pthread/thread.cpp and
linux/thread.cpp as beeing the same names, doesn't it?

This gives me the error:

warning: Python location is not configured
warning: the Boost.Python library won't be built
Building Boost.Regex with the optional Unicode/ICU support disabled.
Please refer to the Boost.Regex documentation for more information
(and if you don't know what ICU is then you probably don't need it).
/home/roland/Projects/boost/thread_rewrite/tools/build/v2/build/virtual-target.jam:976:
in virtual-target.register-actual-name from module virtual-target
error: Duplicate name of actual target:
<p../../../bin.v2/libs/thread/build/gcc/debug/threading-multi>thread.o
error: previous virtual target { gcc%gcc.compile.c++-thread.o.OBJ {
pthread/thread.cpp.CPP } }
error: created from ../../../libs/thread/build/boost_thread_pthread
error: another virtual target { gcc%gcc.compile.c++-thread.o.OBJ {
linux/thread.cpp.CPP } }
error: created from ../../../libs/thread/build/boost_thread
error: added properties: none
error: removed properties: none
/home/roland/Projects/boost/thread_rewrite/tools/build/v2/build/virtual-target.jam:450:
in actualize-no-scanner from module object(file-target)@249
/home/roland/Projects/boost/thread_rewrite/tools/build/v2/build/virtual-target.jam:110:
in object(file-target)@249.actualize from module object(file-target)@249
/home/roland/Projects/boost/thread_rewrite/tools/build/v2/build/virtual-target.jam:723:
in actualize-source-type from module object(action)@258
/home/roland/Projects/boost/thread_rewrite/tools/build/v2/build/virtual-target.jam:744:
in actualize-sources from module object(action)@258
/home/roland/Projects/boost/thread_rewrite/tools/build/v2/build/virtual-target.jam:689:
in object(action)@258.actualize from module object(action)@258
/home/roland/Projects/boost/thread_rewrite/tools/build/v2/build/virtual-target.jam:273:
in actualize-action from module object(file-target)@259
/home/roland/Projects/boost/thread_rewrite/tools/build/v2/build/virtual-target.jam:458:
in actualize-no-scanner from module object(file-target)@259
/home/roland/Projects/boost/thread_rewrite/tools/build/v2/build/virtual-target.jam:110:
in object(file-target)@259.actualize from module object(file-target)@259
/home/roland/Projects/boost/thread_rewrite/tools/build/v2/build-system.jam:372:
in load from module build-system
/home/roland/Projects/boost/thread_rewrite/tools/build/v2/kernel/modules.jam:261:
in import from module modules
/home/roland/Projects/boost/thread_rewrite/tools/build/v2/kernel/bootstrap.jam:132:
in boost-build from module
/home/roland/Projects/boost/thread_rewrite/boost-build.jam:12: in module
scope from module

Isn't it possible to have the names of the lib's causing the objects go
to a separate directory as bbv1 did?

I tried then to follow the suggestions of the posted link.
This indeed did work, but it causes my Jamfile look _very_ odd:

project boost/thread
     : source-location ../src
     : default-build <threading>multi
     ;

obj pthread_thread : pthread/thread.cpp ;
obj pthread_mutex : pthread/mutex.cpp ;
obj pthread_condition : pthread/condition.cpp ;
obj pthread_exceptions : pthread/exceptions.cpp ;
obj pthread_xtime : pthread/xtime.cpp ;

lib boost_thread_pthread
        : ## sources ##
            pthread_thread
            pthread_mutex
            pthread_condition
            pthread_exceptions
            pthread_xtime
        : ## requirements ##
        ;

obj linux_thread : linux/thread.cpp ;
obj linux_mutex : linux/mutex.cpp ;
obj linux_condition : linux/condition.cpp ;
obj linux_exceptions : linux/exceptions.cpp ;
obj linux_xtime : linux/xtime.cpp ;

lib boost_thread
        : ## sources ##
            linux_thread
            linux_mutex
            linux_condition
            linux_exceptions
            linux_xtime
        : ## requirements ##
        ;

Also this setup will make it harder to to specify common build
properties. I think I would need a template for the obj's wouldn't I?

It would be nice if I could put something like <build-dir>pthread or
<build-dir>linux into the requirements of the lib. Or can I simply
invent a variant, say <variant>linux and put this into the requirements?

Regards,
Roland


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