From b64491e2844fa5c5158de207338a1b6862edfdff Mon Sep 17 00:00:00 2001 From: JustArchi Date: Thu, 21 Jul 2016 23:24:03 +0200 Subject: [PATCH] Fix compilation with Mono master Bugs, bugs everywhere! https://bugzilla.xamarin.com/show_bug.cgi?id=42606 --- ArchiSteamFarm/ArchiSteamFarm.csproj | 4 ++++ ConfigGenerator/ConfigGenerator.csproj | 4 ++++ cc.sh | 4 ++++ mono_envsetup.sh | 23 +++++++++++++++++++++++ run.sh | 4 ++++ 5 files changed, 39 insertions(+) create mode 100644 mono_envsetup.sh diff --git a/ArchiSteamFarm/ArchiSteamFarm.csproj b/ArchiSteamFarm/ArchiSteamFarm.csproj index 1f5f6e734..2abd680c8 100644 --- a/ArchiSteamFarm/ArchiSteamFarm.csproj +++ b/ArchiSteamFarm/ArchiSteamFarm.csproj @@ -189,6 +189,10 @@ copy "$(TargetDir)$(TargetName).exe" "$(SolutionDir)out\ASF.exe" + if [[ -f "$(SolutionDir)/mono_envsetup.sh" ]]; then + source "$(SolutionDir)/mono_envsetup.sh" + fi + mkdir -p "$(SolutionDir)out/config" cp "$(TargetDir)config/ASF.json" "$(SolutionDir)out/config" cp "$(TargetDir)config/example.json" "$(SolutionDir)out/config" diff --git a/ConfigGenerator/ConfigGenerator.csproj b/ConfigGenerator/ConfigGenerator.csproj index feb1949e2..1844316fb 100644 --- a/ConfigGenerator/ConfigGenerator.csproj +++ b/ConfigGenerator/ConfigGenerator.csproj @@ -115,6 +115,10 @@ copy "$(TargetDir)$(TargetName).exe" "$(SolutionDir)out\ASF-ConfigGenerator.exe" + if [[ -f "$(SolutionDir)/mono_envsetup.sh" ]]; then + source "$(SolutionDir)/mono_envsetup.sh" + fi + mono --llvm --server -O=all "$(SolutionDir)tools/ILRepack/ILRepack.exe" /ndebug /internalize /parallel /targetplatform:v4 /wildcards /out:"$(SolutionDir)out/ASF-ConfigGenerator.exe" "$(TargetDir)$(TargetName).exe" "$(TargetDir)*.dll" rm "$(SolutionDir)out/ASF-ConfigGenerator.exe.config" diff --git a/cc.sh b/cc.sh index 02e754497..216552710 100755 --- a/cc.sh +++ b/cc.sh @@ -29,6 +29,10 @@ XBUILD_ARGS+=("/p:Configuration=$BUILD") cd "$(dirname "$(readlink -f "$0")")" +if [[ -f "mono_envsetup.sh" ]]; then + source "mono_envsetup.sh" +fi + if [[ -d ".git" ]] && hash git &>/dev/null; then git pull || true fi diff --git a/mono_envsetup.sh b/mono_envsetup.sh new file mode 100644 index 000000000..e00e3f0e2 --- /dev/null +++ b/mono_envsetup.sh @@ -0,0 +1,23 @@ +#!/bin/bash + +MONO_DEBUG_IF_AVAILABLE() { + local PREVIOUS_MONO_DEBUG="$MONO_DEBUG" + + if [[ -z "$PREVIOUS_MONO_DEBUG" ]]; then + export MONO_DEBUG="$1" + elif echo "$PREVIOUS_MONO_DEBUG" | grep -Fq "$1"; then + return 0 + else + export MONO_DEBUG="${PREVIOUS_MONO_DEBUG},${1}" + fi + + if mono "" 2>&1 | head -n 1 | grep -Fq "$1"; then + export MONO_DEBUG="$PREVIOUS_MONO_DEBUG" + return 1 + fi + + return 0 +} + +# https://bugzilla.xamarin.com/show_bug.cgi?id=42606 +MONO_DEBUG_IF_AVAILABLE "no-compact-seq-points" diff --git a/run.sh b/run.sh index 4bece845c..4e6a21f42 100755 --- a/run.sh +++ b/run.sh @@ -26,6 +26,10 @@ fi cd "$(dirname "$(readlink -f "$0")")" +if [[ -f "mono_envsetup.sh" ]]; then + source "mono_envsetup.sh" +fi + BINARY="ArchiSteamFarm/bin/$BUILD/ArchiSteamFarm.exe" if [[ ! -f "$BINARY" ]]; then