<html>
<head>
<style>
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Verdana
}
</style>
</head>
<body class='hmmessage'>
I'm pretty confident we can fix this fairly soon.<BR>
Many M3Config users can/should be replaced with MxConfig.<BR>
MxConfig can be augmented with "static" things like OS_TYPE, PATH_SEP.<BR>
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.<BR>
 <BR>
Can anyone confirm the theory I just invented as to the history here?<BR>
 M3Config existed.<BR>
 M3Config was recognized as broken.<BR>
 MxConfig introduced as a replacement for M3Config.<BR>
 <BR>
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. :)<BR>
 <BR>
Doing the same grep that Olaf did...<BR>
 <BR>
C:\dev2\cm3.2\m3-libs\sgml\src\SGML.m3(177):    CopyTextArray(self.options.addSearchDir,M3Config.PKG_USE & <BR> broken<BR>
 <BR>
C:\dev2\cm3.2\m3-libs\sgml\src\SGML.m3(178):        M3Config.PATH_SEP & "sgml" & M3Config.PATH_SEP & "src" &<BR>C:\dev2\cm3.2\m3-libs\sgml\src\SGML.m3(179):        M3Config.PATH_SEP & "dtd");<BR> ok, augment MxConfig with this data<BR>
 <BR>
C:\dev2\cm3.2\m3-obliq\obliqrt\src\Obliq.m3(57):      env := NewEnv("target", NewText(M3Config.TARGET), env);<BR>C:\dev2\cm3.2\m3-obliq\obliqrt\src\Obliq.m3(58):      env := NewEnv("osType", NewText(M3Config.OS_TYPE), env);<BR>C:\dev2\cm3.2\m3-obliq\obliqrt\src\Obliq.m3(59):      env := NewEnv("pathSep", NewText(M3Config.PATH_SEP), env);<BR> ditto<BR>
 <BR>
C:\dev2\cm3.2\m3-sys\cm3\src\Main.m3(54):        Quake.Define(mach, "TARGET", M3Config.TARGET);<BR>C:\dev2\cm3.2\m3-sys\cm3\src\Main.m3(55):        Quake.Define(mach, "OS_TYPE", M3Config.OS_TYPE);<BR>C:\dev2\cm3.2\m3-sys\cm3\src\Main.m3(61):        Quake.Define(mach, "WORD_SIZE", M3Config.WORD_SIZE);<BR>C:\dev2\cm3.2\m3-sys\cm3\src\Main.m3(66):        Quake.Define(mach, "HOST", M3Config.TARGET);<BR>C:\dev2\cm3.2\m3-sys\cm3\src\Main.m3(67):        Quake.Define(mach, "HOST_OS_TYPE", M3Config.OS_TYPE);<BR> 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.)<BR>
 <BR>
C:\dev2\cm3.2\m3-sys\cm3ide\src\misc\Default.m3(35):    build_dir       := M3Config.Get ("BUILD_DIR");<BR>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 *)<BR>  These are all really MxConfig, everything in this file, ok.<BR>
 <BR>
 <BR>
C:\dev2\cm3.2\m3-tools\m3browser\src\Main.m3(22):  SLASH      = M3Config.PATH_SEP;<BR>
 ok <BR>
<BR>C:\dev2\cm3.2\m3-tools\m3browser\src\Main.m3(31):  package_root     := M3Config.PKG_USE;<BR>
 broken<BR>
<BR>C:\dev2\cm3.2\m3-tools\m3browser\src\Main.m3(37):  derived_dirs     := IntList.List1 (ID.Add (M3Config.BUILD_DIR));<BR> slightly broken<BR>
 <BR>
C:\dev2\cm3.2\m3-tools\m3tohtml\src\Main.m3(137):  pkgRoot := M3Config.PKG_USE;<BR> broken<BR>
 <BR>
C:\dev2\cm3.2\m3-tools\m3tohtml\src\Main.m3(243):              proj_pkg := pkgRoot & M3Config.PATH_SEP & pkg;<BR> ok<BR>
 <BR>
C:\dev2\cm3.2\m3-tools\m3tohtml\src\Main.m3(281):      IF Text.GetChar (filename, i) # Text.GetChar (M3Config.BUILD_DIR, i) THEN<BR>   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.<BR>
 <BR>
