Commit Graph

145 Commits

Author SHA1 Message Date
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
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
Martin Storsjö
e3fce5095b Explicitly allow read-only relocations when building on OS X in 32 bit mode
This fixes building libwels.dylib, since the assembly code
isn't position independent.
2014-02-19 21:17:57 +02:00
Martin Storsjö
561027ebac Install the import library as well, in MSVC builds 2014-02-19 21:04:30 +02:00
Martin Storsjö
b1d8671bd4 Support building DLLs with MSVC
MSVC doesn't export any functions at all by default, contrary to
gcc which exports all global functions by default.

Doing the same for linux/OS X isn't too hard, but they use yet
two other, different syntaxes for the corresponding symbol file.
2014-02-19 21:04:30 +02:00
Martin Storsjö
03c00dc226 Include the x86 common header for x86 MSVC as well 2014-02-19 21:04:30 +02:00
Licai Guo
d058176c3b add android support, single commit 2014-02-18 17:54:27 -08:00
Martin Storsjö
d262129e92 Set CC wherever we set CXX 2014-02-12 22:12:33 +02:00
Martin Storsjö
ce22f84a2b Regenerate target makefiles after the latest mktargets.py changes 2014-02-12 22:11:05 +02:00
jwwang
4fa810da8b 1. support .c in makefile generator. 2. add test to check C interfaces. 2014-02-12 14:52:35 +08:00
Martin Storsjö
d0185ab253 Remove redundant /./ parts from pathnames in makefiles
This is mostly a cosmetic improvement for the quiet make output.
2014-02-08 18:46:52 +02:00
Martin Storsjö
8ecdcc7172 Add a make option for silencing the commands run
Add "V=No" to the make command to silence the make output.

This makes it easier to spot warnings or other unexpected messages
in the build output.
2014-01-30 13:56:19 +02:00
Martin Storsjö
a164436d98 Automatically track per-file dependencies
This is enabled for platforms/compilers that support the -MMD
option, which creates a dependency file named out.d when compiling
to a file named out.o, only including local, not system headers.

The additional -MP option adds phony targets for all included
headers, to avoid having make error out due to "no rule to make
target foo.h" if a header is renamed/removed.

This makes sure that all the right files are rebuilt if a header
is changed, avoiding the need for a full rebuild if only a few
files are affected.
2014-01-28 08:15:45 +02:00
Ethan Hugg
977768ac88 Merge pull request #222 from mstorsjo/enable-threading
Enable threading when building for most platforms
2014-01-27 14:50:13 -08:00
Ethan Hugg
00a76419b4 Merge pull request #237 from mstorsjo/simplify-make-lib-rules
Simplify the make rules for creating libraries
2014-01-27 14:09:20 -08:00
Martin Storsjö
d36939580a Removed an unused pair of files generated by MSVC project wizards
These files aren't actually even referenced by the MSVC project
files.
2014-01-27 22:55:33 +02:00
Ethan Hugg
2a55578a98 Merge pull request #208 from mstorsjo/remove-unused-mk-field
Remove an unnecessary field from generated makefiles
2014-01-27 08:55:23 -08:00
Martin Storsjö
ea8a00278f Simplify the make rules for creating libraries 2014-01-27 14:45:18 +02:00
Martin Storsjö
8062596d23 Fix building threading for freebsd
FreeBSD (and at least NetBSD as well) still use hw.ncpu without
deprecating it, contrary to apple.
2014-01-26 10:40:24 +02:00
Martin Storsjö
b9f04e0db8 Enable threading when building for most platforms
Don't enable threading globally since the MSVC/ARM build target
(neither windows phone nor windows rt) doesn't support the normal
windows threading functions.
2014-01-26 10:34:53 +02:00
Martin Storsjö
a239637be5 Fix building for freebsd in 64 bit mode 2014-01-26 10:21:56 +02:00
Martin Storsjö
253c2c84b3 Do chdir within mktargets.py
This simplifies the calling shell script.
2014-01-24 15:09:11 +02:00
Martin Storsjö
7df69c1482 Remove an unnecessary field from generated makefiles 2014-01-24 15:02:40 +02:00
Martin Storsjö
8a932fbe85 Remove excludes of nonexistent files 2014-01-23 22:55:36 +02:00
Martin Storsjö
3cacaf85f1 Include the executable suffix within make
This makes sure that e.g. "make clean" actually removes
the built exe files, and avoids relinking the exe files each
time make is run when cross compiling from linux to windows.

