forked from lordhoto/ios-toolchain
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build-pkg-config.sh
executable file
·67 lines (53 loc) · 1.91 KB
/
build-pkg-config.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
#!/bin/bash
#
# Copyright (c) 2016 Johannes Schickel <[email protected]>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# NLS nuisances.
LC_ALL=C
export LC_ALL
LANGUAGE=C
export LANGUAGE
VERSION=0.29
TARGETS="arm-apple-darwin9 arm-apple-darwin11"
SOURCE_DIR=`pwd`
BUILD_DIR=build/
if [ -z "PARALLELISM" ]; then
PARALLELISM=2
fi
if [ -z "$IOS_TOOLCHAIN_BASE" ]; then
echo "ERROR: \$IOS_TOOLCHAIN_BASE needs to be set to the path where pkg-config should be installed."
exit 1
fi
IOS_TOOLCHAIN_BASE=`realpath "$IOS_TOOLCHAIN_BASE"`
mkdir -p "$BUILD_DIR"
cd "$BUILD_DIR"
echo "Downloading pkg-config $VERSION sources..."
wget -c -nv --show-progress --progress=bar:force http://pkgconfig.freedesktop.org/releases/pkg-config-$VERSION.tar.gz || exit 1
echo "Preparing soucres..."
tar xf pkg-config-$VERSION.tar.gz || exit 1
cd "pkg-config-$VERSION"
for i in $TARGETS; do
echo "Building pkg-config for $i..."
"./configure" --prefix="$IOS_TOOLCHAIN_BASE/$i/usr" --disable-host-tool &>build.log || exit 1
make -j$PARALLELISM &>build.log || exit 1
make install &>build.log || exit 1
rm -f "$IOS_TOOLCHAIN_BASE/$i/usr/bin/$i-pkg-config"
ln -sr "$IOS_TOOLCHAIN_BASE/$i/usr/bin/pkg-config" "$IOS_TOOLCHAIN_BASE/$i/usr/bin/$i-pkg-config"
make distclean &>build.log || exit 1
done
echo "Removing build directory..."
cd "$SOURCE_DIR"
rm -r "$BUILD_DIR"