Greets,
I think the best way to communicate a string representing compiler
flags is to have the native build script write a file and have the
charmonize app read it. Right now usage for charmonize looks like this:
./charmonize --outpath=OUTPATH [--cc=COMPILER]
An input file is more extensible, though:
./charmonize INFILE
I'm thinking something XML-ish for the input format. This isn't part
of the Charmonizer library, it's specific to our build scripts, and
only people who write bindings are going to have to deal with it.
<charm_compiler>gcc</charm_compiler>
<charm_ccflags>-g -pipe -fno-common -DPERL_DARWIN -no-cpp-
precomp -fno-strict-aliasing -I/usr/local/include</charm_ccflags>
<charm_outpath>lucyconf.h</charm_outpath>
That's cake to parse from C and human-readable. Prepending 'charm_'
to each tag name makes the delimiters robust.
Will there ever be a situation where we'd need to make the compiler
flags anything other than a fixed string? There might be for other
potential uses of Charmonizer down the road, but for Lucy, I think
the fixed string suffices.
Each of these vars would be a char* in Charmonizer/Core, with a
public setter in Charmonizer/Main:
/* this is in charmonize.c */
compiler = extract_delimited(infile_contents, "charm_compiler");
chaz_Main_set_compiler(compiler);
Marvin Humphrey
Rectangular Research
http://www.rectangular.com/