Boost logo

Boost-Build :

From: zouguangxian (zouguangxian_at_[hidden])
Date: 2005-09-29 11:19:17


hi all:
.dog is the suffix i defined . there is a tool used to convert
shared_lib to .dog. so i write a generator to let bjam can recognize
it .
here is the sample code of my project . the dog rule was defined
in dog.jam.

------dog.jam------

import type ;
type.register DOG : dog : main ;

import generators ;
generators.register-standard dog.dog : SHARED_LIB : DOG ;

rule dog ( target : sources * : properties * )
{
echo "default-build" $(default-build) ;
}

actions dog
{
echo "source" $(>) "dest" $(<)
copy $(>) $(<) ;
}
------end------

in Jamfile.v2, there are several code lines:

dog abc : hello.cpp utils.cpp ;

when i invoke bjam , it works, and generate a abc.dog in target dir .

BUT, THE ABD.DLL IS LINKED WITHOUT /DLL.

so i checked why , finnaly ,i found /DLL is setted just when "<main-
target-type>LIB/<link>shared" is defined. and <main-target-type>LIB
is added in bulitin.lib-generator.run.

here is the output generated by "bjam --debug-generators" :
*** construct DOG
from { hello.cpp.CPP }
from { utils.cpp.CPP }
properties: <asynch-exceptions>off <debug-store>object
<debug-symbols>on <exception-handling>on <extern-c-nothrow>off
<hardcode-dll-paths>true <inlining>off <install-dependencies>off
<link>shared <main-target-type>DOG <optimization>off <os>NT
<profiling>off <rtti>on <runtime-debugging>on <runtime-link>shared
<stdlib>native <symlink-location>project-relative <threading>single
<toolset-msvc:version>7.1 <toolset>msvc <user-interface>console
<variant>debug <warnings-as-errors>off <warnings>all
find-viable-generators target-type= DOG property-set= msvc-
7.1/debug
trying type DOG
there are generators for this type
trying generator dog.dog ( SHARED_LIB -> DOG )
is viable
*** 1 viable generators
generator dog.dog
multiple:
composing:
*** construct SHARED_LIB
from { hello.cpp.CPP }
from { utils.cpp.CPP }
properties: <asynch-exceptions>off <debug-store>object
<debug-symbols>on <exception-handling>on <extern-c-nothrow>off
<hardcode-dll-paths>true <inlining>off <install-dependencies>off
<link>shared <main-target-type>DOG <optimization>off <os>NT
<profiling>off <rtti>on <runtime-debugging>on <runtime-link>shared
<stdlib>native <symlink-location>project-relative <threading>single
<toolset-msvc:version>7.1 <toolset>msvc <user-interface>console
<variant>debug <warnings-as-errors>off <warnings>all
find-viable-generators target-type= SHARED_LIB property-
set= msvc-7.1/debug
trying type SHARED_LIB

here are the output generated when i apply rule "lib abc : hello.cpp
utils.cpp ;"
*** construct LIB
from { hello.cpp.CPP }
from { utils.cpp.CPP }
properties: <asynch-exceptions>off <debug-store>object
<debug-symbols>on <exception-handling>on <extern-c-nothrow>off
<hardcode-dll-paths>true <inlining>off <install-dependencies>off
<link>shared <main-target-type>LIB <optimization>off <os>NT
<profiling>off <rtti>on <runtime-debugging>on <runtime-link>shared
<stdlib>native <symlink-location>project-relative <threading>single
<toolset-msvc:version>7.1 <toolset>msvc <user-interface>console
<variant>debug <warnings-as-errors>off <warnings>all
find-viable-generators target-type= LIB property-set= msvc-
7.1/debug
trying type LIB
there are generators for this type
trying generator builtin.lib-generator ( -> LIB )
is viable
trying generator builtin.prebuilt ( -> LIB )
trying generator dog.dog ( -> LIB )
is viable
*** 2 viable generators
lib-generator run
lib-generator object(property-set)@4
*** construct SHARED_LIB
from { hello.cpp.CPP }
from { utils.cpp.CPP }
properties: <asynch-exceptions>off <debug-store>object
<debug-symbols>on <exception-handling>on <extern-c-nothrow>off
<hardcode-dll-paths>true <inlining>off <install-dependencies>off
<link>shared <main-target-type>LIB <optimization>off <os>NT
<profiling>off <rtti>on <runtime-debugging>on <runtime-link>shared
<stdlib>native <symlink-location>project-relative <threading>single
<toolset-msvc:version>7.1 <toolset>msvc <user-interface>console
<variant>debug <warnings-as-errors>off <warnings>all
find-viable-generators target-type= SHARED_LIB property-
set= msvc-7.1/debug
trying type SHARED_LIB

compare these information , we can say that
==> lib-generator was not invoked
==> <main-target-type>LIB not setted
==> /DLL not added to linkflgas
==> the abc.dll generated is not a normal dll.

so my question is : how to resolve this problem ? can you give me
some advice ?

thanks

regars
-weck

 


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