3 AC_DEFUN(CL_PROG_INSTALL,
4 [dnl This is mostly copied from AC_PROG_INSTALL.
5 # Find a good install program. We prefer a C program (faster),
6 # so one script is as good as another. But avoid the broken or
7 # incompatible versions:
8 # SysV /etc/install, /usr/sbin/install
9 # SunOS /usr/etc/install
12 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
13 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
14 # ./install, which can be erroneously created by make from ./install.sh.
15 AC_MSG_CHECKING(for a BSD compatible install)
16 if test -z "$INSTALL"; then
17 AC_CACHE_VAL(cl_cv_path_install,
18 [ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
19 for ac_dir in $PATH; do
20 # Account for people who put trailing slashes in PATH elements.
22 /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
24 # OSF1 and SCO ODT 3.0 have their own names for install.
25 for ac_prog in ginstall installbsd scoinst install; do
26 if test -f $ac_dir/$ac_prog; then
27 if test $ac_prog = install &&
28 grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then
29 # AIX install. It has an incompatible calling convention.
30 # OSF/1 installbsd also uses dspmsg, but is usable.
33 if test $ac_prog = installbsd &&
34 grep src/bos $ac_dir/$ac_prog >/dev/null 2>&1; then
35 # AIX installbsd doesn't work without option "-g".
38 cl_cv_path_install="$ac_dir/$ac_prog -c"
48 # As a last resort, use cp.
49 test -z "$cl_cv_path_install" && cl_cv_path_install="cp"
51 INSTALL="$cl_cv_path_install"
53 dnl We do special magic for INSTALL instead of AC_SUBST, to get
54 dnl relative paths right.
55 AC_MSG_RESULT($INSTALL)
57 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
58 # It thinks the first close brace ends the variable substitution.
59 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='$(INSTALL)'
60 AC_SUBST(INSTALL_PROGRAM)dnl
61 if test -z "$INSTALL_DATA"; then
63 cp | */cp ) INSTALL_DATA='$(INSTALL)' ;;
64 * ) INSTALL_DATA='$(INSTALL) -m 644' ;;
67 AC_SUBST(INSTALL_DATA)dnl