(Make on windows seems to have an exception that knows to skip
rebuilding the 'h264enc' target if 'h264enc' doesn't exist but
'h264enc.exe' does, but this exception doesn't work on normal
unix make.)
2014-01-23 16:15:22 +02:00
Martin Storsjö
797a19e367 Define MACOS when building for OS X
The library uses this define to enable OS X specific functionality
in general, even if none of those snippets actually have been
strictly required so far.
2014-01-21 21:17:59 +02:00
Ethan Hugg
b6dcd94cb0 Merge pull request #180 from mstorsjo/remove-disabled-bundle-loading
Remove disabled/broken/unused code for bundle loading in the console tools
2014-01-21 10:30:28 -08:00
Martin Storsjö
35ad8cb3a5 Remove an exclude of an nonexistent file 2014-01-21 14:59:41 +02:00
Martin Storsjö
41928236e4 Remove unused files about macos bundle loading from the console tools 2014-01-21 14:59:41 +02:00
Martin Storsjö
5cb3fc93e0 Remove the __NO_CTYPE define
Nothing within the project uses it, and it's not necessary to
build the project either, tested on both linux and mingw.
2014-01-21 12:48:33 +02:00
Varun B Patil
2d83e4561a Don't execute mktargets.py if cannot cd into correct directory 2014-01-20 21:52:36 +05:30
Varun B Patil
d78906aa21 Cleanup mktargets.py
1.Remove semicolons
2.close file
2014-01-19 21:39:20 +05:30
Ethan Hugg
00e9293433 Update msvc options from VS projects. 2014-01-17 12:56:15 -08:00
Martin Storsjö
b38976944a Regenerate gtest-targets.mk using mktargets.sh/py
This simplifies updating all makefiles consistently.
2014-01-17 18:53:17 +02:00
Martin Storsjö
a8d549e343 Omit assembler source rules if no asm sources are found 2014-01-17 18:52:46 +02:00
Martin Storsjö
7f6cdb516d Add platform files for msvc and msvc-arm
Build with "make UNAME=msvc" to invoke this.
2014-01-17 12:06:12 +02:00
Martin Storsjö
b842ff30e5 Make the compiler/ar/linker file output parameters overrideable
This is in preparation for allowing building using MSVC via
makefiles.
2014-01-17 12:06:11 +02:00
Varun B Patil
a00b0ca79b simplify gtest makefile 2014-01-16 23:33:20 +05:30
Martin Storsjö
ba38dc77a5 Add support for 64 bit mingw in the makefiles
By setting an overridable variable in the main makefile, we avoid
having to move the default -DUNIX64 into each of the other unix
platform makefiles, but still allowing the mingw platform to
override it.
2014-01-10 19:01:22 +02:00
EKR
b7a5d70212 don't choke on deprecated sha-1 routines 2014-01-09 10:36:12 -08:00
Ethan Hugg
f85911e331 Merge pull request #117 from mstorsjo/make-patterns
Use make patterns to avoid needing autogenerated rules for each source file
2014-01-08 09:48:31 -08:00
Martin Storsjö
488fb7bb20 Add proper dependencies for the command line binaries
This makes sure that all the dependency libs are built before trying
to link them together, fixing parallel make (which occasionally
failed due to trying to link the encoder or decoder command line
binaries before the libs had been built) and also fixes building an
individual component by e.g. "make h264enc".
2014-01-08 16:36:11 +02:00
Martin Storsjö
80669ed059 Use make patterns to avoid needing autogenerated rules for each source file 2014-01-08 16:33:35 +02:00
Ethan Hugg
319ae0253b Merge pull request #98 from mstorsjo/trailing-whitespace-platform
Get rid of trailing whitespace in the platform makefiles
2014-01-06 09:35:24 -08:00
Martin Storsjö
0ad7c4c9b6 Get rid of trailing whitespace in the platform makefiles 2014-01-05 14:48:52 +02:00
Martin Storsjö
12d7f72eec Mark the mktargets shell/python scripts executable 2014-01-05 14:43:53 +02:00
volvet
8a7a15ff30 fix merge conflict 2014-01-04 08:20:56 +08:00
volvet
2c828d7918 merge VS2012 makefile for 64bits assembly 2014-01-03 16:12:47 +08:00
volvet
ec84f4bcc9 resolve conflict 2014-01-03 14:49:45 +08:00
unknown
1e5a290855 1. fix gcc 3.4 link error.
2. fix mingw build issue when enable asm
2014-01-02 17:19:25 +08:00
Ethan Hugg
71e48218c4 Merge pull request #63 from mstorsjo/crossbuild
Use $(AR) instead of explicitly calling 'ar'
2013-12-27 08:23:06 -08:00
V
7fa09903cf Add MinGW platform makefile and related source changes 2013-12-23 21:42:31 +01:00
Ethan Hugg
77fde5c9bc Turn on -Werror for OSX builds 2013-12-19 17:05:30 -08:00
Ethan Hugg
b2066e1dc2 Move -Werror to platform file. Also, %zu can't be used on Windows. 2013-12-19 11:27:05 -08:00
Martin Storsjö
785ac16d28 Use $(AR) instead of explicitly calling 'ar'
This simplifies overriding the command used, e.g. for cross
compilation.
2013-12-17 12:29:21 +02:00
Ethan Hugg
5d616714c4 Merge pull request #54 from rmuch/freebsd-build
Add FreeBSD platform makefile
2013-12-16 09:37:11 -08:00
Martin Storsjö
f1cfd1e28a Don't link to libdl when building with NO_DYNAMIC_VP defined 2013-12-16 09:35:03 +02:00
Rupert Muchembled
51c121f947 Add FreeBSD platform makefile
Add platform-freebsd.mk makefile to allow building on FreeBSD.

