From 9c4d33950b4606a40c994455b2de5ff7adf7aa5d Mon Sep 17 00:00:00 2001 From: z411 Date: Wed, 29 Dec 2021 00:01:16 +0000 Subject: [PATCH] Added libtheora cross-compiling --- Shared-libraries-(buildfiles).md | 33 +++++++++++++++++++++++++++++--- 1 file changed, 30 insertions(+), 3 deletions(-) diff --git a/Shared-libraries-(buildfiles).md b/Shared-libraries-(buildfiles).md index a01a58d..41ac9e1 100644 --- a/Shared-libraries-(buildfiles).md +++ b/Shared-libraries-(buildfiles).md @@ -97,7 +97,7 @@ Obtainment instructions: * download MSYS2 Package [1] in x86 and x64 versions: https://packages.msys2.org/base/mingw-w64-libpng * use dll from `bin` folder -Cross-compiling: +Cross-compiling (requires zlib): ``` d0=$(pwd) @@ -187,12 +187,12 @@ Obtainment instructions: * download MSYS2 Package [1] in x86 and x64 versions: https://packages.msys2.org/base/mingw-w64-libvorbis * use dll from `bin` folder -Cross-compiling: +Cross-compiling (requires libogg): ``` d0=$(pwd) -OGG_ROOT=$d0/../ogg/out VORBISVER="v1.3.7" +OGG_ROOT=$d0/../ogg/out git clone -b $VORBISVER https://gitlab.xiph.org/xiph/vorbis.git @@ -228,6 +228,33 @@ Obtainment instructions: * download MSYS2 Package [1] in x86 and x64 versions: https://packages.msys2.org/base/mingw-w64-libtheora * use dll from `bin` folder +Cross-compiling (requires libogg and libvorbis): + +``` +d0=$(pwd) +THEORAVER="v1.1.1" +OGG_ROOT="$d0/../ogg/out" +VORBIS_ROOT="$d0/../vorbis/out" + +git clone -b $THEORAVER https://gitlab.xiph.org/xiph/theora.git + +# Fix mingw32 defs +sed -i '1iLIBRARY libtheoradec' "$d0/theora/win32/xmingw32/libtheoradec-all.def" +sed -i '1iLIBRARY libtheoraenc' "$d0/theora/win32/xmingw32/libtheoraenc-all.def" +sed -i '/TH_VP31_QUANT_INFO/d' "$d0/theora/win32/xmingw32/libtheoraenc-all.def" +sed -i '/TH_VP31_HUFF_CODES/d' "$d0/theora/win32/xmingw32/libtheoraenc-all.def" + +# Start build +mkdir out +mkdir build +cd build +$d0/theora/autogen.sh --host=x86_64-w64-mingw32 --prefix="$d0/out" --with-ogg="$OGG_ROOT" --with-vorbis="$VORBIS_ROOT" --enable-shared --disable-examples --disable-sdltest --disable-vorbistest --disable-oggtest +make +make install +cd "$d0" +cp out/bin/libtheora-0.dll ~/Games/xonotic/misc/buildfiles/win64/libtheora-0.dll +``` + ### macOS Darkplaces loads `libtheora.dylib` -- 2.39.2