[M3devel] HEADS UP: cm3.cfg locations, was: Re: problems with cm3.cfg and MxConfig

Dragiša Durić dragisha at m3w.org
Mon Aug 3 22:10:02 CEST 2009


One day when we start thinking about configurations other than
"developing, debugging or trying out new versions of the compiler" we
will be ready for people other than m3devel readership.

On Mon, 2009-08-03 at 20:59 +0200, Darko Volaric wrote:
> Putting it in /etc would mean that having different active versions of  
> compiler would e a pain, which is useful when developing, debugging or  
> trying out new versions of the compiler and when compilers are not  
> self hosted, which will be the case for ARM_DARWIN.
> 
> What's the benefit of having it /etc other than being "standard"?
> 
> 
> On 03/08/2009, at 5:25 PM, Olaf Wagner wrote:
> 
> > Quoting Tony Hosking <hosking at cs.purdue.edu>:
> >
> >> I don't think we did agree that config files reside other than in the
> >> cm3 hierarchy.
> >
> > I may have been too quick to extend the search path some weeks ago.
> > I'm really undecided myself. I guess the score currently is
> > +2 for cm3/ +1 /etc :-)
> >
> > But we should perhaps really come to an agreement that is acceptable
> > for all here.
> >
> > Olaf
> >
> >> On 3 Aug 2009, at 06:30, Olaf Wagner wrote:
> >>
> >>> It was a specific request from the people building platform specific
> >>> installation packages that config files reside and are found in the
> >>> `usual' locations on their system and not somewhere beneath cm3.
> >>>
> >>> Place don't change that unless there is no objection from anyone
> >>> on m3devel.
> >>>
> >>> Olaf
> >>>
> >>> Quoting Jay K <jay.krell at cornell.edu>:
> >>>
> >>>> Sorry about #1 Randy, my mistake.
> >>>>
> >>>>
> >>>> Sitting in the bin directory...seems a little wierd, eh?
> >>>> What source are you going to build sitting there?
> >>>> I guess um some custom quake code??
> >>>> Good enough if empty is instead just "."?
> >>>>
> >>>> This falls out of the fact that cm3 actually probes all over  
> >>>> the    place for the cm3.cfg file and the first place it looks in  
> >>>> is the    current directory.
> >>>>
> >>>>
> >>>> Another good option I think would be just to remove that probe.
> >>>> It looks in way too many places.
> >>>>
> >>>>
> >>>> Here is the current code. I think it is gross.
> >>>> Too much probing make things quite ambiguous.
> >>>>
> >>>>
> >>>> PROCEDURE FindConfig () =
> >>>> (* LL = mu *)
> >>>> VAR txt: TEXT;
> >>>> BEGIN
> >>>>  IF (found) THEN RETURN END;
> >>>>
> >>>>  (* try the current directory *)
> >>>>  IF TryConfig (Filename) THEN RETURN END;
> >>>>
> >>>>  (* try the immediate source directory *)
> >>>>  IF TryConfig ("src", Filename) THEN RETURN END;
> >>>>
> >>>>  (* try the sibling source directory *)
> >>>>  IF TryConfig ("..", "src", Filename) THEN RETURN END;
> >>>>
> >>>>  (* try the M3CONFIG environment variable *)
> >>>>  txt := QMachine.GetEnv (NIL, "M3CONFIG");
> >>>>  IF (txt # NIL) THEN
> >>>>    IF TryConfig (txt) THEN RETURN END;
> >>>>    IF TryConfig (txt, Filename) THEN RETURN END;
> >>>>  END;
> >>>>
> >>>>  (* try the directory containing the current executable *)
> >>>>  txt := Pathname.Prefix (Params.Get (0));
> >>>>
> >>>>  IF Text.Length (txt)> 0 THEN
> >>>>    IF TryConfig (txt, Filename) THEN RETURN END;
> >>>>  END;
> >>>>
> >>>>  (* try the directories named by the PATH environment variable. *)
> >>>>  txt := Env.Get ("PATH");
> >>>>  FindConfigInPath (txt);
> >>>>
> >>>>  IF found THEN RETURN END;
> >>>>
> >>>>  (* try the etc directories *)
> >>>>  IF TryConfig("/usr/local/cm3/etc", Filename) THEN RETURN END;
> >>>>  IF TryConfig("/usr/cm3/etc", Filename) THEN RETURN END;
> >>>>  IF TryConfig("/cm3/etc", Filename) THEN RETURN END;
> >>>>  IF TryConfig("/usr/contrib/etc", Filename) THEN RETURN END;
> >>>>  IF TryConfig("/usr/local/etc", Filename) THEN RETURN END;
> >>>>  IF TryConfig("/usr/etc", Filename) THEN RETURN END;
> >>>>  IF TryConfig("/opt/etc", Filename) THEN RETURN END;
> >>>>  IF TryConfig("/sw/etc", Filename) THEN RETURN END;
> >>>>  IF TryConfig("/etc", Filename) THEN RETURN END;
> >>>>
> >>>>  (* oh well, make sure we don't try this silly exercise again... *)
> >>>>  config := NIL;
> >>>>  found := TRUE;
> >>>> END FindConfig;
> >>>>
> >>>>
> >>>> I propose..roughly roughly, we make it like this instead:
> >>>>
> >>>>
> >>>> PROCEDURE FindConfig () =
> >>>> (* LL = mu *)
> >>>> VAR txt: TEXT;
> >>>> BEGIN
> >>>>  IF (found) THEN RETURN END;
> >>>>
> >>>>  (* try the M3CONFIG environment variable *)
> >>>>  txt := QMachine.GetEnv (NIL, "M3CONFIG");
> >>>>  IF (txt # NIL) THEN
> >>>>    IF TryConfig (txt) THEN RETURN END;
> >>>>    IF TryConfig (txt, Filename) THEN RETURN END;
> >>>>  END;
> >>>>
> >>>>  (* try the directory containing the current executable *)
> >>>>  txt := Pathname.Prefix (Params.Get (0));
> >>>>  IF Text.Length (txt)> 0 THEN
> >>>>    IF TryConfig (txt, Filename) THEN RETURN END;
> >>>>  END;
> >>>>
> >>>>  (* oh well, make sure we don't try this silly exercise again... *)
> >>>>  config := NIL;
> >>>>  found := TRUE;
> >>>> END FindConfig;
> >>>>
> >>>>
> >>>> or, if people really like it looking all over the place, fixing    
> >>>> the  case of it being in the current working directory is  
> >>>> probably   like  this:
> >>>>
> >>>>
> >>>>  (* try the current directory *)
> >>>> <    IF TryConfig (Filename) THEN RETURN END;
> >>>>> IF TryConfig (".", Filename) THEN RETURN END;
> >>>>
> >>>>
> >>>> - Jay
> >>>>
> >>>>
> >>>>
> >>>> ----------------------------------------
> >>>>> From: jay.krell at cornell.edu
> >>>>> To: rcoleburn at scires.com
> >>>>> Date: Sun, 2 Aug 2009 23:42:17 -0700
> >>>>> CC: m3devel at elegosoft.com
> >>>>> Subject: Re: [M3devel] problems with cm3.cfg and MxConfig
> >>>>>
> >>>>> Host, hm, I think probably my mistake. It is defined by cm3 but  
> >>>>> not
> >>>>> all m3quake users. Path() should be the directory containing  
> >>>>> the  file
> >>>>> with the call.
> >>>>>
> >>>>> - Jay (phone)
> >>>>>
> >>>>> On Aug 2, 2009, at 9:52 PM, "Randy Coleburn"
> >>>>> wrote:
> >>>>>
> >>>>>> I have been working on the problem of cm3ide not getting the
> >>>>>> BUILD_DIR from cm3.cfg. I've run across some perplexing test   
> >>>>>> results.
> >>>>>>
> >>>>>> MxConfig.Get("BUILD_DIR") is returning NIL on Windows XP & Vista.
> >>>>>> I've tracked it down a bit further. There seem to be two issues
> >>>>>> that must be fixed to solve this problem:
> >>>>>>
> >>>>>> 1. HOST does not seem to be defined. In particular my "C:\cm3\bin
> >>>>>> \cm3.cfg" file appears as follows (this is the file Jay   
> >>>>>> recommended):
> >>>>>> INSTALL_ROOT = path() & "/.."
> >>>>>> include (path() & "/config/" & HOST)
> >>>>>>
> >>>>>> Is HOST a variable? Or, was I supposed to replace it by "NT386"?
> >>>>>> If the latter, my bad on this one--I took Jay's message  
> >>>>>> literally.
> >>>>>>
> >>>>>> 2. path() does not appear to always yield the path to the bin
> >>>>>> folder. In particular, it seems to work fine unless you invoke  
> >>>>>> the
> >>>>>> program when the current directory is actually set to the bin
> >>>>>> folder, in which case path() seems to return the empty string.
> >>>>>>
> >>>>>> So, if Í%=C:\, and I run cm3ide, path() returns "C:\cm3\bin"  
> >>>>>> as  it s
> >>>>>> hould.
> >>>>>> But, if Í%=C:\cm3\bin, and I run cm3ide, path() returns "".
> >>>>>>
> >>>>>> So in the latter case, the include statement winds up trying  
> >>>>>> to  pull
> >>>>>> a file from the wrong place, e.g. "/config/NT386" rather than "C:
> >>>>>> \cm3\bin/config/NT386"
> >>>>>>
> >>>>>> Regards,
> >>>>>> Randy Coleburn
> >>>
> >>>
> >>>
> >>> -- 
> >>> 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
> >>>
> >
> >
> >
> > -- 
> > 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
> >
> 
-- 
Dragiša Durić <dragisha at m3w.org>




More information about the M3devel mailing list