-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathandroid_jpegturbo.sh
executable file
·104 lines (90 loc) · 2.09 KB
/
android_jpegturbo.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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
#!/bin/sh
# Set these variables to suit your needs
NDK_PATH="/home/inkpot/dev/android/ndk-bundle"
TOOLCHAIN="clang"
ANDROID_VERSION=21
mkdir -p build
cd build
cmake -G"Unix Makefiles" \
-DANDROID_ABI=armeabi-v7a \
-DANDROID_ARM_MODE=arm \
-DANDROID_PLATFORM=android-${ANDROID_VERSION} \
-DANDROID_TOOLCHAIN=${TOOLCHAIN} \
-DCMAKE_ASM_FLAGS="--target=aarch64-linux-android${ANDROID_VERSION}" \
-DCMAKE_TOOLCHAIN_FILE=${NDK_PATH}/build/cmake/android.toolchain.cmake \
..
make
if [ $? -eq 0 ]
then
echo "ARM build successfull."
cd ..
mkdir -p arm
cp build/libjpeg.so arm/
cp build/libturbojpeg.a arm/
rm -rf build
else
exit 1
fi
mkdir -p build
cd build
cmake -G"Unix Makefiles" \
-DANDROID_ABI=arm64-v8a \
-DANDROID_ARM_MODE=arm \
-DANDROID_PLATFORM=android-${ANDROID_VERSION} \
-DANDROID_TOOLCHAIN=${TOOLCHAIN} \
-DCMAKE_ASM_FLAGS="--target=aarch64-linux-android${ANDROID_VERSION}" \
-DCMAKE_TOOLCHAIN_FILE=${NDK_PATH}/build/cmake/android.toolchain.cmake \
..
make
if [ $? -eq 0 ]
then
echo "ARM 64 build successfull."
cd ..
mkdir -p arm64
cp build/libjpeg.so arm64/
cp build/libturbojpeg.a arm64/
rm -rf build
else
exit 1
fi
mkdir -p build
cd build
cmake -G"Unix Makefiles" \
-DANDROID_ABI=x86 \
-DANDROID_PLATFORM=android-${ANDROID_VERSION} \
-DANDROID_TOOLCHAIN=${TOOLCHAIN} \
-DCMAKE_TOOLCHAIN_FILE=${NDK_PATH}/build/cmake/android.toolchain.cmake \
..
make
if [ $? -eq 0 ]
then
echo "x86 build successfull."
cd ..
mkdir -p x86
cp build/libjpeg.so x86/
cp build/libturbojpeg.a x86/
rm -rf build
else
exit 1
fi
mkdir -p build
cd build
cmake -G"Unix Makefiles" \
-DANDROID_ABI=x86_64 \
-DANDROID_PLATFORM=android-${ANDROID_VERSION} \
-DANDROID_TOOLCHAIN=${TOOLCHAIN} \
-DCMAKE_TOOLCHAIN_FILE=${NDK_PATH}/build/cmake/android.toolchain.cmake \
..
make
if [ $? -eq 0 ]
then
echo "x86_64 build successfull."
cd ..
mkdir -p x86_64
cp build/libjpeg.so x86_64/
cp build/libturbojpeg.a x86_64/
rm -rf build
else
exit 1
fi
echo "Done."