1#!/bin/sh
2
3[ -z "${PREFIX}" ] && PREFIX=/usr
4
5# find root
6cd "$(dirname "$PWD/$0")"
7. ./CONFIG
8
9mkdir -p _work
10cd _work
11
12ccache --help > /dev/null 2>&1
13if [ $? = 0 ]; then
14	[ -z "${CC}" ] && CC=gcc
15	CC="ccache ${CC}"
16	export CC
17fi
18
19#valac --help > /dev/null 2>&1
20#if [ ! $? = 0 ]; then
21	# must install from tarball
22	VV=0.32.0
23	SV=$(echo ${VV}|cut -d . -f 1,2)
24	if [ ! -d vala-${VV} ]; then
25		wget "http://download.gnome.org/sources/vala/${SV}/vala-${VV}.tar.xz"
26		tar xJvf vala-${VV}.tar.xz
27	fi
28	cd vala-${VV} || exit 1
29	./configure --prefix="${PREFIX}" || exit 1
30	make || exit 1
31	sudo make install || exit 1
32	cd ..
33#fi
34
35exit 0
36
37# git install
38
39if [ -d vala ]; then
40	cd vala
41	#sudo make uninstall
42	git pull
43else
44	git clone git://git.gnome.org/vala
45	cd vala
46fi
47sh autogen.sh --prefix="${PREFIX}" && \
48make -j 4 && \
49sudo make install
50cd ..
51