weewonder / garglk

Automatically exported from code.google.com/p/garglk
Other
0 stars 0 forks source link

More command-line configurability for the build system #127

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
In the main Jamrules file there are couple of user-configurable variables, such 
as BUILD, USESDL, BUNDLEFONTS, CC, C++, OPTIM and LINKFLAGS. Unfortunately, all 
except BUILD are defined as  "X = y" instead of "X ?= y", which means they 
cannot be overridden on the command line with "jam -sX=z".

Of course, the file can still be edited, but it would be cleaner to compile by 
passing arguments to jam rather than editing files beforehand, especially when 
compiling automatically.

So my request is simple: could the variables mentioned above (and any others 
which can be meaningfully edited by users without breaking stuff) be declared 
in such a way that they can be overridden, similar to how BUILD can be 
overridden right now?

For OPTIM and LINKFLAGS, it might be useful to append CFLAGS and LDFLAGS from 
the environment (if jam supports this?) to whatever options are set depending 
on the current BUILD, so that e.g. custom optimization flags override the 
defaults.

Original issue reported on code.google.com by znxfire...@gmail.com on 6 Oct 2010 at 4:30

GoogleCodeExporter commented 8 years ago
I actually didn't know about the difference between = and ?=, and I am happy to 
make that change. Seems quite handy.

I'll look at the OPTIM and LINKFLAGS situation as well. 

Original comment by bcressey@gmail.com on 15 Nov 2010 at 6:09

GoogleCodeExporter commented 8 years ago
Fixed in r513. Can you test and let me know if this works the way you'd like?

Original comment by bcressey@gmail.com on 22 Feb 2011 at 8:56

GoogleCodeExporter commented 8 years ago
Seems to work great, especially together with some of the earlier changes made 
by Chris Spiegel; thanks!

One small issue remains: the LDFLAGS from the environment are added to 
LINKFLAGS, but not to SHRLINKFLAGS, which are used to link libgarglk.so (in 
fact, SHRLINKFLAGS is not initialized at all as far as I could tell).  Is there 
a reason for this, or was this an oversight?

Original comment by znxfire...@gmail.com on 23 Feb 2011 at 11:58

GoogleCodeExporter commented 8 years ago
On a related note, it's unfortunate that the C++ compiler is specified in a 
variable called "C++", which is not a valid shell identifier. I think CXX is a 
more common variable name for this purpose. Passing -sC++=$CXX to jam works 
around it, but it would be nice to be able to inherit the value from the 
environment, like CC does.

Original comment by znxfire...@gmail.com on 24 Feb 2011 at 12:42

GoogleCodeExporter commented 8 years ago
I will get both changes added.

Original comment by bcressey@gmail.com on 24 Feb 2011 at 3:09

GoogleCodeExporter commented 8 years ago
Changed C++ to CXX and initialized SHRLINKFLAGS in r536. Let me know if you'd 
like anything else.

Original comment by bcressey@gmail.com on 16 Mar 2011 at 6:29

GoogleCodeExporter commented 8 years ago

Original comment by bcressey@gmail.com on 18 Mar 2011 at 11:14