libk  Diff

Differences From Artifact [2fb772064d]:

To Artifact [0ffa5553a2]:


     4      4   check() {
     5      5   	var=$1
     6      6   	test "${!var}" == "" || return 0
     7      7   	say "we were not able to detect a default value for the configuration variable \$$var. please set this variable to $2 and try again."
     8      8   	exit 1
     9      9   }
    10     10   
    11         -test "$out" = "" && {
    12         -	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!"
           11  +test "$to" = "" && {
           12  +	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!"
    13     13   	exit 2
    14     14   }
    15     15   
    16     16   reqpack() {
    17     17   	if ! has "$1"; then
    18     18   		say "to $2 for libk, install the $1 package and try again"
    19     19   		exit 3
    20     20   	fi
    21     21   }
           22  +
           23  +noimpl() {
           24  +	say "$1 is not currently implemented on your system. an exciting chance for you to contribute, no?"
           25  +	exit 1
           26  +}
           27  +
           28  +timestamp() { date "+%H:%M:%S %A"; }
           29  +
           30  +scan() { find "$1" -name "$2"; }
           31  +
           32  +if test "$COLORTERM" != ""; then
           33  +	announce() {
           34  +		test "$verbose" = "silent" && return
           35  +		local cmd="$1"; shift;
           36  +		local color=225;
           37  +		case "$cmd" in
           38  +			rm) color=196;; $asm) color=198;;
           39  +			$cc) color=213;; ar) color=120;;
           40  +			ranlib) color=105;; ld) color=216;;
           41  +			global/build-manpage.sh) color=177;;
           42  +			$m4) color=207;;
           43  +		esac
           44  +
           45  +		printf " → [38;5;$color;1m$cmd"
           46  +		for a in "$@"; do
           47  +			if test ${a:0:1} = "-"; then
           48  +				printf " $a";
           49  +			else
           50  +				printf " $a";
           51  +			fi
           52  +		done
           53  +		echo
           54  +	}
           55  +else
           56  +	announce() { shift; echo " --> " $@; }
           57  +fi
           58  +
           59  +# the following function is called to report a command invocation
           60  +# the person compiling the library. the first argument should be
           61  +# an ansi format string; this is used to color-code the tool being
           62  +# launched and thus should be different for each one.
           63  +
           64  +report() { announce $@; $@; }