C:\dev2\cm3.2\m3-tools\m3tohtml\src\Main.m3(287):    IF Text.GetChar (filename, i) = Text.GetChar (M3Config.PATH_SEP, 0) THEN<BR> ok<BR>
 <BR>
C:\dev2\cm3.2\m3-tools\m3tohtml\src\Msg.m3(38):  IF Text.Equal(M3Config.OS_TYPE, "WIN32") THEN<BR> 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.<BR>
 <BR>
 <BR>
later..<BR>
 - Jay<BR><BR><BR> <BR>> Date: Thu, 16 Jul 2009 08:44:14 +0200<BR>> From: wagner@elegosoft.com<BR>> To: m3devel@elegosoft.com<BR>> Subject: Re: [M3devel] M3Config contains paths to installation directory.<BR>> <BR>> Please remind me again what exactly depends on this interface<BR>> and why we do it that way.<BR>> <BR>> In cm3 I find quake variables like these<BR>> <BR>> (* Default to a native build, so the config file can say less. *)<BR>> <BR>> Quake.Define(mach, "TARGET", M3Config.TARGET);<BR>> Quake.Define(mach, "OS_TYPE", M3Config.OS_TYPE);<BR>> Quake.Define(mach, "BACKEND_MODE", Version.BackendMode);<BR>> Quake.Define(mach, "C_COMPILER", Version.CCompiler);<BR>> Quake.Define(mach, "LINKER", Version.Linker);<BR>> Quake.Define(mach, "THREAD_LIBRARY", Version.ThreadLibrary);<BR>> Quake.Define(mach, "WINDOW_LIBRARY", Version.WindowLibrary);<BR>> Quake.Define(mach, "WORD_SIZE", M3Config.WORD_SIZE);<BR>> <BR>> (* Even if the config file overrides the defaults, such as to do<BR>> a cross build, the host characteristics are still available. *)<BR>> <BR>> Quake.Define(mach, "HOST", M3Config.TARGET);<BR>> Quake.Define(mach, "HOST_OS_TYPE", M3Config.OS_TYPE);<BR>> Quake.Define(mach, "HOST_GNU_MAKE", Version.GNUMake);<BR>> <BR>> but no installation paths. Most code uses MxConfig AS M3Config.<BR>> <BR>> I see it's used in m3browser as package_root deault, but that can surely<BR>> be fixed and it can also be specified on the command line.<BR>> Same in m3tohtml. So why is it needed?<BR>> <BR>> One obvious way to overcome Peter's problem would of course be<BR>> to pass a parameter block to quake when building ("m3config-overrides"?).<BR>> Better perhaps to get rid of these paths.<BR>> <BR>> Olaf<BR>> <BR>> Quoting Peter Eiserloh <eiserlohpp@yahoo.com>:<BR>> <BR>> > Hi Jay,<BR>> ><BR>> > Do you know of any way to tell the build system that the<BR>> > final installation directory is located in one place, but<BR>> > that the software is to actually be shipped (temporarily)<BR>> > to a staging directory.<BR>> ><BR>> > Specifically, libm3/src/config contains a m3makefile that<BR>> > derives the M3Config interface, containing a number of<BR>> > paths to the installation root directory.<BR>> ><BR>> > This is the normal situation for most people, but I am<BR>> > installing to a temporary directory, for packaging purposes.<BR>> > The packaging software later installs the package into<BR>> > the correct location.<BR>> ><BR>> > Whenever I build the system, M3Config always contains<BR>> > the paths to my staging area.<BR>> ><BR>> > I would like some way of specifying to the build system<BR>> > that the final (or real) installation root is one thing,<BR>> > but "ship" would actually install into a different one.<BR>> ><BR>> > +--------------------------------------------------------+<BR>> > | Peter P. Eiserloh |<BR>> > +--------------------------------------------------------+<BR>> -- <BR>> Olaf Wagner -- elego Software Solutions GmbH<BR>> Gustav-Meyer-Allee 25 / Gebäude 12, 13355 Berlin, Germany<BR>> phone: +49 30 23 45 86 96 mobile: +49 177 2345 869 fax: +49 30 23 45 86 95<BR>> http://www.elegosoft.com | Geschäftsführer: Olaf Wagner | Sitz: Berlin<BR>> Handelregister: Amtsgericht Charlottenburg HRB 77719 | USt-IdNr: DE163214194<BR>> <BR></body>
</html>