profile-configure 834 Bytes
Newer Older
1 2 3 4 5
#!/usr/bin/env bash

profiles=(
	"darwin
		--disable-mtp
6
		--disable-appledevice
7
		--disable-ipod
8
		--disable-daap
9 10 11
		--disable-boo
		--disable-gnome
		--disable-webkit
12
		--disable-youtube
13
		--disable-docs
14 15
		--disable-gio-hardware
		--disable-gio
16 17 18 19 20 21 22 23 24 25 26 27
	"
)

selected_profile=$1; shift

for ((i=0; i<${#profiles[@]}; i++)); do
	profile=(${profiles[$i]})
	if [ "${profile[0]}" = "$selected_profile" ]; then
		configure="./configure"
		for ((j=1; j<${#profile[@]}; j++)); do
			configure="$configure ${profile[$j]}"
		done
28
		if [ -d .git ]; then
29
			configure="$configure"
30
		fi
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46
		echo "Running $configure $@"
		$configure $@
		exit $?
	fi
done

echo "Usage: $0 <profile> [extra configure args]"
echo
echo "  Available profiles:"
echo
for ((i=0; i<${#profiles[@]}; i++)); do
	profile=(${profiles[$i]})
	echo "    ${profile[0]}"
done
echo
exit 1