|
Boost-Build : |
From: muchacho_30 (aachkar_at_[hidden])
Date: 2004-10-09 12:36:01
Hi Vladimir,
What I meant by hard-coding the search path is that in my Jamfile I have:
icc12w -Lc:/icc/bin .......
instead of something like:
icc12w -L$(LINKPATH)
So, I was planning to copy all the libraries into that path, since the
limitation of this linker is that it only allows ONE path in the -L
option and only ONE -L option. You're right, it's a pretty limitted
linker, but hey, that's sometimes what you have to live with in the
embedded word ;)
After that, just like the following line works for pre-built libs:
lib os : : <name>os ;
I wanted to try something similar like:
lib crc : : <name>crc ;
but that didn't work since crc is a generated (not pre-built) library.
Anyway, I'll have to take some time to try your suggestion. Sounds
like a good suggestion that will allow me to learn about this amazing
object-oriented language that is built on top of Boost-Jam. I never
imagined that would be possible.
Thanks a lot for your response!
BTW, I think this tool is excellent!! It is the best one I've seen so
far. It is so versatile and that's why we're hoping to use it in our
business since we need to compile code for PIC controllers, HC12, and
QNX, and a lot of the code and libraries have to be shared among the
different target hardware platforms.
Are there any plans for a Quick-Start User's Guide, and/or a Reference
Guide (other than what's currently available online) ?
Alain
--- In jamboost_at_[hidden], Vladimir Prus <ghost_at_c...> wrote:
>
> Hi Alain,
>
> > Hi,
> >
> > Sorry for the long post, but I have to explain this in detail.
> >
> > I am trying to create a toolset called icc for the ImageCraft
> > compiler, so I am basing it on boost-build/tools/gcc.jam
> >
> > My biggest problem is the linker.
>
> .......
>
> > My compiler needs to see something like -los to find the library
> > libos.a in its search path (which is currently hard-coded as
> > c:\icc\lib). I am getting on the command line something like:
> >
> > icc12w -o {path}main.exe {path}file1.o file2.o ........ -los -lc12
c12p
> >
> > which is good, but still missing: -lbqueue -lcrc -lnvm
> >
> > The manual says we can use the <name> feature for pre-built libraries
> > (which is what I did for os, c12, c12p), however, the other libraries
> > (bqueue, crc, nvm) are being passed in the LIBRARIES variable as:
> >
> > ../../../generic/libs/crc/bin/icc/debug/link-static/libcrc.a
> > ../../../generic/libs/nvm/bin/icc/debug/link-static/libnvm.a
> > ../../../generic/libs/bqueue/bin/icc/debug/link-static/libbqueue.a
> >
> > so, I cannot use -l$(LIBRARIES) because the linker appends the prefix
> > 'lib' and the suffix '.a' to the above filenames.
>
> So your linker does not allow to specify input library names? That's
bad :-(
>
> I need to clarify one question. It seems the above libraries must be
pasded
> via the "-l" switch. But you say that the search path for that switch is
> hardcoded, so I don't understand how the linker will find a library
> in ../../../generic/libs/crc/bin/icc/debug/link-static
>
> Anyway, supposing you just want to strip ".a" and "lib" from targets. I
> think you'd need to customize the linking generator. To begin with:
>
> class icc-linking-generator : unix-linking-generator
> {
> rule generated-targets ( sources + : property-set : project name ? )
> {
> return [ unix-linking-generator.generated-targets
> $(sources) : $(property-set) : $(property-set) $(name) ] ;
> }
> }
>
> generators.register [ new icc-linking-generator icc.link : OBJ : EXE :
> <toolset>icc ] ;
>
> Now, you'd need to traverse elements of 'sources', and find all the
> libraries. For libraries, you'd need to add relevant
<find-static-library>
> property.
>
> local sources2 ;
> local properties ;
> for local s in $(sources)
> {
> if [ type.is-derived [ $(s).type ] LIB ]
> {
> local name = [ $(s).name ] ;
> # Process the 'name' as needed
> properties += <find-shared-library>$(name) ;
> }
> else
> {
> sources2 += $(s) ;
> }
> }
>
> Then, you remove libraries from sources and add needed properties.
>
> sources = $(sources2) ;
> property-set = [ $(property-set).add-raw $(properties) ] ;
>
> I haven't tested the above, but the basic approach should work. You
might
> need to add additional <search> properties too, but that depends on the
> answer to my question.
>
> HTH,
> Volodya
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