blob: 8ef7a94698be2e4aadc22e4eee42cd7ed73fba4d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
|
AC_PREREQ(2.13)
AC_DEFUN([CL_PROG_LN],
[AC_REQUIRE([CL_PROG_CP])
AC_CACHE_CHECK(how to make hard links, cl_cv_prog_LN, [
rm -f conftestdata conftestfile
echo data > conftestfile
if ln conftestfile conftestdata 2>/dev/null; then
cl_cv_prog_LN=ln
else
cl_cv_prog_LN="$cl_cv_prog_cp"
fi
rm -f conftestdata conftestfile
])
LN="$cl_cv_prog_LN"
AC_SUBST(LN)
])
AC_DEFUN([CL_PROG_LN_S],
[AC_REQUIRE([CL_PROG_LN])
AC_MSG_CHECKING(whether ln -s works)
AC_CACHE_VAL(cl_cv_prog_LN_S, [
rm -f conftestdata
if ln -s X conftestdata 2>/dev/null; then
cl_cv_prog_LN_S="ln -s"
else
cl_cv_prog_LN_S="$cl_cv_prog_LN"
fi
rm -f conftestdata
])
if test "$cl_cv_prog_LN_S" = "ln -s"; then
AC_MSG_RESULT(yes)
else
AC_MSG_RESULT(no)
fi
LN_S="$cl_cv_prog_LN_S"
AC_SUBST(LN_S)
])
AC_DEFUN([CL_PROG_HLN],
[AC_REQUIRE([CL_PROG_LN_S])
AC_CACHE_CHECK(how to make hard links to symlinks, cl_cv_prog_hln, [
cl_cv_prog_hln="ln"
if test "$cl_cv_prog_LN_S" = "ln -s"; then
echo "blabla" > conftest.x
ln -s conftest.x conftest.y
ln conftest.y conftest.z 2>&AC_FD_CC
rm -f conftest.x
if cat conftest.z > /dev/null 2>&1 ; then
# ln is usable.
cl_cv_prog_hln="ln"
else
# conftest.z is a symbolic link to the non-existent conftest.x
cl_cv_prog_hln="hln"
fi
else
# If there are no symbolic links, the problem cannot occur.
cl_cv_prog_hln="ln"
fi
rm -f conftest*
])
HLN="$cl_cv_prog_hln"
AC_SUBST(HLN)
])
|