-
Notifications
You must be signed in to change notification settings - Fork 13
Expand file tree
/
Copy pathScriptRunner
More file actions
executable file
·128 lines (104 loc) · 2.41 KB
/
ScriptRunner
File metadata and controls
executable file
·128 lines (104 loc) · 2.41 KB
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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
#! /usr/bin/env -i /bin/ksh
# KSH is the one shell language I know really well.
# Copyright (c) 2015-2020 David Hoerl, all rights reserved
#
# I needed to clean the environment - some Xcode defines were messing up the build (this as of Xcode 6)
# above from http://crashingdaily.wordpress.com/2008/03/07/clearing-environment-variables-in-bash-scripts/ (Search on Gordon)
# and http://unix.stackexchange.com/questions/48994/how-to-run-a-program-in-a-clean-environment-in-bash
PWD=$(pwd)
export PATH="${PWD}:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
#echo $PATH
#if you want to see every command execute, remove the # below as "set -x" causes a lot of helpful output
#set -x
date
# Read in the user selected variables
. ./ScriptVariables
# set
# Now lets get the source
FETCH=""
VERSION=""
if [ -f ./libjpeg-turbo/VERSION ]
then
VERSION=$(cat ./libjpeg-turbo/VERSION)
fi
if [ -d ./libjpeg-turbo ]
then
if [[ ${TURBO_VERSION} == "master" ]]
then
if [[ ${VERSION} == "master" ]]
then
cd ./libjpeg-turbo
git pull origin master # update
cd ..
else
FETCH=" "
fi
else
# user selected a numbered release
if [[ ${TURBO_VERSION} != ${VERSION} ]]
then
FETCH="-b${TURBO_VERSION}"
echo "Cloning version ${TURBO_VERSION}"
else
echo "Using version $(cat ./libjpeg-turbo/VERSION)"
fi
fi
else
if [[ ${TURBO_VERSION} == "master" ]]
then
FETCH=" "
else
FETCH="-b${TURBO_VERSION}"
fi
fi
if [[ ${FETCH} != "" ]]
then
rm -rf ./libjpeg-turbo
git clone ${FETCH} https://github.com/libjpeg-turbo/libjpeg-turbo.git
echo ${TURBO_VERSION} > ./libjpeg-turbo/VERSION
# just do this once
cd libjpeg-turbo
date >> ../Log.configure
cd ..
fi
# Go into the source dir
cd libjpeg-turbo
../buildIOS
if [[ -f build/libturbojpeg.a ]]
then
cp -f build/libturbojpeg.a /tmp/ios.a
else
echo "BUILD FAILED"
exit 1
fi
rm -rf build
if [[ -f /usr/local/bin/yasm ]]
then
# builds the C only version
echo "Building SIMD version of the Simulator slice"
../buildSIM_SIMD
else
# builds the C only version
echo "Building C version of the Simulator slice"
../buildSIM_C
fi
if [[ -f build/libturbojpeg.a ]]
then
cp -f build/libturbojpeg.a /tmp/sim.a
else
echo "BUILD FAILED"
exit 1
fi
rm -rf build
# ... now pop out
cd ..
rm -f libturbojpeg.a
lipo -create /tmp/ios.a /tmp/sim.a -output libturbojpeg.a
if [ $? != "0" ]
then
echo "Lipo failed!"
exit 1
fi
rm /tmp/ios.a /tmp/sim.a
echo "SUCCESS!!!"
exit 0