OpenH264 builds and runs successfully on FreeBSD 9.2-RELEASE amd64, with both
the gcc and clang compilers.

Note that building i386 binaries with the native toolchain using the -m32 flag
on amd64 FreeBSD is unsupported and will not work, so ENABLE64BIT should always
be set to Yes when compiling on a FreeBSD amd64 system.
2013-12-16 07:10:26 +00:00
Licai Guo
ac6828f4fa Enable 64-bit build on Linux & Mac 2013-12-14 20:37:33 -08:00
Martin Storsjö
f9dea46712 Remove trailing whitespace
Most of it was removed in ff6b669176 from C++ source files,
but other files were left unchanged.
2013-12-13 11:24:17 +02:00
Ethan Hugg
ff6b669176 Pretty printed the C++ code with astyle 2013-12-12 14:21:12 -08:00
EKR
8bb8276967 Make gtest support conditional 2013-12-12 12:24:55 +08:00
EKR
fb429bbf67 Add gtest support 2013-12-12 10:56:52 +08:00
Ethan Hugg
2ca14fed1c Rebase of EKR's patches for tracing and frame size 2013-12-11 06:51:26 -08:00
EKR
cf92e8d620 Add support for assembly on linux as well as multiple configs 2013-12-10 18:57:32 +08:00
EKR
2edc251ded First cut at new build system. Tested on Mac 2013-12-10 16:19:42 +08:00