/usr/share/doc/libav-tools/html/platform.html is in libav-tools 4:0.8.17-0ubuntu0.12.04.2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html401/loose.dtd">
<html>
<!-- Created on April 1, 2016 by texi2html 1.82 -->
<!--
texi2html was written by:
Lionel Cons <Lionel.Cons@cern.ch> (original author)
Karl Berry <karl@freefriends.org>
Olaf Bachmann <obachman@mathematik.uni-kl.de>
and many others.
Maintained by: Many creative people.
Send bugs and suggestions to <texi2html-bug@nongnu.org>
-->
<head>
<title>Libav documentation : : </title>
<meta name="description" content=": ">
<meta name="keywords" content="Libav documentation : : ">
<meta name="resource-type" content="document">
<meta name="distribution" content="global">
<meta name="Generator" content="texi2html 1.82">
<style type="text/css">
<!--
a.summary-letter { text-decoration: none }
a { color: #2D6198; }
a:visited { color: #884488; }
h1 a, h2 a, h3 a { text-decoration: inherit; color: inherit; }
p { margin-left: 1em; margin-right: 1em; }
table { margin-left: 2em; }
pre { margin-left: 2em; }
#footer { text-align: center; }
#body { margin-left: 1em; margin-right: 1em; }
body { background-color: #313131; margin: 0; }
#container {
background-color: white;
color: #202020;
margin-left: 1em;
margin-right: 1em;
}
h1 {
background-color: #7BB37B;
border: 1px solid #6A996A;
color: #151515;
font-size: 1.2em;
padding-bottom: 0.2em;
padding-left: 0.4em;
padding-top: 0.2em;
}
h2 {
color: #313131;
font-size: 1.2em;
}
h3 {
color: #313131;
font-size: 0.8em;
margin-bottom: -8px;
}
.note {
margin: 1em;
border: 1px solid #bbc9d8;
background-color: #dde1e1;
}
.important {
margin: 1em;
border: 1px solid #d26767;
background-color: #f8e1e1;
}
-->
</style>
<link rel="icon" href="favicon.png" type="image/png" />
<link rel="stylesheet" type="text/css" href="default.css" />
</head>
<body >
<div id="container">
<div id="body">
<a name="SEC_Top"></a>
<h1 class="settitle">Platform Specific information</h1>
<a name="SEC_Contents"></a>
<h1>Table of Contents</h1>
<div class="contents">
<ul class="toc">
<li><a name="toc-Unix_002dlike" href="#Unix_002dlike">1. Unix-like</a>
<ul class="toc">
<li><a name="toc-BSD" href="#BSD">1.1 BSD</a></li>
<li><a name="toc-_0028Open_0029Solaris" href="#g_t_0028Open_0029Solaris">1.2 (Open)Solaris</a></li>
<li><a name="toc-Darwin-_0028OS-X_002c-iPhone_0029" href="#Darwin-_0028OS-X_002c-iPhone_0029">1.3 Darwin (OS X, iPhone)</a></li>
</ul></li>
<li><a name="toc-DOS" href="#DOS">2. DOS</a></li>
<li><a name="toc-OS_002f2" href="#OS_002f2">3. OS/2</a></li>
<li><a name="toc-Windows" href="#Windows">4. Windows</a>
<ul class="toc">
<li><a name="toc-Native-Windows-compilation" href="#Native-Windows-compilation">4.1 Native Windows compilation</a></li>
<li><a name="toc-Microsoft-Visual-C_002b_002b-compatibility" href="#Microsoft-Visual-C_002b_002b-compatibility">4.2 Microsoft Visual C++ compatibility</a>
<ul class="toc">
<li><a name="toc-Using-static-libraries" href="#Using-static-libraries">4.2.1 Using static libraries</a></li>
<li><a name="toc-Using-shared-libraries" href="#Using-shared-libraries">4.2.2 Using shared libraries</a></li>
</ul></li>
<li><a name="toc-Cross-compilation-for-Windows-with-Linux-1" href="#Cross-compilation-for-Windows-with-Linux-1">4.3 Cross compilation for Windows with Linux</a></li>
<li><a name="toc-Compilation-under-Cygwin" href="#Compilation-under-Cygwin">4.4 Compilation under Cygwin</a></li>
<li><a name="toc-Crosscompilation-for-Windows-under-Cygwin" href="#Crosscompilation-for-Windows-under-Cygwin">4.5 Crosscompilation for Windows under Cygwin</a></li>
</ul>
</li>
</ul>
</div>
<a name="Unix_002dlike"></a>
<h1 class="chapter"><a href="platform.html#toc-Unix_002dlike">1. Unix-like</a></h1>
<p>Some parts of Libav cannot be built with version 2.15 of the GNU
assembler which is still provided by a few AMD64 distributions. To
make sure your compiler really uses the required version of gas
after a binutils upgrade, run:
</p>
<table><tr><td> </td><td><pre class="example">$(gcc -print-prog-name=as) --version
</pre></td></tr></table>
<p>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</code>
to configure.
</p>
<a name="BSD"></a>
<h2 class="section"><a href="platform.html#toc-BSD">1.1 BSD</a></h2>
<p>BSD make will not build Libav, you need to install and use GNU Make
(‘<tt>gmake</tt>’).
</p>
<a name="g_t_0028Open_0029Solaris"></a>
<h2 class="section"><a href="platform.html#toc-_0028Open_0029Solaris">1.2 (Open)Solaris</a></h2>
<p>GNU Make is required to build Libav, so you have to invoke (‘<tt>gmake</tt>’),
standard Solaris Make will not work. When building with a non-c99 front-end
(gcc, generic suncc) add either <code>--extra-libs=/usr/lib/values-xpg6.o</code>
or <code>--extra-libs=/usr/lib/64/values-xpg6.o</code> to the configure options
since the libc is not c99-compliant by default. The probes performed by
configure may raise an exception leading to the death of configure itself
due to a bug in the system shell. Simply invoke a different shell such as
bash directly to work around this:
</p>
<table><tr><td> </td><td><pre class="example">bash ./configure
</pre></td></tr></table>
<p><a name="Darwin"></a>
</p><a name="Darwin-_0028OS-X_002c-iPhone_0029"></a>
<h2 class="section"><a href="platform.html#toc-Darwin-_0028OS-X_002c-iPhone_0029">1.3 Darwin (OS X, iPhone)</a></h2>
<p>The toolchain provided with Xcode is sufficient to build the basic
unacelerated code.
</p>
<p>OS X on PowerPC or ARM (iPhone) requires a preprocessor from
<a href="git://git.libav.org/gas-preprocessor.git">git://git.libav.org/gas-preprocessor.git</a> to build the optimized
assembler functions. Put the Perl script somewhere
in your PATH, Libav’s configure will pick it up automatically.
</p>
<p>OS X on AMD64 and x86 requires <code>yasm</code> to build most of the
optimized assembler functions <a href="http://mxcl.github.com/homebrew/">Homebrew</a>,
<a href="http://www.gentoo.org/proj/en/gentoo-alt/prefix/bootstrap-macos.xml">Gentoo Prefix</a>
or <a href="http://www.macports.org">MacPorts</a> can easily provide it.
</p>
<a name="DOS"></a>
<h1 class="chapter"><a href="platform.html#toc-DOS">2. DOS</a></h1>
<p>Using a cross-compiler is preferred for various reasons.
<a href="http://www.delorie.com/howto/djgpp/linux-x-djgpp.html">http://www.delorie.com/howto/djgpp/linux-x-djgpp.html</a>
</p>
<a name="OS_002f2"></a>
<h1 class="chapter"><a href="platform.html#toc-OS_002f2">3. OS/2</a></h1>
<p>For information about compiling Libav on OS/2 see
<a href="http://www.edm2.com/index.php/FFmpeg">http://www.edm2.com/index.php/FFmpeg</a>.
</p>
<a name="Windows"></a>
<h1 class="chapter"><a href="platform.html#toc-Windows">4. Windows</a></h1>
<a name="Native-Windows-compilation"></a>
<h2 class="section"><a href="platform.html#toc-Native-Windows-compilation">4.1 Native Windows compilation</a></h2>
<p>Libav can be built to run natively on Windows using the MinGW tools. Install
the latest versions of MSYS and MinGW from <a href="http://www.mingw.org/">http://www.mingw.org/</a>.
You can find detailed installation
instructions in the download section and the FAQ.
</p>
<p>Libav does not build out-of-the-box with the packages the automated MinGW
installer provides. It also requires coreutils to be installed and many other
packages updated to the latest version. The minimum version for some packages
are listed below:
</p>
<ul>
<li> bash 3.1
</li><li> msys-make 3.81-2 (note: not mingw32-make)
</li><li> w32api 3.13
</li><li> mingw-runtime 3.15
</li></ul>
<p>Libav automatically passes <code>-fno-common</code> to the compiler to work around
a GCC bug (see <a href="http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37216">http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37216</a>).
</p>
<p>Notes:
</p>
<ul>
<li> Building natively using MSYS can be sped up by disabling implicit rules
in the Makefile by calling <code>make -r</code> instead of plain <code>make</code>. This
speed up is close to non-existent for normal one-off builds and is only
noticeable when running make for a second time (for example in
<code>make install</code>).
</li><li> In order to compile AVplay, you must have the MinGW development library
of <a href="http://www.libsdl.org/">SDL</a>.
Edit the ‘<tt>bin/sdl-config</tt>’ script so that it points to the correct prefix
where SDL was installed. Verify that ‘<tt>sdl-config</tt>’ can be launched from
the MSYS command line.
</li><li> By using <code>./configure --enable-shared</code> when configuring Libav,
you can build libavutil, libavcodec and libavformat as DLLs.
</li></ul>
<a name="Microsoft-Visual-C_002b_002b-compatibility"></a>
<h2 class="section"><a href="platform.html#toc-Microsoft-Visual-C_002b_002b-compatibility">4.2 Microsoft Visual C++ compatibility</a></h2>
<p>As stated in the FAQ, Libav will not compile under MSVC++. However, if you
want to use the libav* libraries in your own applications, you can still
compile those applications using MSVC++. But the libav* libraries you link
to <em>must</em> be built with MinGW. However, you will not be able to debug
inside the libav* libraries, since MSVC++ does not recognize the debug
symbols generated by GCC.
We strongly recommend you to move over from MSVC++ to MinGW tools.
</p>
<p>This description of how to use the Libav libraries with MSVC++ is based on
Microsoft Visual C++ 2005 Express Edition. If you have a different version,
you might have to modify the procedures slightly.
</p>
<a name="Using-static-libraries"></a>
<h3 class="subsection"><a href="platform.html#toc-Using-static-libraries">4.2.1 Using static libraries</a></h3>
<p>Assuming you have just built and installed Libav in ‘<tt>/usr/local</tt>’.
</p>
<ol>
<li> Create a new console application ("File / New / Project") and then
select "Win32 Console Application". On the appropriate page of the
Application Wizard, uncheck the "Precompiled headers" option.
</li><li> Write the source code for your application, or, for testing, just
copy the code from an existing sample application into the source file
that MSVC++ has already created for you. For example, you can copy
‘<tt>libavformat/output-example.c</tt>’ from the Libav distribution.
</li><li> Open the "Project / Properties" dialog box. In the "Configuration"
combo box, select "All Configurations" so that the changes you make will
affect both debug and release builds. In the tree view on the left hand
side, select "C/C++ / General", then edit the "Additional Include
Directories" setting to contain the path where the Libav includes were
installed (i.e. ‘<tt>c:\msys\1.0\local\include</tt>’).
Do not add MinGW’s include directory here, or the include files will
conflict with MSVC’s.
</li><li> Still in the "Project / Properties" dialog box, select
"Linker / General" from the tree view and edit the
"Additional Library Directories" setting to contain the ‘<tt>lib</tt>’
directory where Libav was installed (i.e. ‘<tt>c:\msys\1.0\local\lib</tt>’),
the directory where MinGW libs are installed (i.e. ‘<tt>c:\mingw\lib</tt>’),
and the directory where MinGW’s GCC libs are installed
(i.e. ‘<tt>C:\mingw\lib\gcc\mingw32\4.2.1-sjlj</tt>’). Then select
"Linker / Input" from the tree view, and add the files ‘<tt>libavformat.a</tt>’,
‘<tt>libavcodec.a</tt>’, ‘<tt>libavutil.a</tt>’, ‘<tt>libmingwex.a</tt>’,
‘<tt>libgcc.a</tt>’, and any other libraries you used (i.e. ‘<tt>libz.a</tt>’)
to the end of "Additional Dependencies".
</li><li> Now, select "C/C++ / Code Generation" from the tree view. Select
"Debug" in the "Configuration" combo box. Make sure that "Runtime
Library" is set to "Multi-threaded Debug DLL". Then, select "Release" in
the "Configuration" combo box and make sure that "Runtime Library" is
set to "Multi-threaded DLL".
</li><li> Click "OK" to close the "Project / Properties" dialog box.
</li><li> MSVC++ lacks some C99 header files that are fundamental for Libav.
Get msinttypes from <a href="http://code.google.com/p/msinttypes/downloads/list">http://code.google.com/p/msinttypes/downloads/list</a>
and install it in MSVC++’s include directory
(i.e. ‘<tt>C:\Program Files\Microsoft Visual Studio 8\VC\include</tt>’).
</li><li> MSVC++ also does not understand the <code>inline</code> keyword used by
Libav, so you must add this line before <code>#include</code>ing libav*:
<table><tr><td> </td><td><pre class="example">#define inline _inline
</pre></td></tr></table>
</li><li> Build your application, everything should work.
</li></ol>
<a name="Using-shared-libraries"></a>
<h3 class="subsection"><a href="platform.html#toc-Using-shared-libraries">4.2.2 Using shared libraries</a></h3>
<p>This is how to create DLL and LIB files that are compatible with MSVC++:
</p>
<p>Within the MSYS shell, build Libav with
</p>
<table><tr><td> </td><td><pre class="example">./configure --enable-shared
make
make install
</pre></td></tr></table>
<p>Your install path (‘<tt>/usr/local/</tt>’ by default) should now have the
necessary DLL and LIB files under the ‘<tt>bin</tt>’ directory.
</p>
<p>Alternatively, build the libraries with a cross compiler, according to
the instructions below in <a href="#Cross-compilation-for-Windows-with-Linux">Cross compilation for Windows with Linux</a>.
</p>
<p>To use those files with MSVC++, do the same as you would do with
the static libraries, as described above. But in Step 4,
you should only need to add the directory where the LIB files are installed
(i.e. ‘<tt>c:\msys\usr\local\bin</tt>’). This is not a typo, the LIB files are
installed in the ‘<tt>bin</tt>’ directory. And instead of adding the static
libraries (‘<tt>libxxx.a</tt>’ files) you should add the MSVC import libraries
(‘<tt>avcodec.lib</tt>’, ‘<tt>avformat.lib</tt>’, and
‘<tt>avutil.lib</tt>’). Note that you should not use the GCC import
libraries (‘<tt>libxxx.dll.a</tt>’ files), as these will give you undefined
reference errors. There should be no need for ‘<tt>libmingwex.a</tt>’,
‘<tt>libgcc.a</tt>’, and ‘<tt>wsock32.lib</tt>’, nor any other external library
statically linked into the DLLs.
</p>
<p>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:
</p><table><tr><td> </td><td><pre class="example">extern __declspec(dllimport) const AVPixFmtDescriptor av_pix_fmt_descriptors[];
</pre></td></tr></table>
<p>Note that using import libraries created by dlltool requires
the linker optimization option to be set to
"References: Keep Unreferenced Data (<code>/OPT:NOREF</code>)", otherwise
the resulting binaries will fail during runtime. This isn’t
required when using import libraries generated by lib.exe.
This issue is reported upstream at
<a href="http://sourceware.org/bugzilla/show_bug.cgi?id=12633">http://sourceware.org/bugzilla/show_bug.cgi?id=12633</a>.
</p>
<p>To create import libraries that work with the <code>/OPT:REF</code> option
(which is enabled by default in Release mode), follow these steps:
</p>
<ol>
<li> Open ‘<tt>Visual Studio 2005 Command Prompt</tt>’.
<p>Alternatively, in a normal command line prompt, call ‘<tt>vcvars32.bat</tt>’
which sets up the environment variables for the Visual C++ tools
(the standard location for this file is
‘<tt>C:\Program Files\Microsoft Visual Studio 8\VC\bin\vcvars32.bat</tt>’).
</p>
</li><li> Enter the ‘<tt>bin</tt>’ directory where the created LIB and DLL files
are stored.
</li><li> Generate new import libraries with ‘<tt>lib.exe</tt>’:
<table><tr><td> </td><td><pre class="example">lib /machine:i386 /def:..\lib\avcodec-53.def /out:avcodec.lib
lib /machine:i386 /def:..\lib\avdevice-53.def /out:avdevice.lib
lib /machine:i386 /def:..\lib\avfilter-2.def /out:avfilter.lib
lib /machine:i386 /def:..\lib\avformat-53.def /out:avformat.lib
lib /machine:i386 /def:..\lib\avutil-51.def /out:avutil.lib
lib /machine:i386 /def:..\lib\swscale-2.def /out:swscale.lib
</pre></td></tr></table>
</li></ol>
<p><a name="Cross-compilation-for-Windows-with-Linux"></a>
</p><a name="Cross-compilation-for-Windows-with-Linux-1"></a>
<h2 class="section"><a href="platform.html#toc-Cross-compilation-for-Windows-with-Linux-1">4.3 Cross compilation for Windows with Linux</a></h2>
<p>You must use the MinGW cross compilation tools available at
<a href="http://www.mingw.org/">http://www.mingw.org/</a>.
</p>
<p>Then configure Libav with the following options:
</p><table><tr><td> </td><td><pre class="example">./configure --target-os=mingw32 --cross-prefix=i386-mingw32msvc-
</pre></td></tr></table>
<p>(you can change the cross-prefix according to the prefix chosen for the
MinGW tools).
</p>
<p>Then you can easily test Libav with <a href="http://www.winehq.com/">Wine</a>.
</p>
<a name="Compilation-under-Cygwin"></a>
<h2 class="section"><a href="platform.html#toc-Compilation-under-Cygwin">4.4 Compilation under Cygwin</a></h2>
<p>Please use Cygwin 1.7.x as the obsolete 1.5.x Cygwin versions lack
llrint() in its C library.
</p>
<p>Install your Cygwin with all the "Base" packages, plus the
following "Devel" ones:
</p><table><tr><td> </td><td><pre class="example">binutils, gcc4-core, make, git, mingw-runtime, texi2html
</pre></td></tr></table>
<p>And the following "Utils" one:
</p><table><tr><td> </td><td><pre class="example">diffutils
</pre></td></tr></table>
<p>Then run
</p>
<table><tr><td> </td><td><pre class="example">./configure
</pre></td></tr></table>
<p>to make a static build.
</p>
<p>The current <code>gcc4-core</code> package is buggy and needs this flag to build
shared libraries:
</p>
<table><tr><td> </td><td><pre class="example">./configure --enable-shared --disable-static --extra-cflags=-fno-reorder-functions
</pre></td></tr></table>
<p>If you want to build Libav with additional libraries, download Cygwin
"Devel" packages for Ogg and Vorbis from any Cygwin packages repository:
</p><table><tr><td> </td><td><pre class="example">libogg-devel, libvorbis-devel
</pre></td></tr></table>
<p>These library packages are only available from
<a href="http://sourceware.org/cygwinports/">Cygwin Ports</a>:
</p>
<table><tr><td> </td><td><pre class="example">yasm, libSDL-devel, libdirac-devel, libfaac-devel, libgsm-devel,
libmp3lame-devel, libschroedinger1.0-devel, speex-devel, libtheora-devel,
libxvidcore-devel
</pre></td></tr></table>
<p>The recommendation for libnut and x264 is to build them from source by
yourself, as they evolve too quickly for Cygwin Ports to be up to date.
</p>
<p>Cygwin 1.7.x has IPv6 support. You can add IPv6 to Cygwin 1.5.x by means
of the <code>libgetaddrinfo-devel</code> package, available at Cygwin Ports.
</p>
<a name="Crosscompilation-for-Windows-under-Cygwin"></a>
<h2 class="section"><a href="platform.html#toc-Crosscompilation-for-Windows-under-Cygwin">4.5 Crosscompilation for Windows under Cygwin</a></h2>
<p>With Cygwin you can create Windows binaries that do not need the cygwin1.dll.
</p>
<p>Just install your Cygwin as explained before, plus these additional
"Devel" packages:
</p><table><tr><td> </td><td><pre class="example">gcc-mingw-core, mingw-runtime, mingw-zlib
</pre></td></tr></table>
<p>and add some special flags to your configure invocation.
</p>
<p>For a static build run
</p><table><tr><td> </td><td><pre class="example">./configure --target-os=mingw32 --extra-cflags=-mno-cygwin --extra-libs=-mno-cygwin
</pre></td></tr></table>
<p>and for a build with shared libraries
</p><table><tr><td> </td><td><pre class="example">./configure --target-os=mingw32 --enable-shared --disable-static --extra-cflags=-mno-cygwin --extra-libs=-mno-cygwin
</pre></td></tr></table>
<div id="footer">
<p>
<font size="-1">
This document was generated by <em>Build Daemon user</em> on <em>April 1, 2016</em> using <a href="http://www.nongnu.org/texi2html/"><em>texi2html 1.82</em></a>.
</font>
<br>
</div></div>
</p>
</body>
</html>
</div>
|