libogg Documentation

repository·main·Indexed 19 days ago

https://github.com/xiph/ogg

The BSD-licensed implementation of the Ogg bitstream format, used by various codecs to arrange compressed data for seeking, time stamping, error recovery, and stream mixing. Includes instructions for building via Autotools, CMake, and MSBuild across Linux, Windows, and macOS.

Tokens
749
Snippets
6
Records
6
Agent score
15%

What's inside libogg

  1. Build libogg from repository source

    main

    If you are building directly from the repository source (e.g., via SVN), you must first generate the configuration files using autogen.sh before running the standard build sequence.

    ./autogen.sh
    ./configure
    make
    # Optionally (as root):
    make install
  2. Run libogg automated tests

    main

    Testing is an optional step and is separate from the build/install process. The command to run tests depends on your build system:

    • Autotools (Unix/MinGW): Use make check.
    • CMake (Unix/MinGW): Use make test or ctest.
    • Windows (MSBuild): Use ctest with the specific configuration type (Debug or Release).
    # If built with Autotools
    make check
    
    # If built with CMake
    make test
    # OR
    ctest
    
    # If built with MSBuild on Windows
    ctest -C Debug
    ctest -C Release
  3. Build libogg on Windows

    main

    There are two primary ways to build on Windows:

    1. MSBuild/Project Files: Use the project files located in the win32 directory. These are designed to compile out of the box.
    2. CMake: Use a generator corresponding to your Visual Studio version.

    To build a framework on macOS using CMake, use the Xcode generator and set BUILD_FRAMEWORK=1.

    # Windows CMake example
    cmake -G "Visual Studio 12 2013" ..
    
    # macOS Framework example
    cmake -G Xcode -DBUILD_FRAMEWORK=1 ..
  4. Cross-compile libogg from Linux to Windows

    main

    You can cross-compile using MinGW tools. On Debian/Ubuntu, install the necessary tools first:

    sudo apt-get mingw32 mingw32-binutils mingw32-runtime wine

    Then configure with the appropriate host and target flags:

    ./configure --host=i586-mingw32msvc --target=i586-mingw32msvc --build=i586-linux
    make
    make check
  5. Build libogg using CMake

    main

    Ogg supports CMake for generating native projects. By default, CMake generates projects that build static libraries. To build dynamic (shared) libraries, you must set the BUILD_SHARED_LIBS option to 1.

    # For static libraries (default):
    mkdir build
    cd build
    cmake -G YOUR-PROJECT-GENERATOR ..
    
    # For dynamic/shared libraries:
    cmake -G YOUR-PROJECT-GENERATOR -DBUILD_SHARED_LIBS=1 ..
  6. Build libogg from tarball distributions

    main

    To build libogg from a released tarball, use the standard Autotools workflow. By default, this installs libraries and headers into /usr/local/lib and /usr/local/include respectively.

    ./configure
    make
    # Optionally (as root):
    make install