Question

I've been tryin' to compile x264 for Android with Thread Support...But with no success...

I've managed to compile the same without thread support...The configure command is as follows :

./configure --prefix=$PREFIX \
--enable-pic \
--host=arm-linux \
--disable-cli \
--cross-prefix=$PREBUILT/bin/arm-linux-androideabi- \
--sysroot=$PLATFORM 

where PREBUILT=$NDK/toolchains/arm-linux-androideabi-4.7/prebuilt/linux-x86 and PLATFORM=$NDK/platforms/android-14/arch-arm

I've also tried with and without the option --enable-static and extra-ldflags="-lpthread", but when attempted make it ends with errors.

Is there any way to accomplish the above said...?

Was it helpful?

Solution

The error that seemed to appear in config.log in context to thread support was cannot find lpthread... That got resolved by manually removing the -lpthread from the configure file. But then the configuration started failing at the test that included the struct cpu_set_t and CPU_COUNT()...

Seems that certain libc functions and definitions are not included in the code provided with Android NDK (R8D)...In the above case CPU_COUNT() and the definition for struct cpu_set_t...

The workaround for the above was to patch sched.h with the latest version... There are a few bug reports in the Android Issue List describing the same problem which would hopefully be addressed in the next NDK release...

Also x264 could be compiled to include the " ARM Support Feature " by including the option --extra-cflags="-mfloat-abi=softfp"...

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top