-
Notifications
You must be signed in to change notification settings - Fork 0
/
android-arm64v8.sh
60 lines (50 loc) · 2.14 KB
/
android-arm64v8.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
#!/bin/bash
DIST=aarch64-linux-androideabi22
DST_NAME=sc68
DST_GCC=aarch64-linux-android22-clang
DST_LIBS_DIR=$(pwd)/libs
DST_INCLUDES="-I$DST_LIBS_DIR/portaudio_opensles/portaudio_opensles/include -I$DST_LIBS_DIR/sc68-svn/sc68/file68 -I$DST_LIBS_DIR/sc68-svn/sc68/libsc68"
export TOOLCHAIN=$DST_LIBS_DIR/android-ndk/toolchains/llvm/prebuilt/linux-x86_64/bin
export PATH=$PATH:$TOOLCHAIN
touch $DST_LIBS_DIR/android-ndk/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/lib/aarch64-linux-android/22/libpthread.a
rm -rf libs/_compiled/$DIST
mkdir -p libs/_compiled/$DIST
cd libs/zlib/_build
rm -rf $DIST
mkdir -p $DIST
cd $DIST
CFLAGS="-O2 -fPIC" CC=aarch64-linux-android22-clang ../../zlib/configure --prefix=$DIST --static
make
cp libz.a ../../../_compiled/$DIST/
cd ../../../sc68-svn/_build
rm -rf $DIST
mkdir -p $DIST
cd $DIST
rm -rf as68
mkdir -p as68
cd as68
../../../sc68/as68/configure --host=$DIST --enable-static --disable-shared CC=aarch64-linux-android22-clang
make
sudo make install
cd ..
../../sc68/configure --host=$DIST --without-ao --without-curl --enable-static --disable-shared CC=aarch64-linux-android22-clang CFLAGS="-O2 -fPIC" LDFLAGS="-L/home/djthunder/sc68/libs/zlib/_build/$DIST/"
make
cp libsc68/.libs/libsc68.a ../../../_compiled/$DIST/
cp file68/.libs/libfile68.a ../../../_compiled/$DIST/
cp unice68/.libs/libunice68.a ../../../_compiled/$DIST/
cd ../../..
rm -rf portaudio_opensles/_build/$DIST
mkdir -p portaudio_opensles/_build/$DIST
cd portaudio_opensles/_build/$DIST
../../portaudio_opensles/configure --host=$DIST --enable-static --disable-shared CC=aarch64-linux-android22-clang CFLAGS="-O2 -fPIC" LDFLAGS='-pthread'
make
cp lib/.libs/libportaudio.a ../../../_compiled/$DIST/
cd ../../../../bin
rm -rf $DIST
mkdir -p $DIST
cd $DIST
$DST_GCC -std=c99 -I$DST_LIBS_DIR/android-ndk/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include $DST_INCLUDES -O2 -fPIC -c ../../$DST_NAME"_player.c"
$DST_GCC -s -L$DST_LIBS_DIR/_compiled/$DIST -shared -o lib$DST_NAME.so $DST_NAME"_player.o" -Wl,-Bstatic -lz -lsc68 -lfile68 -lunice68 -lportaudio -Wl,-Bdynamic -lm -lOpenSLES
cd ../..
mkdir -p output/arm64-v8a
cp bin/$DIST/libsc68.so output/arm64-v8a/