summaryrefslogtreecommitdiff
path: root/TINDERBOX
blob: 4e4e66b5ba2170547756584ed2a13caa06baae9f (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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
#!/bin/bash

PREFIX=/opt/X11R7.5
XORG=$PWD

usage() {
        scriptname=`basename $0`
	echo << USAGE
$0 [--restart] [<prefix>]

$scriptname is a script to build all X.Org modules into the"
specified prefix (default: $PREFIX).

If started without options, scriptname continues from the last"
built-modules. The list of already build modules is stored"
in $XORG/built.modules.

$scriptname must be run from the base of the supermodule.

Options:
 --restart ... wipes the prefix before starting.
USAGE
}


while test $# != 0; do
	case $1 in
	--restart)
		WIPE=1
		;;
        -*)
		usage $0
		exit
		;;
        *)
                PREFIX="$1"
                ;;
	esac
	shift
done



if ! test -d $XORG; then
	mkdir -p $XORG
fi

# First run? Init submodule and symlink extras for build.sh
for file in extras/*; do
    if ! test -e ${file/extras\/}; then
        ln -s $file
    fi
done

if ! test -d $XORG/util/modular; then
	git clone git://anongit.freedesktop.org/git/xorg/util/modular $XORG/util/modular
fi

if ! test -e $XORG/built.modules; then
        WIPE=1
fi

if test -z "$WIPE"; then
	CONTCMD="-r `tail -n 1 $XORG/built.modules`"
else
	echo -n "Wiping $PREFIX... (5 seconds to cancel)"
	sleep 5
	rm -rf "$PREFIX/*"
	if test -e $XORG/built.modules; then
	    rm $XORG/built.modules
	fi
	echo "... done"
fi

git config --global user.email > /dev/null
if test $? -ne 0; then
	git config --global user.email "tinderbox@tinder.box"
	git config --global user.name "Tinderbox user"
fi

export PKG_CONFIG_PATH=$PREFIX/lib/pkgconfig
export ACLOCAL="aclocal -I $PREFIX/share/aclocal"
export LD_LIBRARY_PATH=$PREFIX/lib

echo "Updating util/modular"
cd $XORG/util/modular && git pull --rebase origin || exit 1
echo "**************** TINDERBOX BUILD STARTING *****************"
cd $XORG && $XORG/util/modular/build.sh $CONTCMD -f $XORG/built.modules $PREFIX