1 dnl Copyright (C) 1993-2002 Free Software Foundation, Inc.
2 dnl This file is free software, distributed under the terms of the GNU
3 dnl General Public License. As a special exception to the GNU General
4 dnl Public License, this file may be distributed as part of a program
5 dnl that contains a configuration script generated by Autoconf, under
6 dnl the same distribution terms as the rest of that program.
8 dnl From Bruno Haible, Marcus Daniels.
12 AC_DEFUN([CL_PROG_LN],
13 [AC_REQUIRE([CL_PROG_CP])dnl
14 AC_CACHE_CHECK(how to make hard links, cl_cv_prog_LN, [
15 rm -f conftestdata conftestfile
16 echo data > conftestfile
17 if ln conftestfile conftestdata 2>/dev/null; then
20 cl_cv_prog_LN="$cl_cv_prog_cp"
22 rm -f conftestdata conftestfile
28 AC_DEFUN([CL_PROG_LN_S],
29 [AC_REQUIRE([CL_PROG_LN])dnl
30 dnl Make a symlink if possible; otherwise try a hard link. On filesystems
31 dnl which support neither symlink nor hard link, use a plain copy.
32 AC_MSG_CHECKING(whether ln -s works)
33 AC_CACHE_VAL(cl_cv_prog_LN_S, [
35 if ln -s X conftestdata 2>/dev/null; then
36 cl_cv_prog_LN_S="ln -s"
38 cl_cv_prog_LN_S="$cl_cv_prog_LN"
42 if test "$cl_cv_prog_LN_S" = "ln -s"; then
47 LN_S="$cl_cv_prog_LN_S"
51 AC_DEFUN([CL_PROG_HLN],
52 [AC_REQUIRE([CL_PROG_LN_S])dnl
53 dnl SVR4 "ln" makes hard links to symbolic links, instead of resolving the
54 dnl symbolic link. To avoid this, use the "hln" program.
55 AC_CACHE_CHECK(how to make hard links to symlinks, cl_cv_prog_hln, [
57 if test "$cl_cv_prog_LN_S" = "ln -s"; then
58 echo "blabla" > conftest.x
59 ln -s conftest.x conftest.y
60 ln conftest.y conftest.z 2>&AC_FD_CC
62 if cat conftest.z > /dev/null 2>&1 ; then
66 # conftest.z is a symbolic link to the non-existent conftest.x
70 # If there are no symbolic links, the problem cannot occur.