- AC_CACHE_CHECK(
- [whether link(2) dereferences a symlink specified with a trailing slash],
- jm_ac_cv_func_link_follows_symlink,
- [
- dnl poor-man's AC_REQUIRE: FIXME: repair this once autoconf-3 provides
- dnl the appropriate framework.
- test -z "$ac_cv_header_unistd_h" \
- && AC_CHECK_HEADERS(unistd.h)
-
- # Create a regular file.
- echo > conftest.file
- AC_TRY_RUN(
- [
+ AC_CHECK_FUNCS_ONCE([readlink])
+ dnl Mingw lacks link, although gnulib provides a good replacement.
+ dnl However, it also lacks symlink, so there's nothing to test in
+ dnl the first place, and no reason to need to distinguish between
+ dnl linkat variants. So, we set LINK_FOLLOWS_SYMLINKS to 0.
+ gl_link_follows_symlinks=0 # assume GNU behavior
+ if test $ac_cv_func_readlink = yes; then
+ AC_CACHE_CHECK([whether link(2) dereferences a symlink],
+ gl_cv_func_link_follows_symlink,
+ [
+ # Create a regular file.
+ echo > conftest.file
+ AC_RUN_IFELSE([AC_LANG_SOURCE([[