doc: extra build info with more cases

This commit is contained in:
bnnm 2021-08-08 18:47:35 +02:00
parent 38ace8cf7e
commit d9845dbf95
3 changed files with 179 additions and 85 deletions

View File

@ -265,7 +265,7 @@ Also be aware that other plugins (not vgmstream) can tell the player they handle
some extension, then not actually play it. This makes the file unplayable as
vgmstream doesn't even get the chance to parse that file, so you may need to
disable the offending plugin or rename the file (for example this may happen with
`.asf` in foobar2000).
`.asf` in foobar2000/Winamp, may be fixed in newer versions).
When extracting from a bigfile, sometimes internal files don't have a proper
extension. Those should be renamed to its correct one when possible, as the

View File

@ -1,15 +1,21 @@
# vgmstream build help
This document explains how to build each of vgmstream's components and libs.
## Compilation requirements
Because each module has different quirks one can't use a single tool for everything. You should be able to build most using a standard *compiler* (GCC/MSVC/Clang) using common *build systems* (scripts/CMake/autotools) in any typical *OS* (Windows/Linux/Mac).
Because each module has different quirks one can't use a single tool for everything. You should be able to build most using a standard compiler (GCC/MSVC/Clang) in any typical OS (Windows/Linux/Mac) using common build helpers (scripts/CMake/autotools).
64-bit support may work but has been minimally tested, since main use of vgmstream is plugins for 32-bit players (extra codec libs for Windows are included for 32-bit only ATM, and there may be bugs in some codecs and formats).
64-bit support may work but has been minimally tested, since main use of vgmstream is plugins for 32-bit players (should work but extra codec libs are included for 32-bit only ATM).
Components are detailed below, but if you are new to development you probably want:
- Windows: Visual Studio + simple scripts
- Linux: GCC + CMake
- Max: Clang + CMake
### GCC / Make
Though it's rather flexible (like using Windows with GCC and autotools), some combos may be a bit more complex to get working depending on your system and other factors.
### GCC / Make (compiler)
Common C compiler, most development is done with this.
On Windows you need one of these somewhere in PATH:
@ -22,66 +28,95 @@ On Windows you need one of these somewhere in PATH:
https://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win32/Personal%20Builds/mingw-builds/8.1.0/threads-win32/sjlj/i686-8.1.0-release-win32-sjlj-rt_v6-rev0.7z/download
- Get from sourceforge page > "files" tab > Toolchains targetting Win32 > Personal Builds > mingw-builds > some version zip
- MSYS2 with the MinGW-w64_shell (32bit) package: https://msys2.github.io/
- Resulting binaries may depend on `msys*.dll`.
On Linux it should be included by default in the distribution, or can be easily installed using the distro's package manager (for example `sudo apt-get install gcc g++ make`).
### Microsoft's Visual C++ (MSVC) / Visual Studio / MSBuild
Alt C compiler, auto-generated builds for Windows use this.
On Mac may be installed with a package manager like *Homebrew*, but using *Clang* is probably easier.
Bundled in either:
- Visual Studio (2015/2017/latest): https://www.visualstudio.com/downloads/
Any not-too-ancient versions should work, since vgmstream uses standard C. GCC usually comes with *Make*, a program that can be used to build vgmstream.
Visual Studio Community should work (free), but must register after trial period. Even after trial you can still use MSBuild, command-line tool that actually does all the building. You can also find and install "Visual C++ Build Tools" without Visual Studio IDE (try google as MS's links tend to move around).
### Microsoft's Visual C++ (MSVC) / Visual Studio / MSBuild (compiler)
Alt C compiler (Windows only), auto-generated builds for Windows use this. Bundled in:
- Visual Studio (2015/2017/2019/latest): https://www.visualstudio.com/downloads/
Older versions of MSVC (2010 and before) have limited C support, while reportedly beta/new versions aren't always very stable. Some very odd issues affecting only MSVC have been found and fixed before. Keep in mind if you run into problems.
Visual Studio Community (free) should work, but you may need to register after a trial period. Even after trial you can still use *MSBuild*, command-line tool that actually does all the building, calling the *MSVC* compiler (Visual Studio itself is just an IDE for development and not actually needed).
### Clang
Reportedly works fine on Mac and may used as a replacement for GCC without issues.
Instead of the full (usually huge) Visual Studio, you can also get "Build Tools for Visual Studio", variation that only installs *MSBuild* and necessary files without the IDE. Usually found in the above link, under "Tools for Visual Studio" (or google as MS's links tend to move around).
Should be usable on Linux and possibly Windows with CMake.
When installing check the "Desktop development with C++" group, and optionally select "MFC support" and "ATL support" sub-options to build foobar2000 plugin (you can modify that or re-install IDE later, by running installed "Visual Studio Installer"). You could include MSVC v141 (2017) compatibility too just in case, since it's mainly tested with that.
Older versions of MSVC (2010 and earlier) have limited C support and may not work with latest commits, while reportedly beta/new versions aren't always very stable. Also, only projects (`.vcxproj`) for VS2015+ are included (CMake may be able to generate older `.vcproj` if you really need them). Some very odd issues affecting MSVC only have been found and fixed before. Keep in mind all of this if you run into problems.
### Clang (compiler)
Alt C compiler, reportedly works fine on Mac and may used as a replacement of GCC without issues.
- https://releases.llvm.org/download.html
For other makefiles may work, though may need to set compiler vars appropriately (CC=clang AR=llvm-ar).
Should be usable on Linux and possibly Windows with CMake. For default Makefiles may need to set compiler vars appropriately (CC=clang AR=llvm-ar and so on).
### Git
Optional, used to generate version numbers:
- Git for Windows: https://git-scm.com/download/win
### Simple scripts (builds)
Default build scripts included in source that can compile vgmstream, though limited in some ways.
Git also comes with typical Linux utils compiled for Windows (in the usr\bin dir), that can help when compiling some extra components on Windows.
**For MSVC**: there is a default Visual Studio `.sln` that should be up to date (run `./msvc-build-init.bat` first, or see the foobar section to get extra dependencies manually, then open). A PowerShell script also automates compilation (on Windows 7 may need recent .NET framework and PowerShell versions), simply run `./msvc-build.bat`.
### CMake
Optional, can be used to compile vgmstream's modules instead of regular scripts. Needs v3.6 or later:
First you may need to either open the `.sln` and change project compiler (*PlatformToolset*) and SDK (*WindowsTargetPlatformVersion*) to your installed version, or edit `msvc-build.ps1` and set the variables near *CONFIG*. To avoid modifying files you can also create a file named `msvc-build.config.ps1` with:
```
# - toolsets: "" (p), "v140" (MSVC 2015), "v141" (MSVC 2017), "v141_xp" (XP support), "v142" (MSVC 2019), etc
# - sdks: "" (default), "7.0" (Win7 SDK), "8.1" (Win8 SDK), "10.0" (Win10 SDK), etc
$toolset = "142"
$sdk = "10.0"
```
It's also possible to call MSBuild and pass those values from the CMD, see foobar section for an example.
Once finished resulting binaries are in the *./Release* folder. Remember you need to copy extra `.dll` to run them (see [README.md](../README.md)).
**For GCC/CLang**: there are basic Makefiles that work like usual with *make* (like `make vgmstream_cli EXTRA_CFLAGS="-DVGM_DEBUG_OUTPUT`). On Windows this compiles with extra libs enabled, but not on Linux (try CMake or autotools for those). Artifacts are usually in their subdir (*./cli*, *./winamp*, etc).
### CMake (builds)
Tool used to generate common build files (for *make*, *VS/MSBuild*, etc), that in turn can be used to compile vgmstream's modules instead of existing scripts/files. Needs v3.6 or later:
- https://cmake.org/download/
If you wish to use CMake, see [CMAKE.md](CMAKE.md). Some extra info is only mentioned in this doc though.
If you wish to use CMake see [CMAKE.md](CMAKE.md). Some extra info is only mentioned in this doc though.
### autotools
Optional, used by some modules (mainly Audacious for Linux, and external libs).
Note that doing in-source builds of CMake (`cmake .` / selecting `./vgmstream` as output dir) is not recommended and may clobber default build files.
For Windows you must include GCC, and Linux's sh tool in some form in PATH. The simplest would be installing MinGW-w64 for GCC.exe, and Git for sh.exe, and making PATH point their bin dir.
- ex. `C:\i686-8.1.0-release-win32-sjlj-rt_v6-rev0\mingw32\bin` and `C:\Git\usr\bin`
### autotools (builds)
Autogenerated *make* scripts, used by some modules (mainly Audacious for Linux, and external libs).
For Windows you must include GCC, and Linux's sh tool in some form in PATH. Simplest would be installing *MinGW-w64* for `gcc.exe` (and related tools), and *Git* for `sh.exe`, and making PATH point their bin dir.
- ex. `C:\mingw\i686-8.1.0-release-win32-sjlj-rt_v6-rev0\mingw32\bin` and `C:\Git\usr\bin`
- Both must be installed/copied in a dir without spaces (with spaces autoconf seemingly works but creates buggy files)
- If you don't have Git, try compiled GNU tools for Windows (http://gnuwin32.sourceforge.net/packages.html)
A useful trick for Windows is that you can alter PATH variable temporarly in `.bat` scripts (PATH is used to call programs in Windows without having to write full path to .exe)
A trick on Windows is that you can temporary alter PATH variable in `.bat` scripts (PATH is used to call programs in Windows without having to write full path to .exe)
```
set PATH=%PATH%;C:\i686-8.1.0-release-win32-sjlj-rt_v6-rev0\mingw32\bin
set PATH=%PATH%;C:\mingw\i686-8.1.0-release-win32-sjlj-rt_v6-rev0\mingw32\bin
set PATH=%PATH%;C:\Git\usr\bin
gcc.exe (...)
```
For Linux, those may be included already, or install with a package manager (`sudo apt-get install autoconf automake libtool`).
For Linux, GCC/make/autotools should be included already, or install with a package manager (`sudo apt-get install gcc g++ make autoconf automake libtool`), also depends on *Make*.
Typical usage involves `./configure` (creates makefiles) + `Make` (compiles) + `Make install` (copies results), but varies slightly depending on module/lib (explained later).
Typical usage involves `./configure` (creates Makefiles) + `make` (compiles) + `make install` (copies results), but varies slightly depending on module/lib (explained later).
External libs using autotools can be compiled on Windows too, try using `sh.exe ./configure`, `mingw32-make.exe`, `mingw32-make.exe install` instead. Also for older libs, call `sh.exe ./configure` with either `--build=mingw32`, `--host=mingw32` or `--target-os=mingw32` (varies) for older configure. You may also need to use `mingw32-make.exe LDFLAGS="-no-undefined -static-libgcc" MAKE=mingw32-make.exe` so that `.dll` are correctly generated.
### Extra libs
Optional, add codec or extra functionalities. See *External libraries* for full info.
### Git (extras)
Code version control for development. Optional, used to auto-generate version numbers:
- https://git-scm.com/download
Remember Git can only be used if you clone the vgmstream repo (not with `.zip` sources).
On Windows, Git also comes with typical Linux utils (in the usr\bin dir), that can help when compiling some extra components.
### Extra libs (extras)
Optional codec. See *External libraries* for full info.
On Windows most libs are pre-compiled and included to simplify building (since they can be quite involved to compile).
On Linux you usually need dev packages of each (for example `libao-dev` for vgmstream123, `audacious-dev` for Audacious, and so on) and they should be picked by CMake/autotool scripts.
On Linux you usually need dev packages of each (for example `libao-dev` for vgmstream123, `libvorbis-dev` for Vorbis, and so on) and they should be picked by CMake/autotool scripts.
With no extra libs (or only some) enabled vgmstream works fine, but some advanced formats/codecs won't play. See *External libraries* for info about those extra codecs.
## Compiling modules
@ -90,18 +125,20 @@ On Linux you usually need dev packages of each (for example `libao-dev` for vgms
**With GCC/Clang**: there are various ways to build it, each with some differences; you probably want CMake described below.
Simplest way is using the *./Makefile* in the root folder, see inside for options. For compilation flags check the *Makefile* in each folder. You may need to manually rebuild if you change a *.h* file (use *make clean*). On Windows this will build with external libs enabled, but Linux can't ATM.
Simplest way is using the *./Makefile* in the root folder, see inside for options. For compilation flags check the *Makefile* in each folder. You may need to manually rebuild if you change a *.h* file (`make clean`). On Windows this will build with external libs enabled, but Linux can't ATM.
Also, on Linux you can't build *in_vgmstream* and *xmp-vgmstream* (given they are Windows DLLs...). Makefiles have been used in the past to cross-compile from Linux with MingW headers though, but can't generate native Win code at the moment (should be fixable with some effort).
*Autotools* should build and install it as `vgmstream-cli`, this is explained in detail in the Audacious section. It enables (some) extra codecs. Some Linux distributions like Arch Linux include pre-patched vgmstream with most libraries, you may want that instead:
https://aur.archlinux.org/packages/vgmstream-kode54-git/
- https://aur.archlinux.org/packages/vgmstream-git/
If you use Mac (or Linux), there is a *Homebrew* script that may automate the process (uses CMake): https://formulae.brew.sh/formula/vgmstream
If you use Mac (or Linux), there is a *Homebrew* script that may automate the process (uses CMake):
- https://formulae.brew.sh/formula/vgmstream
You may try CMake instead as it may be simpler and handle libs better. Some older distros may not work though (CMake version needs to recognize FILTER command). You may also need to install resulting artifacts manually (check ./cli dir). Check the *CMAKE.md* doc for some extra info too.
You may try CMake instead as it may be simpler and handle libs better. Some older distros may not work though (CMake version needs to recognize FILTER command). You may also need to install resulting artifacts manually. Check the *CMAKE.md* doc for some extra info too.
```
sudo apt-get update
sudo apt-get install -y gcc g++ make build-essential
sudo apt-get install -y libmpg123-dev libvorbis-dev libspeex-dev
sudo apt-get install -y libavformat-dev libavcodec-dev libavutil-dev libswresample-dev
sudo apt-get install -y libao-dev audacious-dev
@ -110,11 +147,12 @@ sudo apt-get install -y cmake
git clone https://github.com/vgmstream/vgmstream
cd vgmstream
cmake .
# for older versions try "cmake ." instead
cmake -S . -B build
make
```
Windows CMD example (with some debugging on):
Windows CMD .bat example (with some debugging on):
```
prompt $P$G$_$S
set PATH=C:\Program Files (x86)\Git\usr\bin;%PATH%
@ -130,37 +168,45 @@ mingw32-make.exe vgmstream_cli -f Makefile ^
1> ../vgmstream-stdout.txt 2> ../vgmstream-stderr.txt
```
**With MSVC**: To build in Visual Studio, run `./msvc-build-init.bat`, open `vgmstream_full.sln` and compile. To build from the command line, just run `./msvc-build.bat`.
**With MSVC**: To build in Visual Studio, run *./init-build.bat*, open *./vgmstream_full.sln* and compile. To build from the command line, run *./build.bat*.
The build script will automatically handle obtaining dependencies and making the project changes listed in the foobar2000 section (you may need to install some PowerShell .NET packages). You could also call MSBuild directly in the command line (see the foobar2000 section for dependencies and examples).
The build script will automatically handle obtaining dependencies and making the project changes listed in the foobar2000 section (you may need to get some PowerShell .NET packages).
If you get build errors, remember you need to adjust compiler/SDK in the `.sln`. See *Simple scripts* above or CMD example in the foobar section.
You can also call MSBuild directly in the command line (see the foobar2000 section for dependencies and examples)
CMake can also be used instead to create project files (no particular benefit).
#### notes
While the official name for the CLI tool is `vgmstream-cli`, `test.exe` is used on Windows for historical reasons. If you want to reuse it for your own project it's probably better renaming to `vgmstream-cli.exe`.
### foobar2000 plugin (foo\_input\_vgmstream)
Requires MSVC (foobar/SDK only links to MSVC C++ DLLs) and these dependencies:
Requires MSVC (foobar/SDK only links to MSVC C++ DLLs). To build in Visual Studio, run `./msvc-build-init.bat`, open `vgmstream_full.sln` and compile. To build from the command line, just run `./msvc-build.bat`.
foobar has multiple dependencies. Build script downloads them automatically, but here they are:
- foobar2000 SDK (2018), in *(vgmstream)/dependencies/foobar/*: http://www.foobar2000.org/SDK
- (optional) FDK-AAC, in *(vgmstream)/dependencies/fdk-aac/*: https://github.com/kode54/fdk-aac
- (optional) QAAC, in *(vgmstream)/dependencies/qaac/*: https://github.com/kode54/qaac
- WTL (if needed), in *(vgmstream)/dependencies/WTL/*: http://wtl.sourceforge.net/
- may need to install ATL and MFC libraries (can be installed in Visual Studio Installer)
- may need to install ATL and MFC libraries if not included by default (can be added from the Visual Studio installer)
The following project modifications are required:
- For *foobar2000_ATL_helpers* add *../../../WTL/Include* to the compilers's *additional includes*
FDK-AAC/QAAC can be enabled adding *VGM_USE_MP4V2* and *VGM_USE_FDKAAC* in the compiler/linker options and the project dependencies, otherwise FFmpeg is used instead to support .mp4. FDK-AAC Support is limited so FFmpeg is recommended.
You can also manually use the command line to compile with MSBuild, if you don't want to touch the .vcxproj files, register VS after trial, get PowerShell dependencies for the build script, or only have VC++/MSBuild tools.
In theory any foobar SDK should work, but there may be issues when using versions past `2018-02-05`. Mirror in case official site is down: https://github.com/vgmstream/vgmstream-deps/raw/master/foobar2000/SDK-2018-02-05.zip
Windows CMD example for foobar2000:
You can also manually use the command line to compile with MSBuild, if you don't want to touch the `.vcxproj` files, register VS after trial, get PowerShell dependencies for the build script, or only have VC++/MSBuild tools.
Windows CMD example for foobar2000 (manual build):
```
prompt $P$G$_$S
set PATH=C:\Program Files (x86)\Git\usr\bin;%PATH%
set PATH=C:\Program Files (x86)\MSBuild\14.0\Bin;%PATH%
REM MSVC ~2015
REM set PATH=%PATH%;C:\Program Files (x86)\MSBuild\14.0\Bin;%PATH%
REM Latest(?) MSVC
set PATH=%PATH%;C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\Current\Bin
cd vgmstream
@ -170,20 +216,25 @@ set LINK="C:\projects\foobar\foobar2000\shared\shared.lib"
msbuild fb2k/foo_input_vgmstream.vcxproj ^
/t:Clean
REM depending on your installed Visual Studio build tools you may need to change:
REM - PlatformToolset: v140=MSVC 2015, v141=MSVC 2017, v141_xp=same with XP support, v142=MSVC 2019, etc
REM - WindowsTargetPlatformVersion: 7.0=Win7 SDK, 8.1=Win8 SDK, 10.0=Win10 SDK, etc
msbuild fb2k/foo_input_vgmstream.vcxproj ^
/t:Build ^
/p:Platform=Win32 ^
/p:PlatformToolset=v140 ^
/p:PlatformToolset=v142 ^
/p:WindowsTargetPlatformVersion=10.0 ^
/p:Configuration=Release ^
/p:DependenciesDir=../..
```
### Audacious plugin
Requires the dev version of Audacious (and dependencies), automake/autoconf or CMake, and gcc/make (C++11). It must be compiled and installed into Audacious, where it should appear in the plugin list as "vgmstream".
Requires the dev version of Audacious (and dependencies), autotools (automake/autoconf) or CMake, and gcc/make (C++11). It must be compiled and installed into Audacious, where it should appear in the plugin list as "vgmstream".
The plugin needs Audacious 3.5 or higher. New Audacious releases can break plugin compatibility so it may not work with the latest version unless adapted first.
libvorbis/libmpg123/libspeex will be used if found, while FFmpeg and other external libraries aren't enabled at the moment, thus some formats won't work (build scripts need to be fixed).
CMake should handle all correctly, while when using autotools, libvorbis/libmpg123/libspeex will be used if found, while FFmpeg and other external libraries aren't enabled at the moment, thus some formats won't work (build scripts need to be fixed).
Windows builds aren't supported at the moment (should be possible but there are complex dependency chains).
@ -192,7 +243,24 @@ If you get errors during the build phase we probably forgot some `#ifdef` needed
Take note of other plugins stealing extensions (see README). To change Audacious's default priority for vgmstream you can make with CFLAG `AUDACIOUS_VGMSTREAM_PRIORITY n` (where `N` is a number where 10=lowest)
Terminal example, assuming a Ubuntu-based Linux distribution:
You can try building with CMake. Some older distros may not work though (CMake version needs to recognize FILTER command), and may need to install resulting artifacts manually (check ./audacious dir).
```
sudo apt-get update
sudo apt-get install -y gcc g++ make build-essential
sudo apt-get install -y libmpg123-dev libvorbis-dev libspeex-dev
sudo apt-get install -y libavformat-dev libavcodec-dev libavutil-dev libswresample-dev
sudo apt-get install -y libao-dev audacious-dev
sudo apt-get install -y cmake
git clone https://github.com/vgmstream/vgmstream
cd vgmstream
# for older versions try "cmake ." instead
cmake -S . -B build
make
```
Instead of CMake you can use autotools. Terminal example, assuming a Ubuntu-based Linux distribution:
```
# build setup
@ -248,29 +316,34 @@ find . -name ".deps" -type d -exec rm -r "{}" \;
## WARNING, removes *all* untracked files not in .gitignore
git clean -fd
```
To update vgmstream it's probably easiest to remove the `vgmstream` folder and start again from *base vgmstream build* step, since updates often require a full rebuild anyway.
Instead of autotools you can try building with CMake. Some older distros may not work though (CMake version needs to recognize FILTER command). You may need to install resulting artifacts manually (check ./audacious dir).
```
sudo apt-get update
sudo apt-get install -y libmpg123-dev libvorbis-dev libspeex-dev
sudo apt-get install -y libavformat-dev libavcodec-dev libavutil-dev libswresample-dev
sudo apt-get install -y libao-dev audacious-dev
sudo apt-get install -y cmake
git clone https://github.com/vgmstream/vgmstream
cd vgmstream
cmake .
make
```
To update vgmstream it's probably easiest to remove the `vgmstream` folder and start again from *base vgmstream build* step, since updates often require a full rebuild anyway, or call `git clean -fd` or maybe `git reset --hard`.
### vgmstream123 player
Should be buildable with Autotools/CMake by following the same steps as listen in the Audacious section (requires libao-dev).
Should be buildable with Autotools/CMake by following the same steps as listen in the Audacious section (requires *libao-dev*).
Windows builds are possible with `libao.dll` and `libao` includes (found elsewhere) through the `Makefile`, but some features are disabled.
libao is licensed under the GPL v2 or later.
*libao* is licensed under the GPL v2 or later.
## Shared lib
Currently there isn't an official way to make vgmstream a shared lib (`.so`/`.dll`), but it can be achieved with some effort.
For example with the basic makefiles:
```
# build all of the intermediates with relocatable code
# *note*: quick hack with performance penalty, needs better dependency rules
make vgmstream_cli EXTRA_CFLAGS=-fPIC
# build the actual shared library
make -C src libvgmstream.so
```
May also need to take `vgmstream.h`, `streamfile.h` and `plugins.h`, and trim them somewhat to use as includes for the `.so`.
For MSVC, you could add `__declspec(dllexport)` to exported functions in the "public" API of the above `.h`, and set `<ConfigurationType>DynamicLibrary</ConfigurationType>` in `libvgmstream.vcxproj`, plus add a `<Link>` under `<ClCompile>` to those libs (copy from `vgmstream_cli.vcxproj`).
A cleaner API/.h and build methods is planned for the future (low priority though).
## External libraries
@ -291,7 +364,7 @@ MSVC needs a .lib helper to link .dll files, but libs below usually only create
### libvorbis
Adds support for Vorbis (inside Ogg and custom containers).
Adds support for Vorbis, inside Ogg as `.ogg` (plain or encrypted) or custom variations like `.wem`, `.fsb`, `.ogl`, etc.
- Source: http://downloads.xiph.org/releases/vorbis/libvorbis-1.3.6.zip
- DLL: `libvorbis.dll`
- licensed under the 3-clause BSD license.
@ -300,7 +373,7 @@ Should be buildable with MSVC (in /win32 dir are .sln files) or autotools (use `
### mpg123
Adds support for MPEG (MP1/MP2/MP3).
Adds support for MPEG (MP1/MP2/MP3), used in formats that may have custom MPEG like `.ahx`, `.msf`, `.xvag`, `.scd`, etc.
- Source: https://sourceforge.net/projects/mpg123/files/mpg123/1.25.10/
- Builds: http://www.mpg123.de/download/win32/1.25.10/
- DLL: `libmpg123-0.dll`
@ -310,7 +383,7 @@ Must use autotools (sh configure, make, make install), though some scripts simpl
### libg719_decode
Adds support for ITU-T G.719 (standardization of Polycom Siren 22).
Adds support for ITU-T G.719 (standardization of Polycom Siren 22), used in a few Namco `.bnsf` games.
- Source: https://github.com/kode54/libg719_decode
- DLL: `libg719_decode.dll`
- unknown license (possibly invalid and Polycom's)
@ -319,12 +392,12 @@ Use MSVC (use `g719.sln`). It can be built with GCC too, but you'll need to manu
### FFmpeg
Adds support for multiple codecs: ATRAC3, ATRAC3plus, XMA1/2, WMA v1, WMA v2, WMAPro, AAC, Bink, AC3/SPDIF, Opus, Musepack, FLAC, etc (also Vorbis and MPEG for certain cases).
Adds support for multiple codecs: ATRAC3 (`.at3`), ATRAC3plus (`.at3`), XMA1/2 (`.xma`), WMA v1 (`.wma`), WMA v2 (`.wma`), WMAPro (`.xwma`), AAC (`.mp4`, `.aac`), Bink (`.bik`), AC3/SPDIF (`.ac3`), Opus (`.opus`), Musepack (`.mpc`), FLAC (`.flac`), etc.
- Source: https://github.com/FFmpeg/FFmpeg/
- DLLs: `avcodec-vgmstream-58.dll`, `avformat-vgmstream-58.dll`, `avutil-vgmstream-56.dll`, `swresample-vgmstream-3.dll`
- primarily licensed under the LGPL v2.1 or later, with portions licensed under the GPL v2
vgmstream's FFmpeg builds remove many unnecessary parts of FFmpeg to trim down its gigantic size, and are also built with the "vgmstream-" preffix (to avoid clashing with other plugins). Current options can be seen in `ffmpeg_options.txt`.
vgmstream's FFmpeg builds for Windows remove many unnecessary parts of FFmpeg to trim down its gigantic size, and are also built with the "vgmstream-" prefix to avoid clashing with other plugins. Current options can be seen in `ffmpeg_options.txt`. Linux usually links to the system's FFmpeg without issues.
For GCC simply use autotools (configure, make, make install), passing to `configure` the above options.
@ -334,7 +407,7 @@ Both may need yasm somewhere in PATH to properly compile: https://yasm.tortall.n
### LibAtrac9
Adds support for ATRAC9.
Adds support for ATRAC9, used in `.at9` and other formats for the PS4 and Vita.
- Source: https://github.com/Thealexbarney/LibAtrac9
- DLL: `libatrac9.dll`
- licensed under the MIT license
@ -343,7 +416,7 @@ Use MSCV and `libatrac9.sln`, or GCC and the Makefile included.
### libcelt
Adds support for FSB CELT versions 0.6.1 and 0.11.0.
Adds support for FSB CELT versions 0.6.1 and 0.11.0, used in a handful of older `.fsb`.
- Source (0.6.1): http://downloads.us.xiph.org/releases/celt/celt-0.6.1.tar.gz
- Source (0.11.0): http://downloads.xiph.org/releases/celt/celt-0.11.0.tar.gz
- DLL: `libcelt-0061.dll`, `libcelt-0110.dll`
@ -381,9 +454,11 @@ To compile we'll use autotools with GCC preprocessor renaming:
- you need to create a .def file for those DLL with the renamed simbol names above
- finally the includes. libcelt gives "celt.h" "celt_types.h" "celt_header.h", but since we renamed a few functions we have a simpler custom .h with minimal renamed symbols.
For Linux, an option is using AUR's scripts (https://aur.archlinux.org/packages/vgmstream-git/) that similarly patch celt libs in PKGBUILD.
### libspeex
Adds support for Speex (inside custom containers).
Adds support for Speex (inside custom containers), used in a few *EA* formats (`.sns`, `.sps`) for voices.
- Source: http://downloads.us.xiph.org/releases/speex/speex-1.2.0.tar.gz
- DLL: `libspeex.dll`
- licensed under the Xiph.Org variant of the BSD license.
@ -395,8 +470,8 @@ You can also find a release on Github (https://github.com/xiph/speex/releases/ta
Windows CMD example:
```
set PATH=%PATH%;C:\mingw\i686-8.1.0-release-win32-sjlj-rt_v6-rev0\mingw32\bin
set PATH=%PATH%;C:\Git\usr\bin
set PATH=%PATH%;C:\i686-8.1.0-release-win32-sjlj-rt_v6-rev0\mingw32\bin
sh ./configure --host=mingw32 --prefix=/c/celt-0.11.0/bin/ --exec-prefix=/c/celt-0.11.0/bin/
mingw32-make.exe LDFLAGS="-no-undefined -static-libgcc" MAKE=mingw32-make.exe

View File

@ -15,11 +15,9 @@
- Windows: https://www.visualstudio.com/downloads/
If building the CLI for *nix-based OSes, vgmstream123 also needs the following:
- **LibAO**
If building for *nix-based OSes, the following libraries are optional:
- **libmpg123**
- **libvorbis** (really libvorbisfile, though)
- **FFmpeg**
@ -37,7 +35,7 @@ First you will need to run CMake to generate the build setup. You can use either
### CMake GUI
If you have access to the CMake GUI, you can use that to create your build setup. Select where the source code is (that should be the directory just above this one) and where you wish to build to.
If you have access to the CMake GUI, you can use that to create your build setup. Select where the source code is (that should be the directory just above this one) and where you wish to build to (preferably a directory outside source).
You may have to add some entries before configuring will succeed. See the [CMake Cache Entries](#cmake-cache-entries) section for details on the entries.
@ -50,6 +48,8 @@ Generating done
Before that you'll see what options are enabled and disabled, what is going to be built and where they will be installed to.
You may need to select a Generator first, depending on your installed tools (for example, Visual Studio 16 2019 or MingW Make on Windows). If you need to change it later, select *File > Delete Cache*.
If you decided to build for a project-based GUI, you can click on Open Project to open that. (NOTE: Only Visual Studio has been tested as a project-based GUI.) If you decided to build for a command line build system, you can open up the command line for the build directory and run your build system.
### CMake command line
@ -60,11 +60,31 @@ If you don't have access to the CMake GUI or would prefer to only use the comman
cmake -G "<generator>" <options> <path to source code>
```
Replace `<generator>` with the CMake generator you wish to use as your build system. Make note of the quotes, and use `cmake -h` to get a list of generators for your system.
Replace `<generator>` with the CMake generator you wish to use as your build system (for example `Unix Makefiles`, or don't set for default). Make note of the quotes, and use `cmake -h` to get a list of generators for your system.
You may have to add some entries before configuring will success. See the [CMake Cache Entries](#cmake-cache-entries) section for details on the entries.
Place your entries in the `<options>` section of the above command, with each option in the form of `-D<optionname>:<type>=<value>`. Replace `<path to source code>` with the path where the source code is (that should be the directory just above this one).
Place your entries in the `<options>` section of the above command, with each option in the form of `-D<optionname>:<type>=<value>`. Replace `<path to source code>` with the path where the source code is (that should be the directory just above this one), may need to se `-S <path to source> -B <output dir>` instead. Example:
```
git clone https://github.com/vgmstream/vgmstream.git
cd vgmstream
cmake -DUSE_FFMPEG=ON -DBUILD_AUDACIOUS=OFF -S . -B build
```
You may need to install appropriate packages first (see [BUILD.md)(BUILD.md) for more info), for example:
```
sudo apt-get update
# basic compilation
sudo apt-get install -y gcc g++ make build-essential
# extra libs
sudo apt-get install -y libmpg123-dev libvorbis-dev libspeex-dev
# extra libs
sudo apt-get install -y libavformat-dev libavcodec-dev libavutil-dev libswresample-dev
# for vgmstream123 and audacious
sudo apt-get install -y libao-dev audacious-dev
# actual cmake
sudo apt-get install -y cmake
```
Once you have run the command, as long as there are no errors, you should see the following at the bottom of the window:
@ -92,7 +112,6 @@ If not using a project-based GUI, then you will also need to set what build type
All of these options are of type BOOL and can be set to either `ON` or `OFF`. Most of the details on these libraries can be found in the [External Libraries section of BUILD.md](BUILD.md#external-libraries).
- **USE_FDKAAC**: Chooses if you wish to use FDK-AAC/QAAC for support of MP4 AAC. Note that this requires `QAAC_PATH` and `FDK_AAC_PATH` to also be given if the option is `ON`. The default for is `ON`. See the foobar2000 plugin section of [BUILD.md](BUILD.md) for more information on this.
- **USE_MPEG**: Chooses if you wish to use libmpg123 for support of MP1/MP2/MP3. The default is `ON`.
- **USE_VORBIS**: Chooses if you wish to use libvorbis for support of Vorbis. The default is `ON`.
- **USE_FFMPEG**: Chooses if you wish to use FFmpeg for support of many codecs. The default is `ON`. `FFMPEG_PATH` can also be given, so it can use official/external SDK instead of the one used in vgmstream project.