简体   繁体   中英

Build script for Android NDK in linux

How can I build my source for android with NDK.
Already I download ndk and I don't know how can I set arch compiler path.

This is my "build-for-android.sh" code:

#!/bin/sh
cairo=system
curl=system
pal=android
alsa=no
pulse=no
sles=yes
ffmpeg=yes
gallium=no
egl=yes
glx=no

PKG_CONFIG_PATH=$MOONLIGHT_PREFIX/lib/pkgconfig
if [ -d /usr/X11/share/aclocal ]; then
  export ACLOCAL_FLAGS="-I /usr/X11/share/aclocal"
fi

./autogen.sh --host=arm-linux-androideabi --prefix=$MOONLIGHT_PREFIX --with-manual-mono=yes --with-testing=no --enable-browser-support --disable-desktop-support --with-unwind=no --with-ffmpeg=$ffmpeg --with-alsa=$alsa --with-pulseaudio=$pulse --with-opensles=$sles --with-pal=$pal --with-curl=$curl --with-cairo=$cairo --with-gallium-path=$gallium --enable-sdk=no --with-egl=$egl --with-glx=$glx CFLAGS="-DPLATFORM_ANDROID -I$MOONLIGHT_PREFIX/include $CFLAGS" LDFLAGS="-L$MOONLIGHT_PREFIX/lib $LDFLAGS" CXXFLAGS="-fno-rtti -DPLATFORM_ANDROID -I$MOONLIGHT_PREFIX/include $CFLAGS"
make $@

when I run it I get error below:

checking for arm-linu-androideabi-g++... no
checking for arm-linu-androideabi-c++... no
checking for arm-linu-androideabi-gpp... no
checking for arm-linu-androideabi-aCC... no
checking for arm-linu-androideabi-cc... no
.
.
.
.

I can see them in ~/Android/android-ndk-r8b/toolchains/arm-linux-androideabi-4.4.3/prebuild/linux-x86/bin/* directory.

OK. I found it.:

First, a standalone toolchain is created to make the configure script easier to use

~$ android-ndk-r5b/build/tools/make-standalone-toolchain.sh --platform=android-8 --install-dir=android-8-toolchain

Next, the toolchain's bin directory is added to the PATH.

~$ export PATH=$PATH:~/android-8-toolchain/bin/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM