Commit Graph

276 Commits

Author SHA1 Message Date
Henrik Gramner 64f4e24909 osx: Add -D_DARWIN_C_SOURCE to CFLAGS
OSX doesn't like _POSIX_C_SOURCE being defined when _DARWIN_C_SOURCE isn't.
2016-04-12 21:47:47 +02:00
Henrik Gramner deae1b1001 windows: Flag debug builds in the resource file 2016-04-12 17:10:39 +02:00
Henrik Gramner dfe394cadc ffms: Various improvements
* Drop the MinGW Unicode workarounds. Those were required at the time
   Windows Unicode support was added to x264 but the underlying problem
   has since been fixed in FFMS.

 * Use FFMS_IndexBelongsToFile() as an additional sanity check when reading
   an index file to ensure that it belongs to the current source video.

 * Upgrade to the new API to prevent deprecation warnings when compiling.

 * Fix a resource leak that would occur if FFMS_GetFirstTrackOfType() or
   FFMS_CreateVideoSource() failed.

 * Minor string handling adjustments related to progress reporting.

This increases the FFMS version requirement from 2.16.2 to 2.21.0.
2016-04-11 16:59:51 +02:00
Henrik Gramner 5be32efc24 configure: Define feature test macros for --std=gnu99
Makes the printf() family functions on MinGW use the correct C99 POSIX
versions instead of the broken pre-VS2015 Microsoft ones.

Also allows us to get rid of some _GNU_SOURCE and _ISOC99_SOURCE defines.
2016-04-11 16:58:23 +02:00
Henrik Gramner c01bf42117 mingw: Enable high-entropy ASLR on 64-bit Windows
To fully utilize HEASLR the image base address must also be set above
4 GiB. For consistency use the same address as MSVC uses by default.

This requires binutils 2.25 which isn't available on all common
distributions, so only enable it after checking that it's supported.
2016-04-11 16:58:23 +02:00
Henrik Gramner dd6b7b974e msvs: WinRT support
To compile x264 for WinRT the following additional steps has to be performed.

 * Ensure that the necessary SDK is installed.

 * Set the correct environment variables in the VS command prompt as shown at
   https://trac.ffmpeg.org/wiki/CompilationGuide/WinRT

 * Add one of the following to --extra-cflags depending on the target OS:
   "-DWINAPI_FAMILY=WINAPI_FAMILY_PC_APP -D_WIN32_WINNT=0x0A00" (Windows 10)
   "-DWINAPI_FAMILY=WINAPI_FAMILY_PC_APP -D_WIN32_WINNT=0x0603" (Windows 8.1)
2016-04-11 16:58:22 +02:00
Henrik Gramner 7650a13670 configure: Disable CLI libraries when CLI is disabled 2016-04-11 16:58:22 +02:00
Henrik Gramner 3d972062c8 cli: Use memory-mapped input frames for yuv and y4m
Improves performance by avoiding extraneous memory copying.
Most beneficial on fast settings.

On average around 5-10% faster overall on ultrafast but the
performance improvement can be even larger in some cases.
2016-01-17 00:30:13 +01:00
Henrik Gramner cc652c158c configure: Simplify cygwin/mingw/msys code
Avoids some code duplication.

Also drop the -mno-cygwin check since that option was removed back in 2008.
2016-01-17 00:30:13 +01:00
Henrik Gramner 30ba5dc22f windows: Use native threads by default
--disable-win32thread can be passed as an argument to configure to compile
with pthreads, which was the old default behavior.
2016-01-17 00:30:13 +01:00
Anton Mitrofanov 479d0c1fe7 Don't assume 16-byte stack alignment by default on x86-32
Some compilers depending on target OS uses 4-byte stack alignment by default.
Explicitly check known good compilers and specific options for stack alignment.
2015-10-11 18:44:54 +02:00
Jerome Duval 39af8c72e6 Haiku support
Add Haiku as supported platform in configure.
Haiku has no nice() function, use the platform specific substitute instead.
2015-10-11 18:44:54 +02:00
Henrik Gramner 3dff8af303 x86: Enable SSE2 by default on x86-32
It makes more sense to tune the defaults to benefit the vast majority of users.

Anyone still using a Pentium III for video encoding is of course free to
explicitly set different flags when compiling.
2015-08-19 01:24:27 +03:00
Henrik Gramner 51d8aa09b7 msvs/icl: Improve default CFLAGS
Use -fp:fast as a substitute for -ffast-math.
Increase warning level from -W0 to -W1 (the default setting).
Disable -GS (stack cookies) on MSVS. It's disabled by default on ICL.
2015-08-19 01:24:26 +03:00
Henrik Gramner 7edaf4b966 Use a relative $SRCPATH for out-of-tree builds
Fixes out-of-tree MSVS builds on Cygwin.
2015-08-19 01:00:26 +03:00
Henrik Gramner e7b4b863dc cygwin: Enable MSVS support
`cl -showIncludes` creates absolute Windows paths for some files, attempt
to convert those to Unix paths.

Use relative paths for dependencies located in or below the working directory
in order to mimic the behavior of gcc and to make the paths more readable.

Make the dependency generation script a bit more robust in general.
2015-08-19 01:00:24 +03:00
Henrik Gramner 1a3d963441 Simplify version.sh
Also remove some non-POSIX syntax and improve robustness.

As a bonus the script now runs about 2-3 times faster.

`git rev-list --count` could be used to simplify things even further,
but that functionality was added in git 1.7.2 so keep `wc -l` for now
to maintain compatibility with older git versions.
2015-08-19 01:00:22 +03:00
장영훈 f7f6af76ef msvs: Fix cl detection in non-English environments 2015-08-19 01:00:21 +03:00
Henrik Gramner b1cbf7ebe4 mingw: Enable the tsaware linker flag
Avoids an irrelevant compatibility layer in Terminal Services environments.

https://msdn.microsoft.com/en-us/library/cc834995.aspx
2015-08-19 01:00:16 +03:00
Henrik Gramner aa9d22927c msvs: Prefer link.exe from the same directory as cl.exe
/usr/bin/link from coreutils may be located before the MSVS linker in $PATH
which causes linking to fail due to using the wrong binary.
2015-08-19 01:00:14 +03:00
Marcin Juszkiewicz 73ae2d11d4 aarch64: Remove broken CFLAGS in configure
GCC doesn't have an "-arch" switch, but works when that entire line is removed.
2015-07-25 22:52:55 +02:00
Rong Yan cc002bd545 ppc: Add little-endian PowerPC support 2015-07-25 22:52:55 +02:00
Kaustubh Raste ce0757d9d2 mips: Initial MSA support
MSA is the MIPS SIMD Architecture.

Add X264_CPU_MSA define.
Update configure to detect MIPS platform and set flags.
CPU-specific gcc options are expected through --extra-cflags.

Sample command line for mips32r5:
    ./configure --host=mipsel-linux-gnu --cross-prefix=<TOOLCHAIN>/mips-mti-linux-gnu-
    --extra-cflags="-EL -mips32r5 -msched-weight -mload-store-pairs"

Signed-off-by: Kaustubh Raste <kaustubh.raste@imgtec.com>
2015-07-25 22:52:54 +02:00
Henrik Gramner b568a256b9 x86: Experimental nasm support
Enables the use of nasm as an alternative to yasm.

Note that nasm cannot assemble x264 with PIC enabled since it currently doesn't
support [symbol-$$] addressing which is used extensively by x264's PIC code.
This includes all 64-bit Windows and 64-bit OS X builds, even non-shared.

For the above reason nasm is currently intentionally not auto-detected, instead
the assembler must be explicitly specified using "AS=nasm ./configure".

Also drop -O2 from ASFLAGS since it's simply ignored anyway.
2015-07-25 22:52:54 +02:00
Henrik Gramner 3f8c8eb175 Get rid of fPIC warnings when compiling a shared library on Windows
PIC is always enabled when compiling for Windows so gcc complains when using
-fPIC since it doesn't do anything.
2015-07-25 22:52:54 +02:00
Anton Mitrofanov 3a6bd39a65 Fix detection of system libx264 configuration 2015-05-24 11:34:40 +02:00
Anton Mitrofanov 8e71b432e5 Update configure for auto detection of system libx264 configuration 2015-02-23 20:09:33 +03:00
Anton Mitrofanov b77cc09b92 Fix ARCH variable name conflict with BSD ports (bsd.port.mk) read-only variable 2015-02-23 13:34:47 +03:00
Anton Mitrofanov 40bb56814e x86: Update intel compiler cpu dispatcher override for new versions of ICC/ICL 2014-12-20 19:29:44 +03:00
Anton Mitrofanov 8797e0f8d4 Update to the latest version of gas-preprocessor.pl from http://git.libav.org/?p=gas-preprocessor.git
Contributions by Janne Grunau, Martin Storsjo, Mans Rullgard, David Conrad, Martin Aumuller and others
2014-12-16 20:40:13 +03:00
Anton Mitrofanov dd79a61e0e Update to the current lavf API and fix memory leak when using --seek 2014-08-26 09:19:25 -07:00
Anton Mitrofanov 56fcb444c4 configure: improve cc_check for clang and ICL to not ignore unknown options 2014-08-26 09:19:24 -07:00
Janne Grunau 943128a527 aarch64: initial build support 2014-08-26 09:19:20 -07:00
Janne Grunau d72760401c arm: check if the assembler supports the '.func' directive
The integrated assembler in llvm trunk (to be released as 3.5) is
otherwise capable enough to assemble the arm asm correctly.
2014-08-26 09:19:19 -07:00
Janne Grunau 9463ec0004 arm/ppc: use $CC as default assembler 2014-08-26 09:19:19 -07:00
Janne Grunau 716ee56d0b arm: do not append CFLAGS to ASFLAGS 2014-08-26 09:19:18 -07:00
Yusuke Nakamura 8a85db879d mp4_lsmash: Use new I/O API instead of deprecated one. 2014-07-19 20:53:01 -07:00
Steven Walters 6fbbb5b0c0 MSVS 2013 Update 2 support
The first MSVS compiler C99 compliant enough to build x264.
Use `CC=cl ./configure` to compile with it.
2014-07-19 20:53:00 -07:00
Diego Biurrun f53af048ed configure: Add -Wno-maybe-uninitialized to CFLAGS
The warnings generated by -Wmaybe-uninitialized are mostly spurious.
2014-07-19 20:53:00 -07:00
Diego Biurrun cbd8d7b6db build: Replace cltostr.pl by a shell script
This avoids a dependency on Perl to build OpenCL support.
2014-07-19 20:53:00 -07:00
Diego Biurrun 2bd932fdf0 configure: Drop workaround for obsolete gcc 4.2 on ARM 2014-07-19 20:52:59 -07:00
Diego Biurrun 016831ec7b Delete all SPARC optimizations
SPARC has been obsolete for a long time and makes little sense as a
H.264 encoding platform.

Also update authors file.
2014-07-19 20:52:58 -07:00
Diego Biurrun c7c8eb1592 configure: Don't check for libavcore
libavcore was a never-released bad idea with a short lifespan.
2014-07-19 20:52:58 -07:00
Diego Biurrun dd5b5d3959 build: Set all ASFLAGS from within configure
This is how all other toolchain flags are handled.
2014-07-19 20:52:58 -07:00
William Grant 24ab0e75db aarch64: require PIC in shared mode 2014-04-22 15:37:49 -07:00
Anton Mitrofanov 863ea2a224 Only add strip option '-s' for linker flags
Fixes some build warnings with clang.
2014-04-22 15:37:47 -07:00
Tsukasa OMOTO 4102614df9 configure: remove an unnecessary option from CFLAGS on OS X
Fixes Clang 3.4 compilation on OS X.
2014-04-21 13:53:44 -07:00
Henrik Gramner 7c860f075c x86inc: Support arbitrary stack alignments
If the stack is known to be at least 32-byte aligned we can safely store ymm
registers on the stack without doing manual alignment.

Change ALLOC_STACK to always align the stack before allocating stack space for
consistency. Previously alignment would occur either before or after allocating
stack space depending on whether manual alignment was required or not.
2014-03-11 21:11:04 -07:00
Henrik Gramner 8596dd36df x86: Pass -Worphan-labels to yasm
Makes it easier to detect typos.
2014-03-11 21:10:22 -07:00
Yu Xiaolei 0d668be8d7 Fix build with Android NDK
Android NDK does not expose sched_getaffinity.
2014-02-23 19:14:00 -08:00