Boost logo

Boost-Build :

From: Markus Schöpflin (markus.schoepflin_at_[hidden])
Date: 2006-03-07 04:55:16


The following is an extension from the v2 libraries example to demonstrate
the problem. I extended the example to include one more source file
(bar1.cpp) to the bar lib.

tools/build/v2/example/libraries/util/foo> bjam -d+2 --v2
hp_cxx-71_006_tru64 link=static
hp_cxx.compile.c++
../../util/foo/bin/hp_cxx-71_006_tru64/debug/link-static/bar.o

     cxx -x cxx -c -std strict_ansi -nopure_cname -noimplicit_include
-timplicit_local -ptr
"../../util/foo/bin/hp_cxx-71_006_tru64/debug/link-static/cxx_repository"
-D__CNAME_OVERLOADS -model ansi -g3 -gall -O0 -inline none -msg_display_tag
-version V7.1-006 -ieee -msg_disable badppdirkey,nostdlonglong -o
"../../util/foo/bin/hp_cxx-71_006_tru64/debug/link-static/bar.o"
"../../util/foo/bar.cpp"

hp_cxx.compile.c++
../../util/foo/bin/hp_cxx-71_006_tru64/debug/link-static/bar1.o

     cxx -x cxx -c -std strict_ansi -nopure_cname -noimplicit_include
-timplicit_local -ptr
"../../util/foo/bin/hp_cxx-71_006_tru64/debug/link-static/cxx_repository"
-D__CNAME_OVERLOADS -model ansi -g3 -gall -O0 -inline none -msg_display_tag
-version V7.1-006 -ieee -msg_disable badppdirkey,nostdlonglong -o
"../../util/foo/bin/hp_cxx-71_006_tru64/debug/link-static/bar1.o"
"../../util/foo/bar1.cpp"

hp_cxx.archive
../../util/foo/bin/hp_cxx-71_006_tru64/debug/link-static/libbar.a

   rm -f "../../util/foo/bin/hp_cxx-71_006_tru64/debug/link-static/libbar.a"
   ar rc ../../util/foo/bin/hp_cxx-71_006_tru64/debug/link-static/libbar.a
../../util/foo/bin/hp_cxx-71_006_tru64/debug/link-static/bar.o
../../util/foo/bin/hp_cxx-71_006_tru64/debug/link-static/bar1.o

This works as expected. Now I change bar1.cpp and rebuild:

tools/build/v2/example/libraries/util/foo> touch bar1.cpp
tools/build/v2/example/libraries/util/foo> bjam -d+2 --v2
hp_cxx-71_006_tru64 link=static
hp_cxx.compile.c++
../../util/foo/bin/hp_cxx-71_006_tru64/debug/link-static/bar1.o

     cxx -x cxx -c -std strict_ansi -nopure_cname -noimplicit_include
-timplicit_local -ptr
"../../util/foo/bin/hp_cxx-71_006_tru64/debug/link-static/cxx_repository"
-D__CNAME_OVERLOADS -model ansi -g3 -gall -O0 -inline none -msg_display_tag
-version V7.1-006 -ieee -msg_disable badppdirkey,nostdlonglong -o
"../../util/foo/bin/hp_cxx-71_006_tru64/debug/link-static/bar1.o"
"../../util/foo/bar1.cpp"

hp_cxx.archive
../../util/foo/bin/hp_cxx-71_006_tru64/debug/link-static/libbar.a

   rm -f "../../util/foo/bin/hp_cxx-71_006_tru64/debug/link-static/libbar.a"
   ar rc ../../util/foo/bin/hp_cxx-71_006_tru64/debug/link-static/libbar.a
../../util/foo/bin/hp_cxx-71_006_tru64/debug/link-static/bar1.o

Now libbar.a only contains bar1.o and not bar.o. So why is the static
library deleted before it is created? It works for dynamic libraries, BTW.

Markus


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