<html>
<head>
<style>
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
FONT-SIZE: 10pt;
FONT-FAMILY:Tahoma
}
</style>
</head>
<body class='hmmessage'>It is easier than today I think, and might be made even easier.<BR>
Unix doesn't have to be as hard as possible, though I guess I'm a heretic on this point too.<BR>
Unix seems to be all about making things much harder than necessary.<BR>
<BR>
I am using a workaround for at least some scenarios.<BR>
In particular I have some NTFS junctions and some Cygwin symlinks.<BR>
Though the symlinks are just for shorter paths and I think unnecessary.<BR>
Cygwin symlinks:<BR>
/c => /cygdrive/c <BR>
/dev2 => /c/dev2 (and then recurse) <BR>
/cm3 => /c/cm3 (and then recurse) <BR>
<BR>
NTFS junctions: (I use sysinternals.com's junction.exe to set these up) <BR>
\cygdrive\c => c:\ <BR>
\c\cm3 => c:\cm3 (aka /c/cm3, on current drive, and win32 accepts forward slashes, voila) <BR>
\c\dev2 => c:\dev2 (aka /c/cdev2, likewise) <BR>
<BR>
You could also setup in-memory symlinks I believe with subst and/or DefineDosDevice.<BR>
<BR>
This way I can cross build either from either.<BR>
Just bringing up CM3/Cygwin and "staying there", I don't think requires this. Nor does starting from the distribution I provided,I think. I guess I should test that, and if I am wrong, document these as "officially" needed.<BR>
(X86_CYGWIN?, X86_MINGWIN? X86_INTERIX, X86_POSIX_CYGWIN, X86_WIN32_MINGWIN, X86_POSIX_INTERIX?)<BR>
<BR>
I also do some path conversion in the Python wrappers.<BR>
<BR>
I would strongly consider the following:<BR>
in cm3.exe, set the quake variables INSTALLROOT and ROOT very much like how the Python/sh/Quake code does.<BR>
Something like:<BR>
If the environment variable CM3_ROOT is set, set ROOT to it.<BR>
If the environment variable CM3_INSTALL is set, set INSTALLROOT to it.<BR>
I wouldn't mind while at it coming up with longer more clear names -- CM3_INSTALL_ROOT and CM3_SOURCE_ROOT.<BR>
Convert INSTALLROOT and ROOT to what is native to cm3.exe.<BR>
Possibly write the variables back out to the environment, though that should be not necessary.<BR>
If M3CONFIG is set in the environment, convert it to what is native cm3.exe.<BR>
<BR>
For all this work, only accept full paths. That removes ambiguity since /foo is a valid Win32 path.<BR>
<BR>
If the environment variables are not set, CM3_INSTALL can be gleaned from cm3.exe's own path.<BR>
On Windows this is from GetModuleHandleW(NULL). On other platforms, I guess argv[0]?<BR>
/Possibly/ by searching $PATH for cm3.exe, but that fails if I run cm3.exe by full path and it isn't in $PATH, so no.<BR>
<BR>
CM3_ROOT /maybe/ should not be sniffed out.<BR>
You could do it by checking for CVS directory in current working directory and then going up until CVS/Repository has no slashes, something like that. Yes, I know that is specific to using CVS, doesn't work if you are sitting elsewhere, doesn't work when another source control system is used, etc. But it is very much correct today and fast enough and when it works, is correct (ok..sitting in another CVS tree?) and makes things just a little easier to use. Automation is the name of the game, right? Otherwise we'd all be programming in assembly or ones and zeros.<BR>
<BR>
<BR>
- Jay<BR><BR><BR><BR>
<HR id=stopSpelling>
<BR>
> To: wagner@elegosoft.com<BR>> Date: Sun, 24 Feb 2008 13:54:34 -0800<BR>> From: mika@async.caltech.edu<BR>> CC: m3devel@elegosoft.com<BR>> Subject: Re: [M3devel] paths..<BR>> <BR>> Olaf, you're right:<BR>> <BR>> People who use Cygwin are used to dealing with all kinds of oddities.<BR>> <BR>> I am here reproducing "README.CYGWIN" from the top level of my M3<BR>> project (note the stuff after "IMPORTANT SECTION FOLLOWS"). In my <BR>> opinion (and I think of everyone else who appears to use NT386GNU and<BR>> also post to this mailing list) the point of Cygwin is to work as a<BR>> crutch for Unix people who really, really don't want to use Windows,<BR>> but are forced for some (probably economic) reason to do so... We<BR>> want as much Unix and as little Windows as possible, and we're willing<BR>> to jump through all sorts of hoops to get our way....<BR>> <BR>> Mika<BR>> <BR>> <BR>> #<BR>> # $Id: README.CYGWIN,v 1.3 2007/07/28 23:43:50 mika Exp $<BR>> #<BR>> <BR>> ===== Basic instructions =====<BR>> <BR>> If you are just building, not maintaining, just <BR>> <BR>> export CYGWIN=1<BR>> <BR>> before compiling.<BR>> <BR>> If you are not building as user "mika", you will have to make some<BR>> changes to Make.defs (please look at that file).<BR>> <BR>> ===== From-Scratch Installation =====<BR>> <BR>> Installing this system on Cygwin can be a little tricky. So far, it's<BR>> only been tested with the old PM3 distribution from Klagenfurt (?).<BR>> This PM3 comes on 44 "floppies" and is installed in accordance with the<BR>> instructions (in German) located at<BR>> <BR>> http://www.1o0.de/wi-links/informatik/praxis/programmiersprachen/modula3/installation/windows/windows.html<BR>> <BR>> Having installed the PM3 distribution, building small, self-contained <BR>> Modula-3 programs should be no problem.<BR>> <BR>> However, it is different with this software distribution. During the<BR>> build process, tools are built that are used later on in the same build<BR>> process. For various reasons, m3 "overrides" don't seem to work right on<BR>> Cygwin/PM3-Klagenfurt, so we build a "distribution" system and m3ship<BR>> everything.<BR>> <BR>> ===== IMPORTANT SECTION FOLLOWS =====<BR>> <BR>> The main thing that has to be done to simplify the work of the build<BR>> system is to make sure that DOS and Cygwin directory paths match AS<BR>> MUCH AS POSSIBLE. This is difficult, because by default, Cygwin has<BR>> a different view of the "root" of the filesystem from the standard<BR>> DOS view. Running under Cygwin, the Klagenfurt system unfortunately<BR>> sometimes takes the DOS view and sometimes takes the Cygwin view.<BR>> The situation is further complicated by the fact that Windows doesn't<BR>> have proper symbolic links.<BR>> <BR>> The saving grace is that Cygwin DOES have proper symbolic links.<BR>> The solution is therefore to make the directory structure that is desired<BR>> under DOS and then link to it from within the Cygwin hierarchy.<BR>> <BR>> Therefore:<BR>> <BR>> Move the users' home directories to <BR>> <BR>> C:\home<BR>> <BR>> and make the links as follows:<BR>> <BR>> Cygwin link DOS equivalent<BR>> /home -> /cygdrive/c/home C:\cygwin\home -> C:\home<BR>> <BR>> etc.<BR>> <BR>> The filenames are still occasionally polluted by DOS things like<BR>> backslashes and drive letters. The scripts in cygwinhacks should take<BR>> care of most of the remaining problems of this sort.<BR>> <BR>> I am not sure this system can be made to work if your system disk<BR>> is called anything other than C:. Best not to try.<BR>> <BR>> (end of README.CYGWIN)<BR>> <BR>> Olaf Wagner writes:<BR>> >Jay,<BR>> ><BR>> >I'm not really happy with NT386GNU using PathnameWin32.m3.<BR>> >In my opininion it should just use the POSIX code, whatever problems<BR>> >people will have with their installation roots. (These can be avoided<BR>> >by using the /cygdrive/... equivalents.)<BR>> >Why don't we just assume that by deafult CM3 is installed in<BR>> >/usr/local/cm3 as for all other targets (except NT386, of course)?<BR>> ><BR>> >One thing that immediately comes to mind is that all paths output<BR>> >by CM3 programs will contain \ instead of / then and thus be<BR>> >unusable for simple copy-and-paste, as \ is the escape character<BR>> >in all POSIX command line tools. So this seems kind of incompatible<BR>> >to me.<BR>> ><BR>> >Olaf<BR>> ><BR>> >Quoting Jay <jayk123@hotmail.com>:<BR>> ><BR>> >> I could be wrong about many things here:<BR>> >><BR>> >> Cygwin fopen and I presume open accepts all of:<BR>> >> c:\foo, c:/foo, /foo, \foo<BR>> >><BR>> >> /foo and \foo probably have a different meaning between Cygwin and Win32.<BR>> >> In Win32, /foo and \foo are, well, \foo, on the current drive.<BR>> >> In Cygwin, /foo is probably /foo at the Cygwin root.<BR>> >> I'd kind of like to be wrong here, about \foo having different <BR>> >> meanings between them, since it a common form for me.<BR>> >><BR>> >> Cygwin does not accept c:foo.<BR>> >> In Win32 c:foo is foo in the current working directory of the C: drive.<BR>> >> I don't think c:foo is used often, but it does have a meaning.<BR>> >><BR>> >> Now, as well, cm3 has its own Path module, M3Path, but I realized <BR>> >> tonight it also uses libm3's Pathname module a fair amount. In <BR>> >> particular, I was having errors "shipping".<BR>> >><BR>> >> This throws a big monkey wrench into where I was going.<BR>> >> So now, after a bunch of going back and forth on various uncommited <BR>> >> changes, I have now switched (and commited) NT386GNU to use <BR>> >> PathnameWin32.m3. To some extent, this strikes at the core of "what <BR>> >> is Posix" and "ruins" NT386GNU's differentiation from "NT386MINGNU". <BR>> >> However, remember that Cygwin does appear to accept Win32 paths. <BR>> >> So, again, if Cygwin accepts Win32 paths, is it Posix? (Given that <BR>> >> Win32 accepts /foo, is it Posix?) As well, this target still uses <BR>> >> cygwin1.dll for its all its odd behaviors. It still uses <BR>> >> open/read/write (again, remember that msvcrt.dll DOES expose these <BR>> >> SAME functions..I still contend that Win32 is close enough to Posix <BR>> >> to satisfy almost everyone..and then X Windows can be dealt with <BR>> >> separately maybe, or Trestle/Win32 fixed).<BR>> >><BR>> >> I have some more testing to do but I think this switch will fly, and <BR>> >> various other options can go away.<BR>> >> And I can undo the small amount I had commited.<BR>> >> I think I'll just send my m3path.m3 diff around and then delete it.<BR>> >><BR>> >> I ended up with a set based approach where host and target have a <BR>> >> set of dir separaters, volume separaters, and separators (union of <BR>> >> previous two). These are TINY sets, containing a maximum of three <BR>> >> characters each, and '/' is always a member of two of them. So a set <BR>> >> is kind of overkill. But it works out pretty ok.<BR>> >><BR>> >> - Jay<BR>> >> _________________________________________________________________<BR>> >> Need to know the score, the latest news, or you need your <BR>> >> Hotmail®-get your "fix".<BR>> >> http://www.msnmobilefix.com/Default.aspx<BR>> ><BR>> ><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><br /><hr />Climb to the top of the charts! Play the word scramble challenge with star power. <a href='http://club.live.com/star_shuffle.aspx?icid=starshuffle_wlmailtextlink_jan' target='_new'>Play now!</a></body>
</html>