<html>
<head>
<style>
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Verdana
}
</style>
</head>
<body class='hmmessage'>
how to find cm3.cfg<BR>
 <BR>
 <BR>
I propose, in this order:<BR>
  -  -config or --config switch (actually any number of dashes) <BR>
  - $M3_CONFIG environment variable (however it is already spelled) <BR>
     This is a preferably path to a specific file, not some directory to further probe. <BR>
     I'll have to check the current implementation though. It might be <BR>
     a directory containing cm3.cfg as well. Whatever it currently does is how it should likely stay. <BR>
  - cm3.cfg next to executable, be it cm3.exe, cm3ide.exe, etc. <BR>
  - possibly one other choice, if none of the above exist, and executable is not cm3/cm3.exe, <BR>
   then search $PATH for cm3/cm3.exe and use cm3.cfg next to it <BR>
 <BR>
This includes NOT looking in:<BR>
  - /etc <BR>
  - current directory <BR>
  - $PATH in general <BR>
 <BR>
 <BR>
One problem is, you can't really directly/easily even find the current executable in Posix.<BR>
I'll do more research on this.<BR>
It is easy in Win32 and I assume Mac.<BR>
Otherwise will probably fall back to:<BR>
 <BR>
 <BR>
I believe everyone's best effort here is looking at argv[0] and if that isn't a full or<BR>
current working directory relative path, search $PATH.<BR>
 <BR>
 <BR>
Any other search should be layerable upon this.<BR>
That is, cm3.cfg can include(/etc/cm3.cfg) or such.<BR>
 <BR>
 <BR>
One thing not accounted for here is a --target command line option.<BR>
Given the current layout and code, that doesn't work out well.<BR>
Specifically, using config/target wouldn't set INSTALL_ROOT correctly.<BR>
--target could set $TARGET and cm3.cfg could include config/target if<BR>
target is already set.<BR>
Or cm3 could set INSTALL_ROOT itself.<BR>
 <BR>
 <BR>
We could look for next-to-executable/target.cfg.<BR>
 <BR>
 <BR>
I think I'll punt on all this for now -- any accomodation of --target on command line.<BR>
 <BR>
 <BR>
I think this change should probably go in this release, given that there was another change<BR>
already that this undoes and given th bug I found regarding running by relative path (granted,<BR>
I should debug that before replacing the code).<BR>
 <BR>
Or, I guess, at the very least, remove the new probes and fix the bug I found.<BR>
I guess.<BR>
 <BR>
 - Jay<BR></body>
</html>