[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
False negative for ln -s test on MSYS
From: |
Cesar Strauss |
Subject: |
False negative for ln -s test on MSYS |
Date: |
Sat, 20 Feb 2010 22:34:35 -0200 |
User-agent: |
Thunderbird 2.0.0.23 (Windows/20090812) |
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
- False negative for ln -s test on MSYS,
Cesar Strauss <=