summaryrefslogtreecommitdiff
path: root/profile-configure
blob: 40e7704973efa58c52dda4cc04a035865a4dd20f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#!/usr/bin/env bash

profiles=(
	"darwin
		--disable-mtp
		--disable-appledevice
		--disable-ipod
		--disable-daap
		--disable-boo
		--disable-gnome
		--disable-webkit
		--disable-youtube
		--disable-docs
	"
	"meego
		--enable-meego
		--disable-daap
		--disable-webkit
		--disable-youtube
		--disable-boo
		--disable-ipod
		--disable-docs
	"
)

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
		if [ -d .git ]; then
			configure="$configure"
		fi
		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