autoconf-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: revamping AC_PROG_INSTALL (Was: common mkinstalldirs?)


From: Akim Demaille
Subject: Re: revamping AC_PROG_INSTALL (Was: common mkinstalldirs?)
Date: 30 Sep 2002 10:20:33 +0200
User-agent: Gnus/5.0808 (Gnus v5.8.8) XEmacs/21.4 (Honest Recruiter)

>>>>> "Bruno" == Bruno Haible <address@hidden> writes:

Bruno> Karl Berry writes:
>> So, perhaps you'd like to consider using the mkinstalldirs from
>> automake, so we'd have a single version out there.

Bruno> Perhaps the autoconf/automake maintainers want to put
Bruno> reasonable indentation into this script. Indentation of 2
Bruno> columns here, 3 columns there..., for 'case' clauses of 2
Bruno> columns here, 0 columns there...  Then I'll feel less disgusted
Bruno> when upgrading this script.  Best would be to use
Bruno> "sh-indentation: 2" like everyone else does.

BTW, do we really want to keep mkinstalldirs?  We had discussed, long
ago, the possibility of using `install' (and intall-sh) only to create
the directories, since pre-creating the directories was a total
nightmare for Automake.

I still have this in Autoconf's TODO:

| ** AC_PROG_INSTALL
| This test should be extended to check that install supports the GNU
| Install syntax: install FILES... DIR.  This will relieve everybody
| form having to use mkinstalldirs to create the directories, as install
| does it itself.  install-sh is already handling this case.  This also
| makes it simple not to create the directories where nothing will be
| installed because of configuration options, which is next to
| impossible using the current setting.
| 
| In other words: everything is ready (install-sh and Automake), we just
| need a good reimplementation of AC_PROG_INSTALL.

As is written, all we need is a good implementation of AC_PROG_INSTALL
that does try to install (currently, it's frightening recipe trying to
grep `install' etc.

| # AC_PROG_INSTALL
| # ---------------
| AN_MAKEVAR([INSTALL], [AC_PROG_INSTALL])
| AN_PROGRAM([install], [AC_PROG_INSTALL])
| AC_DEFUN([AC_PROG_INSTALL],
| [AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
| # Find a good install program.  We prefer a C program (faster),
| # so one script is as good as another.  But avoid the broken or
| # incompatible versions:
| # SysV /etc/install, /usr/sbin/install
| # SunOS /usr/etc/install
| # IRIX /sbin/install
| # AIX /bin/install
| # AmigaOS /C/install, which installs bootblocks on floppy discs
| # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
| # AFS /usr/afsws/bin/install, which mishandles nonexistent args
| # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
| # ./install, which can be erroneously created by make from ./install.sh.
| AC_MSG_CHECKING([for a BSD-compatible install])
| if test -z "$INSTALL"; then
| AC_CACHE_VAL(ac_cv_path_install,
| [_AS_PATH_WALK([$PATH],
| [# Account for people who put trailing slashes in PATH elements.
| case $as_dir/ in
|   ./ | .// | /[cC]/* | \
|   /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \
|   /usr/ucb/* ) ;;
|   *)
|     # OSF1 and SCO ODT 3.0 have their own names for install.
|     # Don't use installbsd from OSF since it installs stuff as root
|     # by default.
|     for ac_prog in ginstall scoinst install; do
|       for ac_exec_ext in '' $ac_executable_extensions; do
|         if AS_EXECUTABLE_P(["$as_dir/$ac_prog$ac_exec_ext"]); then
|           if test $ac_prog = install &&
|             grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
|             # AIX install.  It has an incompatible calling convention.
|             :
|           elif test $ac_prog = install &&
|             grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
|             # program-specific install script used by HP pwplus--don't use.
|             :
|           else
|             ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
|             break 3
|           fi
|         fi
|       done
|     done
|     ;;
| esac])
| ])dnl
|   if test "${ac_cv_path_install+set}" = set; then
|     INSTALL=$ac_cv_path_install
|   else
|     # As a last resort, use the slow shell script.  We don't cache a
|     # path for INSTALL within a source directory, because that will
|     # break other packages using the cache if that directory is
|     # removed, or if the path is relative.
|     INSTALL=$ac_install_sh
|   fi
| fi
| dnl We do special magic for INSTALL instead of AC_SUBST, to get
| dnl relative paths right.
| AC_MSG_RESULT([$INSTALL])
| 
| # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
| # It thinks the first close brace ends the variable substitution.
| test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
| AC_SUBST(INSTALL_PROGRAM)dnl
| 
| test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
| AC_SUBST(INSTALL_SCRIPT)dnl
| 
| test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
| AC_SUBST(INSTALL_DATA)dnl
| ])# AC_PROG_INSTALL




reply via email to

[Prev in Thread] Current Thread [Next in Thread]