|
Boost-Build : |
From: Puverle, Tomas (IT) (Tomas.Puverle_at_[hidden])
Date: 2004-09-21 08:00:54
Vladimir,
> > > Hi Puverle,
> >
> > It's Tom :)
>
> I'm sorry!
Don't worry about that! ;)
> I don't insist, it's just better to know all the use cases we
> have to support.
Say we have library A that links with a library B.
Then I use functionality from libB in my application, so I add it to the
link line, too.
Everything is fine.
Then at some later time I decide that I wish to debug the application
and also need libB debug. Such a lib would be called libB-g. So I
rebuild the app in debug mode and then relink it, pulling in libA,
libB-g, and I think you can now see that this will cause problems.
The way we avoid these problems is by keeping the dependency tree only 1
level deep, i.e. only the executable has library dependencies.
> > > What are "additional libraries"?
The support libs are:
RW STL V6.0
libsupc++.a
Now I know what you are going to say - you will say that libsupc++.a is
an archive, so hence my problems, but the linker errors were for our STL
symbols, hence my (wrong) conclusion.
> I'm afraid the documentation is not correct ;-) Here's a part
> of email exchange with a binutils maintainer:
Thanks - that was news to me. I guess I just read it in the man page a
long time ago and just never questioned it.
Anyway, instead of trying to explain all of my mistakes, maybe you could
help me to get boost building the way we need in our environment?
Please see the Makefile below with my comments:
-----------------------------------------------
## -*- mode: makefile -*- ##
BOOST_LOC = #some location where the source is located
BOOST_BUILD_PATH_SUFFIX = #the build path under BOOST_LOC
STL_INCLUDE = #location to our RW STL HEADERS
SYS_INCLUDE = #full path to /include/c++/3.2.3/i686-redhat-linux
BOOST_MAJOR=1
BOOST_MINOR=31
BOOST_PATCH=0
BOOST_VERSION=$(BOOST_MAJOR)_$(BOOST_MINOR)_$(BOOST_PATCH)
BOOST_DIR_NAME=boost_$(BOOST_VERSION)
JAM_DIR=tools/build/jam_src
BJAM_BUILD_COMMAND=build.sh gcc
WITHOUT_LIBS = --without-python
BJAM_TOOLSET=gcc
BJAM_SUFFIX=linuxx86
TOOLSET_OPT=-sGXX="gcc"
BOOST_BUILD_OPT=release debug <threading>multi
BOOST_BUILD_OPT +=<cxxflags>-nostdinc++ <cxxflags>-fPIC
BOOST_BUILD_OPT +=<define>RW_MULTI_THREAD <define>RWSTD_MULTI_THREAD
<define>_REENTRANT
BOOST_BUILD_OPT +=<define>_GNU_SOURCE <define>_TRACE_
BOOST_BUILD_OPT +=<linkflags>--enable-new-dtags
BOOST_BUILD_OPT +=<include>$(STL_INCLUDE)
BOOST_BUILD_OPT +=<sysinclude>$(SYS_INCLUDE)
#Note that I (or my coleague, I can't remember) inquired about this on
boost-users before
#The question was "How can I build boost without building the '.a's?"
#Any ideas? I never got a satisfactory answer, but the below seems to
work
BOOST_BUILD_OPT +=<target-type>DLL
EXEC_SUFFIX = exec
COMMON_SUFFIX = common
TEST_SUFFIX = tests
BUILD_DIR_PATH=$(BOOST_LOC)/$(BOOST_BUILD_PATH_SUFFIX)
INSTALL_EXEC_DIR_PATH=$(BUILD_DIR_PATH)/$(EXEC_SUFFIX)
INSTALL_COMMON_DIR_PATH=$(BUILD_DIR_PATH)/$(COMMON_SUFFIX)
TEST_DIR_PATH=$(BUILD_DIR_PATH)/$(TEST_SUFFIX)
#We have 3 separate areas - src, build and install
#However, when building Jam it tries to write to the src area, so
#copy the source and build it in the build area instead
#I can't find any flags that would let me do this otherwise
configure:
mkdir -p $(BUILD_DIR_PATH)/$(BOOST_DIR_NAME)/$(JAM_DIR)
rsync -r $(BOOST_DIR_NAME)/$(JAM_DIR)/*
$(BUILD_DIR_PATH)/$(BOOST_DIR_NAME)/$(JAM_DIR)
build:
$(BUILD_DIR_PATH)/$(BOOST_DIR_NAME)/$(JAM_DIR)/bin.$(BJAM_SUFFIX)/bjam
cd $(BOOST_DIR_NAME) && \
$(BUILD_DIR_PATH)/$(BOOST_DIR_NAME)/$(JAM_DIR)/bin.$(BJAM_SUFFIX)/bjam \
$(WITHOUT_LIBS) -sTOOLS="$(BJAM_TOOLSET)" $(TOOLSET_OPT)
-sBUILD="$(BOOST_BUILD_OPT)" \
--builddir=$(BUILD_DIR_PATH) --prefix=$(INSTALL_COMMON_DIR_PATH)
--exec-prefix=$(INSTALL_EXEC_DIR_PATH)
install:
cd $(BOOST_DIR_NAME) && \
$(BUILD_DIR_PATH)/$(BOOST_DIR_NAME)/$(JAM_DIR)/bin.$(BJAM_SUFFIX)/bjam \
$(WITHOUT_LIBS) -sTOOLS="$(BJAM_TOOLSET)" $(TOOLSET_OPT)
-sBUILD="$(BOOST_BUILD_OPT)" \
--builddir=$(BUILD_DIR_PATH) --prefix=$(INSTALL_COMMON_DIR_PATH)
--exec-prefix=$(INSTALL_EXEC_DIR_PATH) install
$(BUILD_DIR_PATH)/$(BOOST_DIR_NAME)/$(JAM_DIR)/bin.$(BJAM_SUFFIX)/bjam:
cd $(BUILD_DIR_PATH)/$(BOOST_DIR_NAME)/$(JAM_DIR) &&
./$(BJAM_BUILD_COMMAND)
#Now this is the tough one
#Build (and run) regression tests in the build area against the freshly
build '.so's
#from the install area, just to check everything has been built
correctly
#Note that you must:
#1) use "gcc" and not "g++" as the compiler (long story)
#2) add libstd.so
#3) add libsupc++.a as the last thing on the link line.
run_tests:
?
-----------------------------------------------
Your help in resolving this would be greatly appreciated.
Thanks,
Tom
--------------------------------------------------------
NOTICE: If received in error, please destroy and notify sender. Sender does not waive confidentiality or privilege, and use is prohibited.
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