[CMake] CMake2.5 - wrong default install location for mingw

Bill Hoffman bill.hoffman at kitware.com
Fri Oct 19 21:04:34 EDT 2007


Gonzalo Garramuño wrote:
>
>> What you want to do is extend the msys environment with extra POSIX 
>> compatible tools.   
> 
> No.  I was just trying to compile cmake (or other stuff) under msys and 
> have it behave like all other (subset of) autotools libraries or 
> executables that can be compiled under such environment.  All of these 
> get compiled and installed under MSYS's /usr/local root, not under 
> $PROGRAMFILES.
> 

How is a native windows program supposed to write to /usr/local?  (see 
below)

> To do that cmake
>> would have to link to the MSYS run time library in order to understand 
>> things like sym links and mount points.
>>
> 
> AFAIK, no.  If my understanding of MSYS/MinGW is correct, there's no 
> extra POSIX compatibility library.  The POSIX compatibility comes from 
> the limited POSIX compatibility provided by the win32api and the msvcrt 
> DLL.  This is one of the things it distinguishes it from cygwin, where 
> the cygwin.dll does indeed try to have a 1-to-1 correspondence with 
> POSIX (and some Linux internals too).
> 
> --- digression---
> Currently, neither cygwin nor mingw support sym links (as they are still 
> constrained by what pre-windows vista supports).  Cygwin might support 
> mount points other than windows ones (like NFS), but not sure.  MinGW 
> certainly does not (only windows A: to Z: drives).
> The only magic msys utilities like bash perform is modifying the PATH 
> variable for Windows to make /C/ become C:\ and '/' become MSYSROOT\.
> 

Not really true, cygwin has its own symlinks.  See here:
http://www.cygwin.com/cygwin-ug-net/using.html

Also see here:

http://www.mingw.org/MinGWiki/index.php/Shells%2C%20terminals%20and%20MSYS

 >Firstly: a MSYS application is one that uses (links with)
 > the the MSYS runtime (msys-1.0.dll), just like a Cygwin application
....

> However, the key here is that this MSYS environment is
 >  just a driver for native Win32 tools such as the
 >MinGW gcc which produces MinGW binaries. It is very rare
 > and uncommon to actually use MSYS to build MSYS apps, and
 >in fact to do this you have to install a special environment
 > and use a specially modified copy of gcc -- currently a
  very old 2.95 version.


They have special files and the cygwin run time knows what to do with 
them.  msys also has mount points and such.  For example on my machine: 
$ mount
C:\DOCUME~1\hoffman\LOCALS~1\Temp on /tmp type user (binmode,noumount)
C:\msys\1.0\bin on /usr/bin type user (binmode,cygexec,noumount)
C:\msys\1.0\bin on /bin type user (binmode,cygexec,noumount)
C:\msys\1.0 on /usr type user (binmode,noumount)
C:\msys\1.0 on / type user (binmode,noumount)
c:\MinGW on /mingw type user (binmode)
c: on /c type user (binmode,noumount)

Note, that /usr is really c:\msys\1.0.  An all native windows program 
has no idea what /user or /tmp is according to the msys commands.  So, 
there is no way the native windows cmake could write to /usr/local for 
installing files.  So, there is more magic than meets the eye.


So, even if you figured out what shell you were running from, you still 
could not write to /usr/local because that directory does not exist to a 
windows program.

-Bill


More information about the CMake mailing list