Boost logo

Boost-Build :

Subject: [Boost-build] Problem with notfile target
From: Ian Emmons (iemmons_at_[hidden])
Date: 2008-11-28 22:59:47

I am new to bjam, and I'm sure that the problem I'm having is a simple
thing, but I can't figure out what I'm doing wrong. I'm using bjam
3.1.16 (the pre-built binary) on MacOS 10.5.5.

I am trying to build a C++ library that uses JNI to communicate with a
Java program. This means that before I build the C++ code I must
first build some Java code and then run the javah tool to generate
some C header files that are included by my C++ code. I have
implemented an ant build script to do the javac and javah steps, and I
want to call that from my jam file. Here is my jam file:

import notfile ;

project /KB/KbCore ;

lib Parliament
        : [ glob *.cpp : Utf8StaticInitGen.cpp ]
        : <include>.
        : # default build
        : <include>. ;

notfile JniHeaders : @BuildJniHeaders ;
actions BuildJniHeaders
        ant jniHeaders

If I comment out the source dependency of the library target on the
JniHeaders target, then this works perfectly, except that the two
targets run in the wrong order. But with the source dependency as
above, I get the following error:

/Users/iemmons/bin/boost-build/build/generators.jam:951: in ensure-
type from module generators
error: target { Jamfile</Users/iemmons/dev/KB/Parliament/KbCore>
JniHeaders. } has no type
/Users/iemmons/bin/boost-build/build/generators.jam:1166: in
generators.construct from module generators
/Users/iemmons/bin/boost-build/build/targets.jam:1408: in construct
from module object(typed-target)@54
/Users/iemmons/bin/boost-build/build/targets.jam:1252: in object(typed-
target)@54.generate from module object(typed-target)@54
/Users/iemmons/bin/boost-build/build/targets.jam:765: in generate-
really from module object(main-target)@61
/Users/iemmons/bin/boost-build/build/targets.jam:738: in object(main-
target)@61.generate from module object(main-target)@61
/Users/iemmons/bin/boost-build/build/targets.jam:255: in
object(project-target)@50.generate from module object(project-target)@50
/Users/iemmons/bin/boost-build/build-system.jam:414: in load from
module build-system
/Users/iemmons/bin/boost-build/kernel/modules.jam:261: in import from
module modules
/Users/iemmons/bin/boost-build/kernel/bootstrap.jam:132: in boost-
build from module
/Users/iemmons/bin/boost-build/boost-build.jam:1: in module scope from

This is puzzling to me, because it seems that the definition of
JniHeaders as a "notfile" target should tell boost build that
JniHeaders has no type. Any ideas about what I'm doing wrong?



Boost-Build list run by bdawes at, david.abrahams at, gregod at, cpdaniel at, john at