Problem with using the NDK with other build systems


I am learning Use the NDK with other build systems. Trying to get the example for Autoconf to work. It looks like ./configure --host $TARGET is working as expected. But I get an error while executing make:

arm/filter_neon.S  -fPIC -DPIC -o arm/.libs/filter_neon.o
arm/filter_neon.S:24:17: error: expected string in directive
.section __LLVM,__asm
make[1]: *** [Makefile:1187: arm/filter_neon.lo] Error 1

I am new to Android and Linux. Here is the .sh-file I am using on Ubuntu:

#!/bin/bash -v
# Check out the source.
git clone
cd libpng
# Only choose one of these, depending on your build machine...
#export TOOLCHAIN$NDK/toolchains/llvm/prebuilt/darwin-x86_64
export TOOLCHAIN$NDK/toolchains/llvm/prebuilt/linux-x86_64
# Only choose one of these, depending on your device...
#export TARGETaarch64-linux-android
export TARGETarmv7a-linux-androideabi
#export TARGETi686-linux-android
#export TARGETx86_64-linux-android
# Set this to your minSdkVersion.
export API21
# Configure and build.
export AR$TOOLCHAIN/bin/$TARGET-ar
export AS$TOOLCHAIN/bin/$TARGET-as
export CC$TOOLCHAIN/bin/$TARGET$API-clang
export CXX$TOOLCHAIN/bin/$TARGET$API-clang++
export LD$TOOLCHAIN/bin/$TARGET-ld
export RANLIB$TOOLCHAIN/bin/$TARGET-ranlib
export STRIP$TOOLCHAIN/bin/$TARGET-strip
./configure --host $TARGET

What am I doing wrong, why the tutorial example doesn’t work? Thank you in advance.


There are bug in libpng. Do not use cloning from github. Use released version. There are different link on github

Change this script from official doc and do not clone github repo, just download archive and run this script inside of it.

For me all is working.

Answered By – Alexandr Kirilov

Leave a Comment