+ dnl Solaris 10 mistakenly allows rename("file","name/").
+ dnl This particular condition can be worked around without stripping
+ dnl trailing slash.
+ AC_CACHE_CHECK([whether rename honors trailing slash on destination],
+ [gl_cv_func_rename_slash_dst_works],
+ [rm -rf conftest.f conftest.f1
+ touch conftest.f ||
+ AC_MSG_ERROR([cannot create temporary files])
+ AC_RUN_IFELSE([AC_LANG_PROGRAM([[
+# include <stdio.h>
+# include <stdlib.h>
+]], [return !rename ("conftest.f", "conftest.f1/");])],
+ [gl_cv_func_rename_slash_dst_works=yes],
+ [gl_cv_func_rename_slash_dst_works=no],
+ dnl When crosscompiling, assume rename is broken.
+ [gl_cv_func_rename_slash_dst_works="guessing no"])
+ rm -rf conftest.f conftest.f1
+ ])
+ if test "x$gl_cv_func_rename_slash_dst_works" != xyes; then
+ AC_LIBOBJ([rename])
+ REPLACE_RENAME=1
+ AC_DEFINE([RENAME_TRAILING_SLASH_DEST_BUG], [1],
+ [Define if rename does not correctly handle slashes on the destination
+ argument, such as on Solaris 10.])
+ fi
+