[haiku-development] Re: RFC Patch to add Command built-in to our Jam Ingo?

  • From: "Ingo Weinhold" <ingo_weinhold@xxxxxx>
  • To: haiku-development@xxxxxxxxxxxxx
  • Date: Sat, 22 Sep 2012 20:01:42 +0200

kallisti5 wrote:
> This mostly comes out of personal interests... but may make a few of 
> your lives easier.
> 
> ATM there is no easy way to grab the output of a command in Jam. A 
> good use case for
> this is grabbing the pkg-config output for build flags.
> 
> I ran across some code on the jam ML circa 2007...
> http://osdir.com/ml/tools.jam/2007-03/msg00012.html
> 
> This adds a "Command" built-in which enables you to run a system 
> command and:
>  Catch stdout to a variable
>  Display and stderr out to the screen
> 
> Usage is as follows:
>  QT_CFLAGS = [ Command "pkg-config QtGui --libs" ] ;
> 
> See? Infinitely useful :)
> 
> Anyone have any reservations on me including this in our Jam?

I believe as is the patch would violate Jam's license (the "modifications are 
clearly marked" part).

That aside, back in 2002 (or 2003), when Jam was still actively maintained, a 
similar patch I proposed was rejected. The reason given was that the build 
process should not depend on the execution result of external programs, but 
only on the state of the file system. While I wouldn't say I that fully agree 
with this view, I nevertheless think there is a point to it. From my experience 
almost all command executions -- the one in your example included -- can be 
moved to a configure stage. For bigger build systems (like Haiku's) this also 
has a positive impact on the build stage's warm-up time.

That being said, if you think you really need the feature, feel free to add it.

CU, Ingo

Other related posts: