[M3devel] M3Config contains paths to installation directory.

Jay K jay.krell at cornell.edu
Thu Jul 16 09:43:22 CEST 2009


I'm pretty confident we can fix this fairly soon.

Many M3Config users can/should be replaced with MxConfig.

MxConfig can be augmented with "static" things like OS_TYPE, PATH_SEP.

Capturing stuff like PKG_USE at compile time is quite bogus, except as part of some sort of "cm3 -v" like how gcc reports its configure command line. But that wouldn't be in a public interface.

 

Can anyone confirm the theory I just invented as to the history here?

 M3Config existed.

 M3Config was recognized as broken.

 MxConfig introduced as a replacement for M3Config.

 

This "AS" construct I see used rarely, makes me thing something a little unusual afoot here, and "getting something very wrong the first time" seems to be unusual in M3. :)

 

Doing the same grep that Olaf did...

 

C:\dev2\cm3.2\m3-libs\sgml\src\SGML.m3(177):    CopyTextArray(self.options.addSearchDir,M3Config.PKG_USE & 
 broken

 

C:\dev2\cm3.2\m3-libs\sgml\src\SGML.m3(178):        M3Config.PATH_SEP & "sgml" & M3Config.PATH_SEP & "src" &
C:\dev2\cm3.2\m3-libs\sgml\src\SGML.m3(179):        M3Config.PATH_SEP & "dtd");
 ok, augment MxConfig with this data

 

C:\dev2\cm3.2\m3-obliq\obliqrt\src\Obliq.m3(57):      env := NewEnv("target", NewText(M3Config.TARGET), env);
C:\dev2\cm3.2\m3-obliq\obliqrt\src\Obliq.m3(58):      env := NewEnv("osType", NewText(M3Config.OS_TYPE), env);
C:\dev2\cm3.2\m3-obliq\obliqrt\src\Obliq.m3(59):      env := NewEnv("pathSep", NewText(M3Config.PATH_SEP), env);
 ditto

 

C:\dev2\cm3.2\m3-sys\cm3\src\Main.m3(54):        Quake.Define(mach, "TARGET", M3Config.TARGET);
C:\dev2\cm3.2\m3-sys\cm3\src\Main.m3(55):        Quake.Define(mach, "OS_TYPE", M3Config.OS_TYPE);
C:\dev2\cm3.2\m3-sys\cm3\src\Main.m3(61):        Quake.Define(mach, "WORD_SIZE", M3Config.WORD_SIZE);
C:\dev2\cm3.2\m3-sys\cm3\src\Main.m3(66):        Quake.Define(mach, "HOST", M3Config.TARGET);
C:\dev2\cm3.2\m3-sys\cm3\src\Main.m3(67):        Quake.Define(mach, "HOST_OS_TYPE", M3Config.OS_TYPE);
 I put all these in and they are all ok, but also ditto. (The idea being we end up with only MxConfig and no M3Config.)

 

C:\dev2\cm3.2\m3-sys\cm3ide\src\misc\Default.m3(35):    build_dir       := M3Config.Get ("BUILD_DIR");
C:\dev2\cm3.2\m3-sys\cm3ide\src\misc\Default.m3(36):    system_root     := M3Config.Get ("PKG_USE"); (* note: system_root is the public package root *)
  These are all really MxConfig, everything in this file, ok.

 

 

C:\dev2\cm3.2\m3-tools\m3browser\src\Main.m3(22):  SLASH      = M3Config.PATH_SEP;

 ok 


C:\dev2\cm3.2\m3-tools\m3browser\src\Main.m3(31):  package_root     := M3Config.PKG_USE;

 broken


C:\dev2\cm3.2\m3-tools\m3browser\src\Main.m3(37):  derived_dirs     := IntList.List1 (ID.Add (M3Config.BUILD_DIR));
 slightly broken

 

C:\dev2\cm3.2\m3-tools\m3tohtml\src\Main.m3(137):  pkgRoot := M3Config.PKG_USE;
 broken

 

