#!/usr/bin/env bash # Production builds (-O2 -g, no cassert, gcc via configure) for counts.sh. # build.sh = ... e.g. build.sh m=$HOME/src/master p=$HOME/src/patched # Each is built out of tree in $R/b- and installed in $R/i-. # R= default ~/lab-pg/ctr set -uo pipefail R=${R:-$HOME/lab-pg/ctr}; mkdir -p "$R" for arg in "$@"; do n=${arg%%=*} src=$(realpath "${arg#*=}") B=$R/b-$n I=$R/i-$n L=$R/log-$n rm -rf "$B" "$I"; mkdir -p "$B"; cd "$B" || exit 1 "$src/configure" -q --prefix="$I" --without-icu --enable-debug CFLAGS='-O2 -g' \ >"$L.configure" 2>&1 || { echo "$n: configure failed"; exit 1; } make -j8 >"$L.make" 2>&1 || { echo "$n: make failed"; exit 1; } echo "$n: $(env GIT_CONFIG_GLOBAL=/dev/null git -C "$src" log --oneline -1 | cut -c1-60)" echo "$n: warnings=$(grep -c 'warning:' "$L.make")" make -s install >/dev/null 2>&1 && echo "$n: installed $I" done