|
Boost-Build : |
From: Rene Rivera (grafik.list_at_[hidden])
Date: 2004-08-29 22:23:57
jfmeinel wrote:
> What I really want, and what I haven't been able to figure out, is how
> to use boost to recognize a dependency and be able to build something
> that is considered source somewhere else.
>
> Is this not possible under V1?
Yes... For example here's how I added my own "<package>" type targets:
> ## Support for installable packages.
> ##
> gTARGET_TYPE_ID(package) = PACK ;
> gGENERATOR_FUNCTION(PACK) = package-file ;
> RPMBUILD ?= [ GLOB $(PATH) : rpmbuild rpm ] ; RPMBUILD = $(RPMBUILD[1]) ;
> if $(RPMBUILD)
> {
> SUFPACK = .rpm ;
> }
> rule package ( target : sources + : requirements * : default-build * )
> {
> local .fake-target = [ get-values <target> : $(requirements) ] ;
> local .target ;
> if $(.fake-target)
> {
> requirements += <suppress>true ;
> }
> local gIS_DEPENDENCY(EXE) = TRUE ;
> .target = [ declare-local-target $(target) : $(sources) : $(requirements) : $(default-build) : PACK ] ;
> if $(.fake-target)
> {
> DEPENDS $(.fake-target[1]) : $(.target) ;
> }
> }
> rule package-file
> {
> MakeLocate $(<) : $(LOCATE_TARGET) ;
> type-DEPENDS package : $(<) ;
> DEPENDS $(<) : $(>) ;
> if $(RPMBUILD)
> {
> rpm-package-action $(<) : $(>[1]) ;
> }
> }
> actions rpm-package-action
> {
> set -e
> export old_pwd="$PWD"
> cd "$(>:D)"
> "$(RPMBUILD)" -bb "$(>:D=)" | tee "$old_pwd/$(<:D)/rpm.out"
> eval "`grep '^export TARGET_RPM' $old_pwd/$(<:D)/rpm.out`"
> cd "$old_pwd/$(<:D)"
> rm -rf "$(<:D=)"
> ln -s "$TARGET_RPM" "$(<:D=)"
> rm -f "$old_pwd/$(<:D)/rpm.out"
> }
The built in target types <dll>, <lib>, <exe>, <template>, etc. are
supported similarly. Just look for "gTARGET_TYPE_ID(_) = _ ;" in
boost-base.jam and other *.jam files.
I can explain the above code if that's needed, but it's fairly simple ;-)
HTH.
-- -- Grafik - Don't Assume Anything -- Redshift Software, Inc. - http://redshift-software.com -- rrivera/acm.org - grafik/redshift-software.com - 102708583/icq
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