forked from pspdev/psplibraries
-
Notifications
You must be signed in to change notification settings - Fork 0
/
libraries.sh
executable file
·55 lines (48 loc) · 1.4 KB
/
libraries.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
#!/bin/bash
## remove $CC and $CXX for configure
unset CC
unset CXX
## Set executable name for libtoolize
if [ "$(uname)" == "Darwin" ]; then
LIBTOOLIZE=glibtoolize
else
LIBTOOLIZE=libtoolize
fi
export LIBTOOLIZE
## Enter the psplibraries directory.
cd "`dirname $0`" || { echo "ERROR: Could not enter the psplibraries directory."; exit 1; }
source common.sh
basepath=$PWD
mkdir -p build || { echo "ERROR: Could not create the build directory."; exit 1; }
test_deps psptoolchain libtool
# If specific steps were requested, run the requested build scripts.
if [ $1 ]; then
buildall=0
list="$@"
# Else, run the all build scripts.
else
buildall=1
list="$(ls -1 $basepath/scripts/*.sh | sed -e "s/.*\///" -e "s/\..*//" | sort)"
fi
faillist=""
for step in $list; do
f=$basepath/scripts/$step.sh
test_deps $step
if [ $? -ne 0 ] || [ $buildall -eq 0 ]; then
if [ -x $f ]; then
cd $basepath/build
bash -c "source ../common.sh; \
set -e; \
basepath=$basepath; \
source $f" || { echo "Failed installing $step!"; faillist="$faillist $step"; }
else
echo "Installation script for $step not found!"
fi
else
echo "$step already installed"
fi
done
echo "Installation finished."
if [ -n "$faillist" ]; then
echo "Failed installing:$faillist"
fi