[FFmpeg-user] compiling for android

Carl Eugen Hoyos cehoyos at ag.or.at
Wed Jul 9 11:37:52 CEST 2014


Patrick Shirkey <pshirkey <at> boosthardware.com> writes:

> It utilises ./configure too but has additional code 
> which modifies various config files before building

This is one of the reasons why you definitely shouldn't 
use this script.

[...]

> > Why are --extra-cflags needed?
> 
> No specific reason. They worked for the script above 
> without x264 so I was starting from there.

>  ./configure --arch=arm --target-os=linux --cpu=cortex-a8
> --enable-cross-compile \
> --cross-prefix=/4.4/prebuilts/gcc/linux-x86/arm/
> arm-linux-androideabi-4.7/bin/arm-linux-androideabi- \
> --sysroot=/4.4/prebuilts/ndk/current/platforms/android-18/arch-arm \
> --enable-gpl --enable-avresample --enable-libx264 \
> --extra-cflags='-DGNU_SOURCE -fno-builtin-sin -fno-builtin-cos' \
> --extra-ldflags='-Wl,--fix-cortex-a8,-L/.4.4/external/x264'

Sorry if this is obvious to you (it isn't to me), why 
are you using --extra-cflags?
I believe -DGNU_SOURCE is both wrong and unneeded.
And why --fix-cortex-a8?

The main reason I ask this is that there may be something 
missing in our configure script (that wasn't reported yet 
or - even worse - the report was missed). In this case it 
would make sense to fix it for all users.

[...]

> libavfilter/avf_showcqt.c:332: error: undefined reference to 'sincos'

Doesn't this mean that your headers (or toolchain) do 
not match your math library?

The following compiles fine here (no cross-compiling) with 
gcc -lm. If it doesn't work for your cross-compiler, I 
suspect you have to fix it before you can compile FFmpeg.

#define _GNU_SOURCE
#include <math.h>
int main(void)
{
double a, b, c;
sincos(a, &b, &c);
return b*c;
}

Carl Eugen



More information about the ffmpeg-user mailing list