1#!/bin/sh
2TARGET=$1
3DIR=build-"$TARGET"
4CONFIGURE=do-"$TARGET"-configure
5shift
6
7for p in /opt/*/bin; do
8    PATH="$p":$PATH
9done
10
11mkdir "$DIR"
12trap 'rm -rf "$DIR"' 0 1 15
13(cd "$DIR" || exit 1
14 echo '##################################################'
15 echo '##########' ../scripts/"$CONFIGURE" -Dwerror=true "$@"
16 echo '##################################################'
17 ../scripts/"$CONFIGURE" -Dwerror=true "$@"
18 case $? in
19     0)
20	 echo 'Configuration succeeded'
21	 ;;
22     77)
23	 echo 'Configuration skipped'
24	 exit 0
25	 ;;
26     *)
27	 echo 'Configuration failed with' "$?"
28	 exit 1
29	 ;;
30 esac
31 cat meson-logs/*
32 ninja || exit 1) || exit 1
33