proginstall.m4 3.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. # AC_PROG_INSTALL
  2. # ---------------
  3. #
  4. # This macro is stolen from Autoconf 2.61a-341.
  5. # It requires `install' to be able to install multiple files at once.
  6. # This file will be obsolete when GCC moves to Autoconf 2.62.
  7. m4_version_prereq([2.62], [],
  8. [
  9. AC_DEFUN([AC_PROG_INSTALL],
  10. [AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
  11. dnl AC_REQUIRE_AUX_FILE([install-sh])dnl This line does not work with 2.59.
  12. # Find a good install program. We prefer a C program (faster),
  13. # so one script is as good as another. But avoid the broken or
  14. # incompatible versions:
  15. # SysV /etc/install, /usr/sbin/install
  16. # SunOS /usr/etc/install
  17. # IRIX /sbin/install
  18. # AIX /bin/install
  19. # AmigaOS /C/install, which installs bootblocks on floppy discs
  20. # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
  21. # AFS /usr/afsws/bin/install, which mishandles nonexistent args
  22. # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
  23. # OS/2's system install, which has a completely different semantic
  24. # ./install, which can be erroneously created by make from ./install.sh.
  25. # Reject install programs that cannot install multiple files.
  26. AC_MSG_CHECKING([for a BSD-compatible install])
  27. if test -z "$INSTALL"; then
  28. AC_CACHE_VAL(ac_cv_path_install,
  29. [_AS_PATH_WALK([$PATH],
  30. [# Account for people who put trailing slashes in PATH elements.
  31. case $as_dir/ in
  32. ./ | .// | /[cC]/* | \
  33. /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \
  34. ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \
  35. /usr/ucb/* ) ;;
  36. *)
  37. # OSF1 and SCO ODT 3.0 have their own names for install.
  38. # Don't use installbsd from OSF since it installs stuff as root
  39. # by default.
  40. for ac_prog in ginstall scoinst install; do
  41. for ac_exec_ext in '' $ac_executable_extensions; do
  42. if AS_EXECUTABLE_P(["$as_dir/$ac_prog$ac_exec_ext"]); then
  43. if test $ac_prog = install &&
  44. grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
  45. # AIX install. It has an incompatible calling convention.
  46. :
  47. elif test $ac_prog = install &&
  48. grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
  49. # program-specific install script used by HP pwplus--don't use.
  50. :
  51. else
  52. rm -rf conftest.one conftest.two conftest.dir
  53. echo one > conftest.one
  54. echo two > conftest.two
  55. mkdir conftest.dir
  56. if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" &&
  57. test -s conftest.one && test -s conftest.two &&
  58. test -s conftest.dir/conftest.one &&
  59. test -s conftest.dir/conftest.two
  60. then
  61. ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
  62. break 3
  63. fi
  64. fi
  65. fi
  66. done
  67. done
  68. ;;
  69. esac])
  70. rm -rf conftest.one conftest.two conftest.dir
  71. ])dnl
  72. if test "${ac_cv_path_install+set}" = set; then
  73. INSTALL=$ac_cv_path_install
  74. else
  75. # As a last resort, use the slow shell script. Don't cache a
  76. # value for INSTALL within a source directory, because that will
  77. # break other packages using the cache if that directory is
  78. # removed, or if the value is a relative name.
  79. INSTALL=$ac_install_sh
  80. fi
  81. fi
  82. dnl Do special magic for INSTALL instead of AC_SUBST, to get
  83. dnl relative names right.
  84. AC_MSG_RESULT([$INSTALL])
  85. # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
  86. # It thinks the first close brace ends the variable substitution.
  87. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
  88. AC_SUBST(INSTALL_PROGRAM)dnl
  89. test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
  90. AC_SUBST(INSTALL_SCRIPT)dnl
  91. test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
  92. AC_SUBST(INSTALL_DATA)dnl
  93. ])# AC_PROG_INSTALL
  94. ])