[Omake] autoconf-style configure-time options

Aleksey Nogin anogin at hrl.com
Fri Jun 1 09:12:26 PDT 2007


On 31.05.2007 20:16, Erick Tryzelaar wrote:

> But if I have an OMakeroot like this:
> 
> open Configure/Fam
> DefineCommandVars()
> ...
> 
> the Fam's static section will run before DefineCommandVars, right?

Right. If you do want the static section to see the variables, either 
make them environment variables instead of the command-line ones, or 
call DefineCommandVars() twice (I am not 100% certain, but I believe 
that you can do that as many times as you need). We normally call it 
after the "open" directives to allow users to override the default values.

>> Note that most of the tests in our configure files should be 
>> cross-compilation-friendly. As long as you only try to compile/link, 
>> but do not try to actually run, the tests should do the right thing 
>> w.r.t. figuring out the _target_ configuration (you may have to run 
>> with --configure every time you switch the target platform :-( ; this 
>> will go away in what's currently called the 0.9.8.x branch, but may 
>> end up getting renamed).
> 
> But we have to run some programs :( Among other things, we need to be 
> able to query C/C++ type size info, or have it manually specified.

Yes, figuring out type sizes is where I usually give up on "do not run 
target programs in order not to break cross-compilation" rule. I know 
that there are some tricks that people use to avoid this, such as compiling

typedef char arr[sizeof(int) == 4 ? 1 : -1];
int main () {
   arr a;
   return 0;
}

However I have no idea how portable this test is.

> Oh and one last thing. There isn't a way to add info to "omake --help" 
> is there? If we provide a bunch of configure-time options, it'd be nice 
> to be able to easily document what options are specified.

There is no way to change "omake --help" as the "--help" option would 
cause OMake not to look at any files at all. I would recommend placing 
all the options into a config file, similar to how we do it for 
self-builds (and we also do a similar thing in the MetaPRL project - see 
http://svn.metaprl.org/viewvc/*checkout*/mojave/metaprl/mk/make_config 
and http://svn.metaprl.org/viewvc/*checkout*/mojave/metaprl/mk/load_config )

Aleksey
-- 
Aleksey Nogin, Research Scientist
Advanced Technologies Department, Information & System Sciences Lab
HRL Laboratories, LLC, Malibu, CA


More information about the Omake mailing list