automake-patches
[Top][All Lists]
Advanced

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

install-sh simplifications


From: Alexandre Duret-Lutz
Subject: install-sh simplifications
Date: 01 Aug 2001 19:27:59 +0200
User-agent: Gnus/5.0808 (Gnus v5.8.8) Emacs/20.7

>>> "Tom" == Tom Tromey <address@hidden> writes:

[...]

 adl> if test -z "$install_sh"; then
 adl> install_sh="$ac_aux_dir/install-sh"
 adl> fi

 Tom> This plan sounds good to me.

Here is a proposal.

Note I've done three more things
1) renamed and moved AC_MISSING_INSTALL_SH as it does not use
   missing any more.
2) used $am_aux_dir to define $install_sh.
   The point is that $install_sh is not usable from a
   subdirectory otherwise.
3) simplified $INSTALL_STRIP_PROGRAM since $install_sh is now
   always absolute.

Actually, I'm not completly sure that 2) and 3) are good.  I
*know* that keeping install_sh in the original form is useless,
since it won't always work.  But I fail to see were
$(install_sh) is used, apart from $INSTALL_STRIP_PROGRAM.  Is
there any need to AC_SUBST(install_sh) at all?  Because if
$(install_sh) is not exported to the user, it doesn't matter
whether it's useful or not :) It can stay relative, and the
actual definition of AM_PROG_INSTALL_STRIP can be kept as is.

I've not tested the AM_PROG_INSTALL_STRIP change yet, I'll do
that at home.

Index: ChangeLog
from  Alexandre Duret-Lutz  <address@hidden>

        * m4/init.m4: Adjust call to AM_PROG_INSTALL_SH.
        * m4/install-sh.m4: New file.
        * m4/missing.m4 (AM_MISSING_INSTALL_SH): Move ...
        * m4/install-sh.m4 (AM_PROG_INSTALL_SH): ... here.  Don't check
        for install.sh any longer, always use install-sh, don't even
        fall back to missing.  Use $am_aux_dir.
        * m4/strip.m4 (AM_PROG_INSTALL_STRIP): Simplify since $install_sh
        is absolute.

Index: m4/Makefile.am
===================================================================
RCS file: /cvs/automake/automake/m4/Makefile.am,v
retrieving revision 1.34
diff -u -r1.34 Makefile.am
--- m4/Makefile.am 2001/07/21 18:35:20 1.34
+++ m4/Makefile.am 2001/08/01 17:02:50
@@ -2,9 +2,9 @@
 
 m4datadir = $(datadir)/aclocal
 m4data_DATA = as.m4 auxdir.m4 ccstdc.m4 cond.m4 depend.m4 depout.m4 \
-dmalloc.m4 error.m4 gcj.m4 header.m4 init.m4 lex.m4 lispdir.m4 make.m4 \
-maintainer.m4 minuso.m4 missing.m4 multi.m4 obstack.m4 protos.m4 \
-ptrdiff.m4 python.m4 regex.m4 sanity.m4 strip.m4 strtod.m4 termios.m4 \
-winsz.m4
+dmalloc.m4 error.m4 gcj.m4 header.m4 init.m4 install-sh.m4 lex.m4 \
+lispdir.m4 make.m4 maintainer.m4 minuso.m4 missing.m4 multi.m4 \
+obstack.m4 protos.m4 ptrdiff.m4 python.m4 regex.m4 sanity.m4 strip.m4 \
+strtod.m4 termios.m4 winsz.m4
 
 EXTRA_DIST = $(m4data_DATA)
Index: m4/Makefile.in
===================================================================
RCS file: /cvs/automake/automake/m4/Makefile.in,v
retrieving revision 1.158
diff -u -r1.158 Makefile.in
--- m4/Makefile.in 2001/07/31 06:09:19 1.158
+++ m4/Makefile.in 2001/08/01 17:02:50
@@ -70,10 +70,10 @@
 
 m4datadir = $(datadir)/aclocal
 m4data_DATA = as.m4 auxdir.m4 ccstdc.m4 cond.m4 depend.m4 depout.m4 \
