Skip to content

Commit f49a203

Browse files
committed
Allow compiling with Mono
1 parent fd1458e commit f49a203

File tree

2 files changed

+30
-0
lines changed

2 files changed

+30
-0
lines changed

server/JsDbg.Gdb/Makefile

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,25 @@ BINDEPS=$(filter-out %extensions %JsDbg.py %JsDbg.Gdb, $(wildcard $(PUBLISH)/*))
1010

1111
PYTHON_FILES=JsDbg.py ../JsDbg.Stdio/JsDbg{Base,Types}.py
1212

13+
# Setting MONO=1 compiles the code with mono instead of dotnet. It does also
14+
# set up a runtimeconfig.json file to allow running the code with dotnet, which
15+
# JsDbgBase.py makes use of.
16+
# Running with Mono will not work until https://github.com/mono/mono/issues/15119
17+
# is fixed.
18+
# Requires packages:
19+
# apt install libmono-system-runtime-serialization4.0-cil libmono-system-web4.0-cil
20+
MONO=
21+
1322
all: bin/test_program
23+
ifdef MONO
24+
mkdir -p $(PUBLISH)
25+
mcs -r:System.Runtime.Serialization -r:System.Web ../JsDbg.Core/*.cs ../JsDbg.Stdio/*.cs -out:$(PUBLISH)/JsDbg.Stdio.dll
26+
cp -r ../../extensions $(PUBLISH)
27+
cp mono/* $(PUBLISH)
28+
else
1429
cd ../JsDbg.Stdio && $(DOTNET) restore $(RESTOREFLAGS)
1530
cd ../JsDbg.Stdio && $(DOTNET) publish -c Release --no-restore -o $(PUBLISH) $(PUBLISHFLAGS)
31+
endif
1632

1733
clean:
1834
rm -rf bin $(PUBLISH) $(PUBLISH_SC) ../JsDbg.{Core,Stdio,Stdio.Tests}/{bin,obj} jsdbg-gdb.tar.bz2 {.,../JsDbg.Stdio}/{*.pyc,__pycache__}
@@ -29,10 +45,12 @@ bin/test_program: testsuite/test_program.cc
2945
$(CXX) $^ -o $@ -g
3046

3147
check: bin/test_program
48+
ifndef MONO
3249
@# The restore flags set by debian/rules do not work with dotnet test.
3350
@# dotnet test does require us to download packages from the internet,
3451
@# so if $(RESTOREFLAGS) is set, just skip this test.
3552
if test x"$(RESTOREFLAGS)" = x; then cd ../JsDbg.Stdio.Tests && $(DOTNET) restore $(RESTOREFLAGS) && $(DOTNET) test --no-restore; fi
53+
endif
3654
cd testsuite && runtest
3755
python2 ../JsDbg.Stdio/JsDbgBase_test.py
3856
python3 ../JsDbg.Stdio/JsDbgBase_test.py
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"runtimeOptions": {
3+
"tfm": "net5.0",
4+
"framework": {
5+
"name": "Microsoft.NETCore.App",
6+
"version": "5.0.0"
7+
},
8+
"configProperties": {
9+
"System.Globalization.Invariant": true
10+
}
11+
}
12+
}

0 commit comments

Comments
 (0)