diff --git a/CHANGES b/CHANGES index b6ba67f..313b4f1 100644 --- a/CHANGES +++ b/CHANGES @@ -1,4 +1,6 @@ 1.17 -> 2.0: + - devzero2000: give some color to autogen.sh + Certainly not so useful but not hurt either. - jbj: i18n: msgmerge (Translation Project). - devzero2000: redo commit 8396019 Useless to have format crap just for conforming diff --git a/autogen.sh b/autogen.sh index 7a18b4f..bc628be 100755 --- a/autogen.sh +++ b/autogen.sh @@ -1,4 +1,5 @@ #!/bin/sh +# # $Id$ # autogen.sh: autogen.sh script for popt projects # @@ -7,17 +8,32 @@ # This program have the same copyright notice as popt # itself # +# Global Function and Variables +# +_PROGNAME="$0" +# +red=; grn=; lgn=; blu=; std=; +test "X$$TERM" != Xdumb \ +&& test -t 1 2>/dev/null \ +&& { \ + red=''; \ + grn=''; \ + lgn=''; \ + blu=''; \ + std=''; \ +} +Die() { + color="$red" + echo "${color}${_PROGNAME}: Error: $@${std}" >&2 + exit 1 +} + +Notice() { + color="$grn" + echo "${color}${_PROGNAME}: $@${std}" +} -# Guess whether we are using configure.ac or configure.in -if test -f configure.ac; then - conffile="configure.ac" -elif test -f configure.in; then - conffile="configure.in" -else - echo "$0: could not find configure.ac or configure.in" - exit 1 -fi # Function Used for ichecking the Version Used for building # @@ -128,18 +144,17 @@ autopoint - gettext 0.17 libtool 1.5.22 " - -echo "$0: Bootstrapping popt build system..." echo - +Notice "Bootstrapping popt build system..." +echo # Guess whether we are using configure.ac or configure.in if test -f configure.ac; then conffile="configure.ac" elif test -f configure.in; then conffile="configure.in" else - echo "$0: could not find configure.ac or configure.in" - exit 1 + Die "could not find configure.ac or configure.in" + echo fi if ! printf "$buildreq" | check_versions; then @@ -162,7 +177,8 @@ case $libtoolize in esac esac if test -z "$libtoolize"; then - echo "$0: libtool not found." + Die "libtool not found." + echo fi find . -name "autom4te.cache" | xargs rm -rf [ ! -d m4 ] && mkdir m4 @@ -175,7 +191,7 @@ ls "$po_dir"/*.po 2>/dev/null | # echo -echo "$0: done. Now you can run './configure'." +Notice "done. Now you can run './configure'." ####################### # End Bootstrapping #######################