|
Boost-Build : |
From: David Abrahams (david.abrahams_at_[hidden])
Date: 2002-06-21 15:18:24
----- Original Message -----
From: "op_jared_oberhaus" <oberhaus_at_[hidden]>
To: <jamboost_at_[hidden]>
Sent: Friday, June 21, 2002 3:39 PM
Subject: [jamboost] Re: Boost.Build examples and getting started
> Thanks, this is super useful! I wasn't doing bjam, I was doing jam.
>
> So, now I have everything set up as such:
>
> - I put allyourbase.jam, boost-base.jam, etc. in my tools/build
> directory.
> - Set BOOST_BUILD_PATH to that directory
> - Set TOP to my top directory, so $TOP/tools/build is the same as
> $BOOST_BUILD_PATH
Unneccessary. Probably not a good idea to use the SubDir rule either. Using
boost as an example,
# top-level jamfile
#
project-root ;
# to auto-build subprojects from root
subinclude path/to/subproject1 ;
subinclude path/to/subproject2 ;
--- # in subproject jamfiles subproject path/from/project-root/directory ; ... --- All this is covered in the docs, I think. > - Downloaded jam.zip from sourceforge, renamed the jam.exe inside to > bjam.exe. They are the same, right? Yeah, but why? The bjam executable you want is listed at http://www.boost.org/tools/build/#Jam > - set TOOLS=msvc (I have Visual Studio .NET) > - set BUILD=debug > > Now I still can't do what I want to do, and here are my two jamfiles > to demonstrate the problem: > > -----$TOP/src/testlib1/Jamfile: > > SubDir TOP src testlib1 ; should be: suproject src/testlib1 ; > # Build testlib1 > > CPP_SOURCES = > Library1 > ; > > lib mytestlib1 > : $(CPP_SOURCES).cpp > : <include>$(TOP)$(SLASH)src > <threading>multi > : debug release <runtime-link>static/dynamic > ; > > -----$TOP/src/testlib2/Jamfile: > > SubDir TOP src testlib2 ; should be: suproject src/testlib2 ; > # Build testlib2 library > > dll mytestlib2 > : <lib>../testlib1/mytestlib1 > : <include>$(TOP)$(SLASH)src > <threading>multi > : debug release <runtime-link>static/dynamic > ; > > --------------- > > Now I cd into testlib1, "bjam", and it all works and makes a bunch > of stuff under directory "bin". > > The I cd into testlib2, "bjam", and here's what it gives me: > > C:\jared\jared-shared-laptop\tools\build\boost-base.jam:202: in Link- > DLL > *** argument error > * rule Link-action ( target implib ? : sources + : target-type ? ) > * called with: ( <src!testlib2\mytestlib2.dll\msvc\debug\runtime- > link-dynamic\threading-multi>mytestlib2.dll <src!testlib2 > \mytestlib2.dll\msvc\debug\runtime-link-dynamic\threading- > multi>mytestlib2.lib : : DLL ) > * missing argument sources Looks like a bug to me; we don't let you build a library that contains no sources of its own. Add a single source file and you should be dandy. > > So, trying to figure this out, I decide this isn't super important, > and I modify msvc-tools.jam:120, and change "sources +" to "sources > *", since that's what it is in other places anyways. This gets me a > little further... But now when I invoke bjam in my testlib2 > directory, I get this: > C:\jared\jared-shared-laptop\src\testlib2>bjam > don't know how to make <src!testlib1>Library1.cpp Because Library1.cpp isn't in src/testlib1? > ...skipped 6 targets... > ...updated 14 targets... > > > I determined that this is because it's not doing the relative path > thing correctly, ignoring my ../ and instead taking all this stuff > relative to the current directory. I don't see any "../"involved with finding Library1.cpp, do you? > So I modified > my "src/testlib2/Jamfile" to reference ../testlib1/Jamfile with an > absolute path: It's actually not an absolute path, just relative to $(TOP). > -----$TOP/src/testlib2/Jamfile: > > SubDir TOP src testlib2 ; > > # Build testlib2 library > > dll mytestlib2 > : <lib>$(TOP)/src/testlib1/mytestlib1 > : <include>$(TOP)$(SLASH)src > <threading>multi > : debug release <runtime-link>static/dynamic > ; > > --------------- > > Now doing this seems to get me a little farther, and it seems as if > its really attempting to figure out how to link the libraries > together. But this is the output I get: > As you can see, it's trying to figure out if the two libraries are > compatible to link together or something, I'm not sure. But instead > of figuring out how I couldv'e gotten into this state, I just > commented out the code that's doing the check, because it is just a > validation. So I commented out boost-base.jam:1416-1420. At this point you're just hacking up the system... go back, go back! Try using the system the way the docs prescribe; it does seem to work for other people. Good Luck, Dave
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