C:\dev2\cm3.2\m3-tools\m3tohtml\src\Main.m3(243):              proj_pkg := pkgRoot & M3Config.PATH_SEP & pkg;
 ok

 

C:\dev2\cm3.2\m3-tools\m3tohtml\src\Main.m3(281):      IF Text.GetChar (filename, i) # Text.GetChar (M3Config.BUILD_DIR, i) THEN
   slightly broken, BUILD_DIR is not necessarily TARGET, though if/when we provide CM3_OUTPUT_ROOT, BUILD_DIR can go away, or just be really synonymous with TARGET.

 

C:\dev2\cm3.2\m3-tools\m3tohtml\src\Main.m3(287):    IF Text.GetChar (filename, i) = Text.GetChar (M3Config.PATH_SEP, 0) THEN
 ok

 

C:\dev2\cm3.2\m3-tools\m3tohtml\src\Msg.m3(38):  IF Text.Equal(M3Config.OS_TYPE, "WIN32") THEN
 ok, but there is a better way, something like Wr.EOL or OSConfig.LineSep, which are completely redundant, and Wr.EOL ideally would be a constant.

 

 

later..

 - Jay


 
> Date: Thu, 16 Jul 2009 08:44:14 +0200
> From: wagner at elegosoft.com
> To: m3devel at elegosoft.com
> Subject: Re: [M3devel] M3Config contains paths to installation directory.
> 
> Please remind me again what exactly depends on this interface
> and why we do it that way.
> 
> In cm3 I find quake variables like these
> 
> (* Default to a native build, so the config file can say less. *)
> 
> Quake.Define(mach, "TARGET", M3Config.TARGET);
> Quake.Define(mach, "OS_TYPE", M3Config.OS_TYPE);
> Quake.Define(mach, "BACKEND_MODE", Version.BackendMode);
> Quake.Define(mach, "C_COMPILER", Version.CCompiler);
> Quake.Define(mach, "LINKER", Version.Linker);
> Quake.Define(mach, "THREAD_LIBRARY", Version.ThreadLibrary);
> Quake.Define(mach, "WINDOW_LIBRARY", Version.WindowLibrary);
> Quake.Define(mach, "WORD_SIZE", M3Config.WORD_SIZE);
> 
> (* Even if the config file overrides the defaults, such as to do
> a cross build, the host characteristics are still available. *)
> 
> Quake.Define(mach, "HOST", M3Config.TARGET);
> Quake.Define(mach, "HOST_OS_TYPE", M3Config.OS_TYPE);
> Quake.Define(mach, "HOST_GNU_MAKE", Version.GNUMake);
> 
> but no installation paths. Most code uses MxConfig AS M3Config.
> 
> I see it's used in m3browser as package_root deault, but that can surely
> be fixed and it can also be specified on the command line.
> Same in m3tohtml. So why is it needed?
> 
> One obvious way to overcome Peter's problem would of course be
> to pass a parameter block to quake when building ("m3config-overrides"?).
> Better perhaps to get rid of these paths.
> 
> Olaf
> 
> Quoting Peter Eiserloh <eiserlohpp at yahoo.com>:
> 
> > Hi Jay,
> >
> > Do you know of any way to tell the build system that the
> > final installation directory is located in one place, but
> > that the software is to actually be shipped (temporarily)
> > to a staging directory.
> >
> > Specifically, libm3/src/config contains a m3makefile that
> > derives the M3Config interface, containing a number of
> > paths to the installation root directory.
> >
> > This is the normal situation for most people, but I am
> > installing to a temporary directory, for packaging purposes.
> > The packaging software later installs the package into
> > the correct location.
> >
> > Whenever I build the system, M3Config always contains
> > the paths to my staging area.
> >
> > I would like some way of specifying to the build system
> > that the final (or real) installation root is one thing,
> > but "ship" would actually install into a different one.
> >
> > +--------------------------------------------------------+
> > | Peter P. Eiserloh |
> > +--------------------------------------------------------+
> -- 
> 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
> 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://m3lists.elegosoft.com/pipermail/m3devel/attachments/20090716/84114e26/attachment-0002.html>


More information about the M3devel mailing list