}
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" ;;
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"
}
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 () {
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"
}
step=$1
-target_arch=$2
-out_dir=$3
+buildpath=$2
+target_arch=$3
case $step in
gmp) prepare && build_gmp ;;
;;
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'
#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'
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