]> git.sesse.net Git - ffmpeg/blobdiff - doc/platform.texi
cosmetics: Write NULL pointer inequality checks more compactly
[ffmpeg] / doc / platform.texi
index b692475c65232f6582814024e8a9977c1af0650c..d4a6618b137cbe7dcf06c369656a6b2b8734a9a0 100644 (file)
@@ -24,6 +24,20 @@ If not, then you should install a different compiler that has no
 hard-coded path to gas. In the worst case pass @code{--disable-asm}
 to configure.
 
+@section Advanced linking configuration
+
+If you compiled Libav libraries statically and you want to use them to
+build your own shared library, you may need to force PIC support (with
+@code{--enable-pic} during Libav configure) and add the following option
+to your project LDFLAGS:
+
+@example
+-Wl,-Bsymbolic
+@end example
+
+If your target platform requires position independent binaries, you should
+pass the correct linking flag (e.g. @code{-pie}) to @code{--extra-ldexeflags}.
+
 @section BSD
 
 BSD make will not build Libav, you need to install and use GNU Make
@@ -51,12 +65,12 @@ The toolchain provided with Xcode is sufficient to build the basic
 unacelerated code.
 
 OS X on PowerPC or ARM (iPhone) requires a preprocessor from
-@url{http://github.com/yuvi/gas-preprocessor} to build the optimized
-assembler functions. Just download the Perl script and put it somewhere
+@url{git://git.libav.org/gas-preprocessor.git} to build the optimized
+assembly functions. Put the Perl script somewhere
 in your PATH, Libav's configure will pick it up automatically.
 
 OS X on AMD64 and x86 requires @command{yasm} to build most of the
-optimized assembler functions @url{http://mxcl.github.com/homebrew/, Homebrew},
+optimized assembly functions @url{http://mxcl.github.com/homebrew/, Homebrew},
 @url{http://www.gentoo.org/proj/en/gentoo-alt/prefix/bootstrap-macos.xml, Gentoo Prefix}
 or @url{http://www.macports.org, MacPorts} can easily provide it.
 
@@ -101,42 +115,56 @@ you can build all libraries as DLLs.
 
 @end itemize
 
-@section Microsoft Visual C++
+@section Microsoft Visual C++ or Intel C++ Compiler for Windows
 
-Libav can be built with MSVC using a C99-to-C89 conversion utility and
-wrapper. At this time, only static builds are supported.
+Libav can be built with MSVC 2012 or earlier using a C99-to-C89 conversion utility
+and wrapper, or with MSVC 2013 and ICL natively.
 
 You will need the following prerequisites:
 
 @itemize
-@item @uref{https://github.com/rbultje/c99-to-c89/, C99-to-C89 Converter & Wrapper}
+@item @uref{https://github.com/libav/c99-to-c89/, C99-to-C89 Converter & Wrapper}
+(if using MSVC 2012 or earlier)
 @item @uref{http://code.google.com/p/msinttypes/, msinttypes}
+(if using MSVC 2012 or earlier)
 @item @uref{http://www.mingw.org/, MSYS}
 @item @uref{http://yasm.tortall.net/, YASM}
 @item @uref{http://gnuwin32.sourceforge.net/packages/bc.htm, bc for Windows} if
 you want to run @uref{fate.html, FATE}.
 @end itemize
 
-To set up a proper MSVC environment in MSYS, you simply need to run
-@code{msys.bat} from the Visual Studio command prompt.
+To set up a proper environment in MSYS, you need to run @code{msys.bat} from
+the Visual Studio or Intel Compiler command prompt.
 
-Place @code{c99wrap.exe}, @code{c99conv.exe}, and @code{yasm.exe} somewhere
-in your @code{PATH}.
+Place @code{yasm.exe} somewhere in your @code{PATH}. If using MSVC 2012 or
+earlier, place @code{c99wrap.exe} and @code{c99conv.exe} somewhere in your
+@code{PATH} as well.
 
-Next, make sure @code{inttypes.h} and any other headers and libs you want to use
-are located in a spot that MSVC can see. Do so by modifying the @code{LIB} and
-@code{INCLUDE} environment variables to include the @strong{Windows} paths to
-these directories. Alternatively, you can try and use the
-@code{--extra-cflags}/@code{--extra-ldflags} configure options.
+Next, make sure any other headers and libs you want to use, such as zlib, are
+located in a spot that the compiler can see. Do so by modifying the @code{LIB}
+and @code{INCLUDE} environment variables to include the @strong{Windows-style}
+paths to these directories. Alternatively, you can try and use the
+@code{--extra-cflags}/@code{--extra-ldflags} configure options. If using MSVC
+2012 or earlier, place @code{inttypes.h} somewhere the compiler can see too.
 
 Finally, run:
 
 @example
+For MSVC:
 ./configure --toolchain=msvc
+
+For ICL:
+./configure --toolchain=icl
+
 make
 make install
 @end example
 
+If you wish to compile shared libraries, add @code{--enable-shared} to your
+configure options. Note that due to the way MSVC and ICL handle DLL imports and
+exports, you cannot compile static and shared libraries at the same time, and
+enabling shared libraries will automatically disable the static ones.
+
 Notes:
 
 @itemize
@@ -163,7 +191,14 @@ erroneously included when building Libav.
 can see.
 @end enumerate
 
-@item Libav has been tested with Visual Studio 2010 and 2012, Pro and Express.
+@item Libav has been tested with the following on i686 and x86_64:
+@itemize
+@item Visual Studio 2010 Pro and Express
+@item Visual Studio 2012 Pro and Express
+@item Visual Studio 2013 Pro and Express
+@item Intel Composer XE 2013
+@item Intel Composer XE 2013 SP1
+@end itemize
 Anything else is not officially supported.
 
 @end itemize
@@ -174,16 +209,7 @@ If you plan to link with MSVC-built static libraries, you will need
 to make sure you have @code{Runtime Library} set to
 @code{Multi-threaded (/MT)} in your project's settings.
 
-Libav headers do not declare global data for Windows DLLs through the usual
-dllexport/dllimport interface. Such data will be exported properly while
-building, but to use them in your MSVC code you will have to edit the
-appropriate headers and mark the data as dllimport. For example, in
-libavutil/pixdesc.h you should have:
-@example
-extern __declspec(dllimport) const AVPixFmtDescriptor av_pix_fmt_descriptors[];
-@end example
-
-You will also need to define @code{inline} to something MSVC understands:
+You will need to define @code{inline} to something MSVC understands:
 @example
 #define inline __inline
 @end example
@@ -293,4 +319,67 @@ and for a build with shared libraries
 ./configure --target-os=mingw32 --enable-shared --disable-static --extra-cflags=-mno-cygwin --extra-libs=-mno-cygwin
 @end example
 
+@chapter Plan 9
+
+The native @uref{http://plan9.bell-labs.com/plan9/, Plan 9} compiler
+does not implement all the C99 features needed by Libav so the gcc
+port must be used.  Furthermore, a few items missing from the C
+library and shell environment need to be fixed.
+
+@itemize
+
+@item GNU awk, grep, make, and sed
+
+Working packages of these tools can be found at
+@uref{http://code.google.com/p/ports2plan9/downloads/list, ports2plan9}.
+They can be installed with @uref{http://9front.org/, 9front's} @code{pkg}
+utility by setting @code{pkgpath} to
+@code{http://ports2plan9.googlecode.com/files/}.
+
+@item Missing/broken @code{head} and @code{printf} commands
+
+Replacements adequate for building Libav can be found in the
+@code{compat/plan9} directory.  Place these somewhere they will be
+found by the shell.  These are not full implementations of the
+commands and are @emph{not} suitable for general use.
+
+@item Missing C99 @code{stdint.h} and @code{inttypes.h}
+
+Replacement headers are available from
+@url{http://code.google.com/p/plan9front/issues/detail?id=152}.
+
+@item Missing or non-standard library functions
+
+Some functions in the C library are missing or incomplete.  The
+@code{@uref{http://ports2plan9.googlecode.com/files/gcc-apelibs-1207.tbz,
+gcc-apelibs-1207}} package from
+@uref{http://code.google.com/p/ports2plan9/downloads/list, ports2plan9}
+includes an updated C library, but installing the full package gives
+unusable executables.  Instead, keep the files from @code{gccbin.tgz}
+under @code{/386/lib/gnu}.  From the @code{libc.a} archive in the
+@code{gcc-apelibs-1207} package, extract the following object files and
+turn them into a library:
+
+@itemize
+@item @code{strerror.o}
+@item @code{strtoll.o}
+@item @code{snprintf.o}
+@item @code{vsnprintf.o}
+@item @code{vfprintf.o}
+@item @code{_IO_getc.o}
+@item @code{_IO_putc.o}
+@end itemize
+
+Use the @code{--extra-libs} option of @code{configure} to inform the
+build system of this library.
+
+@item FPU exceptions enabled by default
+
+Unlike most other systems, Plan 9 enables FPU exceptions by default.
+These must be disabled before calling any Libav functions.  While the
+included tools will do this automatically, other users of the
+libraries must do it themselves.
+
+@end itemize
+
 @bye