Boost logo

Boost-Build :

From: Stefan Knorr (stefan.knorr_at_[hidden])
Date: 2007-08-30 16:57:15


Hi all,

I'm using boost-build now for a couple of years for compiling a rather
complex project with several executables, static-libs and DLL's/.so
M10 was very reliable to me, but as M11 is now out for more than a year,
I wanted to switch to the current version.
But I run into a problem with the generators, which up to now I couldn't
solve:

I added a custom handler for my own file-extension, which basically
calls an python script which generates from this file a c-file and on
windows a rc-file.
I get the following error-message:

----
Error: ambiguity found when searching for best transformation
Trying to produce type 'OBJ' from:
  -  { lttosal.ver.VER }
Generators that succeeded:
  -  rc.compile.resource
  -  gcc.compile.c
First generator produced:
  -  { rc%rc.compile.resource-lttosal_res.o.OBJ { 
version-handler%version-handler.version-lttosal.rc.RC { lttosal.ver.VER 
} } }
Second generator produced:
  -  { gcc%gcc.compile..c-lttosal_version.o.OBJ { 
version-handler%version-handler.version-lttosal_version.c.C { 
lttosal.ver.VER } } }
----
as I understands, it complains about creating at the end 2 object files.
I took a look at the bison.jam and midl.jam, which generates also 
several files from one input file, but I couldn't figure out, what is 
going wrong.
The version-handler, I use:
---
#
# this file needs to be imported into
# the project-root.jam file to be effective
#
import os ;
import type ;
# so that bjam will recognize files
# with the VER extension
type.register VER : ver ;
# this creates a generator "version"
# it will generate a c-file from a version file
import generators ;
if [ os.name ] = NT
{
     generators.register-standard version-handler.version : VER : 
C(%_version) RC ;
}
else
{
     generators.register-standard version-handler.version : VER : 
C(%_version) ;
}
# this rule means it will always be compiled
rule version ( target * : sources * : properties * )
{
    ALWAYS $(target) ;
}
# here is the action the generator will take
# $(>) input  file
# $(<) output file
actions version
{
    python version-handler.py $(>) $(<)
}
---
Can somebody please help me with it?
Best regards,
Stefan

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