I'd like to move the "-c" argument usually attached to the end of the
definition of "INSTALL" over to those "INSTALL_*" macros that need it.

This has bugged me for a long time and I finally encountered a real
situation where I couldn't easily hack around the problem.

It turns out that some versions of *BSD "install" (aka xinstall.c in the
4.4bsd distribution) don't allow '-c' and '-d' at the same time (and
strictly speaking none should).  I tripped over this most recently in
NetBSD-1.3.3, but it no doubt has existed at times elsewhere.  The
-current source for NetBSD now allows this combination and basically
ignores the '-c' when '-d' is used.

So while this won't be a direct issue for me for very much longer (as I
gradually migrate all the machines I support onto newer releases), I
suspect it's not an entirely rare problem.

Of course this crops up because some authors using Autoconf (and
Automake) have the (good, in my opinion) habit of using "install -d" to
create new directories (instead of 'mkdir').

The one issue with this is that the '-c' flag may not be welcome with
100% of all "install" programs that are otherwise usable with GNU
makefiles.  If this turns out to be a problem I think the best
alternative would be to add a new macro called "INSTALL_DIR" which could
then be set to "install-sh -d" if necessary or left as "install" but
which would not have the "-c" added and to encourage developers to fix
their packages to use "INSTALL_DIR" when necessary.

(BTW, once upon a time "install -d" was more than just a good thing
because "mkdir -p" didn't exist....)

Index: acspecific.m4
===================================================================
RCS file: /cvs/autoconf/acspecific.m4,v
retrieving revision 1.272
diff -c -c -r1.272 acspecific.m4
*** acspecific.m4       2000/05/28 16:27:56     1.272
--- acspecific.m4       2000/06/01 04:25:38
***************
*** 196,202 ****
  # ---------------
  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
--- 196,202 ----
  # ---------------
  AC_DEFUN([AC_PROG_INSTALL],
  [AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
! # Find a good install program.  We prefer a C program (faster and safer),
  # so one script is as good as another.  But avoid the broken or
  # incompatible versions:
  # SysV /etc/install, /usr/sbin/install
***************
*** 230,236 ****
            # program-specific install script used by HP pwplus--don't use.
            :
          else
!           ac_cv_path_install="$ac_dir/$ac_prog -c"
            break 2
          fi
        fi
--- 230,236 ----
            # program-specific install script used by HP pwplus--don't use.
            :
          else
!           ac_cv_path_install="$ac_dir/$ac_prog"
            break 2
          fi
        fi
***************
*** 256,268 ****
  
  # 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
  
--- 256,268 ----
  
  # 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} -c'
  AC_SUBST(INSTALL_PROGRAM)dnl
  
! test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL} -c'
  AC_SUBST(INSTALL_SCRIPT)dnl
  
! test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -c -m 644'
  AC_SUBST(INSTALL_DATA)dnl
  ])# AC_PROG_INSTALL
  

-- 
                                                        Greg A. Woods

+1 416 218-0098      VE3TCP      <[EMAIL PROTECTED]>      <robohack!woods>
Planix, Inc. <[EMAIL PROTECTED]>; Secrets of the Weird <[EMAIL PROTECTED]>

Reply via email to