]> git.xonotic.org Git - xonotic/xonotic.wiki.git/blobdiff - Shared-libraries-(buildfiles).md
Update Mapping Introduction
[xonotic/xonotic.wiki.git] / Shared-libraries-(buildfiles).md
index 664c21fb47b6c794c0026b25eb77c0e68c7f8fd5..56053581f0585dcb4936a9e87fa98da3c7d174e4 100644 (file)
@@ -259,13 +259,6 @@ cp out/bin/libtheora-0.dll ~/Games/xonotic/misc/buildfiles/win64/libtheora-0.dll
 ### macOS
 Darkplaces loads `libtheora.dylib`
 
-# libd0_blind_id-0 & libd0_rijndael-0
-Internal project, see https://gitlab.com/xonotic/d0_blind_id
-
-### Linux
-
-`LDFLAGS='-L$HOME/Games/xonotic/misc/builddeps/linux64/gmp/lib' CPPFLAGS='-I$HOME/Games/xonotic/misc/builddeps/linux64/gmp/include' ./configure --prefix=$HOME/Games/xonotic/misc/builddeps/linux64/d0_blind_id  --enable-static --disable-shared --with-pic`
-
 # libgmp
 A dependency of libd0_blind_id-0
 
@@ -280,6 +273,62 @@ Obtainment instructions:
 * download as MSYS2 Package [1] in x86 and x64 versions: https://packages.msys2.org/base/mingw-w64-gmp
 * use dll from `bin` folder
 
+Cross-compiling:
+
+```
+d0=$(pwd)
+GMPVER="6.2.1"
+
+curl -o gmp-$GMPVER.tar.xz https://gmplib.org/download/gmp/gmp-$GMPVER.tar.xz
+tar xf gmp-$GMPVER.tar.xz
+rm gmp-$GMPVER.tar.xz
+
+mkdir out
+mkdir build
+cd build
+"$d0/gmp-$GMPVER/configure" --prefix="$d0/out" --host=x86_64-w64-mingw32 --with-pic --enable-fat --disable-static --enable-shared
+make
+make install
+cd "$d0"
+cp out/bin/libgmp-10.dll ~/Games/xonotic/misc/buildfiles/win64/libgmp-10.dll
+```
+
+# libd0_blind_id-0 & libd0_rijndael-0
+Internal project, see https://gitlab.com/xonotic/d0_blind_id
+
+### Linux
+
+`LDFLAGS='-L$HOME/Games/xonotic/misc/builddeps/linux64/gmp/lib' CPPFLAGS='-I$HOME/Games/xonotic/misc/builddeps/linux64/gmp/include' ./configure --prefix=$HOME/Games/xonotic/misc/builddeps/linux64/d0_blind_id  --enable-static --disable-shared --with-pic`
+
+### Windows
+Cross-compiling (requires libgmp):
+
+```
+d0=$(pwd)
+GMP_ROOT="$d0/../gmp/out"
+export LDFLAGS="-L$GMP_ROOT/lib"
+export CPPFLAGS="-I$GMP_ROOT/include"
+
+git clone https://gitlab.com/xonotic/d0_blind_id.git
+
+cd d0_blind_id
+./autogen.sh
+sed -i '/libd0_blind_id_la_LDFLAGS/ s/$/ -no-undefined/' Makefile.am
+sed -i '/libd0_rijndael_la_LDFLAGS/ s/$/ -no-undefined/' Makefile.am
+
+cd "$d0"
+mkdir build
+mkdir out
+cd build
+"$d0/d0_blind_id/configure" --with-pic --prefix="$d0/out" --host=x86_64-w64-mingw32
+make
+make install
+
+cd "$d0"
+cp out/bin/libd0_blind_id-0.dll ~/Games/xonotic/misc/buildfiles/win64/libd0_blind_id-0.dll
+cp out/bin/libd0_rijndael-0.dll ~/Games/xonotic/misc/buildfiles/win64/libd0_rijndael-0.dll
+```
+
 # libode
 Is not loaded under Windows and crashes the game if it is and a map is loaded up.
 Also it is not statically linked and thus requires libstdc++-6.dll and libgcc_s_sjlj-1.dll.