Personal tools
Namespaces
Variants
Actions
Navigation
Projects
Toolbox

How to compile

From AC3Filter
Jump to: navigation, search

Contents

[edit] Tools

Here is the list of tools required for the build environment.

Mandatory:

Optional:

[edit] Visual Studio 2008

Currently (Mar 2011), the latest version of Windows SDK is Microsoft Windows SDK for Windows 7 and .NET Framework 3.5 SP1 (ISO). Please note if you are running a 64-bit version of Windows and Visual Studio 2008, please upgrade to Visual Studio 2008 SP1 before installing the Windows 7 SDK.

After installing Windows SDK, run Windows SDK configuration tool (Start -> Programs -> Microsoft Windows SDK 7.0 -> Visual Studio Registration -> Windows SDK configuration tool), choose 'v 7.0' from the list of installed SDK versions and press Make current button.

Windows SDK configuration tool.png

[edit] BaseClasses

BaseClasses are required to build DirectShow filter. It is a part of Windows SDK, but it is not pre-build and you have to compile it before building AC3Filter. Note, that AC3Filetr uses static RTL linking, so a change in BaseClasses project options have to be made.

Open BaseClasses solution from C:\Program Files\Microsoft SDKs\Windows\v7.0\Samples\multimedia\directshow\baseclasses. Change Runtime library option to 'Multi-threaded Debug' at 'Debug_MBCS' configuration and 'Multi-threaded' at 'Release_MBCS' configuration:

BaseClasses.png

Batch-build Win32 and x64 library versions:

Build BaseCalsses.png

Rename strmbasd.lib to strmbasd_mbcs.lib and strmbase.lib to strmbase_mbcs.lib (both Win32 and x64 versions) and place all libraries somewhere, so Visual Studio may find it. Personally, I place it into Windows SDK lib folder C:\Program Files\Microsoft SDKs\Windows\v7.0\Lib. So the resulting library structure looks like:

C:\Program Files\Microsoft SDKs\Windows\v7.0\Lib

strmbase_mbcs.lib
strmbasd_mbcs.lib
x64
strmbase_mbcs.lib
strmbasd_mbcs.lib

Next, Visual Studio have to see BaseClasses includes. Run Visual Studio and add BaseClasses folder to Include path at Tools -> Options -> Projects and Solutions -> VC++ Directories (do not forget to do this for both Win32 and x64 paltforms).

BaseClasses include path.png

[edit] Boost

Boost is required to build AC3Filter. You can get the last version from Boost site. Currently, AC3Filter is built with Boost 1.45.0.

Download and unpack the archive. Make Boost visible to Visual Studio at Include files (both Win32 and x64). Point to the root Boost directory, not Boost/boost!

Boost include path.png

The above is enough to build AC3Filter. But if you like to work with valib test project, you have to compile Boost Test library.

First, run bootstrap.bat from the boost folder. This will build bjam (boost build engine). Then, run the following commands:

bjam -j2 variant=debug link=static threading=multi runtime-link=static --with-thread --with-date_time --with-test --with-filesystem
bjam -j2 variant=release link=static threading=multi runtime-link=static --with-thread --with-date_time --with-test --with-filesystem
bjam -j2 --stagedir=stage64 address-model=64 variant=debug link=static threading=multi runtime-link=static --with-thread --with-date_time --with-test --with-filesystem
bjam -j2 --stagedir=stage64 address-model=64 variant=release link=static threading=multi runtime-link=static --with-thread --with-date_time --with-test --with-filesystem

Note, -j2 specifies the number of compilation threads (two in this example). If you have more cores, adjust it respectively to build faster.

At last, make Boost libraries folder visible to Visual Studio (stage/lib for Win32 and stage64/lib for x64):

Boost lib path.png

[edit] stdint

Some 3rd party libraries used in AC3Filter project require stdint.h and inttypes.h headers standartized as a part of C99. Unfortunately, Visual Studio does not include these files. Fortunately, there is a project that fixes this issue.

Download the latest version and unpack it to Visual Studio includes (C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\include).

[edit] Mercurial (optional)

AC3Filter uses Mercurial for version control. It's possible to compile AC3Filter without it (you can download source code tarball from the Repository, but it is highly recommended to install it.

I recommend TortoiseHG as a comfortable Mercurial client.

[edit] InnoSetup (optional)

This step is required only if you want to build AC3Filter distribution package.

Inno Setup is a free installer for Windows programs. Download and install it. To build the distribution package use #build_dist.cmd script (you may need to update vars.cmd).

Installation scripts:

Note, that you may need to download additional languages and place it to the Languages folder of InnoSetup. See [Languages] section at .iss files.

[edit] Doxygen (optional)

This step is required only if you want to build valib documentation.

Get the latest version of Doxygen from the official site and install it.

There're two ways to build the documentation:

To build docs using GUI, run Doxywizard (installed with Doxygen) and open valib/Doxygen file. Then go to Run tab and press Run doxygen button. This will create valib/doc/html folder and build the documentation there.

To build from command line run the following script from valib folder:

rmdir /s /y doc/valib 2>nul
mkdir doc 2> nul
mkdir doc/valib 2> nul
doxygen

[edit] poEdit (optional)

This step is required only if you like to modify localization files. See more at AC3Filter:How to translate

[edit] Get sources

Run the following script to get sources from AC3Filter site:

md AC3Filter
cd AC3Filter
hg clone http://ac3filter.net/repo/valib
hg clone http://ac3filter.net/repo/ac3filter

Run the following script to get sources from Google Code:

md AC3Filter
cd AC3Filter
hg clone http://valib.ac3filter.googlecode.com/hg valib
hg clone http://ac3filter.ac3filter.googlecode.com/hg ac3filter

Or, if you do not have Mercurial client installed, you can get the latest source tarballs:

Unpack both to ac3filter and valib folders respectively.

See also: Source code.

[edit] Build ffmpeg (optional)

Valib uses ffmpeg for some decoders. Unfortunately, it is not possible to build it in VisualStudio natively. Therefore an compiled version comes with valib (dlls, libs and includes). If you like to build your own ffmpeg version, read How to build ffmpeg.

[edit] Command-line scripts

[edit] config.cmd

You can build AC3Filter from Visual Studio, but sometimes it is convenient to build from the command-line.

To do this the build script tries to determine the location of VisualStudio, but it may fail. In this case you may explicitly specify where it is. To this, copy cmd/config.example to cmd/config.cmd and edit the last. Set vc6vars variable to the full name of VisualStudio 97 vcvars.bat file (if you use VisualStudio 97). Set vc9vars variable to the full name of VisualStudio 2008 vcvarsall.bat file. For example:

set vc9vars=C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\vcvarsall.bat

Do not forget to do this for both ac3filter and valib projects.

[edit] clean.cmd

This script deletes all intermediate, temp and build files. Recursively in some cases. For instance:

Useful for clean builds and to clean the source folder before distribution.

[edit] build.cmd

Builds the project at the current folder. Run #clean.cmd to perform a clean build. Edit #config.cmd if you get 'compiler not found' error.

Usage: build_vc [compiler] [platform] [configuration]

[edit] build_dist.cmd

This script builds the distribution package (both bianry and source). Accepts 2 parameters:

Without the parameters the version appears as a timestamp (like '1103251833').

This script uses InnoSetup and an archiver. You may customize both using vars.cmd file: