From cfdafe49b75754c5bb893c4c911802ee31f1a690 Mon Sep 17 00:00:00 2001 From: z411 Date: Sun, 20 Feb 2022 17:01:50 -0300 Subject: [PATCH] Updated DLL building in release --- misc/buildsrc/dlls.sh | 25 +++++++++++-------------- misc/tools/all/release.subr | 26 ++++++++++++++++++++++++-- 2 files changed, 35 insertions(+), 16 deletions(-) diff --git a/misc/buildsrc/dlls.sh b/misc/buildsrc/dlls.sh index 5c642508..6c3ced43 100755 --- a/misc/buildsrc/dlls.sh +++ b/misc/buildsrc/dlls.sh @@ -14,11 +14,6 @@ require () { } prepare () { - if [ -z $out_dir ]; then - echo "Out directory not set." - exit 1 - fi - case $target_arch in win32) ARCH="i686" ;; win64) ARCH="x86_64" ;; @@ -26,9 +21,10 @@ prepare () { esac # Set directories - src_dir="$d0/dlls/src" - work_dir="$d0/dlls/work/$target_arch" - pkg_dir="$d0/dlls/pkg/$target_arch" + src_dir="$buildpath/src" + work_dir="$buildpath/work/$target_arch" + pkg_dir="$buildpath/pkg/$target_arch" + out_dir="$buildpath/out/$target_arch" # Set arch vars CHOST="$ARCH-w64-mingw32" @@ -300,9 +296,10 @@ install () { } clean () { - rm -rf "$d0/dlls/src" - rm -rf "$d0/dlls/work" - rm -rf "$d0/dlls/pkg" + rm -rf "$buildpath/src" + rm -rf "$buildpath/work" + rm -rf "$buildpath/pkg" + rm -rf "$buildpath/out" } list () { @@ -324,7 +321,7 @@ usage () { echo "Experimental Windows DLL cross-compiling for Xonotic" echo "by z411" echo - echo "usage: $0 [arch] [out directory]" + echo "usage: $0 [build path] [arch]" echo echo "available steps (require arch):" echo " : build specified library" @@ -342,8 +339,8 @@ usage () { } step=$1 -target_arch=$2 -out_dir=$3 +buildpath=$2 +target_arch=$3 case $step in gmp) prepare && build_gmp ;; diff --git a/misc/tools/all/release.subr b/misc/tools/all/release.subr index adb2789f..f4e246e9 100644 --- a/misc/tools/all/release.subr +++ b/misc/tools/all/release.subr @@ -268,13 +268,34 @@ case "$cmd" in ;; esac ;; + release-dlls-compile) + release_common + arch=$1 + buildpath=$2 + targetdir=$3 + mkdir -p "$d0/$targetdir" + cd "$d0/misc/buildsrc" + verbose ./dlls.sh all "$buildpath" "$arch" + verbose mv "$buildpath/out/$arch/*" "$d0/$targetdir" + cd "$d0" + ;; + release-dlls-clean) + verbose $d0/misc/buildsrc/dlls.sh clean "$buildpath" + ;; + release-dlls) + release_common + good=false + verbose "$SELF" release-dlls-compile win32 /tmp/dlls Xonotic/bin32 && good=true + verbose "$SELF" release-dlls-compile win64 /tmp/dlls Xonotic/bin64 && good=true + verbose "$SELF" release-dlls-clean /tmp/dlls + $good + ;; release-engine-win32) release_common #good=true #verbose "$SELF" release-getbinary Xonotic/xonotic-x86.exe || good=false #verbose "$SELF" release-getbinary Xonotic/xonotic-x86-dedicated.exe || good=false #$good - verbose "$d0/misc/buildsrc/dlls.sh" all win32 Xonotic/bin32 verbose "$SELF" release-compile win32 \ 'STRIP=: D3D=1 DP_MAKE_TARGET=mingw WIN32RELEASE=1 CC="i686-w64-mingw32-gcc -static -g1 -mstackrealign -Wl,--dynamicbase -Wl,--nxcompat -I../../../.deps/include -L../../../.deps/lib -DSUPPORTIPV6" WINDRES="i686-w64-mingw32-windres" SDL_CONFIG="../../../.deps/bin/sdl2-config" DP_LINK_CRYPTO=dlopen DP_LINK_CRYPTO_RIJNDAEL=dlopen DP_LINK_JPEG=dlopen DP_LINK_ODE=dlopen DP_LINK_ZLIB=dlopen' \ release 'darkplaces.exe:Xonotic/xonotic-x86-wgl.exe darkplaces-sdl.exe:Xonotic/xonotic-x86.exe darkplaces-dedicated.exe:Xonotic/xonotic-x86-dedicated.exe' @@ -285,7 +306,7 @@ case "$cmd" in #verbose "$SELF" release-getbinary Xonotic/xonotic.exe || good=false #verbose "$SELF" release-getbinary Xonotic/xonotic-dedicated.exe || good=false #$good - verbose "$d0/misc/buildsrc/dlls.sh" all win64 Xonotic/bin64 + verbose "$SELF" release-dlls win64 /tmp/dlls Xonotic/bin64 verbose "$SELF" release-compile win64 \ 'STRIP=: D3D=1 DP_MAKE_TARGET=mingw WIN64RELEASE=1 CC="x86_64-w64-mingw32-gcc -static -g1 -Wl,--dynamicbase -Wl,--nxcompat -I../../../.deps/include -L../../../.deps/lib -DSUPPORTIPV6" WINDRES="x86_64-w64-mingw32-windres" SDL_CONFIG="../../../.deps/bin/sdl2-config" DP_LINK_CRYPTO=dlopen DP_LINK_CRYPTO_RIJNDAEL=dlopen DP_LINK_JPEG=dlopen DP_LINK_ODE=dlopen DP_LINK_ZLIB=dlopen' \ release 'darkplaces.exe:Xonotic/xonotic-wgl.exe darkplaces-sdl.exe:Xonotic/xonotic.exe darkplaces-dedicated.exe:Xonotic/xonotic-dedicated.exe' @@ -579,6 +600,7 @@ case "$cmd" in release_common verbose "$SELF" release-prepare verbose "$SELF" release-maps + verbose "$SELF" release-dlls verbose "$SELF" release-engine verbose "$SELF" release-qc verbose "$SELF" release-pack -- 2.39.2