From: David Abrahams (dave_at_[hidden])
Date: 2003-01-28 16:41:59
[John, please read to the bottom; ./configure issues arise]
Florian Stöhr <florian.stoehr_at_[hidden]> writes:
> I wrote a tutorial on compiling boost under NetBSD.
> This describes various "dirty" patches to gcc-tools.jam.
> Could someone please have a look at this and tell me what can be
> done in a "cleaner" way ... or can someone edit the gcc-tools.jam
> for upcoming releases to support NetBSD by default?
> Thank you
Sorry it's taken so long. Things have been piling up...
> This document descripes the installation of boost-1.29 under
> NetBSD-i386 1.6 (should work in a similar way for other ports).
> Note that this refers to NON-STLPORT with GCC 2.95.3, which comes by
> default with NetBSD 1.6!
> If you want to build the THREADS library, you need to enable
> threading support for NetBSD.
> Get the GNU PTHREADS package (pth-1.4.1nb2.tgz for NetBSD 1.6) and
> install it.
> This will install several files under /usr/pkg/include and /usr/pkg/lib.
Are these standard NetBSD installation locations for many "system"
libraries such as pthreads?
> Now edit /etc/profile (e.g.) and add the include/lib paths:
> # Add these lines (bash only)
> CPPFLAGS=-I/usr/pkg/include; export CPPFLAGS
> LDFLAGS=-L/usr/pkg/lib; export LDFLAGS
> CLOSE THE TERMINAL and log in again (to reread the /etc/profile).
> This will enable the configure script of boost to find your pthread files.
> Now get the boost-1.29.0.tar.gz from www.boost.org und unpack it, e.g.
> root_at_flo [/usr] # tar -xvzf /home/flo/downloads/boost-1.29.0.tar.gz
> I will refer to (boost) as the root directory of boost, e.g. /usr/boost_1_29_0.
> First of all, you need the build the make-replacement "bjam" of boost. Note that
> this is NOT the traditional bjam! It's in the tools/build/jam_src directory. Invoke
> make on it.
> root_at_flo [/usr/boost_1_29_0/tools/build/jam_src] # make
With the current CVS that will be:
could you check that it works?
> The bjam executable now resides in ./bin.netbsdx86. If you don't
> have traditional bjam installed on your system
What is "traditional bjam"?
> (hope so!), just copy the bjam into a directory in the path
> root_at_flo [/usr/boost_1_29_0/tools/build/jam_src/bin.netbsdx86] # cp bjam /usr/bin
> Now BEFORE you try to build boost, you have to edit the jamfile
> (boost)/tools/build/gcc-tools.jam due to a bug in the gcc (?) that
> comes with NetBSD 1.6
> Open the file and replace every occurrence of
That's already done in the current Boost CVS.
> Now replace every occurence of
We can fix that; please do the following and post the output:
prompt$ bjam -f-
ECHO $(JAMUNAME) ;
> Unfortunately, this is not yet enough, since the build process itself doesn't seem to
> use the CPPFLAGS and LDFLAGS environment variables.
As well it should not.
> So search for "actions gcc-Cc-action" in the file. Insert "-I/usr/pkg/include" and
> "-L/usr/pkg/lib" into the gcc-call, perhaps just before the "-I$(SPACE)".
> Then do the same once again for the "actions gcc-C++-action" block, insert our
> dirs before the '-I"$(HDRS)"'.
I think we can make the appropriate adjustments here as well, though
it will be ugly :(.
> Before making boost, be sure to invoke the configure script.
> root_at_flo [/usr/boost_1_29_0/libs/config] # ./configure
Hmm, I have my doubts. Boost comes nicely preconfigured for
gcc-2.95.3. Does this really change very much?
> Now open the file USER.HPP and add the line
> #define BOOST_HAS_THREADS
Threads are probably not detected by the configure script because
pthreads get installed in a nonstandard place. John, can you help to
> Your final step will now be to copy this file USER.HPP from libs config dir
> to the boost config dir:
> root_at_flo [/usr/boost_1_29_0/libs/config] # cp user.hpp ../../boost/config
> Then, you can change to the boost root directory and simple invoke make with the
> root_at_flo [/usr/boost_1_29_0] # bjam "-sTOOLS=gcc"
> Enjoy boost!
-- David Abrahams dave_at_[hidden] * http://www.boost-consulting.com Boost support, enhancements, training, and commercial distribution
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