]> git.rm.cloudns.org Git - xonotic/xonotic.git/commitdiff
Updated DLL building in release
authorz411 <z411@omaera.org>
Sun, 20 Feb 2022 20:01:50 +0000 (17:01 -0300)
committerz411 <z411@omaera.org>
Sun, 20 Feb 2022 20:01:50 +0000 (17:01 -0300)
misc/buildsrc/dlls.sh
misc/tools/all/release.subr

index 5c6425081078c7fb72d720ce6ebdceb4f661e839..6c3ced431a61fedf3e6454c5b8b05e0dba87d70c 100755 (executable)
@@ -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 <step> [arch] [out directory]"
+       echo "usage: $0 <step> [build path] [arch]"
        echo
        echo "available steps (require arch):"
        echo "  <library name>: 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 ;;
index adb2789f81df5c52b642e104c7e32b18dcddca63..f4e246e95087a07804633633227a2fdb37519c0a 100644 (file)
@@ -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