The following packages are required for the development of all WebM projects:
The VP8 SDK supports a large variety of targets and build
environments. These are generally identified by a isa-os-compiler
triplet. This is the instruction set architecture, the operating
system, and compiler used to compile for the target. A full list of
these targets can be seen by running ./configure --help in the root
of your source tree. (Windows users will need to set up MSYS
before being able to run this command.) Certain targets require special
setup be completed. Please see if one of the sections on this page
applies to you before trying to build the codec library.
The Yasm assembler is required to build optimized libraries for x86 platforms. Version 0.8.0 or newer is required. Version 1.0.0 is known to have bugs affecting libvpx, but subsequent versions (1.1.0) should work.
For Unix-like platforms, binary distributions are likely to be included in your package manager, or you can easily build from source. Windows users are advised to download the pre-built binary.
There are two methods of building for Windows.
Visual Studio project files are available in each release
snapshot,
but are not present in code checked out from the Git repository. To
build a release snapshot on Windows, you only need to install Yasm, as
described above. The project files are located in the build/
subdirectory.
Important When
installing Yasm, disregard
instructions for Visual Studio integration and use the “general use”
executables instead (yasm-x.x.x-win32.exe or yasm-x.x.x-win64.exe).
These files are generated using our Makefile build system, so if you wish to work on the latest code from Git on Windows, you’ll have to install a Unix-workalike environment like MSYS or Cygwin. Instructions for installing MSYS can be found below. When creating the Visual Studio projects from source, you’ll have to do some additional setup:
The “build root” is not necessarily the same directory as the “source root” with this build system. This allows you to keep your source tree pristine and not clutter it with object files, temporary files, output runs, etc. You can wipe out your whole build root at any time without worrying too much about it. We first must choose the build root we want to use:
In-tree build root means that your build root is a subdirectory of the source root. The advantage of this approach is that the Git Extensions plug-in for Visual Studio can be used. Create the following directory (use vs7 for VS 2003): libvpx/build/x86-win32-vs8 Note that git has been configured to ignore this directory — we don’t want the generated files to be checked in.
Out-of-tree build root means that the build root is not a child of the source root. This is the most common configuration used. Typically you create a build directory in the same location that the libvpx tree is checked out.
The first thing that must be done to a new build root is to configure it for the configuration of the SDK that you want to build.
Start a Cygwin or MSYS shell, and navigate to your build directory.
Here we’ll assume that you want to do an out-of-tree build, you’ve
cloned libvpx to /cygdrive/c/libvpx and you’ve created the build
directory /cygdrive/c/build.
$ cd /cygdrive/c/build
$ ../libvpx/configure --target=x86-win32-vs8 --enable-static-msvcrt
--enable-static-msvcrt to switch all vs8 projects to use
static for Runtime library option, i.e. /MT and /MTd,
instead of /MD and /MDd by default.
vs9 is for Visual Studio 2008, vs8 is for Visual Studio 2005,
and vs7 is for Visual Studio .NET 2003
../libvpx/configure --help has interesting output.
If configuration succeeded (it should) you can now execute the scripts that create the visual studio solutions and projects:
$ make
You typically will not need to rerun the configuration scripts, but it
doesn’t hurt to do so. You will need to rerun them if you pull in
changes to any file named configure or .mk, or if any files are
added, removed, or renamed (even by others). You should be aware that
your changes will be overwritten any time you modify the project
settings through the properties page. The Makefiles and associated
scripts are the authoritative location for all build related
information. This means if you add, remove, or rename a file, you
must do so in the Makefiles first, and then regenerate the project
files from them.
If you’re already familiar with MSYS, there’s likely nothing here that will surprise you. If this is your first time installing MSYS, read on …
The depot_tools are used to download the tools and patches needed to
build the VP8 library on Windows. They facilitate a one-step
dependencies download, and allow you to avoid the hassle of
downloading individual MSYS archives.
depot_tools directory to your PATH.Now we use the depot_tools installation to grab MSYS, and a subset of
MSYS tools needed for building VP8.
Create a very simple .gclient in an empty directory, and insert the following text:
solutions = [
{ "name" : "mingw",
"url" : "http://src.chromium.org/svn/trunk/deps/third_party/mingw"
}
]
.gclient. Note that any text editor will do, provided that it
will allow you to name a file .gclient. Notepad++ is not
required.Open a cmd.exe window, cd to the directory where you saved
your .gclient, and execute the command:
D:\src\chromium_mingw_deps>gclient sync
It will return output similar to the following.
________ running 'svn checkout
http://src.chromium.org/svn/trunk/deps/third_party/mingw
D:\src\chromium_mingw_deps\mingw
' in 'D:\src\chromium_mingw_deps'
A D:\src\chromium_mingw_deps\mingw\README.chromium
A D:\src\chromium_mingw_deps\mingw\mingwrt-3.15.2-mingw32-dev.tar.gz
A D:\src\chromium_mingw_deps\mingw\pthreads-w32.patch.txt
A D:\src\chromium_mingw_deps\mingw\msysCORE-1.0.11-20080826-src.tar.gz
A D:\src\chromium_mingw_deps\mingw\coreutils-5.97-MSYS-1.0.11-snapshot-src.tar.bz2
A D:\src\chromium_mingw_deps\mingw\gcc-4.2.1-2-src.tar.gz
A D:\src\chromium_mingw_deps\mingw\w32api-3.13-mingw32-src.tar.gz
A D:\src\chromium_mingw_deps\mingw\gcc-core-4.2.1-sjlj-2.tar.gz
A D:\src\chromium_mingw_deps\mingw\binutils-2.17.50-20060824-1.tar.gz
A D:\src\chromium_mingw_deps\mingw\pthreads-w32-2-8-0-release.tar.gz
A D:\src\chromium_mingw_deps\mingw\MSYS-1.0.11.exe
A D:\src\chromium_mingw_deps\mingw\mingwrt-3.15.2-mingw32-src.tar.gz
A D:\src\chromium_mingw_deps\mingw\binutils-2.17.50-20060824-1-src.tar.gz
A D:\src\chromium_mingw_deps\mingw\w32api-3.13-mingw32-dev.tar.gz
A D:\src\chromium_mingw_deps\mingw\coreutils-5.97-MSYS-1.0.11-snapshot.tar.bz2
depot_tools will
install it for you! No need to stop here to install it yourself.