diff options
author | Jari Vetoniemi <jari.vetoniemi@indooratlas.com> | 2020-03-16 18:49:26 +0900 |
---|---|---|
committer | Jari Vetoniemi <jari.vetoniemi@indooratlas.com> | 2020-03-30 00:39:06 +0900 |
commit | fcbf63e62c627deae76c1b8cb8c0876c536ed811 (patch) | |
tree | 64cb17de3f41a2b6fef2368028fbd00349946994 /jni/iconv/m4/ln.m4 |
Fresh start
Diffstat (limited to 'jni/iconv/m4/ln.m4')
-rw-r--r-- | jni/iconv/m4/ln.m4 | 77 |
1 files changed, 77 insertions, 0 deletions
diff --git a/jni/iconv/m4/ln.m4 b/jni/iconv/m4/ln.m4 new file mode 100644 index 0000000..8ef7a94 --- /dev/null +++ b/jni/iconv/m4/ln.m4 @@ -0,0 +1,77 @@ +dnl Copyright (C) 1993-2002 Free Software Foundation, Inc. +dnl This file is free software, distributed under the terms of the GNU +dnl General Public License. As a special exception to the GNU General +dnl Public License, this file may be distributed as part of a program +dnl that contains a configuration script generated by Autoconf, under +dnl the same distribution terms as the rest of that program. + +dnl From Bruno Haible, Marcus Daniels. + +AC_PREREQ(2.13) + +AC_DEFUN([CL_PROG_LN], +[AC_REQUIRE([CL_PROG_CP])dnl +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)dnl +]) + +AC_DEFUN([CL_PROG_LN_S], +[AC_REQUIRE([CL_PROG_LN])dnl +dnl Make a symlink if possible; otherwise try a hard link. On filesystems +dnl which support neither symlink nor hard link, use a plain copy. +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 +])dnl +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)dnl +]) + +AC_DEFUN([CL_PROG_HLN], +[AC_REQUIRE([CL_PROG_LN_S])dnl +dnl SVR4 "ln" makes hard links to symbolic links, instead of resolving the +dnl symbolic link. To avoid this, use the "hln" program. +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)dnl +]) |