-dmalloc.m4 error.m4 gcj.m4 header.m4 init.m4 lex.m4 lispdir.m4 make.m4 \
-maintainer.m4 minuso.m4 missing.m4 multi.m4 obstack.m4 protos.m4 \
-ptrdiff.m4 python.m4 regex.m4 sanity.m4 strip.m4 strtod.m4 termios.m4 \
-winsz.m4
+dmalloc.m4 error.m4 gcj.m4 header.m4 init.m4 install-sh.m4 lex.m4 \
+lispdir.m4 make.m4 maintainer.m4 minuso.m4 missing.m4 multi.m4 \
+obstack.m4 protos.m4 ptrdiff.m4 python.m4 regex.m4 sanity.m4 strip.m4 \
+strtod.m4 termios.m4 winsz.m4
 
 
 EXTRA_DIST = $(m4data_DATA)
Index: m4/init.m4
===================================================================
RCS file: /cvs/automake/automake/m4/init.m4,v
retrieving revision 1.30
diff -u -r1.30 init.m4
--- m4/init.m4 2001/07/27 00:02:43 1.30
+++ m4/init.m4 2001/08/01 17:02:51
@@ -70,7 +70,7 @@
 AM_MISSING_PROG(AUTOHEADER, autoheader)
 AM_MISSING_PROG(MAKEINFO, makeinfo)
 AM_MISSING_PROG(AMTAR, tar)
-AM_MISSING_INSTALL_SH
+AM_PROG_INSTALL_SH
 AM_PROG_INSTALL_STRIP
 # We need awk for the "check" target.  The system "awk" is bad on
 # some platforms.
Index: m4/install-sh.m4
===================================================================
RCS file: install-sh.m4
diff -N install-sh.m4
--- /dev/null   Tue May  5 13:32:27 1998
+++ m4/install-sh.m4 Wed Aug 1 10:02:51 2001
@@ -0,0 +1,7 @@
+# AM_PROG_INSTALL_SH
+# ------------------
+# Define $install_sh.
+AC_DEFUN([AM_PROG_INSTALL_SH],
+[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
+install_sh=${install_sh-"$am_aux_dir/install-sh"}
+AC_SUBST(install_sh)])
Index: m4/missing.m4
===================================================================
RCS file: /cvs/automake/automake/m4/missing.m4,v
retrieving revision 1.17
diff -u -r1.17 missing.m4
--- m4/missing.m4 2001/08/01 16:23:55 1.17
+++ m4/missing.m4 2001/08/01 17:02:51
@@ -12,25 +12,6 @@
 AC_SUBST($1)])
 
 
-# AM_MISSING_INSTALL_SH
-# ---------------------
-# Like AM_MISSING_PROG, but only looks for install-sh.
-AC_DEFUN([AM_MISSING_INSTALL_SH],
-[AC_REQUIRE([AM_MISSING_HAS_RUN])
-if test -z "$install_sh"; then
-   for install_sh in "$ac_aux_dir/install-sh" \
-                     "$ac_aux_dir/install.sh" \
-                     "${am_missing_run}${ac_aux_dir}/install-sh";
-   do
-     test -f "$install_sh" && break
-   done
-   # FIXME: an evil hack: we remove the SHELL invocation from
-   # install_sh because automake adds it back in.  Sigh.
-   install_sh=`echo $install_sh | sed -e 's/\${SHELL}//'`
-fi
-AC_SUBST(install_sh)])
-
-
 # AM_MISSING_HAS_RUN
 # ------------------
 # Define MISSING if not defined so far and test if it supports --run.
Index: m4/strip.m4
===================================================================
RCS file: /cvs/automake/automake/m4/strip.m4,v
retrieving revision 1.3
diff -u -r1.3 strip.m4
--- m4/strip.m4 2001/05/18 01:14:53 1.3
+++ m4/strip.m4 2001/08/01 17:02:51
@@ -6,7 +6,6 @@
 # always use install-sh in `make install-strip', and initialize
 # STRIPPROG with the value of the STRIP variable (set by the user).
 AC_DEFUN([AM_PROG_INSTALL_STRIP],
-[AC_REQUIRE([AM_MISSING_INSTALL_SH])dnl
-_am_dirpart="`echo $install_sh | sed -e 's,//*[[^/]]*$,,'`"
-INSTALL_STRIP_PROGRAM="\${SHELL} \`CDPATH=: && cd $_am_dirpart && 
pwd\`/install-sh -c -s"
+[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
+INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s"
 AC_SUBST([INSTALL_STRIP_PROGRAM])])

-- 
Alexandre Duret-Lutz




reply via email to

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