I'm building the current hg tip:
$ hg id
87cf29627c28+ tip
with the latest release of 64-bit Cygwin:
$ uname -a
CYGWIN_NT-10.0 desktop-new 2.10.0(0.325/5/3) 2018-02-02 15:16 x86_64 Cygwin
The build doesn't actually complete, as I'll explain below, but it gets far enough to compile clisp.exe, and it produces the following incorrect result (working in the build directory):
$ ./clisp -K boot -q -x '(sys::program-name)'
"lisp.exe"
The result should be the absolute path name of $build_dir/lisp.exe.
A bisection showed that the problem began with the following commit:
changeset: 16075:6bdd34a86295
user: Bruno Haible bruno@clisp.org
date: Tue Oct 24 13:54:05 2017 +0200
summary: Fix the error message of TRUENAME on a nonexistent file.
This commit caused Cygwin to start using my_realpath(), which told me that the problem was in that function. To confirm this, I simply ripped out all of the Cygwin-specific code from that function (patch attached), and the problem was fixed:
$ ./clisp -K boot -q -x '(sys::program-name)'
"/home/kbrown/src/x86_64-clisp-build/lisp.exe"
I'm not asserting that the attached patch is the right fix, since I don't know what problem the Cygwin-specific code was trying to solve. The purpose of my patch is simply to demonstrate where the problem is.
Because of this problem, the build of clisp fails as soon as it tries to configure module directories. With the unpatched sources, I get the following when the build gets to i18n:
configure: creating cache config.cache
configure: ** I18N (Common)
checking how to remove colons from paths... echo $x
checking for CLISP version... 2.49.93+ (2018-02-18) (built 3728389427) (memory 3728390859)
checking for CLISP libdir... /home/kbrown/src/x86_64-clisp-build/
checking for CLISP linking set... configure: error: missing lisp.a lispinit.mem modules.h modules.o makevars in '.'
make[1]: Entering directory '/home/kbrown/src/x86_64-clisp-build/i18n'
make[1]: *** No rule to make target 'clisp-module'. Stop.
make[1]: Leaving directory '/home/kbrown/src/x86_64-clisp-build/i18n'
make: *** [Makefile:2339: i18n] Error 2
This happens because the configure script uses the value of (sys::program-name) to find the directory containing the linking set. Since that value is a relative path, the script searches the directory '.' (i.e., i18n) instead of the build directory.