Annotation of embedaddon/libiconv/m4/ln.m4, revision 1.1

1.1     ! misho       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.
        !             7: 
        !             8: dnl From Bruno Haible, Marcus Daniels.
        !             9: 
        !            10: AC_PREREQ(2.13)
        !            11: 
        !            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
        !            18:   cl_cv_prog_LN=ln
        !            19: else
        !            20:   cl_cv_prog_LN="$cl_cv_prog_cp"
        !            21: fi
        !            22: rm -f conftestdata conftestfile
        !            23: ])
        !            24: LN="$cl_cv_prog_LN"
        !            25: AC_SUBST(LN)dnl
        !            26: ])
        !            27: 
        !            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, [
        !            34: rm -f conftestdata
        !            35: if ln -s X conftestdata 2>/dev/null; then
        !            36:   cl_cv_prog_LN_S="ln -s"
        !            37: else
        !            38:   cl_cv_prog_LN_S="$cl_cv_prog_LN"
        !            39: fi
        !            40: rm -f conftestdata
        !            41: ])dnl
        !            42: if test "$cl_cv_prog_LN_S" = "ln -s"; then
        !            43:   AC_MSG_RESULT(yes)
        !            44: else
        !            45:   AC_MSG_RESULT(no)
        !            46: fi
        !            47: LN_S="$cl_cv_prog_LN_S"
        !            48: AC_SUBST(LN_S)dnl
        !            49: ])
        !            50: 
        !            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, [
        !            56: cl_cv_prog_hln="ln"
        !            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
        !            61: rm -f conftest.x
        !            62: if cat conftest.z > /dev/null 2>&1 ; then
        !            63:   # ln is usable.
        !            64:   cl_cv_prog_hln="ln"
        !            65: else
        !            66:   # conftest.z is a symbolic link to the non-existent conftest.x
        !            67:   cl_cv_prog_hln="hln"
        !            68: fi
        !            69: else
        !            70: # If there are no symbolic links, the problem cannot occur.
        !            71: cl_cv_prog_hln="ln"
        !            72: fi
        !            73: rm -f conftest*
        !            74: ])
        !            75: HLN="$cl_cv_prog_hln"
        !            76: AC_SUBST(HLN)dnl
        !            77: ])

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>