Commit Graph

23 Commits

Author SHA1 Message Date
Licai Guo
585c526b1f rebase on latest code, refine android build 2014-03-05 17:32:03 -08:00
Martin Storsjö
506826a8ae Fix building android on x86
In 70360cb11, the ASM variable was moved to the x86-common file
even though the android build file didn't include neither
platform-arch.mk nor platform-x86-common.mk.

Instead of explicitly declaring ASM here, include platform-arch.mk
and remove setting of the flags that platform-arch.mk sets.

This is inspired by and based on a patch by Licai Guo.
2014-03-05 15:19:18 +02:00
Martin Storsjö
23ab117240 Don't set -mfpu=neon while building the normal C++ files
This will make the normal C++ code not run on non-NEON devices at
all, making the runtime CPU feature detection pointless.

Adding -mfpu=neon to CFLAGS is not necessary, it's enough to
add it while building those individual .S files (via ASMFLAGS).
2014-03-04 08:56:42 +02:00
Martin Storsjö
30c7810cdf Enable the android runtime CPU feature detection
Build and include the android cpufeatures library in libcommon.
2014-03-04 08:56:42 +02:00
Martin Storsjö
0fc93cd98e Hook up building arm assembly in the generic linux and android makefiles 2014-03-04 08:56:42 +02:00
Martin Storsjö
70360cb11e Move the ASM variable declaration into the x86-common file 2014-02-28 10:22:19 +02:00
Martin Storsjö
fbc7519d90 Don't explicitly set/clear USE_ASM in the android makefile
The USE_ASM variable is architecture independent now and only
controls whether assembly optimizations should be enabled in
the general sense, regardless of the target architecture.
2014-02-28 10:19:53 +02:00
Martin Storsjö
7d2c761604 Allow using the USE_ASM makefile variable for architectures other than x86
Add an ASM_ARCH variable which specifies which kind of assembly
is supposed to be built.
2014-02-28 10:19:53 +02:00
Martin Storsjö
8d95d0841d Indent nested ifdefs in the android makefile
This makes the makefile slightly more readable.
2014-02-28 10:19:52 +02:00
Martin Storsjö
2f02bf9626 Link codec_unittest to the static android STL
This allows building (and running) codec_unittest for android.

This explicitly needs to go at the end of the LDFLAGS, since both
this and -lgtest etc. are static libraries, and code in gtest
relies on the STL. Since this explicitly needs to be at the end,
a separate makefile variable is added for it.
2014-02-24 17:03:18 +02:00
Ethan Hugg
df6f92096a Merge pull request #330 from mstorsjo/android-build-fixes
Android build fixes/cleanups
2014-02-20 15:39:22 -08:00
Martin Storsjö
a8a2c5eaba Move LDFLAGS specific to creating a shared library to SHLDFLAGS 2014-02-20 12:28:00 +02:00
Martin Storsjö
f6126a0bb8 Don't add C++ specific compiler flags to CFLAGS, add them to CXXFLAGS 2014-02-20 12:28:00 +02:00
Martin Storsjö
0fc2b6d14e Set the CC and AR tools when building for android as well 2014-02-20 12:28:00 +02:00
Martin Storsjö
64c2164df9 Fix building the gtest library when targeting android
The main purpose is to make sure that the build doesn't fail
if the build directory contains the gtest subdirectory, although
the unittests also could be run on a device.
2014-02-20 12:28:00 +02:00
Martin Storsjö
fc06d8783b Pass the right -mfpu flags for the armeabi-v7a target without NEON 2014-02-20 12:28:00 +02:00
Martin Storsjö
b5a9a83c69 Run ndk-build from the android project top level directory
One doesn't need to run the ndk-build command from within the
jni subdirectory, calling it from the project top level directory
works just as well.

Also remove an unnecessary step of cd ../../../.. at the end -
since all make commands are run in a subshell, we don't need to
restore the current working directory afterwards.
2014-02-20 12:28:00 +02:00
Martin Storsjö
6ac6b941cf Don't quote the android building commands in sh -c ''
The full command line can be written as such without any extra
wrapping.
2014-02-20 12:28:00 +02:00
Martin Storsjö
4d31f66873 Chain build commands using && instead of ;
This makes sure the build aborts as soon as possible if there is an
error, instead of having the error message drown in all the
following output.
2014-02-20 12:28:00 +02:00
Martin Storsjö
317eb437b0 Enable x86 assembly by default if building for x86 android
Most users would probably miss enabling it otherwise.

It can still be disabled manually by passing USE_ASM=No on the
make command line.
2014-02-20 11:23:41 +02:00
Licai Guo
538d22560f refine android build, add TARGET option to specify target in sdk 2014-02-19 20:49:30 -08:00
Licai Guo
f6e4ed6524 enable x86 asm for android 2014-02-19 17:31:21 -08:00
Licai Guo
d058176c3b add android support, single commit 2014-02-18 17:54:27 -08:00