forked from rshimoda/icu4darwin
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathhelper.sh
executable file
·71 lines (49 loc) · 1.33 KB
/
helper.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
#!/bin/sh
function build {
# $1: architecture
# $2: host triple
# $3: sdk name
# $4: deployment target name
unset CXX
unset CC
unset CFLAGS
unset CXXFLAGS
unset LDFLAGS
source "$PWD/../prefix.sh"
ARCH=$1
HOST=$2
SDK=$3
TARGET=$4
echo "-- Building ${ARCH} (host ${HOST}) on ${SDK} for ${TARGET}"
SDKROOT=$(xcrun --sdk ${SDK} --show-sdk-path)
export BUILD_DIR="${PWD}/build-${ARCH}-${SDK}"
export ADDITION_FLAG="-DIOS_SYSTEM_FIX"
export CFLAGS="-isysroot ${SDKROOT} ${CFLAGS} -target ${TARGET} ${ADDITION_FLAG}"
export CXXFLAGS="-isysroot ${SDKROOT} ${CXXFLAGS} -stdlib=libc++ -target ${TARGET} ${ADDITION_FLAG}"
export LDFLAGS="-isysroot ${SDKROOT} -stdlib=libc++ -Wl,-dead_strip -lstdc++ -target ${TARGET} ${ADDITION_FLAG}"
echo "CFLAGS: "$CFLAGS
echo "CXXFLAGS: "$CXXFLAGS
echo "LDFLAGS: "$LDFLAGS
mkdir -p ${BUILD_DIR}
cd ${BUILD_DIR}
if [ -z ${FILTER+x} ]; then
echo "No filters"
else
echo "Using filters ${FILTER}"
export ICU_DATA_FILTER_FILE="${FILTER}"
fi
${ICU_SOURCE}/configure --host=${HOST} --with-cross-build=${PREBUILD} ${CONFIG_PREFIX}
make clean
make -j`sysctl -n hw.ncpu`
# make install
cd ..
}
function combineICULibraries {
# $1: working directory
# $2: output library name
initialWD=${PWD}
cd $1/lib/
echo "-- Generating static library $2"
libtool -o $2.a libicudata.a libicui18n.a libicuuc.a
cd $initialWD
}