-
Notifications
You must be signed in to change notification settings - Fork 0
/
updatesdl.sh
executable file
·87 lines (75 loc) · 2.28 KB
/
updatesdl.sh
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
#!/bin/bash
prefixDir=`pwd`/sdl2-x64
# ------------------------------ Functions Start ------------------------------
function cloneSdlRepo {
(hg clone http://hg.libsdl.org/$1 && cd $1 && hg co default && hg pull -u)
}
function pullAndBuildSdlRepo {
echo "
------------------------------------------------------------
Building $1
------------------------------------------------------------"
sleep 1
echo "Updating $1 from repo"
cd $1
hg co default
hg pull -u
./autogen.sh
#rm -rf build
mkdir build
cd build
../configure --prefix=$prefixDir || exit 1
make || exit 1
make install
cd ../..
echo "
------------------------------------------------------------
Finished Building $1
------------------------------------------------------------"
}
# ------------------------------ Functions End ------------------------------
# ------------------------------ Script Start ------------------------------
echo "Performing update of sdl2
"
#echo -n "Removing current library..."
#rm -rf sdl2-x86
mkdir sdl2-x86
#echo " done"
if [ ! -e SDL ] # Just simply check for SDL since all other depend on it
then
echo "SDL Repo not found. Checking out all repositories"
rm -rf SDL SDL_image SDL_mixer SDL_net SDL_ttf
cloneSdlRepo "SDL" &
cloneSdlRepo "SDL_image" &
cloneSdlRepo "SDL_mixer" &
cloneSdlRepo "SDL_ttf" &
cloneSdlRepo "SDL_net"
echo "
# ------------------------------------------------------------
# Waiting for Repo Checkout
# ------------------------------------------------------------"
wait $(jobs -p)
echo "
------------------------------------------------------------
Finished checking out repositories
------------------------------------------------------------"
sleep 1
fi
# SDL BUILD
pullAndBuildSdlRepo "SDL"
export SDL_CONFIG=$prefixDir/bin/sdl2-config
if [ ! -f $SDL_CONFIG ]
then
echo "Did not find sdl2-config"
exit
fi
# Build the rest
pullAndBuildSdlRepo "SDL_image"
pullAndBuildSdlRepo "SDL_mixer"
pullAndBuildSdlRepo "SDL_ttf"
pullAndBuildSdlRepo "SDL_net"
wait $(jobs -p)
echo "
------------------------------------------------------------
Finished Rebuild All Repositories!
------------------------------------------------------------"