[M3devel] how to find cm3.cfg
Olaf Wagner
wagner at elegosoft.com
Mon Aug 31 09:15:49 CEST 2009
Some quick comments:
o It is rather late in the release to change the interfaces, i.e.
introduce new command line options like -config or -target.
-config is currently the same as -version, so this is incompatible.
I'd rather leave changes like this for the trunk.
The release branch is _not_ for development.
o I do not remember that an agreement was reached concerning the
config search discussion. There were some contradictory mails on
the matter as far as I remember, but no conclusion, so I didn't
change anything again. As long as we haven't really resolved this,
we are likely to change again and again.
o I'm not against simplifying the initial search in the cm3 executable,
but if we agree that customizations for system-specific layouts should
be done in the quake code, this should be documented and even
prepared in the provided config files.
o If anything is changed again, at least not for RC3. The correct way
would be to test such changes on the trunk and then merge them for
a later RC4. Let's do it this way.
It is almost impossible to get the system stable enough
for a multi-platform package build. IIRC, we've been trying for more
than two weeks now to build RC3.
Olaf
Quoting Jay K <jay.krell at cornell.edu>:
> how to find cm3.cfg
>
> I propose, in this order:
>
> - -config or --config switch (actually any number of dashes)
>
> - $M3_CONFIG environment variable (however it is already spelled)
>
> This is a preferably path to a specific file, not some
> directory to further probe.
>
> I'll have to check the current implementation though. It might be
>
> a directory containing cm3.cfg as well. Whatever it currently
> does is how it should likely stay.
>
> - cm3.cfg next to executable, be it cm3.exe, cm3ide.exe, etc.
>
> - possibly one other choice, if none of the above exist, and
> executable is not cm3/cm3.exe,
>
> then search $PATH for cm3/cm3.exe and use cm3.cfg next to it
>
> This includes NOT looking in:
>
> - /etc
>
> - current directory
>
> - $PATH in general
>
> One problem is, you can't really directly/easily even find the
> current executable in Posix.
>
> I'll do more research on this.
>
> It is easy in Win32 and I assume Mac.
>
> Otherwise will probably fall back to:
>
> I believe everyone's best effort here is looking at argv[0] and if
> that isn't a full or
>
> current working directory relative path, search $PATH.
>
> Any other search should be layerable upon this.
>
> That is, cm3.cfg can include(/etc/cm3.cfg) or such.
>
> One thing not accounted for here is a --target command line option.
>
> Given the current layout and code, that doesn't work out well.
>
> Specifically, using config/target wouldn't set INSTALL_ROOT correctly.
>
> --target could set $TARGET and cm3.cfg could include config/target if
>
> target is already set.
>
> Or cm3 could set INSTALL_ROOT itself.
>
> We could look for next-to-executable/target.cfg.
>
> I think I'll punt on all this for now -- any accomodation of
> --target on command line.
>
> I think this change should probably go in this release, given that
> there was another change
>
> already that this undoes and given th bug I found regarding running
> by relative path (granted,
>
> I should debug that before replacing the code).
>
> Or, I guess, at the very least, remove the new probes and fix the
> bug I found.
>
> I guess.
--
Olaf Wagner -- elego Software Solutions GmbH
Gustav-Meyer-Allee 25 / Gebäude 12, 13355 Berlin, Germany
phone: +49 30 23 45 86 96 mobile: +49 177 2345 869 fax: +49 30 23 45 86 95
http://www.elegosoft.com | Geschäftsführer: Olaf Wagner | Sitz: Berlin
Handelregister: Amtsgericht Charlottenburg HRB 77719 | USt-IdNr: DE163214194
More information about the M3devel
mailing list