Commit Graph

117 Commits

Author SHA1 Message Date
Licai Guo
31a93de513 add missing build files 2014-03-18 19:47:26 -07:00
Ethan Hugg
197423f271 Merge pull request #520 from ylatuya/master
Fix compiler warnings and remove dead code
2014-03-18 13:28:02 -07:00
Andoni Morales Alastruey
c55429d7a5 Replace -Werror with -Wall
Treating warnings as error is useless if no warning is activated.
Several build systems enable -Wall in the CLFAGS, which in combination
with -Werror can trigger undesired build errors.
2014-03-18 19:15:25 +01:00
Martin Storsjö
e1b5e038d2 Use .obj as suffix for object files on MSVC
This avoids warnings when linking about "unrecognized source file
type, object file assumed".
2014-03-18 19:41:06 +02:00
Martin Storsjö
00efbc2cb5 Enable the arm assembly in msvc-arm builds
This requires using the external gas-preprocessor tool that
converts the gnu assembler format sources to armasm format at
build time. This allows keeping the source files in one single
format but only converting while building.
2014-03-17 20:28:12 +02:00
Martin Storsjö
d723ad2774 Use -DPREFIX instead of --prefix _ on OS X
The --prefix parameter differs between yasm and nasm; nasm
requires --prefix _ while yasm requires --prefix=_. Using the
define instead (as on windows) allows easier switching between
the two otherwise mostly compatible assemblers.

This fixes building with yasm on OS X in 32 bit mode. For 64 bit,
a few more tweaks are still required.
2014-03-16 11:59:34 +02:00
Martin Storsjö
00849100f8 Remove the unused define NOPREFIX
Nothing in the x86 assembly reacts to that define (nor anything
else within the code base).
2014-03-15 14:40:36 +02:00
Ethan Hugg
567302eb9a Merge pull request #410 from mstorsjo/android-armeabi
Allow building plain armeabi binaries for android
2014-03-10 09:44:19 -07:00
Licai Guo
6d9dfe8954 Merge pull request #454 from mstorsjo/android-any-arch
Support building for any other android architecture
2014-03-10 17:20:58 +08:00
Martin Storsjö
67a9e73a7c Set the arch to armv7 by default when building for iOS
Otherwise it would build for the simulator by default, which
in most cases probably isn't what was intended.
2014-03-09 01:46:43 +02:00
Martin Storsjö
8f88f60637 Explicitly sort the files in mktargets.py
This avoids spurious changes to the targets.mk files when mktargets
is rerun on different platforms and different file systems.

In particular, OS X seems to mostly return files sorted
alphabetically, case insensitively, while they are returned in
a file system specific order on linux.
2014-03-08 01:55:39 +02:00
Martin Storsjö
918af27560 Support building for any other android architecture
This allows e.g. building for mips, as a plain C++ build with
no assembly.
2014-03-08 01:22:31 +02:00
volvet
ffde7b2e09 Merge pull request #442 from mstorsjo/unify-thread-cleanup
Unify the thread cleanup code, enable threading on android
2014-03-07 18:14:03 +08:00
Martin Storsjö
181fe0a99e Enable multithreading on android 2014-03-07 10:51:28 +02:00
Martin Storsjö
30fff7ece0 Allow building plain armeabi binaries for android
Building with "make OS=android APP_ABI=armeabi" will
produce arm binaries that will conform to the armeabi
ABI - not using any features outside of armv5te by
default (but still optionally using the NEON functions at
runtime if detected - even though such devices should rather
use the default armeabi-v7a build).
2014-03-06 08:15:55 +02:00
Licai Guo
36ae8d9f6c use stlport to replace libgnuc++, this remove GCCVERSION variable 2014-03-05 22:15:36 -08:00
Licai Guo
585c526b1f rebase on latest code, refine android build 2014-03-05 17:32:03 -08:00
Licai Guo
61dae45fad Merge pull request #421 from mstorsjo/android-x86-build
Fix building android on x86
2014-03-06 09:07:26 +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ö
0df3a068ba Don't add -DNO_DYNAMIC_VP to ASMFLAGS
None of the assembly source uses this define for anything.
2014-03-05 15:02:53 +02:00
Martin Storsjö
dae8f4b737 Exclude the arm assembly header as well
This avoids warnings about object files not containing any symbols.
2014-03-04 23:23:19 +02:00
Ethan Hugg
01a2f582c3 Merge pull request #401 from mstorsjo/android-arm-assembly
Enable the arm assembly in android builds
2014-03-04 09:50:07 -08:00
Martin Storsjö
773cc4a797 Exclude assembly files that are used as headers
This avoids some warnings about object files not containing any
symbols.
2014-03-04 14:57:36 +02:00
Martin Storsjö
560c14b67c Add the APPLE_IOS define when building for iOS with make
Previously the define was only used when building from within the
xcode project files.

This enables the arm neon assembly.
2014-03-04 09:26:15 +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ö
1118dd4f71 Update the makefile generator to support .S arm assembly files
These are built if ASM_ARCH is set to arm.
2014-03-04 08:56:42 +02:00
Martin Storsjö
3ccd2ae4cf Remove a redundant makefile ifdef
ASM_ARCH=x86 is only set if USE_ASM is enabled.
2014-03-01 23:56:14 +02:00
Martin Storsjö
6f803e16f5 Only set x86 ASMFLAGS if building x86 assembly 2014-03-01 23:56:14 +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ö
078681a097 Add a platform file for building for iOS using the makefile build system
This doesn't build the actual demo apps that you can run on the
phone (not yet at least), but is useful for easily testing compilation
in different setups, and for building a precompiled static library for
use in external projects.
2014-02-28 10:19:53 +02:00
Martin Storsjö
ab3609c4c7 Don't add x86 assembly specific options on darwin if building for other archs
This avoids warnings about using the -read_only_relocs suppress
if building for other architectures than x86.
2014-02-28 10:19:53 +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ö
59e6ab91cf Use an intermediate platform header for including architecture specific rules
This avoids coupling the architecture directly to the platform,
allowing building on e.g. linux on architectures other than x86,
without having to explicitly specify USE_ASM=No while building
on those.

Later this will also facilitate enabling assembly optimizations
where applicable, e.g. arm assembly on linux.
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
Martin Storsjö
113fb8c104 Set GTEST_HAS_TR1_TUPLE to 0 on msvc
This fixes building of gtest on msvc.

See e.g. http://stackoverflow.com/questions/8274588 for
more discussion on the matter.

This is only required on MSVC 2012 - gtest itself (in the cmake
files) adds -D_VARIADIC_MAX=10 to the build when building using
MSVC 2012, but we don't know the MSVC version at the make stage
here. Since the gtest tuple support isn't used at all, it's
simpler to just disable it altogether than to try to add
-D_VARIADIC_MAX=10.
2014-02-24 15:38:37 +02:00
Martin Storsjö
af2a354202 Remove the now unused -Wno-deprecated-declarations on OS X
This was only required for building with OpenSSL.
2014-02-24 15:38:36 +02:00
Martin Storsjö
c6cea2ccac Use -dynamiclib instead of -shared for building shared libraries on OS X
Older toolchains don't recognize the -shared parameter.
2014-02-24 12:05:21 +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