3 # Copyright (C) 2001, 2003, 2005 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 dnl From Volker Borchert.
9 dnl Determine whether rename works for source file names with a trailing slash.
10 dnl The rename from SunOS 4.1.1_U1 doesn't.
12 dnl If it doesn't, then define RENAME_TRAILING_SLASH_BUG and arrange
13 dnl to compile the wrapper function.
16 AC_DEFUN([vb_FUNC_RENAME],
18 AC_CACHE_CHECK([whether rename is broken],
19 vb_cv_func_rename_trailing_slash_bug,
21 rm -rf conftest.d1 conftest.d2
23 AC_MSG_ERROR([cannot create temporary directory])
29 exit (rename ("conftest.d1/", "conftest.d2") ? 1 : 0);
32 vb_cv_func_rename_trailing_slash_bug=no,
33 vb_cv_func_rename_trailing_slash_bug=yes,
34 dnl When crosscompiling, assume rename is broken.
35 vb_cv_func_rename_trailing_slash_bug=yes)
37 rm -rf conftest.d1 conftest.d2
39 if test $vb_cv_func_rename_trailing_slash_bug = yes; then
41 AC_DEFINE(rename, rpl_rename,
42 [Define to rpl_rename if the replacement function should be used.])
43 AC_DEFINE(RENAME_TRAILING_SLASH_BUG, 1,
44 [Define if rename does not work for source file names with a trailing
45 slash, like the one from SunOS 4.1.1_U1.])
50 # Prerequisites of lib/rename.c.
51 AC_DEFUN([gl_PREREQ_RENAME], [:])