Collection of DPF-based plugins for packaging
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

87 lines
3.5KB

  1. # ===========================================================================
  2. # https://www.gnu.org/software/autoconf-archive/ax_prog_cp_s.html
  3. # ===========================================================================
  4. #
  5. # SYNOPSIS
  6. #
  7. # AX_PROG_CP_S
  8. #
  9. # DESCRIPTION
  10. #
  11. # Check how to make a copy by creating a symbolic link to the original -
  12. # it defines the variable CP_S for further use, which you should in fact
  13. # treat like it used to be with be LN_S. The actual value is assured to be
  14. # either LN_S (if the filesystem supports symbolic links) or CP (if the
  15. # filesystem does not know about symbolic links and you need a copy of
  16. # original file to have the same text in both places). In a gnu
  17. # environment it will simply set CP_S="cp -s" since the gnu "cp"-command
  18. # has the "-s" flag. You shall not try to use this command on directories
  19. # since it would require a "-r" in the case of a copy that is not
  20. # supported explicitly here. (I'm not sure if some "cp"-commands out there
  21. # would barf at usage of "-r" on a normal file).
  22. #
  23. # Use CP_S to create a copy of read-only data - if your filesystem
  24. # supports it then a symbolic link is created - a process that is quicker
  25. # and space-saving. However, if the target fs does not support symbolic
  26. # links, just copy the data. Unlike ac_prog_ln_s this macro will never
  27. # fail to set the CP_S ac_subst to something that works.
  28. #
  29. # LICENSE
  30. #
  31. # Copyright (c) 2008 Guido U. Draheim <guidod@gmx.de>
  32. #
  33. # This program is free software; you can redistribute it and/or modify it
  34. # under the terms of the GNU General Public License as published by the
  35. # Free Software Foundation; either version 3 of the License, or (at your
  36. # option) any later version.
  37. #
  38. # This program is distributed in the hope that it will be useful, but
  39. # WITHOUT ANY WARRANTY; without even the implied warranty of
  40. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
  41. # Public License for more details.
  42. #
  43. # You should have received a copy of the GNU General Public License along
  44. # with this program. If not, see <https://www.gnu.org/licenses/>.
  45. #
  46. # As a special exception, the respective Autoconf Macro's copyright owner
  47. # gives unlimited permission to copy, distribute and modify the configure
  48. # scripts that are the output of Autoconf when processing the Macro. You
  49. # need not follow the terms of the GNU General Public License when using
  50. # or distributing such scripts, even though portions of the text of the
  51. # Macro appear in them. The GNU General Public License (GPL) does govern
  52. # all other use of the material that constitutes the Autoconf Macro.
  53. #
  54. # This special exception to the GPL applies to versions of the Autoconf
  55. # Macro released by the Autoconf Archive. When you make and distribute a
  56. # modified version of the Autoconf Macro, you may extend this special
  57. # exception to the GPL to apply to your modified version as well.
  58. #serial 6
  59. AU_ALIAS([AC_PROG_CP_S], [AX_PROG_CP_S])
  60. AC_DEFUN([AX_PROG_CP_S],
  61. [AC_REQUIRE([AC_PROG_LN_S])dnl
  62. AC_MSG_CHECKING(whether cp -s works)
  63. AC_CACHE_VAL(ac_cv_prog_CP_S,
  64. [rm -f conftestdata
  65. if cp -s X conftestdata 2>/dev/null
  66. then
  67. rm -f conftestdata
  68. ac_cv_prog_CP_S="cp -s"
  69. else
  70. ac_cv_prog_CP_S=cp
  71. fi
  72. if test "$LN_S" = "ln -s" ; then
  73. ac_cv_prog_CP_S="ln -s"
  74. fi])dnl
  75. CP_S="$ac_cv_prog_CP_S"
  76. if test "$ac_cv_prog_CP_S" = "ln -s"; then
  77. AC_MSG_RESULT(using ln -s)
  78. elif test "$ac_cv_prog_CP_S" = "cp -s"; then
  79. AC_MSG_RESULT(yes)
  80. else
  81. AC_MSG_RESULT(no, using cp)
  82. fi
  83. AC_SUBST(CP_S)dnl
  84. ])