summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2001-02-18 00:35:19 +0000
committerTom Tromey <tromey@redhat.com>2001-02-18 00:35:19 +0000
commiteb0b15383b024770d3512bb2d82ecaeb4d4616bc (patch)
tree868e6986a5f8ee2eca4784ab4904f745ff64e0fe
parent473d383153733d6fa76d5af745bcc762d6671eee (diff)
downloadautomake-eb0b15383b024770d3512bb2d82ecaeb4d4616bc.tar.gz
2001-02-17 Tom Tromey <tromey@redhat.com>
* automake.in (handle_merge_targets): Use double quotes around setting of INSTALL_STRIP_PROGRAM. * m4/strip.m4 (AM_PROG_INSTALL_STRIP): Set INSTALL_STRIP_PROGRAM to absolute path at runtime. (AM_PROG_STRIP): Don't explicitly test $STRIP. 2001-01-28 Alexandre Duret-Lutz <duret_g@epita.fr> * m4/strip.m4: New file. * m4/Makefile.am (m4data_DATA): Add strip.m4. * m4/init.m4: Call AM_PROG_INSTALL_STRIP. * m4/missing.m4 (AM_AUX_DIR_EXPAND): New function. (AM_MISSING_INSTALL_SH, AM_MISSING_HAS_RUN): Use $am_aux_dir instead of $ac_aux_dir, and require AM_AUX_DIR_EXPAND. * m4/depend.m4 (AM_DEP_TRACK): Likewise. * automake.in (handle_merge_targets): In the install-strip rule, set INSTALL_PROGRAM to INSTALL_STRIP_PROGRAM, and INSTALL_PROGRAM_ENV to INSTALL_STRIP_PROGRAM_ENV; don't use INSTALL_STRIP_FLAG. * progs.am (install-@DIR@PROGRAMS): Adapt to use INSTALL_PROGRAM_ENV, don't use INSTALL_STRIP_FLAG any longer. * header-vars.am (INSTALL_STRIP_FLAG): Remove. (INSTALL_PROGRAM_ENV): New variable.
-rw-r--r--ChangeLog25
-rw-r--r--Makefile.in8
-rw-r--r--aclocal.m472
-rwxr-xr-xautomake.in14
-rwxr-xr-xconfigure139
-rw-r--r--lib/am/progs.am4
-rw-r--r--m4/Makefile.am3
-rw-r--r--m4/Makefile.in11
-rw-r--r--m4/init.m41
-rw-r--r--m4/missing.m424
-rw-r--r--m4/strip.m446
-rw-r--r--progs.am4
-rw-r--r--tests/Makefile.in8
13 files changed, 342 insertions, 17 deletions
diff --git a/ChangeLog b/ChangeLog
index 6be6a38f0..800770308 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,28 @@
+2001-02-17 Tom Tromey <tromey@redhat.com>
+
+ * automake.in (handle_merge_targets): Use double quotes around
+ setting of INSTALL_STRIP_PROGRAM.
+ * m4/strip.m4 (AM_PROG_INSTALL_STRIP): Set INSTALL_STRIP_PROGRAM
+ to absolute path at runtime.
+ (AM_PROG_STRIP): Don't explicitly test $STRIP.
+
+2001-01-28 Alexandre Duret-Lutz <duret_g@epita.fr>
+
+ * m4/strip.m4: New file.
+ * m4/Makefile.am (m4data_DATA): Add strip.m4.
+ * m4/init.m4: Call AM_PROG_INSTALL_STRIP.
+ * m4/missing.m4 (AM_AUX_DIR_EXPAND): New function.
+ (AM_MISSING_INSTALL_SH, AM_MISSING_HAS_RUN): Use $am_aux_dir instead
+ of $ac_aux_dir, and require AM_AUX_DIR_EXPAND.
+ * m4/depend.m4 (AM_DEP_TRACK): Likewise.
+ * automake.in (handle_merge_targets): In the install-strip rule,
+ set INSTALL_PROGRAM to INSTALL_STRIP_PROGRAM, and INSTALL_PROGRAM_ENV
+ to INSTALL_STRIP_PROGRAM_ENV; don't use INSTALL_STRIP_FLAG.
+ * progs.am (install-@DIR@PROGRAMS): Adapt to use INSTALL_PROGRAM_ENV,
+ don't use INSTALL_STRIP_FLAG any longer.
+ * header-vars.am (INSTALL_STRIP_FLAG): Remove.
+ (INSTALL_PROGRAM_ENV): New variable.
+
2001-02-16 Alexandre Duret-Lutz <duret_g@epita.fr>
* automake.in (scan_one_configure_file): Unquote AC_CONFIG_AUX_DIR's
diff --git a/Makefile.in b/Makefile.in
index 17f4deca8..f0f3bc8da 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -59,13 +59,18 @@ PRE_UNINSTALL = :
POST_UNINSTALL = :
@SET_MAKE@
+host_alias = @host_alias@
+host_triplet = @host@
AMDEP = @AMDEP@
AMTAR = @AMTAR@
AWK = @AWK@
DEPDIR = @DEPDIR@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+INSTALL_STRIP_PROGRAM_ENV = @INSTALL_STRIP_PROGRAM_ENV@
MAKEINFO = @MAKEINFO@
PACKAGE = @PACKAGE@
PERL = @PERL@
+STRIP = @STRIP@
VERSION = @VERSION@
_am_include = @_am_include@
install_sh = @install_sh@
@@ -553,7 +558,8 @@ uninstall-am: uninstall-binSCRIPTS uninstall-info \
uninstall: uninstall-recursive
all-am: Makefile $(INFO_DEPS) $(SCRIPTS) $(DATA)
install-strip:
- $(MAKE) $(AM_MAKEFLAGS) INSTALL_STRIP_FLAG=-s install
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM='$(INSTALL_STRIP_PROGRAM)' \
+ INSTALL_PROGRAM_ENV='$(INSTALL_STRIP_PROGRAM_ENV)' install
installdirs: installdirs-recursive
installdirs-am:
$(mkinstalldirs) $(DESTDIR)$(bindir) $(DESTDIR)$(infodir) \
diff --git a/aclocal.m4 b/aclocal.m4
index aa3055efa..10a1adbe1 100644
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -80,6 +80,7 @@ AM_MISSING_PROG(AUTOHEADER, autoheader)
AM_MISSING_PROG(MAKEINFO, makeinfo)
AM_MISSING_PROG(AMTAR, tar)
AM_MISSING_INSTALL_SH
+AM_PROG_INSTALL_STRIP
# We need awk for the "check" target. The system "awk" is bad on
# some platforms.
AC_REQUIRE([AC_PROG_AWK])dnl
@@ -190,6 +191,77 @@ else
fi
])
+# AM_AUX_DIR_EXPAND
+
+# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
+# $ac_aux_dir to ${srcdir}/foo. In other projects, it is set to `.'.
+# Of course, Automake must honor this variable whenever it call a tool
+# from the auxiliary directory. The problem is that $srcdir (hence
+# $ac_aux_dir) can be either an absolute path or a path relative to
+# $top_srcdir or absolute, this depends on how configure is run. This
+# is pretty anoying since it makes $ac_aux_dir quite unusable in
+# subdirectories: on the top source directory, any form will work
+# fine, but in subdirectories relative pat needs to be adapted.
+# - calling $top_srcidr/$ac_aux_dir/missing would success if $srcdir is
+# relative, but fail if $srcdir is absolute
+# - conversly, calling $ax_aux_dir/missing would fail if $srcdir is
+# absolute, and success on relative paths.
+#
+# Consequently, we define and use $am_aux_dir, the "always absolute"
+# version of $ac_aux_dir.
+
+AC_DEFUN([AM_AUX_DIR_EXPAND], [
+# expand $ac_aux_dir to an absolute path
+am_aux_dir=`CDPATH=:; cd $ac_aux_dir && pwd`
+])
+
+# One issue with vendor `install' (even GNU) is that you can't
+# specify the program used to strip binaries. This is especially
+# annoying in cross=compiling environments, where the build's strip
+# is unlikely to handle the host's binaries.
+# Fortunately install-sh will honor a STRIPPROG variable, so if we ever
+# need to use a non standard strip, we just have to make sure we use
+# install-sh with the STRIPPROG variable set.
+AC_DEFUN([AM_PROG_INSTALL_STRIP],
+[AC_REQUIRE([AM_MISSING_INSTALL_SH])
+dnl Don't test for $cross_compiling = yes, it might be `maybe'...
+if test "$cross_compiling" != no; then
+ # since we are cross-compiling, we need to check for a suitable `strip'
+ AM_PROG_STRIP
+ if test -z "$STRIP"; then
+ AC_MSG_WARN([strip missing, install-strip will not strip binaries])
+ fi
+fi
+
+# If $STRIP is defined (either by the user, or by AM_PROG_STRIP),
+# instruct install-strip to use install-sh and the given $STRIP program.
+# Otherwise, just use ${INSTALL}: the idea is to use the vendor install
+# as much as possible, because it's faster.
+if test -z "$STRIP"; then
+ # The top level make will set INSTALL_PROGRAM=$(INSTALL_STRIP_PROGRAM)
+ # and the double dolard below is there to make sure that ${INSTALL}
+ # is substitued in the sub-makes, not at the top-level; this is
+ # needed if ${INSTALL} is a relative path (ajusted in each subdirectory
+ # by config.status).
+ INSTALL_STRIP_PROGRAM='$${INSTALL} -s'
+ INSTALL_STRIP_PROGRAM_ENV=''
+else
+ _am_dirpart="`echo $install_sh | sed -e 's,//*[[^/]]*$,,'`"
+ INSTALL_STRIP_PROGRAM="\${SHELL} \`cd $_am_dirpart && pwd\`/install-sh -c -s"
+ INSTALL_STRIP_PROGRAM_ENV="STRIPPROG='$STRIP'"
+fi
+AC_SUBST([INSTALL_STRIP_PROGRAM])
+AC_SUBST([INSTALL_STRIP_PROGRAM_ENV])])
+
+AC_DEFUN([AM_PROG_STRIP],
+[# Check for `strip', unless the installer
+# has set the STRIP environment variable.
+# Note: don't explicitly check for -z "$STRIP" here because
+# that will cause problems if AC_CANONICAL_* is AC_REQUIREd after
+# this macro, and anyway it doesn't have an effect anyway.
+AC_CHECK_TOOL([STRIP],[strip])
+])
+
# serial 3
# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
diff --git a/automake.in b/automake.in
index 51187fae8..81a339a56 100755
--- a/automake.in
+++ b/automake.in
@@ -3719,10 +3719,18 @@ sub handle_merge_targets
&do_one_merge_target ('all', @all);
- # Generate the new 'install-strip' target. We can't just set
- # INSTALL_PROGRAM because that might be a relative path.
+ # Generate the new 'install-strip' target. (If you ever modify
+ # this, keep in mind that INSTALL_PROGRAM is used in
+ # subdirectories, so never set it to a value relative to
+ # the top directory.)
$output_rules .= ("install-strip:\n\t"
- . '$(MAKE) $(AM_MAKEFLAGS) INSTALL_STRIP_FLAG=-s install'
+ . '$(MAKE) $(AM_MAKEFLAGS) '
+ # Use double quotes here because we might need
+ # to interpolate some backquotes at runtime.
+ . "INSTALL_PROGRAM=\"\$(INSTALL_STRIP_PROGRAM)\" "
+ . "\\\n\t "
+ . "INSTALL_PROGRAM_ENV='\$(INSTALL_STRIP_PROGRAM_ENV)' "
+ . 'install'
. "\n");
&depend ('.PHONY', 'install-strip');
}
diff --git a/configure b/configure
index 6fb1dd9e9..296f3ed0a 100755
--- a/configure
+++ b/configure
@@ -544,6 +544,51 @@ ac_config_guess=$ac_aux_dir/config.guess
ac_config_sub=$ac_aux_dir/config.sub
ac_configure=$ac_aux_dir/configure # This should be Cygnus configure.
+
+# Make sure we can run config.sub.
+if ${CONFIG_SHELL-/bin/sh} $ac_config_sub sun4 >/dev/null 2>&1; then :
+else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
+fi
+
+echo $ac_n "checking host system type""... $ac_c" 1>&6
+echo "configure:555: checking host system type" >&5
+
+host_alias=$host
+case "$host_alias" in
+NONE)
+ case $nonopt in
+ NONE)
+ if host_alias=`${CONFIG_SHELL-/bin/sh} $ac_config_guess`; then :
+ else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; }
+ fi ;;
+ *) host_alias=$nonopt ;;
+ esac ;;
+esac
+
+host=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $host_alias`
+host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
+host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
+host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+echo "$ac_t""$host" 1>&6
+
+echo $ac_n "checking build system type""... $ac_c" 1>&6
+echo "configure:576: checking build system type" >&5
+
+build_alias=$build
+case "$build_alias" in
+NONE)
+ case $nonopt in
+ NONE) build_alias=$host_alias ;;
+ *) build_alias=$nonopt ;;
+ esac ;;
+esac
+
+build=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $build_alias`
+build_cpu=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
+build_vendor=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
+build_os=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+echo "$ac_t""$build" 1>&6
+
# 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:
@@ -556,7 +601,7 @@ ac_configure=$ac_aux_dir/configure # This should be Cygnus configure.
# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
# ./install, which can be erroneously created by make from ./install.sh.
echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
-echo "configure:560: checking for a BSD compatible install" >&5
+echo "configure:605: checking for a BSD compatible install" >&5
if test -z "$INSTALL"; then
if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -609,7 +654,7 @@ test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6
-echo "configure:613: checking whether build environment is sane" >&5
+echo "configure:658: checking whether build environment is sane" >&5
# Just in case
sleep 1
echo timestamp > conftest.file
@@ -676,12 +721,18 @@ else
echo "configure: warning: ${am_backtick}missing' script is too old or missing" 1>&2
fi
+if test $host != $build; then
+ ac_tool_prefix=${host_alias}-
+else
+ ac_tool_prefix=
+fi
+
for ac_prog in gawk mawk nawk awk
do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:685: checking for $ac_word" >&5
+echo "configure:736: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_AWK'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -711,7 +762,7 @@ test -n "$AWK" && break
done
echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
-echo "configure:715: checking whether ${MAKE-make} sets \${MAKE}" >&5
+echo "configure:766: checking whether ${MAKE-make} sets \${MAKE}" >&5
set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -833,6 +884,71 @@ if test -z "$install_sh"; then
install_sh=`echo $install_sh | sed -e 's/\${SHELL}//'`
fi
+
+if test "$cross_compiling" != no; then
+ # since we are cross-compiling, we need to check for a suitable `strip'
+ # Check for `strip', unless the installer
+# has set the STRIP environment variable.
+# Note: don't explicitly check for -z "$STRIP" here because
+# that will cause problems if AC_CANONICAL_* is AC_REQUIREd after
+# this macro, and anyway it doesn't have an effect anyway.
+# Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
+set dummy ${ac_tool_prefix}strip; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:899: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_STRIP'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ if test -n "$STRIP"; then
+ ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
+else
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
+ ac_dummy="$PATH"
+ for ac_dir in $ac_dummy; do
+ test -z "$ac_dir" && ac_dir=.
+ if test -f $ac_dir/$ac_word; then
+ ac_cv_prog_STRIP="${ac_tool_prefix}strip"
+ break
+ fi
+ done
+ IFS="$ac_save_ifs"
+ test -z "$ac_cv_prog_STRIP" && ac_cv_prog_STRIP="strip"
+fi
+fi
+STRIP="$ac_cv_prog_STRIP"
+if test -n "$STRIP"; then
+ echo "$ac_t""$STRIP" 1>&6
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+
+
+
+ if test -z "$STRIP"; then
+ echo "configure: warning: strip missing, install-strip will not strip binaries" 1>&2
+ fi
+fi
+
+# If $STRIP is defined (either by the user, or by AM_PROG_STRIP),
+# instruct install-strip to use install-sh and the given $STRIP program.
+# Otherwise, just use ${INSTALL}: the idea is to use the vendor install
+# as much as possible, because it's faster.
+if test -z "$STRIP"; then
+ # The top level make will set INSTALL_PROGRAM=$(INSTALL_STRIP_PROGRAM)
+ # and the double dolard below is there to make sure that ${INSTALL}
+ # is substitued in the sub-makes, not at the top-level; this is
+ # needed if ${INSTALL} is a relative path (ajusted in each subdirectory
+ # by config.status).
+ INSTALL_STRIP_PROGRAM='$${INSTALL} -s'
+ INSTALL_STRIP_PROGRAM_ENV=''
+else
+ _am_dirpart="`echo $install_sh | sed -e 's,//*[^/]*$,,'`"
+ INSTALL_STRIP_PROGRAM="\${SHELL} \`cd $_am_dirpart && pwd\`/install-sh -c -s"
+ INSTALL_STRIP_PROGRAM_ENV="STRIPPROG='$STRIP'"
+fi
+
+
# We need awk for the "check" target. The system "awk" is bad on
# some platforms.
@@ -843,7 +959,7 @@ AUTOMAKE="`pwd`/automake --amdir=."
# Extract the first word of "perl", so it can be a program name with args.
set dummy perl; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:847: checking for $ac_word" >&5
+echo "configure:963: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_PERL'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1039,6 +1155,19 @@ s%@AUTOHEADER@%$AUTOHEADER%g
s%@MAKEINFO@%$MAKEINFO%g
s%@AMTAR@%$AMTAR%g
s%@install_sh@%$install_sh%g
+s%@host@%$host%g
+s%@host_alias@%$host_alias%g
+s%@host_cpu@%$host_cpu%g
+s%@host_vendor@%$host_vendor%g
+s%@host_os@%$host_os%g
+s%@build@%$build%g
+s%@build_alias@%$build_alias%g
+s%@build_cpu@%$build_cpu%g
+s%@build_vendor@%$build_vendor%g
+s%@build_os@%$build_os%g
+s%@STRIP@%$STRIP%g
+s%@INSTALL_STRIP_PROGRAM@%$INSTALL_STRIP_PROGRAM%g
+s%@INSTALL_STRIP_PROGRAM_ENV@%$INSTALL_STRIP_PROGRAM_ENV%g
s%@AWK@%$AWK%g
s%@SET_MAKE@%$SET_MAKE%g
s%@AMDEP@%$AMDEP%g
diff --git a/lib/am/progs.am b/lib/am/progs.am
index cbaa75514..6ea889823 100644
--- a/lib/am/progs.am
+++ b/lib/am/progs.am
@@ -26,8 +26,8 @@ install-@DIR@PROGRAMS: $(@DIR@_PROGRAMS)
## lossage if the install program doesn't have a name that libtool
## expects.
f="`echo $$p|sed -e 's/$(EXEEXT)$$//' -e '$(transform)' -e 's/$$/$(EXEEXT)/'`"; \
- echo " @LIBTOOL --mode=install@ $(INSTALL_PROGRAM) $(INSTALL_STRIP_FLAG) $$p $(DESTDIR)$(@NDIR@dir)/$$f"; \
- @LIBTOOL --mode=install@ $(INSTALL_PROGRAM) $(INSTALL_STRIP_FLAG) $$p $(DESTDIR)$(@NDIR@dir)/$$f; \
+ echo " $(INSTALL_PROGRAM_ENV) @LIBTOOL --mode=install@ $(INSTALL_PROGRAM) $$p $(DESTDIR)$(@NDIR@dir)/$$f"; \
+ $(INSTALL_PROGRAM_ENV) @LIBTOOL --mode=install@ $(INSTALL_PROGRAM) $$p $(DESTDIR)$(@NDIR@dir)/$$f; \
else :; fi; \
done
diff --git a/m4/Makefile.am b/m4/Makefile.am
index 88d06f38d..c7421c50c 100644
--- a/m4/Makefile.am
+++ b/m4/Makefile.am
@@ -7,6 +7,7 @@ m4datadir = $(datadir)/aclocal
m4data_DATA = 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 strtod.m4 termios.m4 winsz.m4
+ptrdiff.m4 python.m4 regex.m4 sanity.m4 strip.m4 strtod.m4 termios.m4 \
+winsz.m4
EXTRA_DIST = $(m4data_DATA)
diff --git a/m4/Makefile.in b/m4/Makefile.in
index edafec349..e12ae467f 100644
--- a/m4/Makefile.in
+++ b/m4/Makefile.in
@@ -59,13 +59,18 @@ PRE_UNINSTALL = :
POST_UNINSTALL = :
@SET_MAKE@
+host_alias = @host_alias@
+host_triplet = @host@
AMDEP = @AMDEP@
AMTAR = @AMTAR@
AWK = @AWK@
DEPDIR = @DEPDIR@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+INSTALL_STRIP_PROGRAM_ENV = @INSTALL_STRIP_PROGRAM_ENV@
MAKEINFO = @MAKEINFO@
PACKAGE = @PACKAGE@
PERL = @PERL@
+STRIP = @STRIP@
VERSION = @VERSION@
_am_include = @_am_include@
install_sh = @install_sh@
@@ -78,7 +83,8 @@ m4datadir = $(datadir)/aclocal
m4data_DATA = 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 strtod.m4 termios.m4 winsz.m4
+ptrdiff.m4 python.m4 regex.m4 sanity.m4 strip.m4 strtod.m4 termios.m4 \
+winsz.m4
EXTRA_DIST = $(m4data_DATA)
@@ -161,7 +167,8 @@ uninstall-am: uninstall-m4dataDATA
uninstall: uninstall-am
all-am: Makefile $(DATA)
install-strip:
- $(MAKE) $(AM_MAKEFLAGS) INSTALL_STRIP_FLAG=-s install
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM='$(INSTALL_STRIP_PROGRAM)' \
+ INSTALL_PROGRAM_ENV='$(INSTALL_STRIP_PROGRAM_ENV)' install
installdirs:
$(mkinstalldirs) $(DESTDIR)$(m4datadir)
diff --git a/m4/init.m4 b/m4/init.m4
index 1afd69d2f..43850873c 100644
--- a/m4/init.m4
+++ b/m4/init.m4
@@ -67,6 +67,7 @@ AM_MISSING_PROG(AUTOHEADER, autoheader)
AM_MISSING_PROG(MAKEINFO, makeinfo)
AM_MISSING_PROG(AMTAR, tar)
AM_MISSING_INSTALL_SH
+AM_PROG_INSTALL_STRIP
# We need awk for the "check" target. The system "awk" is bad on
# some platforms.
AC_REQUIRE([AC_PROG_AWK])dnl
diff --git a/m4/missing.m4 b/m4/missing.m4
index 1831f4ee4..9a7545151 100644
--- a/m4/missing.m4
+++ b/m4/missing.m4
@@ -47,3 +47,27 @@ else
AC_MSG_WARN([${am_backtick}missing' script is too old or missing])
fi
])
+
+# AM_AUX_DIR_EXPAND
+
+# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
+# $ac_aux_dir to ${srcdir}/foo. In other projects, it is set to `.'.
+# Of course, Automake must honor this variable whenever it call a tool
+# from the auxiliary directory. The problem is that $srcdir (hence
+# $ac_aux_dir) can be either an absolute path or a path relative to
+# $top_srcdir or absolute, this depends on how configure is run. This
+# is pretty anoying since it makes $ac_aux_dir quite unusable in
+# subdirectories: on the top source directory, any form will work
+# fine, but in subdirectories relative pat needs to be adapted.
+# - calling $top_srcidr/$ac_aux_dir/missing would success if $srcdir is
+# relative, but fail if $srcdir is absolute
+# - conversly, calling $ax_aux_dir/missing would fail if $srcdir is
+# absolute, and success on relative paths.
+#
+# Consequently, we define and use $am_aux_dir, the "always absolute"
+# version of $ac_aux_dir.
+
+AC_DEFUN([AM_AUX_DIR_EXPAND], [
+# expand $ac_aux_dir to an absolute path
+am_aux_dir=`CDPATH=:; cd $ac_aux_dir && pwd`
+])
diff --git a/m4/strip.m4 b/m4/strip.m4
new file mode 100644
index 000000000..2948166a6
--- /dev/null
+++ b/m4/strip.m4
@@ -0,0 +1,46 @@
+# One issue with vendor `install' (even GNU) is that you can't
+# specify the program used to strip binaries. This is especially
+# annoying in cross=compiling environments, where the build's strip
+# is unlikely to handle the host's binaries.
+# Fortunately install-sh will honor a STRIPPROG variable, so if we ever
+# need to use a non standard strip, we just have to make sure we use
+# install-sh with the STRIPPROG variable set.
+AC_DEFUN([AM_PROG_INSTALL_STRIP],
+[AC_REQUIRE([AM_MISSING_INSTALL_SH])
+dnl Don't test for $cross_compiling = yes, it might be `maybe'...
+if test "$cross_compiling" != no; then
+ # since we are cross-compiling, we need to check for a suitable `strip'
+ AM_PROG_STRIP
+ if test -z "$STRIP"; then
+ AC_MSG_WARN([strip missing, install-strip will not strip binaries])
+ fi
+fi
+
+# If $STRIP is defined (either by the user, or by AM_PROG_STRIP),
+# instruct install-strip to use install-sh and the given $STRIP program.
+# Otherwise, just use ${INSTALL}: the idea is to use the vendor install
+# as much as possible, because it's faster.
+if test -z "$STRIP"; then
+ # The top level make will set INSTALL_PROGRAM=$(INSTALL_STRIP_PROGRAM)
+ # and the double dolard below is there to make sure that ${INSTALL}
+ # is substitued in the sub-makes, not at the top-level; this is
+ # needed if ${INSTALL} is a relative path (ajusted in each subdirectory
+ # by config.status).
+ INSTALL_STRIP_PROGRAM='$${INSTALL} -s'
+ INSTALL_STRIP_PROGRAM_ENV=''
+else
+ _am_dirpart="`echo $install_sh | sed -e 's,//*[[^/]]*$,,'`"
+ INSTALL_STRIP_PROGRAM="\${SHELL} \`CDPATH=: && cd $_am_dirpart && pwd\`/install-sh -c -s"
+ INSTALL_STRIP_PROGRAM_ENV="STRIPPROG='$STRIP'"
+fi
+AC_SUBST([INSTALL_STRIP_PROGRAM])
+AC_SUBST([INSTALL_STRIP_PROGRAM_ENV])])
+
+AC_DEFUN([AM_PROG_STRIP],
+[# Check for `strip', unless the installer
+# has set the STRIP environment variable.
+# Note: don't explicitly check for -z "$STRIP" here because
+# that will cause problems if AC_CANONICAL_* is AC_REQUIREd after
+# this macro, and anyway it doesn't have an effect anyway.
+AC_CHECK_TOOL([STRIP],[strip])
+])
diff --git a/progs.am b/progs.am
index cbaa75514..6ea889823 100644
--- a/progs.am
+++ b/progs.am
@@ -26,8 +26,8 @@ install-@DIR@PROGRAMS: $(@DIR@_PROGRAMS)
## lossage if the install program doesn't have a name that libtool
## expects.
f="`echo $$p|sed -e 's/$(EXEEXT)$$//' -e '$(transform)' -e 's/$$/$(EXEEXT)/'`"; \
- echo " @LIBTOOL --mode=install@ $(INSTALL_PROGRAM) $(INSTALL_STRIP_FLAG) $$p $(DESTDIR)$(@NDIR@dir)/$$f"; \
- @LIBTOOL --mode=install@ $(INSTALL_PROGRAM) $(INSTALL_STRIP_FLAG) $$p $(DESTDIR)$(@NDIR@dir)/$$f; \
+ echo " $(INSTALL_PROGRAM_ENV) @LIBTOOL --mode=install@ $(INSTALL_PROGRAM) $$p $(DESTDIR)$(@NDIR@dir)/$$f"; \
+ $(INSTALL_PROGRAM_ENV) @LIBTOOL --mode=install@ $(INSTALL_PROGRAM) $$p $(DESTDIR)$(@NDIR@dir)/$$f; \
else :; fi; \
done
diff --git a/tests/Makefile.in b/tests/Makefile.in
index 361dce757..9868f9d70 100644
--- a/tests/Makefile.in
+++ b/tests/Makefile.in
@@ -59,13 +59,18 @@ PRE_UNINSTALL = :
POST_UNINSTALL = :
@SET_MAKE@
+host_alias = @host_alias@
+host_triplet = @host@
AMDEP = @AMDEP@
AMTAR = @AMTAR@
AWK = @AWK@
DEPDIR = @DEPDIR@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+INSTALL_STRIP_PROGRAM_ENV = @INSTALL_STRIP_PROGRAM_ENV@
MAKEINFO = @MAKEINFO@
PACKAGE = @PACKAGE@
PERL = @PERL@
+STRIP = @STRIP@
VERSION = @VERSION@
_am_include = @_am_include@
install_sh = @install_sh@
@@ -461,7 +466,8 @@ uninstall-am:
uninstall: uninstall-am
all-am: Makefile
install-strip:
- $(MAKE) $(AM_MAKEFLAGS) INSTALL_STRIP_FLAG=-s install
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM='$(INSTALL_STRIP_PROGRAM)' \
+ INSTALL_PROGRAM_ENV='$(INSTALL_STRIP_PROGRAM_ENV)' install
installdirs: