yading10: \input texinfo yading10: yading10: Platform Specific Information yading10: yading10: Platform Specific Information yading10: titlepage yading10: yading10: yading10: yading10: yading10: yading10: Unix-like yading10: yading10: Some parts of FFmpeg cannot be built with version 2.15 of the GNU yading10: assembler which is still provided by a few AMD64 distributions. To yading10: make sure your compiler really uses the required version of gas yading10: after a binutils upgrade, run: yading10: yading10: yading10: $(gcc -print-prog-name=as) --version yading10: example yading10: yading10: If not, then you should install a different compiler that has no yading10: hard-coded path to gas. In the worst case pass --disable-asm yading10: to configure. yading10: yading10: BSD yading10: yading10: BSD make will not build FFmpeg, you need to install and use GNU Make yading10: (gmake). yading10: yading10: (Open)Solaris yading10: yading10: GNU Make is required to build FFmpeg, so you have to invoke (gmake), yading10: standard Solaris Make will not work. When building with a non-c99 front-end yading10: (gcc, generic suncc) add either --extra-libs=/usr/lib/values-xpg6.o yading10: or --extra-libs=/usr/lib/64/values-xpg6.o to the configure options yading10: since the libc is not c99-compliant by default. The probes performed by yading10: configure may raise an exception leading to the death of configure itself yading10: due to a bug in the system shell. Simply invoke a different shell such as yading10: bash directly to work around this: yading10: yading10: yading10: bash ./configure yading10: example yading10: yading10: yading10: Darwin (Mac OS X, iPhone) yading10: yading10: The toolchain provided with Xcode is sufficient to build the basic yading10: unacelerated code. yading10: yading10: Mac OS X on PowerPC or ARM (iPhone) requires a preprocessor from yading10: http://github.com/yuvi/gas-preprocessor to build the optimized yading10: assembler functions. Just download the Perl script and put it somewhere yading10: in your PATH, FFmpeg's configure will pick it up automatically. yading10: yading10: Mac OS X on amd64 and x86 requires yasm to build most of the yading10: optimized assembler functions. Fink (http://www.finkproject.org/), yading10: Gentoo Prefix (http://www.gentoo.org/proj/en/gentoo-alt/prefix/bootstrap-macos.xml), yading10: Homebrew (http://mxcl.github.com/homebrew/) yading10: or MacPorts (http://www.macports.org) can easily provide it. yading10: yading10: yading10: DOS yading10: yading10: Using a cross-compiler is preferred for various reasons. yading10: http://www.delorie.com/howto/djgpp/linux-x-djgpp.html yading10: yading10: yading10: OS/2 yading10: yading10: For information about compiling FFmpeg on OS/2 see yading10: http://www.edm2.com/index.php/FFmpeg. yading10: yading10: yading10: Windows yading10: yading10: To get help and instructions for building FFmpeg under Windows, check out yading10: the FFmpeg Windows Help Forum at http://ffmpeg.zeranoe.com/forum/. yading10: yading10: Native Windows compilation using MinGW or MinGW-w64 yading10: yading10: FFmpeg can be built to run natively on Windows using the MinGW or MinGW-w64 yading10: toolchains. Install the latest versions of MSYS and MinGW or MinGW-w64 from yading10: http://www.mingw.org/ or http://mingw-w64.sourceforge.net/. yading10: You can find detailed installation instructions in the download section and yading10: the FAQ. yading10: yading10: Notes: yading10: yading10: yading10: yading10: Building natively using MSYS can be sped up by disabling implicit rules yading10: in the Makefile by calling make -r instead of plain make. This yading10: speed up is close to non-existent for normal one-off builds and is only yading10: noticeable when running make for a second time (for example during yading10: make install). yading10: yading10: In order to compile FFplay, you must have the MinGW development library yading10: of SDL (http://www.libsdl.org/) and pkg-config installed. yading10: yading10: By using ./configure --enable-shared when configuring FFmpeg, yading10: you can build the FFmpeg libraries (e.g. libavutil, libavcodec, yading10: libavformat) as DLLs. yading10: yading10: itemize yading10: yading10: Microsoft Visual C++ yading10: yading10: FFmpeg can be built with MSVC using a C99-to-C89 conversion utility and yading10: wrapper. yading10: yading10: You will need the following prerequisites: yading10: yading10: yading10: C99-to-C89 Converter & Wrapper (http://download.videolan.org/pub/contrib/c99-to-c89/) yading10: msinttypes (http://code.google.com/p/msinttypes/) yading10: MSYS (http://www.mingw.org/) yading10: YASM (http://yasm.tortall.net/) yading10: bc for Windows (http://gnuwin32.sourceforge.net/packages/bc.htm) if yading10: you want to run FATE (fate.html). yading10: itemize yading10: yading10: To set up a proper MSVC environment in MSYS, you simply need to run yading10: msys.bat from the Visual Studio command prompt. yading10: yading10: Place makedef, c99wrap.exe, c99conv.exe, and yasm.exe yading10: somewhere in your PATH. yading10: yading10: Next, make sure inttypes.h and any other headers and libs you want to use yading10: are located in a spot that MSVC can see. Do so by modifying the LIB and yading10: INCLUDE environment variables to include the Windows paths to yading10: these directories. Alternatively, you can try and use the yading10: --extra-cflags/--extra-ldflags configure options. yading10: yading10: Finally, run: yading10: yading10: yading10: ./configure --toolchain=msvc yading10: make yading10: make install yading10: example yading10: yading10: If you wish to compile shared libraries, add --enable-shared to your yading10: configure options. Note that due to the way MSVC handles DLL imports and yading10: exports, you cannot compile static and shared libraries at the same time, and yading10: enabling shared libraries will automatically disable the static ones. yading10: yading10: Notes: yading10: yading10: yading10: yading10: It is possible that coreutils' link.exe conflicts with MSVC's linker. yading10: You can find out by running which link to see which link.exe you yading10: are using. If it is located at /bin/link.exe, then you have the wrong one yading10: in your PATH. Either move or remove that copy, or make sure MSVC's yading10: link.exe takes precedence in your PATH over coreutils'. yading10: yading10: If you wish to build with zlib support, you will have to grab a compatible yading10: zlib binary from somewhere, with an MSVC import lib, or if you wish to link yading10: statically, you can follow the instructions below to build a compatible yading10: zlib.lib with MSVC. Regardless of which method you use, you must still yading10: follow step 3, or compilation will fail. yading10: yading10: Grab the zlib sources (http://zlib.net/). yading10: Edit win32/Makefile.msc so that it uses -MT instead of -MD, since yading10: this is how FFmpeg is built as well. yading10: Edit zconf.h and remove its inclusion of unistd.h. This gets yading10: erroneously included when building FFmpeg. yading10: Run nmake -f win32/Makefile.msc. yading10: Move zlib.lib, zconf.h, and zlib.h to somewhere MSVC yading10: can see. yading10: enumerate yading10: yading10: FFmpeg has been tested with Visual Studio 2010 and 2012, Pro and Express. yading10: Anything else is not officially supported. yading10: yading10: itemize yading10: yading10: Linking to FFmpeg with Microsoft Visual C++ yading10: yading10: If you plan to link with MSVC-built static libraries, you will need yading10: to make sure you have Runtime Library set to yading10: Multi-threaded (/MT) in your project's settings. yading10: yading10: You will need to define inline to something MSVC understands: yading10: yading10: #define inline __inline yading10: example yading10: yading10: Also note, that as stated in Microsoft Visual C++, you will need yading10: an MSVC-compatible inttypes.h (http://code.google.com/p/msinttypes/). yading10: yading10: If you plan on using import libraries created by dlltool, you must yading10: set References to No (/OPT:NOREF) under the linker optimization yading10: settings, otherwise the resulting binaries will fail during runtime. yading10: This is not required when using import libraries generated by lib.exe. yading10: This issue is reported upstream at yading10: http://sourceware.org/bugzilla/show_bug.cgi?id=12633. yading10: yading10: To create import libraries that work with the /OPT:REF option yading10: (which is enabled by default in Release mode), follow these steps: yading10: yading10: yading10: yading10: Open the Visual Studio Command Prompt. yading10: yading10: Alternatively, in a normal command line prompt, call vcvars32.bat yading10: which sets up the environment variables for the Visual C++ tools yading10: (the standard location for this file is something like yading10: C:\Program Files (x86_\Microsoft Visual Studio 10.0\VC\bin\vcvars32.bat). yading10: yading10: Enter the bin directory where the created LIB and DLL files yading10: are stored. yading10: yading10: Generate new import libraries with lib.exe: yading10: yading10: yading10: lib /machine:i386 /def:..\lib\foo-version.def  /out:foo.lib yading10: example yading10: yading10: Replace foo-version and foo with the respective library names. yading10: yading10: enumerate yading10: yading10: yading10: Cross compilation for Windows with Linux yading10: yading10: You must use the MinGW cross compilation tools available at yading10: http://www.mingw.org/. yading10: yading10: Then configure FFmpeg with the following options: yading10: yading10: ./configure --target-os=mingw32 --cross-prefix=i386-mingw32msvc- yading10: example yading10: (you can change the cross-prefix according to the prefix chosen for the yading10: MinGW tools). yading10: yading10: Then you can easily test FFmpeg with Wine (http://www.winehq.com/). yading10: yading10: Compilation under Cygwin yading10: yading10: Please use Cygwin 1.7.x as the obsolete 1.5.x Cygwin versions lack yading10: llrint() in its C library. yading10: yading10: Install your Cygwin with all the "Base" packages, plus the yading10: following "Devel" ones: yading10: yading10: binutils, gcc4-core, make, git, mingw-runtime, texi2html yading10: example yading10: yading10: In order to run FATE you will also need the following "Utils" packages: yading10: yading10: bc, diffutils yading10: example yading10: yading10: If you want to build FFmpeg with additional libraries, download Cygwin yading10: "Devel" packages for Ogg and Vorbis from any Cygwin packages repository: yading10: yading10: libogg-devel, libvorbis-devel yading10: example yading10: yading10: These library packages are only available from yading10: Cygwin Ports (http://sourceware.org/cygwinports/): yading10: yading10: yading10: yasm, libSDL-devel, libfaac-devel, libaacplus-devel, libgsm-devel, libmp3lame-devel, yading10: libschroedinger1.0-devel, speex-devel, libtheora-devel, libxvidcore-devel yading10: example yading10: yading10: The recommendation for x264 is to build it from source, as it evolves too yading10: quickly for Cygwin Ports to be up to date. yading10: yading10: Crosscompilation for Windows under Cygwin yading10: yading10: With Cygwin you can create Windows binaries that do not need the cygwin1.dll. yading10: yading10: Just install your Cygwin as explained before, plus these additional yading10: "Devel" packages: yading10: yading10: gcc-mingw-core, mingw-runtime, mingw-zlib yading10: example yading10: yading10: and add some special flags to your configure invocation. yading10: yading10: For a static build run yading10: yading10: ./configure --target-os=mingw32 --extra-cflags=-mno-cygwin --extra-libs=-mno-cygwin yading10: example yading10: yading10: and for a build with shared libraries yading10: yading10: ./configure --target-os=mingw32 --enable-shared --disable-static --extra-cflags=-mno-cygwin --extra-libs=-mno-cygwin yading10: example yading10: yading10: Plan 9 yading10: yading10: The native Plan 9 (http://plan9.bell-labs.com/plan9/) compiler yading10: does not implement all the C99 features needed by FFmpeg so the gcc yading10: port must be used.  Furthermore, a few items missing from the C yading10: library and shell environment need to be fixed. yading10: yading10: yading10: yading10: GNU awk, grep, make, and sed yading10: yading10: Working packages of these tools can be found at yading10: ports2plan9 (http://code.google.com/p/ports2plan9/downloads/list). yading10: They can be installed with 9front's (http://9front.org/) pkg yading10: utility by setting pkgpath to yading10: http://ports2plan9.googlecode.com/files/. yading10: yading10: Missing/broken head and printf commands yading10: yading10: Replacements adequate for building FFmpeg can be found in the yading10: compat/plan9 directory.  Place these somewhere they will be yading10: found by the shell.  These are not full implementations of the yading10: commands and are not suitable for general use. yading10: yading10: Missing C99 stdint.h and inttypes.h yading10: yading10: Replacement headers are available from yading10: http://code.google.com/p/plan9front/issues/detail?id=152. yading10: yading10: Missing or non-standard library functions yading10: yading10: Some functions in the C library are missing or incomplete.  The yading10: yading10: gcc-apelibs-1207 (http://ports2plan9.googlecode.com/files/gcc-apelibs-1207.tbz) package from yading10: ports2plan9 (http://code.google.com/p/ports2plan9/downloads/list) yading10: includes an updated C library, but installing the full package gives yading10: unusable executables.  Instead, keep the files from gccbin.tgz yading10: under /386/lib/gnu.  From the libc.a archive in the yading10: gcc-apelibs-1207 package, extract the following object files and yading10: turn them into a library: yading10: yading10: yading10: strerror.o yading10: strtoll.o yading10: snprintf.o yading10: vsnprintf.o yading10: vfprintf.o yading10: _IO_getc.o yading10: _IO_putc.o yading10: itemize yading10: yading10: Use the --extra-libs option of configure to inform the yading10: build system of this library. yading10: yading10: FPU exceptions enabled by default yading10: yading10: Unlike most other systems, Plan 9 enables FPU exceptions by default. yading10: These must be disabled before calling any FFmpeg functions.  While the yading10: included tools will do this automatically, other users of the yading10: libraries must do it themselves. yading10: yading10: itemize yading10: yading10: