1 AC_DEFUN(EGCS_PROG_INSTALL,
2 [AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
3 # Find a good install program. We prefer a C program (faster),
4 # so one script is as good as another. But avoid the broken or
5 # incompatible versions:
6 # SysV /etc/install, /usr/sbin/install
7 # SunOS /usr/etc/install
10 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
11 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
12 # ./install, which can be erroneously created by make from ./install.sh.
13 AC_MSG_CHECKING(for a BSD compatible install)
14 if test -z "$INSTALL"; then
15 AC_CACHE_VAL(ac_cv_path_install,
16 [ IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS="${IFS}:"
17 for ac_dir in $PATH; do
18 # Account for people who put trailing slashes in PATH elements.
20 /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
22 # OSF1 and SCO ODT 3.0 have their own names for install.
23 for ac_prog in ginstall scoinst install; do
24 if test -f $ac_dir/$ac_prog; then
25 if test $ac_prog = install &&
26 grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then
27 # AIX install. It has an incompatible calling convention.
28 # OSF/1 installbsd also uses dspmsg, but is usable.
31 ac_cv_path_install="$ac_dir/$ac_prog -c"
41 if test "${ac_cv_path_install+set}" = set; then
42 INSTALL="$ac_cv_path_install"
44 # As a last resort, use the slow shell script. We don't cache a
45 # path for INSTALL within a source directory, because that will
46 # break other packages using the cache if that directory is
47 # removed, or if the path is relative.
48 INSTALL="$ac_install_sh"
51 dnl We do special magic for INSTALL instead of AC_SUBST, to get
52 dnl relative paths right.
53 AC_MSG_RESULT($INSTALL)
56 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
57 # It thinks the first close brace ends the variable substitution.
58 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
59 AC_SUBST(INSTALL_PROGRAM)dnl
61 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
62 AC_SUBST(INSTALL_DATA)dnl