- 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([[
+ dnl Solaris has an __xpg4 variable in libc, and it determines the
+ dnl behaviour of link(): It dereferences a symlink if and only if
+ dnl __xpg4 != 0.
+ AC_CACHE_CHECK([for __xpg4], [gl_cv_have___xpg4],
+ [AC_LINK_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[extern int __xpg4;]],
+ [[return __xpg4;]])],
+ [gl_cv_have___xpg4=yes],
+ [gl_cv_have___xpg4=no])
+ ])
+ if test $gl_cv_have___xpg4 = yes; then
+ gl_link_follows_symlinks=-1
+ else
+ 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([[