This repository has been archived by the owner on Feb 5, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathbuild.sh
executable file
·86 lines (76 loc) · 3.04 KB
/
build.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
#!/bin/bash
set -e
export ANDROID_NDK_ROOT=${ANDROID_NDK_ROOT-$PWD/../android-sdk-linux/ndk-bundle/}
# arm or x86
export ARCH=${1-arm}
if [ "$ARCH" = "arm" ] ; then
BUILDCHAIN=arm-linux-androideabi
elif [ "$ARCH" = "arm64" ] ; then
BUILDCHAIN=aarch64-linux-android
elif [ "$ARCH" = "x86" ] ; then
BUILDCHAIN=i686-linux-android
elif [ "$ARCH" = "x86_64" ] ; then
BUILDCHAIN=x86_64-linux-android
fi
LIBTOOL_VERSION=2.4.6
LIBSNDFILE_VERSION=1.0.28
if [ ! -e "ndk-$ARCH" ] ; then
"$ANDROID_NDK_ROOT"/build/tools/make_standalone_toolchain.py --arch="$ARCH" --install-dir="ndk-$ARCH" --api=28
fi
export BUILDROOT=$PWD
export PATH=${BUILDROOT}/ndk-$ARCH/bin:$PATH
export PREFIX=${BUILDROOT}/ndk-$ARCH/sysroot/usr
export PKG_CONFIG_PATH=${PREFIX}/lib/pkgconfig
export CC=${BUILDCHAIN}-gcc
export CXX=${BUILDCHAIN}-g++
export CPPFLAGS="-Dposix_madvise=madvise -DPOSIX_MADV_WILLNEED=MADV_WILLNEED"
export ACLOCAL_PATH=${PREFIX}/share/aclocal
# Fetch external repos
if [ ! -e pulseaudio/bootstrap.sh ] ; then
git submodule init
git submodule update
fi
if [ ! -e libtool-$LIBTOOL_VERSION.tar.gz ] ; then
wget http://ftpmirror.gnu.org/libtool/libtool-$LIBTOOL_VERSION.tar.gz
fi
if [ ! -e libtool-$LIBTOOL_VERSION ] ; then
tar -zxf libtool-$LIBTOOL_VERSION.tar.gz
fi
if [ ! -e "${PREFIX}/lib/libltdl.a" ] ; then
mkdir -p "libtool-build-$ARCH"
pushd "libtool-build-$ARCH"
../libtool-$LIBTOOL_VERSION/configure --host=${BUILDCHAIN} --prefix="${PREFIX}" HELP2MAN=/bin/true MAKEINFO=/bin/true
make
make install
popd
fi
# Now, use updated libtool
export LIBTOOLIZE=${PREFIX}/bin/libtoolize
if [ ! -e libsndfile-$LIBSNDFILE_VERSION.tar.gz ] ; then
wget http://www.mega-nerd.com/libsndfile/files/libsndfile-$LIBSNDFILE_VERSION.tar.gz
fi
if [ ! -e libsndfile-$LIBSNDFILE_VERSION ] ; then
tar -zxf libsndfile-$LIBSNDFILE_VERSION.tar.gz
fi
if [ ! -e "$PKG_CONFIG_PATH/sndfile.pc" ] ; then
mkdir -p "libsndfile-build-$ARCH"
pushd "libsndfile-build-$ARCH"
../libsndfile-$LIBSNDFILE_VERSION/configure --host=${BUILDCHAIN} --prefix="${PREFIX}" --disable-external-libs --disable-alsa --disable-sqlite
# Hack out examples, which doesn't build
perl -pi -e 's/ examples / /g' Makefile
make
make install
popd
fi
pushd pulseaudio
if ! git grep -q SLES; then
git am ../pulseaudio-patches/*
fi
env NOCONFIGURE=1 bash -x ./bootstrap.sh
popd
mkdir -p "pulseaudio-build-$ARCH"
pushd "pulseaudio-build-$ARCH"
../pulseaudio/configure --host=${BUILDCHAIN} --prefix="${PREFIX}" --enable-static --disable-rpath --disable-nls --disable-x11 --disable-oss-wrapper --disable-alsa --disable-esound --disable-waveout --disable-glib2 --disable-gtk3 --disable-gconf --disable-avahi --disable-jack --disable-asyncns --disable-tcpwrap --disable-lirc --disable-dbus --disable-bluez5 --disable-udev --disable-openssl --disable-manpages --disable-samplerate --without-speex --with-database=simple --disable-orc --without-caps --without-fftw --disable-systemd-daemon --disable-systemd-login --disable-systemd-journal --disable-webrtc-aec --disable-tests --disable-neon-opt --disable-gsettings
# --enable-static-bins
make
make install