3 # Copyright (C) 2006, 2009 Free Software Foundation, Inc.
4 # This file is free software; the Free Software Foundation
5 # gives unlimited permission to copy and/or distribute it,
6 # with or without modifications, as long as this notice is preserved.
8 # Derived from rename.m4.
10 # A rename wrapper to make tools like mv -- that would normally
11 # rely on the underlying rename syscall -- work more consistently.
13 AC_DEFUN([gl_FUNC_RENAME_TRAILING_DEST_SLASH],
15 AC_CACHE_CHECK([whether rename is broken with respect to destination slashes],
16 gl_cv_func_rename_trailing_dest_slash_bug,
18 rm -rf conftest.d1 conftest.d2
20 AC_MSG_ERROR([cannot create temporary directory])
26 return (rename ("conftest.d1", "conftest.d2/") ? 1 : 0);
29 gl_cv_func_rename_trailing_dest_slash_bug=no,
30 gl_cv_func_rename_trailing_dest_slash_bug=yes,
31 dnl When crosscompiling, assume rename is broken.
32 gl_cv_func_rename_trailing_dest_slash_bug=yes)
34 rm -rf conftest.d1 conftest.d2
36 if test $gl_cv_func_rename_trailing_dest_slash_bug = yes; then
37 AC_LIBOBJ([rename-dest-slash])
38 AC_DEFINE([rename], [rpl_rename_dest_slash],
39 [Define to rpl_rename_dest_slash if the replacement function should be used.])