From 5be845448074b94c9a346c6b53e022403fe5f59e Mon Sep 17 00:00:00 2001 From: Werner Koch Date: Thu, 9 Jan 2014 19:14:09 +0100 Subject: [PATCH] autogen.sh: Add envvar AUTOGEN_SH_SILENT -- --- autogen.sh | 50 +++++++++++++++++++++++++++++++++++--------------- 1 file changed, 35 insertions(+), 15 deletions(-) diff --git a/autogen.sh b/autogen.sh index 05ed1f2b7..712e070d3 100755 --- a/autogen.sh +++ b/autogen.sh @@ -28,6 +28,13 @@ check_version () { return 1 } +info () { + if [ -z "${SILENT}" ]; then + echo "autogen.sh:" $* + fi +} + + # Allow to override the default tool names AUTOCONF=${AUTOCONF_PREFIX}${AUTOCONF:-autoconf}${AUTOCONF_SUFFIX} AUTOHEADER=${AUTOCONF_PREFIX}${AUTOHEADER:-autoheader}${AUTOCONF_SUFFIX} @@ -40,13 +47,22 @@ MSGMERGE=${GETTEXT_PREFIX}${MSGMERGE:-msgmerge}${GETTEXT_SUFFIX} DIE=no FORCE= +SILENT= tmp=`dirname $0` tsdir=`cd "$tmp"; pwd` +if [ -n "${AUTOGEN_SH_SILENT}" ]; then + SILENT=" --silent" +fi +if test x"$1" = x"--help"; then + echo "usage: ./autogen.sh [--force] [--build-TYPE] [ARGS]" + exit 0 +fi if test x"$1" = x"--force"; then FORCE=" --force" shift fi + # Reject unsafe characters in $HOME, $tsdir and cwd. We consider spaces # as unsafe because it is too easy to get scripts wrong in this regard. am_lf=' @@ -81,7 +97,7 @@ amd64_toolprefixes= #amd64root= if [ -f "$HOME/.gnupg-autogen.rc" ]; then - echo "sourcing extra definitions from $HOME/.gnupg-autogen.rc" + info "sourcing extra definitions from $HOME/.gnupg-autogen.rc" . "$HOME/.gnupg-autogen.rc" fi @@ -134,7 +150,7 @@ if [ "$myhost" = "w32" ]; then extraoptions="--enable-gpgtar $w32_extraoptions" ;; esac - echo "Using $w32root as standard install directory" >&2 + info "Using $w32root as standard install directory" # Locate the cross compiler crossbindir= @@ -162,7 +178,8 @@ if [ "$myhost" = "w32" ]; then fi fi - $tsdir/configure --enable-maintainer-mode --prefix=${w32root} \ + $tsdir/configure --enable-maintainer-mode ${SILENT} \ + --prefix=${w32root} \ --host=${host} --build=${build} \ --with-gpg-error-prefix=${w32root} \ --with-ksba-prefix=${w32root} \ @@ -189,7 +206,7 @@ if [ "$myhost" = "amd64" ]; then build=`$tsdir/scripts/config.guess` [ -z "$amd64root" ] && amd64root="$HOME/amd64root" - echo "Using $amd64root as standard install directory" >&2 + info "Using $amd64root as standard install directory" toolprefixes="$amd64_toolprefixes x86_64-linux-gnu amd64-linux-gnu" @@ -215,7 +232,8 @@ if [ "$myhost" = "amd64" ]; then fi fi - $tsdir/configure --enable-maintainer-mode --prefix=${amd64root} \ + $tsdir/configure --enable-maintainer-mode ${SILENT} \ + --prefix=${amd64root} \ --host=${host} --build=${build} \ --with-gpg-error-prefix=${amd64root} \ --with-ksba-prefix=${amd64root} \ @@ -278,42 +296,44 @@ fi # Check the git setup. if [ -d .git ]; then + CP="cp -a" + [ -z "${SILENT}" ] && CP="$CP -v" if [ -f .git/hooks/pre-commit.sample -a ! -f .git/hooks/pre-commit ] ; then - cat <&2 + [ -z "${SILENT}" ] && cat <&2 + info "*** Adding GIT filter.cleanpo.clean configuration." git config --add filter.cleanpo.clean \ "awk '/^\"POT-Creation-Date:/&&!s{s=1;next};!/^#: /{print}'" fi if [ -f scripts/git-hooks/commit-msg -a ! -f .git/hooks/commit-msg ] ; then - cat <&2 + [ -z "${SILENT}" ] && cat <