@@ -7,10 +7,10 @@ say "we were not able to detect a default value for the configuration variable \$$var. please set this variable to $2 and try again." exit 1 } -test "$out" = "" && { - say "\$out environment variable must be set to your build directory - are you running this script by hand? run ./build.sh in the root directory instead!" +test "$to" = "" && { + say "\$to environment variable must be set to your build directory - are you running this script by hand? run ./build.sh in the root directory instead!" exit 2 } reqpack() { @@ -18,4 +18,47 @@ say "to $2 for libk, install the $1 package and try again" exit 3 fi } + +noimpl() { + say "$1 is not currently implemented on your system. an exciting chance for you to contribute, no?" + exit 1 +} + +timestamp() { date "+%H:%M:%S %A"; } + +scan() { find "$1" -name "$2"; } + +if test "$COLORTERM" != ""; then + announce() { + test "$verbose" = "silent" && return + local cmd="$1"; shift; + local color=225; + case "$cmd" in + rm) color=196;; $asm) color=198;; + $cc) color=213;; ar) color=120;; + ranlib) color=105;; ld) color=216;; + global/build-manpage.sh) color=177;; + $m4) color=207;; + esac + + printf " → [38;5;$color;1m$cmd" + for a in "$@"; do + if test ${a:0:1} = "-"; then + printf " $a"; + else + printf " $a"; + fi + done + echo + } +else + announce() { shift; echo " --> " $@; } +fi + +# the following function is called to report a command invocation +# the person compiling the library. the first argument should be +# an ansi format string; this is used to color-code the tool being +# launched and thus should be different for each one. + +report() { announce $@; $@; }