MSYS is a port of several GNU tools for Windows, by using a POSIX layer derived from Cygwin. It allows the Windows port of the gcc compiler (MinGW) to be driven by the familiar "configure && make && make install" build sequence.

Since Windows in general doesn't have the concept of a symlink, MSYS provides an emulation by copying, as a convenience.

Since MSYS 1.0.12, creating relative symlinks in directories is also emulated properly.

For instance:  ln -s  relpath/file dir
before 1.0.12: cp -pr relpath/file dir
in 1.0.12+:    cp -pr dir/relpath/file dir

Unfortunately, this causes a false negative in an autoconf test:

configure.ac:
AC_INIT
AC_PROG_LN_S
echo "$LN_S"

autoconf version: 2.65.36-64dee

configure output:
checking whether ln -s works... no, using cp -p
cp -p

The test, in _AS_LN_S_PREPARE, is equivalent to

$ mkdir dir
$ touch file
$ ln -s file dir

I don't think this test is reasonable. On a system with true symlinks, this would create a symlink pointing to itself:

$ ls -l dir
... file -> file
$ file dir/file
dir/file: symbolic link in a loop

This ends up failing on MSYS >= 1.0.12 because it tries to copy a nonexistent file: cp -pr dir/file dir

Perhaps a more appropriate test would be something like:

$ ln -s ../file dir

or even

$ ln -s $PWD/file dir

The above test cases give positive results with MSYS >= 1.0.12.

Regards,
Cesar



Reply via email to