mirror of
https://github.com/BepInEx/mono.git
synced 2026-11-17 19:10:23 -10:00
Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2da6ddd758 |
No files matched your search
@@ -32,7 +32,7 @@ file in this directory.
|
||||
CLA
|
||||
=======
|
||||
|
||||
Contributions are now taken under the [.NET Foundation CLA](https://cla.dotnetfoundation.org/).
|
||||
Contributions are now taken under the [.NET Foundation CLA](https://cla2.dotnetfoundation.org/).
|
||||
|
||||
Code Review
|
||||
=======
|
||||
|
||||
@@ -1,7 +1,3 @@
|
||||
<!--
|
||||
If you are new to the project get yourself familiar with https://www.mono-project.com/community/bugs/make-a-good-bug-report/ before filling the issue
|
||||
-->
|
||||
|
||||
## Steps to Reproduce
|
||||
|
||||
1.
|
||||
@@ -9,22 +5,22 @@ If you are new to the project get yourself familiar with https://www.mono-projec
|
||||
3.
|
||||
|
||||
<!--
|
||||
You may drag & drop the attachment (repro code/solution, screenshot, etc.) onto the issue.
|
||||
You may drag & drop the attachement (repro code/solution, screenshot, etc.) onto the issue.
|
||||
-->
|
||||
|
||||
### Current Behavior
|
||||
## Current Behavior
|
||||
|
||||
<!--
|
||||
What is the current behavior?
|
||||
-->
|
||||
|
||||
### Expected Behavior
|
||||
## Expected Behavior
|
||||
|
||||
<!--
|
||||
Please describe the behavior you are expecting
|
||||
-->
|
||||
|
||||
## On which platforms did you notice this
|
||||
### On which platforms did you notice this
|
||||
|
||||
[ ] macOS
|
||||
[ ] Linux
|
||||
@@ -36,12 +32,9 @@ Please describe the behavior you are expecting
|
||||
You can use `mono --version` or About dialog to obtain this information.
|
||||
-->
|
||||
|
||||
## Stacktrace
|
||||
### Stacktrace
|
||||
|
||||
```
|
||||
Please paste the stack trace here if available.
|
||||
Please paste the stacktrace here if available.
|
||||
```
|
||||
|
||||
<!--
|
||||
You can join us at https://gitter.im/mono/mono to discuss your reported issue
|
||||
-->
|
||||
@@ -1,9 +0,0 @@
|
||||
|
||||
|
||||
<!--
|
||||
Thank you for your Pull Request!
|
||||
|
||||
If you are new to contributing to Mono, please try to do your best at conforming to our coding guidelines http://www.mono-project.com/community/contributing/coding-guidelines/ but don't worry if you get something wrong. One of the project members will help you to get things landed.
|
||||
|
||||
Does your pull request fix any of the existing issues? Please use the following format: Fixes #issue-number
|
||||
-->
|
||||
+1
-3
@@ -40,7 +40,6 @@ Ankh.NoLoad
|
||||
*.gpState
|
||||
.vscode/
|
||||
*.exp
|
||||
.vs/
|
||||
|
||||
# Tooling
|
||||
_ReSharper*/
|
||||
@@ -90,7 +89,6 @@ stamp-h.in
|
||||
*.swp
|
||||
*.o
|
||||
.deps
|
||||
.libs
|
||||
|
||||
# Libtool
|
||||
libtool.m4
|
||||
@@ -131,4 +129,4 @@ mono-*.tar.*
|
||||
tmpinst-dir.stamp
|
||||
msvc/scripts/inputs/
|
||||
extensions-config.h
|
||||
*.mlpd
|
||||
|
||||
Vendored
-91
@@ -1,91 +0,0 @@
|
||||
{
|
||||
"configurations": [
|
||||
{
|
||||
"name": "Mac",
|
||||
"includePath": [
|
||||
"/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1",
|
||||
"/usr/local/include",
|
||||
"/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/9.0.0/include",
|
||||
"/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include",
|
||||
"/usr/include",
|
||||
"${workspaceRoot}",
|
||||
"${workspaceRoot}/mono",
|
||||
"${workspaceRoot}/mono/eglib",
|
||||
"${workspaceRoot}/support"
|
||||
],
|
||||
"defines": [],
|
||||
"intelliSenseMode": "clang-x64",
|
||||
"browse": {
|
||||
"path": [
|
||||
"/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1",
|
||||
"/usr/local/include",
|
||||
"/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/9.0.0/include",
|
||||
"/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include",
|
||||
"/usr/include",
|
||||
"${workspaceRoot}",
|
||||
"${workspaceRoot}/mono",
|
||||
"${workspaceRoot}/mono/eglib",
|
||||
"${workspaceRoot}/support"
|
||||
],
|
||||
"limitSymbolsToIncludedHeaders": true,
|
||||
"databaseFilename": ""
|
||||
},
|
||||
"macFrameworkPath": [
|
||||
"/System/Library/Frameworks",
|
||||
"/Library/Frameworks"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Linux",
|
||||
"includePath": [
|
||||
"/usr/include",
|
||||
"/usr/local/include",
|
||||
"${workspaceRoot}",
|
||||
"${workspaceRoot}/mono",
|
||||
"${workspaceRoot}/mono/eglib",
|
||||
"${workspaceRoot}/support"
|
||||
],
|
||||
"defines": [],
|
||||
"intelliSenseMode": "clang-x64",
|
||||
"browse": {
|
||||
"path": [
|
||||
"/usr/include",
|
||||
"/usr/local/include",
|
||||
"${workspaceRoot}",
|
||||
"${workspaceRoot}/mono",
|
||||
"${workspaceRoot}/mono/eglib",
|
||||
"${workspaceRoot}/support"
|
||||
],
|
||||
"limitSymbolsToIncludedHeaders": true,
|
||||
"databaseFilename": ""
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "Win32",
|
||||
"includePath": [
|
||||
"C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/include",
|
||||
"${workspaceRoot}",
|
||||
"${workspaceRoot}/mono",
|
||||
"${workspaceRoot}/mono/eglib",
|
||||
"${workspaceRoot}/support"
|
||||
],
|
||||
"defines": [
|
||||
"_DEBUG",
|
||||
"UNICODE"
|
||||
],
|
||||
"intelliSenseMode": "msvc-x64",
|
||||
"browse": {
|
||||
"path": [
|
||||
"C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/include/*",
|
||||
"${workspaceRoot}",
|
||||
"${workspaceRoot}/mono",
|
||||
"${workspaceRoot}/mono/eglib",
|
||||
"${workspaceRoot}/support"
|
||||
],
|
||||
"limitSymbolsToIncludedHeaders": true,
|
||||
"databaseFilename": ""
|
||||
}
|
||||
}
|
||||
],
|
||||
"version": 4
|
||||
}
|
||||
+17
-24
@@ -17,12 +17,11 @@
|
||||
/acceptance-tests @akoeplinger
|
||||
/acceptance-tests/profiler-stress* @alexrp
|
||||
|
||||
/data @marek-safar @akoeplinger @luhenry
|
||||
/data @marek-safar @akoeplinger
|
||||
/data/gdb @vargaz
|
||||
/data/lldb @lewurm @vargaz
|
||||
|
||||
/docs @luhenry @marek-safar
|
||||
/docs/riscv.md @alexrp
|
||||
/docs/sources/mono-api-profiler.html @alexrp
|
||||
|
||||
/external @marek-safar @luhenry
|
||||
@@ -31,14 +30,14 @@
|
||||
/external/boringssl @baulig
|
||||
/external/nuget-buildtasks @radical @akoeplinger
|
||||
|
||||
/libgc @BrzVlad @vargaz @luhenry
|
||||
/libgc @BrzVlad @vargaz
|
||||
|
||||
/llvm @vargaz @luhenry
|
||||
/llvm @vargaz
|
||||
|
||||
/man @marek-safar @miguel @luhenry
|
||||
/man @marek-safar @miguel
|
||||
/man/*prof* @alexrp
|
||||
|
||||
/mcs @marek-safar @luhenry
|
||||
/mcs @marek-safar
|
||||
|
||||
/mcs/build @marek-safar @akoeplinger
|
||||
|
||||
@@ -65,8 +64,6 @@
|
||||
|
||||
/mono @luhenry
|
||||
|
||||
/mono/arch/riscv @alexrp
|
||||
|
||||
/mono/btls @baulig
|
||||
/mono/dis @lambdageek @vargaz
|
||||
/mono/eglib @kumpera @vargaz @luhenry
|
||||
@@ -85,7 +82,6 @@
|
||||
/mono/mini/*cfgdump* @lewurm
|
||||
/mono/mini/*exceptions* @lewurm
|
||||
/mono/mini/*ppc* @lewurm
|
||||
/mono/mini/*riscv* @alexrp
|
||||
/mono/mini/*type-check* @lewurm
|
||||
/mono/mini/interp/* @lewurm @BrzVlad
|
||||
/mono/mini/*profiler* @alexrp
|
||||
@@ -93,6 +89,11 @@
|
||||
|
||||
/mono/profiler @alexrp @kumpera
|
||||
|
||||
/mono/sdks @luhenry
|
||||
/mono/sdks/android @luhenry @jonpryor
|
||||
/mono/sdks/ios @vargaz @rolfbjarne
|
||||
/mono/sdks/wasm @kumpera @lrz
|
||||
|
||||
/mono/sgen @BrzVlad @kumpera
|
||||
|
||||
/mono/utils @kumpera @vargaz
|
||||
@@ -102,34 +103,26 @@
|
||||
/mono/utils/mono-threads* @luhenry @kumpera
|
||||
/mono/utils/*-win* @lateralusX @kumpera
|
||||
|
||||
/msvc @lateralusX @luhenry
|
||||
/msvc @lateralusX
|
||||
/msvc/*profiler* @alexrp
|
||||
/msvc/scripts @akoeplinger @kg
|
||||
/msvc/scripts @akoeplinger
|
||||
|
||||
/packaging/ @alexischr @akoeplinger @luhenry @directhex
|
||||
/packaging/ @alexischr @akoeplinger
|
||||
/packaging/MacSDK/msbuild.py @radical @akoeplinger
|
||||
|
||||
/runtime @akoeplinger @marek-safar @luhenry
|
||||
/runtime @akoeplinger @marek-safar
|
||||
|
||||
/samples @luhenry
|
||||
/samples/profiler @alexrp
|
||||
/samples/size @alexrp
|
||||
|
||||
/scripts @akoeplinger @luhenry
|
||||
/scripts/ci @akoeplinger @alexischr
|
||||
/scripts @akoeplinger
|
||||
/scripts/ci @akoeplinger
|
||||
/scripts/ci/run-test-profiler-stress-tests.sh @alexrp
|
||||
|
||||
/sdks @marek-safar @luhenry
|
||||
/sdks/builds/android* @luhenry @jonpryor
|
||||
/sdks/builds/mxe* @luhenry @jonpryor
|
||||
/sdks/builds/ios* @vargaz @rolfbjarne
|
||||
/sdks/wasm @kumpera @lrz
|
||||
/sdks/ios @vargaz @rolfbjarne
|
||||
/sdks/android @luhenry @jonpryor
|
||||
|
||||
/support @luhenry @vargaz
|
||||
|
||||
/tools @kumpera @luhenry
|
||||
/tools @kumpera
|
||||
/tools/checker @tritao
|
||||
/tools/crash-bisector @kumpera
|
||||
/tools/locale-builder @marek-safar
|
||||
|
||||
+9
-5
@@ -11,9 +11,15 @@ else
|
||||
tools_dir = tools
|
||||
endif
|
||||
|
||||
SUBDIRS = mk po $(libgc_dir) llvm mono $(ikvm_native_dir) support data runtime scripts man samples $(tools_dir) msvc $(docs_dir) acceptance-tests
|
||||
if BUILD_SUPPORT
|
||||
support_dir = support
|
||||
else
|
||||
support_dir =
|
||||
endif
|
||||
|
||||
SUBDIRS = po $(libgc_dir) mono $(ikvm_native_dir) $(support_dir) data runtime scripts man samples $(tools_dir) msvc $(docs_dir) acceptance-tests llvm
|
||||
# Keep in sync with SUBDIRS
|
||||
DIST_SUBDIRS = m4 mk po $(libgc_dir) llvm mono ikvm-native support data runtime scripts man samples tools msvc docs acceptance-tests
|
||||
DIST_SUBDIRS = m4 po $(libgc_dir) mono ikvm-native $(support_dir) data runtime scripts man samples tools msvc docs acceptance-tests llvm
|
||||
|
||||
all: update_submodules
|
||||
|
||||
@@ -126,7 +132,6 @@ package-inputs:
|
||||
(echo " <project dir=\"$$1\" library=\"$$2\">"; \
|
||||
read boot; echo " <boot>$$boot</boot>"; \
|
||||
read flags; echo " <flags>$$flags</flags>"; \
|
||||
read sources;echo " <sources>$$sources</sources>"; \
|
||||
read output; echo " <output>$$output</output>"; \
|
||||
read built; echo " <built_sources>`echo $$built | sed 's/\\\/\\\\/g'`</built_sources>"; \
|
||||
read libou; echo " <library_output>$$libou</library_output>"; \
|
||||
@@ -145,10 +150,9 @@ update-llvm-version:
|
||||
|
||||
|
||||
update-solution-files:
|
||||
cd msvc/scripts && $(MAKE) genproj.exe || exit $$?;
|
||||
$(MAKE) update-csproj
|
||||
$(MAKE) package-inputs
|
||||
(cd msvc/scripts; mono --debug genproj.exe $(GENPROJ_ARGS))
|
||||
(cd msvc/scripts; $(MAKE) genproj.exe; mono genproj.exe $(GENPROJ_ARGS))
|
||||
|
||||
update-solution-files-with-tests:
|
||||
$(MAKE) "GENPROJ_ARGS=2012 true true" update-solution-files
|
||||
@@ -3,7 +3,7 @@ create cross platform applications. It is an open source
|
||||
implementation of Microsoft's .NET Framework based on the ECMA
|
||||
standards for C# and the Common Language Runtime.
|
||||
|
||||
The Mono project is part of the [.NET Foundation](https://www.dotnetfoundation.org/)
|
||||
The Mono project is part of the [.NET Foundation](http://www.dotnetfoundation.org/)
|
||||
|
||||
[](https://gitter.im/mono/mono?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
|
||||
|
||||
@@ -19,31 +19,30 @@ The Mono project is part of the [.NET Foundation](https://www.dotnetfoundation.o
|
||||
|
||||
| OS | Architecture | Status |
|
||||
|--------------|--------------------|------------------------------|
|
||||
| Debian 9 | amd64 | [![debian-9-amd64][1]][2] |
|
||||
| Debian 9 | i386 | [![debian-9-i386][3]][4] |
|
||||
| Debian 9 | armel | [![debian-9-armel][5]][6] |
|
||||
| Debian 9 | armhf | [![debian-9-armhf][7]][8] |
|
||||
| Debian 9 | arm64 | [![debian-9-arm64][9]][10] |
|
||||
| Ubuntu 14.04 | amd64 | [![ubuntu-1404-amd64][1]][2] |
|
||||
| Ubuntu 14.04 | i386 | [![ubuntu-1404-i386][3]][4] |
|
||||
| Debian 8 | armel | [![debian-8-armel][5]][6] |
|
||||
| Debian 8 | armhf | [![debian-8-armhf][7]][8] |
|
||||
| Debian 8 | arm64 | [![debian-8-arm64][9]][10] |
|
||||
| OS X | amd64 | [![osx-amd64][11]][12] |
|
||||
| OS X | i386 | [![osx-i386][13]][14] |
|
||||
| Windows | amd64 | [![windows-amd64][15]][16] |
|
||||
| Windows | i386 | [![windows-i386][17]][18] |
|
||||
| Windows | i386 | [![windows-amd64][17]][18] |
|
||||
| CentOS | s390x (cs) | [![centos-s390x][19]][20] |
|
||||
| Debian 9 | ppc64el (cs) | [![debian-9-ppc64el][21]][22]|
|
||||
| AIX | ppc64 (cs) | [![aix-ppc64][23]][24] |
|
||||
| Debian 8 | ppc64el (cs) | [![debian-8-ppc64el][21]][22]|
|
||||
|
||||
_(cs) = community supported architecture_
|
||||
|
||||
[1]: https://jenkins.mono-project.com/job/test-mono-mainline-linux/label=debian-9-amd64/badge/icon
|
||||
[2]: https://jenkins.mono-project.com/job/test-mono-mainline-linux/label=debian-9-amd64
|
||||
[3]: https://jenkins.mono-project.com/job/test-mono-mainline-linux/label=debian-9-i386/badge/icon
|
||||
[4]: https://jenkins.mono-project.com/job/test-mono-mainline-linux/label=debian-9-i386/
|
||||
[5]: https://jenkins.mono-project.com/job/test-mono-mainline-linux/label=debian-9-armel/badge/icon
|
||||
[6]: https://jenkins.mono-project.com/job/test-mono-mainline-linux/label=debian-9-armel/
|
||||
[7]: https://jenkins.mono-project.com/job/test-mono-mainline-linux/label=debian-9-armhf/badge/icon
|
||||
[8]: https://jenkins.mono-project.com/job/test-mono-mainline-linux/label=debian-9-armhf/
|
||||
[9]: https://jenkins.mono-project.com/job/test-mono-mainline-linux/label=debian-9-arm64/badge/icon
|
||||
[10]: https://jenkins.mono-project.com/job/test-mono-mainline-linux/label=debian-9-arm64/
|
||||
[1]: https://jenkins.mono-project.com/job/test-mono-mainline-linux/label=ubuntu-1404-amd64/badge/icon
|
||||
[2]: https://jenkins.mono-project.com/job/test-mono-mainline-linux/label=ubuntu-1404-amd64
|
||||
[3]: https://jenkins.mono-project.com/job/test-mono-mainline-linux/label=ubuntu-1404-i386/badge/icon
|
||||
[4]: https://jenkins.mono-project.com/job/test-mono-mainline-linux/label=ubuntu-1404-i386/
|
||||
[5]: https://jenkins.mono-project.com/job/test-mono-mainline-linux/label=debian-8-armel/badge/icon
|
||||
[6]: https://jenkins.mono-project.com/job/test-mono-mainline-linux/label=debian-8-armel/
|
||||
[7]: https://jenkins.mono-project.com/job/test-mono-mainline-linux/label=debian-8-armhf/badge/icon
|
||||
[8]: https://jenkins.mono-project.com/job/test-mono-mainline-linux/label=debian-8-armhf/
|
||||
[9]: https://jenkins.mono-project.com/job/test-mono-mainline-linux/label=debian-8-arm64/badge/icon
|
||||
[10]: https://jenkins.mono-project.com/job/test-mono-mainline-linux/label=debian-8-arm64/
|
||||
[11]: https://jenkins.mono-project.com/job/test-mono-mainline/label=osx-amd64/badge/icon
|
||||
[12]: https://jenkins.mono-project.com/job/test-mono-mainline/label=osx-amd64/
|
||||
[13]: https://jenkins.mono-project.com/job/test-mono-mainline/label=osx-i386/badge/icon
|
||||
@@ -54,10 +53,8 @@ _(cs) = community supported architecture_
|
||||
[18]: https://jenkins.mono-project.com/job/z/label=w32/
|
||||
[19]: https://jenkins.mono-project.com/job/test-mono-mainline-community/label=centos-s390x/badge/icon
|
||||
[20]: https://jenkins.mono-project.com/job/test-mono-mainline-community/label=centos-s390x
|
||||
[21]: https://jenkins.mono-project.com/job/test-mono-mainline-community-chroot/label=debian-9-ppc64el/badge/icon
|
||||
[22]: https://jenkins.mono-project.com/job/test-mono-mainline-community-chroot/label=debian-9-ppc64el
|
||||
[23]: https://jenkins.mono-project.com/job/test-mono-mainline-community/label=aix-ppc64/badge/icon
|
||||
[24]: https://jenkins.mono-project.com/job/test-mono-mainline-community/label=aix-ppc64
|
||||
[21]: https://jenkins.mono-project.com/job/test-mono-mainline-community-chroot/label=debian-8-ppc64el/badge/icon
|
||||
[22]: https://jenkins.mono-project.com/job/test-mono-mainline-community-chroot/label=debian-8-ppc64el
|
||||
|
||||
Compilation and Installation
|
||||
============================
|
||||
@@ -66,15 +63,15 @@ Building the Software
|
||||
---------------------
|
||||
|
||||
Please see our guides for building Mono on
|
||||
[Mac OS X](https://www.mono-project.com/docs/compiling-mono/mac/),
|
||||
[Linux](https://www.mono-project.com/docs/compiling-mono/linux/) and
|
||||
[Windows](https://www.mono-project.com/docs/compiling-mono/windows/).
|
||||
[Mac OS X](http://www.mono-project.com/docs/compiling-mono/mac/),
|
||||
[Linux](http://www.mono-project.com/docs/compiling-mono/linux/) and
|
||||
[Windows](http://www.mono-project.com/docs/compiling-mono/windows/).
|
||||
|
||||
Note that building from Git assumes that you already have Mono installed,
|
||||
so please download and [install the latest Mono release](https://www.mono-project.com/download/)
|
||||
so please download and [install the latest Mono release](http://www.mono-project.com/download/)
|
||||
before trying to build from Git. This is required because the Mono build
|
||||
relies on a working Mono C# compiler to compile itself
|
||||
(also known as [bootstrapping](https://en.wikipedia.org/wiki/Bootstrapping_(compilers))).
|
||||
(also known as [bootstrapping](http://en.wikipedia.org/wiki/Bootstrapping_(compilers))).
|
||||
|
||||
If you don't have a working Mono installation
|
||||
---------------------------------------------
|
||||
@@ -114,7 +111,7 @@ Once you have installed the software, you can run a few programs:
|
||||
|
||||
* `mono program.exe` runtime engine
|
||||
|
||||
* `mcs program.cs` C# compiler
|
||||
* `mcs program.cs` C# compiler
|
||||
|
||||
* `monodis program.exe` CIL Disassembler
|
||||
|
||||
@@ -131,14 +128,6 @@ Directory Roadmap
|
||||
|
||||
* `external/` - Git submodules for external libraries (Newtonsoft.Json, ikvm, etc).
|
||||
|
||||
* `ikvm-native/` - Glue code for ikvm.
|
||||
|
||||
* `libgc/` - The (deprecated) Boehm GC implementation.
|
||||
|
||||
* `llvm/` - Utility Makefiles for integrating the Mono LLVM fork.
|
||||
|
||||
* `m4/` - General utility Makefiles.
|
||||
|
||||
* `man/` - Manual pages for the various Mono commands and programs.
|
||||
|
||||
* `mcs/` - The class libraries, compiler and tools
|
||||
@@ -153,59 +142,33 @@ Directory Roadmap
|
||||
|
||||
* `arch/` - Architecture specific portions.
|
||||
|
||||
* `benchmark/` - A collection of benchmarks.
|
||||
|
||||
* `btls/` - Build files for the BTLS library which incorporates BoringSSL.
|
||||
|
||||
* `cil/` - Common Intermediate Representation, XML
|
||||
definition of the CIL bytecodes.
|
||||
|
||||
* `dis/` - CIL executable Disassembler.
|
||||
* `dis/` - CIL executable Disassembler
|
||||
|
||||
* `eglib/` - Independent implementation of the glib API.
|
||||
* `io-layer/` - The I/O layer and system abstraction for
|
||||
emulating the .NET IO model.
|
||||
|
||||
* `metadata/` - The object system and metadata reader.
|
||||
|
||||
* `mini/` - The Just in Time Compiler.
|
||||
|
||||
* `profiler/` - The profiler implementation.
|
||||
|
||||
* `sgen/` - The SGen Garbage Collector implementation.
|
||||
|
||||
* `tests/` - The main runtime tests.
|
||||
|
||||
* `unit-tests/` - Additional runtime unit tests.
|
||||
|
||||
* `utils/` - Utility functions used across the runtime codebase.
|
||||
|
||||
* `msvc/` - Logic for the MSVC / Visual Studio based runtime and BCL build system.
|
||||
The latter is experimental at the moment.
|
||||
|
||||
* `packaging/` - Packaging logic for the OS X and Windows Mono packages.
|
||||
|
||||
* `po/` - Translation files.
|
||||
|
||||
* `runtime/` - A directory that contains the Makefiles that link the
|
||||
mono/ and mcs/ build systems.
|
||||
|
||||
* `samples/` - Some simple sample programs on uses of the Mono
|
||||
runtime as an embedded library.
|
||||
* `samples/` -Some simple sample programs on uses of the Mono
|
||||
runtime as an embedded library.
|
||||
|
||||
* `scripts/` - Scripts used to invoke Mono and the corresponding program.
|
||||
|
||||
* `sdks/` - A new way of embedding Mono into Xamarin.iOS, Xamarin.Android and other products.
|
||||
|
||||
* `support/` - Various support libraries.
|
||||
|
||||
* `tools/` - A collection of tools, mostly used during Mono development.
|
||||
|
||||
Contributing to Mono
|
||||
====================
|
||||
|
||||
Before submitting changes to Mono, please review the [contribution
|
||||
guidelines](https://www.mono-project.com/community/contributing/).
|
||||
guidelines](http://www.mono-project.com/community/contributing/).
|
||||
Please pay particular attention to the [Important
|
||||
Rules](https://www.mono-project.com/community/contributing/#important-rules)
|
||||
Rules](http://www.mono-project.com/community/contributing/#important-rules)
|
||||
section.
|
||||
|
||||
Reporting bugs
|
||||
@@ -215,7 +178,7 @@ To submit bug reports, please [open an issue on the mono GitHub repo](https://gi
|
||||
|
||||
Please use the search facility to ensure the same bug hasn't already
|
||||
been submitted and follow our
|
||||
[guidelines](https://www.mono-project.com/community/bugs/make-a-good-bug-report/)
|
||||
[guidelines](http://www.mono-project.com/community/bugs/make-a-good-bug-report/)
|
||||
on how to make a good bug report.
|
||||
|
||||
Configuration Options
|
||||
@@ -244,12 +207,12 @@ Disables the inclusion of a Boehm garbage collector.
|
||||
|
||||
* This defaults to `included`.
|
||||
|
||||
* `--enable-cooperative-suspend`
|
||||
* `--with-cooperative-gc`
|
||||
|
||||
* If you pass this flag the Mono runtime is configured to only use
|
||||
the cooperative mode of the garbage collector. If you do not pass
|
||||
this flag, then you can control at runtime the use of the
|
||||
cooperative GC mode by setting the `MONO_ENABLE_COOP_SUSPEND` flag.
|
||||
cooperative GC mode by setting the `MONO_ENABLE_COOP` flag.
|
||||
|
||||
* `--with-tls=__thread,pthread`
|
||||
|
||||
@@ -435,7 +398,7 @@ for Mono. The LLVM code generator and optimizer will be
|
||||
used instead of Mono's built-in code generator for both
|
||||
Just in Time and Ahead of Time compilations.
|
||||
|
||||
* See https://www.mono-project.com/docs/advanced/mono-llvm/ for the
|
||||
* See http://www.mono-project.com/docs/advanced/mono-llvm/ for the
|
||||
full details and up-to-date information on this feature.
|
||||
|
||||
* You will need to have an LLVM built that Mono can link
|
||||
@@ -504,7 +467,7 @@ also, see the man page.
|
||||
|
||||
* This configures the Mono compiler to generate code
|
||||
suitable to be used by Google's Native Client:
|
||||
https://code.google.com/p/nativeclient/
|
||||
http://code.google.com/p/nativeclient/
|
||||
|
||||
* Currently this is used with Mono's AOT engine as
|
||||
Native Client does not support JIT engines yet.
|
||||
@@ -578,7 +541,7 @@ file for information about Microsoft's patent grant.
|
||||
Mono Trademark Use Policy
|
||||
=========================
|
||||
|
||||
The use of trademarks and logos for Mono can be found [here](https://www.dotnetfoundation.org/legal/mono-tm).
|
||||
The use of trademarks and logos for Mono can be found [here] (http://www.dotnetfoundation.org/legal/mono-tm).
|
||||
|
||||
Maintaining the Class Library Solution Files
|
||||
============================================
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Reflection;
|
||||
|
||||
namespace System.Runtime.Loader
|
||||
{
|
||||
public static class AssemblyExtensions
|
||||
{
|
||||
public static Type[] GetTypes(this Assembly assembly)
|
||||
{
|
||||
return assembly.GetTypes ();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -5,7 +5,7 @@ CORECLR_PATH=$(ACCEPTANCE_TESTS_PATH)/coreclr
|
||||
MSTESTSUITE_PATH=$(ACCEPTANCE_TESTS_PATH)/ms-test-suite
|
||||
|
||||
CLEANFILES = *.dll *.exe *.mdb
|
||||
EXTRA_DIST=README.md SUBMODULES.json versions.mk profiler-stress.mk roslyn.mk coreclr.mk ms-test-suite.mk
|
||||
EXTRA_DIST=README.md SUBMODULES.json versions.mk roslyn.mk coreclr.mk ms-test-suite.mk
|
||||
|
||||
CLASS=$(mcs_topdir)/class/lib/$(DEFAULT_PROFILE)
|
||||
TOOLS_CLASS=$(mcs_topdir)/class/lib/build
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
{
|
||||
"name": "roslyn",
|
||||
"url": "git://github.com/mono/roslyn.git",
|
||||
"rev": "7a840bd5697ef6ea41f554a09d837636fba9d88d",
|
||||
"rev": "1d9895045041925490038c5df0d8f947d8dcbd7f",
|
||||
"remote-branch": "origin/mono-testing",
|
||||
"branch": "mono-testing",
|
||||
"directory": "roslyn"
|
||||
@@ -10,7 +10,7 @@
|
||||
{
|
||||
"name": "coreclr",
|
||||
"url": "git://github.com/mono/coreclr.git",
|
||||
"rev": "f3d9c9f742f9dcb5faf40080db5e7f464dab7e7c",
|
||||
"rev": "83d8279997d8ce4ad344ff9b937b2d13d074dcaa",
|
||||
"remote-branch": "origin/mono",
|
||||
"branch": "mono",
|
||||
"directory": "coreclr"
|
||||
|
||||
+10
-12
@@ -2162,6 +2162,7 @@ CORECLR_COREMANGLIB_TEST_CS_SRC= \
|
||||
$(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/double/doubleepsilon.cs \
|
||||
$(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/double/doubleequals1.cs \
|
||||
$(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/double/doubleequals2.cs \
|
||||
$(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/double/doublegethashcode.cs \
|
||||
$(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/double/doubleiconvertibletoboolean.cs \
|
||||
$(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/double/doubleiconvertibletobyte.cs \
|
||||
$(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/double/doubleiconvertibletodatetime.cs \
|
||||
@@ -2216,6 +2217,7 @@ CORECLR_COREMANGLIB_TEST_CS_SRC= \
|
||||
$(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/gc/gcgettotalmemory.cs \
|
||||
$(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/gc/gckeepalive.cs \
|
||||
$(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/gc/gcmaxgeneration.cs \
|
||||
$(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/gc/gcsuppressfinalize.cs \
|
||||
$(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/gc/gcwaitforpendingfinalizers.cs \
|
||||
$(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/globalization/calendarweekrule/calendarweekrulefirstday.cs \
|
||||
$(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/globalization/calendarweekrule/calendarweekrulefirstfourdayweek.cs \
|
||||
@@ -3241,6 +3243,7 @@ CORECLR_COREMANGLIB_TEST_CS_SRC= \
|
||||
$(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/security/securityexception/securityexceptionctor3.cs \
|
||||
$(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/security/securityexception/securityexceptiontostring.cs \
|
||||
$(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/single/singleepsilon.cs \
|
||||
$(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/single/singlegethashcode.cs \
|
||||
$(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/single/singleisinfinity.cs \
|
||||
$(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/single/singleisnan.cs \
|
||||
$(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/single/singleisnegativeinfinity.cs \
|
||||
@@ -3689,8 +3692,9 @@ CORECLR_STRESSTEST_RUNNER_CS_SRC= \
|
||||
$(CORECLR_PATH)/tests/src/GC/Stress/Framework/RFLogging.cs \
|
||||
$(CORECLR_PATH)/tests/src/GC/Stress/Framework/DetourHelpers.cs \
|
||||
$(CORECLR_PATH)/tests/src/GC/Stress/Framework/LoaderClass.cs \
|
||||
GCStressTests/AssemblyLoadContext.cs
|
||||
|
||||
GCStressTests/AssemblyLoadContext.cs \
|
||||
GCStressTests/AssemblyExtensions.cs
|
||||
|
||||
CORECLR_TESTLIBRARY_CS_SRC = \
|
||||
$(CORECLR_PATH)/tests/src/Common/CoreCLRTestLibrary/TestFramework.cs \
|
||||
$(CORECLR_PATH)/tests/src/Common/CoreCLRTestLibrary/Utilities.cs \
|
||||
@@ -3712,7 +3716,7 @@ CORECLR_DISABLED_TEST_CS_SRC += \
|
||||
CORECLR_DISABLED_TEST_CS_SRC += \
|
||||
$(CORECLR_PATH)/tests/src/readytorun/main.cs \
|
||||
$(CORECLR_PATH)/tests/src/readytorun/test.cs
|
||||
|
||||
|
||||
# relies on a referenced managed or native assembly, to complicated here:
|
||||
CORECLR_DISABLED_TEST_CS_SRC += \
|
||||
$(CORECLR_PATH)/tests/src/Regressions/assemblyref/assem.cs \
|
||||
@@ -3852,7 +3856,7 @@ CORECLR_DISABLED_TEST_CS_SRC += \
|
||||
CORECLR_DISABLED_TEST_CS_SRC += \
|
||||
$(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/datetime/cfdatetimetools.cs \
|
||||
$(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/datetime/datetimeisdaylightsavingtime.cs
|
||||
|
||||
|
||||
# relies on delegatedefinitions.cs helper
|
||||
CORECLR_DISABLED_TEST_CS_SRC += \
|
||||
$(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/multicastdelegate/multicastdelegatector.cs \
|
||||
@@ -3960,7 +3964,7 @@ CORECLR_DISABLED_TEST_CS_SRC += \
|
||||
$(CORECLR_PATH)/tests/src/CoreMangLib/system/delegate/threatmodel/public/testclass.cs \
|
||||
$(CORECLR_PATH)/tests/src/CoreMangLib/system/delegate/threatmodel/tests/bindingtarget.cs \
|
||||
$(CORECLR_PATH)/tests/src/CoreMangLib/system/delegate/threatmodel/tests/testclass.cs
|
||||
|
||||
|
||||
# samples (should probably be removed upstream)
|
||||
CORECLR_DISABLED_TEST_CS_SRC += \
|
||||
$(CORECLR_PATH)/tests/src/hosting/samples/hosting/usercode/usercode.cs \
|
||||
@@ -3978,10 +3982,6 @@ CORECLR_DISABLED_TEST_CS_SRC += \
|
||||
$(CORECLR_PATH)/tests/src/JIT/Directed/newarr/newarr.cs \
|
||||
$(CORECLR_PATH)/tests/src/baseservices/exceptions/sharedexceptions/emptystacktrace/oomexception01.cs
|
||||
|
||||
# https://github.com/mono/mono/issues/7432
|
||||
CORECLR_DISABLED_TEST_CS_SRC += \
|
||||
$(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/gc/gcsuppressfinalize.cs
|
||||
|
||||
CORECLR_TEST_IL_SRC = \
|
||||
$(CORECLR_PATH)/tests/src/JIT/BBT/Scenario4/Not-Int32.il \
|
||||
$(CORECLR_PATH)/tests/src/JIT/Directed/Convert/implicitConv.il \
|
||||
@@ -4966,6 +4966,7 @@ CORECLR_TEST_IL_SRC = \
|
||||
$(CORECLR_PATH)/tests/src/JIT/jit64/opt/regress/vswhidbey/223862/rem.il \
|
||||
$(CORECLR_PATH)/tests/src/JIT/jit64/opt/regress/vswhidbey/228572/conv.il \
|
||||
$(CORECLR_PATH)/tests/src/JIT/jit64/opt/regress/vswhidbey/481244/foo.il \
|
||||
$(CORECLR_PATH)/tests/src/JIT/jit64/opt/regress/vswhidbey/481244/foo2.il \
|
||||
$(CORECLR_PATH)/tests/src/JIT/jit64/regress/ddb/118414/118414.il \
|
||||
$(CORECLR_PATH)/tests/src/JIT/jit64/regress/ddb/127931/127931.il \
|
||||
$(CORECLR_PATH)/tests/src/JIT/jit64/regress/vsw/102974/test.il \
|
||||
@@ -5057,9 +5058,6 @@ CORECLR_DISABLED_TEST_IL_SRC += \
|
||||
CORECLR_DISABLED_TEST_IL_SRC += \
|
||||
$(CORECLR_PATH)/tests/src/JIT/Directed/coverage/oldtests/lcliimpl.il
|
||||
|
||||
# We use an r4 for r4-r8 stack merge so it loses precision
|
||||
CORECLR_DISABLED_TEST_IL_SRC += \
|
||||
$(CORECLR_PATH)/tests/src/JIT/jit64/opt/regress/vswhidbey/481244/foo2.il
|
||||
|
||||
# FIXME: these tests are baselined, i.e. we don't have time to investigate
|
||||
# them right now but want to make sure we don't introduce new regressions
|
||||
|
||||
@@ -57,9 +57,7 @@ namespace Mono.Profiling.Tests.Stress {
|
||||
"jit",
|
||||
};
|
||||
|
||||
static readonly TimeSpan _timeout = TimeSpan.FromHours (6);
|
||||
|
||||
const RegexOptions _regexOptions = RegexOptions.Compiled | RegexOptions.Singleline;
|
||||
static readonly TimeSpan _timeout = TimeSpan.FromHours (9);
|
||||
|
||||
static readonly Dictionary<string, Predicate<Benchmark>> _filters = new Dictionary<string, Predicate<Benchmark>> {
|
||||
{ "ironjs-v8", FilterNotOnArm },
|
||||
@@ -91,55 +89,26 @@ namespace Mono.Profiling.Tests.Stress {
|
||||
|
||||
static int Main ()
|
||||
{
|
||||
var regex = new Regex (".*", _regexOptions);
|
||||
|
||||
if (Environment.GetEnvironmentVariable ("MONO_PROFILER_STRESS_REGEX") is string envRegex)
|
||||
regex = new Regex (envRegex, _regexOptions);
|
||||
|
||||
var depDir = Path.Combine ("..", "external", "benchmarker");
|
||||
var benchDir = Path.Combine (depDir, "benchmarks");
|
||||
var testDir = Path.Combine (depDir, "tests");
|
||||
|
||||
var benchmarks = Directory.EnumerateFiles (benchDir, "*.benchmark")
|
||||
.Select (Benchmark.Load)
|
||||
.Where (b => !b.OnlyExplicit && b.ClientCommandLine == null && IsSupported (b) && regex.IsMatch (b.Name))
|
||||
.Where (b => !b.OnlyExplicit && b.ClientCommandLine == null && IsSupported (b))
|
||||
.OrderBy (b => b.Name)
|
||||
.ToArray ();
|
||||
|
||||
var monoPath = Path.GetFullPath (Path.Combine ("..", "..", "runtime", "mono-wrapper"));
|
||||
var classDir = Path.GetFullPath (Path.Combine ("..", "..", "mcs", "class", "lib", "net_4_x"));
|
||||
|
||||
var seed = Environment.TickCount;
|
||||
|
||||
if (Environment.GetEnvironmentVariable ("MONO_PROFILER_STRESS_SEED") is string envSeed)
|
||||
seed = int.Parse (envSeed);
|
||||
|
||||
var timeout = (int) _timeout.TotalMilliseconds;
|
||||
|
||||
if (Environment.GetEnvironmentVariable ("MONO_PROFILER_STRESS_TIMEOUT") is string envTimeout)
|
||||
timeout = (int) TimeSpan.Parse (envTimeout).TotalMilliseconds;
|
||||
|
||||
string options = null;
|
||||
|
||||
if (Environment.GetEnvironmentVariable ("MONO_PROFILER_STRESS_OPTIONS") is string envOptions)
|
||||
options = envOptions;
|
||||
|
||||
var suspend = false;
|
||||
|
||||
if (Environment.GetEnvironmentVariable ("MONO_PROFILER_STRESS_SUSPEND") is string envSuspend)
|
||||
suspend = bool.Parse (envSuspend);
|
||||
|
||||
var rand = new Random (seed);
|
||||
var rand = new Random ();
|
||||
var cpus = Environment.ProcessorCount;
|
||||
|
||||
var sw = Stopwatch.StartNew ();
|
||||
|
||||
Console.ForegroundColor = ConsoleColor.Magenta;
|
||||
Console.WriteLine ($"[{sw.Elapsed.ToString ("G")}] Starting test session with seed: {seed}");
|
||||
Console.ResetColor ();
|
||||
|
||||
var results = new List<TestResult> (benchmarks.Length);
|
||||
|
||||
var sw = Stopwatch.StartNew ();
|
||||
|
||||
for (var i = 0; i < benchmarks.Length; i++) {
|
||||
var bench = benchmarks [i];
|
||||
|
||||
@@ -148,24 +117,17 @@ namespace Mono.Profiling.Tests.Stress {
|
||||
var maxSamples = rand.Next (0, cpus * 2000 + 1);
|
||||
var heapShotFreq = rand.Next (-10, 11);
|
||||
var maxFrames = rand.Next (0, 33);
|
||||
var flags = _options.ToDictionary (x => x, _ => rand.Next (0, 2) == 1)
|
||||
.Select (x => (x.Value ? string.Empty : "no") + x.Key)
|
||||
.ToArray ();
|
||||
var options = _options.ToDictionary (x => x, _ => rand.Next (0, 2) == 1)
|
||||
.Select (x => (x.Value ? string.Empty : "no") + x.Key)
|
||||
.ToArray ();
|
||||
|
||||
var profOptions = "nodefaults,output=/dev/null,";
|
||||
var profOptions = $"maxframes={maxFrames},{string.Join (",", options)},output=/dev/null";
|
||||
|
||||
if (options == null) {
|
||||
profOptions += $"maxframes={maxFrames},";
|
||||
if (sampleFreq > 0)
|
||||
profOptions += $",sample{sampleMode}={sampleFreq},maxsamples={maxSamples}";
|
||||
|
||||
if (sampleFreq > 0)
|
||||
profOptions += $"sample{sampleMode}={sampleFreq},maxsamples={maxSamples},";
|
||||
|
||||
if (heapShotFreq > 0)
|
||||
profOptions += $"heapshot={heapShotFreq}gc,";
|
||||
|
||||
profOptions += string.Join (",", flags);
|
||||
} else
|
||||
profOptions += options;
|
||||
if (heapShotFreq > 0)
|
||||
profOptions += $",heapshot={heapShotFreq}gc";
|
||||
|
||||
var info = new ProcessStartInfo {
|
||||
UseShellExecute = false,
|
||||
@@ -179,9 +141,6 @@ namespace Mono.Profiling.Tests.Stress {
|
||||
info.EnvironmentVariables.Clear ();
|
||||
info.EnvironmentVariables.Add ("MONO_PATH", classDir);
|
||||
|
||||
if (suspend)
|
||||
info.EnvironmentVariables.Add ("MONO_DEBUG", "suspend-on-native-crash,suspend-on-unhandled");
|
||||
|
||||
var progress = $"({i + 1}/{benchmarks.Length})";
|
||||
|
||||
Console.ForegroundColor = ConsoleColor.Blue;
|
||||
@@ -218,7 +177,7 @@ namespace Mono.Profiling.Tests.Stress {
|
||||
proc.BeginOutputReadLine ();
|
||||
proc.BeginErrorReadLine ();
|
||||
|
||||
if (!proc.WaitForExit (timeout)) {
|
||||
if (!proc.WaitForExit ((int) _timeout.TotalMilliseconds)) {
|
||||
// Force a thread dump.
|
||||
Syscall.kill (proc.Id, Signum.SIGQUIT);
|
||||
Thread.Sleep (1000);
|
||||
@@ -274,7 +233,7 @@ namespace Mono.Profiling.Tests.Stress {
|
||||
|
||||
using (var writer = XmlWriter.Create ("TestResult-profiler-stress.xml", settings)) {
|
||||
writer.WriteStartDocument ();
|
||||
writer.WriteComment ($"This file represents the results of running a test suite (seed: {seed})");
|
||||
writer.WriteComment ("This file represents the results of running a test suite");
|
||||
|
||||
writer.WriteStartElement ("test-results");
|
||||
writer.WriteAttributeString ("name", "profiler-stress-tests.dummy");
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
check-roslyn:
|
||||
@$(MAKE) validate-roslyn RESET_VERSIONS=1
|
||||
cd $(ROSLYN_PATH); \
|
||||
./build.sh --restore --build --test --mono || exit; \
|
||||
./mono-testing.sh "$(XUNIT)" || exit; \
|
||||
echo "done"
|
||||
+3
-5
@@ -89,11 +89,9 @@ if test x$NOCONFIGURE = x && test -z "$*"; then
|
||||
echo
|
||||
fi
|
||||
|
||||
am_opt="--add-missing --copy --gnu -Wno-portability -Wno-obsolete"
|
||||
|
||||
case $CC in
|
||||
xlc )
|
||||
am_opt="$am_opt --include-deps";;
|
||||
am_opt=--include-deps;;
|
||||
esac
|
||||
|
||||
|
||||
@@ -144,8 +142,8 @@ if grep "^AC_CONFIG_HEADERS" configure.ac >/dev/null; then
|
||||
autoheader || { echo "**Error**: autoheader failed."; exit 1; }
|
||||
fi
|
||||
|
||||
echo "Running automake $am_opt ..."
|
||||
automake $am_opt ||
|
||||
echo "Running automake --gnu $am_opt ..."
|
||||
automake --add-missing --gnu -Wno-portability -Wno-obsolete $am_opt ||
|
||||
{ echo "**Error**: automake failed."; exit 1; }
|
||||
echo "Running autoconf ..."
|
||||
autoconf || { echo "**Error**: autoconf failed."; exit 1; }
|
||||
|
||||
+468
-1358
File diff suppressed because it is too large.
Load diff
@@ -11,8 +11,6 @@
|
||||
<dllmap dll="oci" target="libclntsh@libsuffix@" os="!windows"/>
|
||||
<dllmap dll="db2cli" target="libdb2_36@libsuffix@" os="!windows"/>
|
||||
<dllmap dll="MonoPosixHelper" target="$mono_libdir/libMonoPosixHelper@libsuffix@" os="!windows" />
|
||||
<dllmap dll="System.Native" target="$mono_libdir/libmono-system-native@libsuffix@" os="!windows" />
|
||||
<dllmap dll="System.Net.Security.Native" target="$mono_libdir/libmono-system-net-security-native@libsuffix@" os="!windows" />
|
||||
<dllmap dll="libmono-btls-shared" target="$mono_libdir/libmono-btls-shared@libsuffix@" os="!windows" />
|
||||
<dllmap dll="i:msvcrt" target="@LIBC@" os="!windows"/>
|
||||
<dllmap dll="i:msvcrt.dll" target="@LIBC@" os="!windows"/>
|
||||
|
||||
+12
-12
@@ -53,7 +53,7 @@ def stringify_class_name(ns, name):
|
||||
if ns == "":
|
||||
return name
|
||||
else:
|
||||
return "{0}.{1}".format (ns, name)
|
||||
return "{}.{}".format (ns, name)
|
||||
|
||||
class ArrayPrinter:
|
||||
"Print a C# array"
|
||||
@@ -66,7 +66,7 @@ class ArrayPrinter:
|
||||
def to_string(self):
|
||||
obj = self.val.cast (gdb.lookup_type ("MonoArray").pointer ()).dereference ()
|
||||
length = obj ['max_length']
|
||||
return "{0} [{1}]".format (stringify_class_name (self.class_ns, self.class_name [0:len (self.class_name) - 2]), int (length))
|
||||
return "{} [{}]".format (stringify_class_name (self.class_ns, self.class_name [0:len (self.class_name) - 2]), int (length))
|
||||
|
||||
class ObjectPrinter:
|
||||
"Print a C# object"
|
||||
@@ -96,7 +96,7 @@ class ObjectPrinter:
|
||||
return (field.name, self.obj [field.name])
|
||||
except:
|
||||
# Superclass
|
||||
return (field.name, self.obj.cast (gdb.lookup_type ("{0}".format (field.name))))
|
||||
return (field.name, self.obj.cast (gdb.lookup_type ("{}".format (field.name))))
|
||||
|
||||
def children(self):
|
||||
# FIXME: It would be easier if gdb.Value would support iteration itself
|
||||
@@ -109,7 +109,7 @@ class ObjectPrinter:
|
||||
class_name = obj ['vtable'].dereference ()['klass'].dereference ()['name'].string ()
|
||||
if class_name [-2:len(class_name)] == "[]":
|
||||
return {}.__iter__ ()
|
||||
gdb_type = gdb.lookup_type ("struct {0}_{1}".format (class_ns.replace (".", "_"), class_name))
|
||||
gdb_type = gdb.lookup_type ("struct {}_{}".format (class_ns.replace (".", "_"), class_name))
|
||||
return self._iterator(obj.cast (gdb_type))
|
||||
except:
|
||||
print (sys.exc_info ()[0])
|
||||
@@ -129,12 +129,12 @@ class ObjectPrinter:
|
||||
return ArrayPrinter (self.val,class_ns,class_name).to_string ()
|
||||
if class_ns != "":
|
||||
try:
|
||||
gdb_type = gdb.lookup_type ("struct {0}.{1}".format (class_ns, class_name))
|
||||
gdb_type = gdb.lookup_type ("struct {}.{}".format (class_ns, class_name))
|
||||
except:
|
||||
# Maybe there is no debug info for that type
|
||||
return "{0}.{1}".format (class_ns, class_name)
|
||||
return "{}.{}".format (class_ns, class_name)
|
||||
#return obj.cast (gdb_type)
|
||||
return "{0}.{1}".format (class_ns, class_name)
|
||||
return "{}.{}".format (class_ns, class_name)
|
||||
return class_name
|
||||
except:
|
||||
print (sys.exc_info ()[0])
|
||||
@@ -154,9 +154,9 @@ class MonoMethodPrinter:
|
||||
val = self.val.dereference ()
|
||||
klass = val ["klass"].dereference ()
|
||||
class_name = stringify_class_name (klass ["name_space"].string (), klass ["name"].string ())
|
||||
return "\"{0}:{1} ()\"".format (class_name, val ["name"].string ())
|
||||
return "\"{}:{} ()\"".format (class_name, val ["name"].string ())
|
||||
# This returns more info but requires calling into the inferior
|
||||
#return "\"{0}\"".format (gdb.parse_and_eval ("mono_method_full_name ({0}, 1)".format (str (int (self.val.cast (gdb.lookup_type ("guint64")))))).string ())
|
||||
#return "\"{}\"".format (gdb.parse_and_eval ("mono_method_full_name ({}, 1)".format (str (int (self.val.cast (gdb.lookup_type ("guint64")))))).string ())
|
||||
|
||||
class MonoClassPrinter:
|
||||
"Print a MonoClass structure"
|
||||
@@ -169,9 +169,9 @@ class MonoClassPrinter:
|
||||
return "0x0"
|
||||
klass = self.val.dereference ()
|
||||
class_name = stringify_class_name (klass ["name_space"].string (), klass ["name"].string ())
|
||||
return "\"{0}\"".format (class_name)
|
||||
return "\"{}\"".format (class_name)
|
||||
# This returns more info but requires calling into the inferior
|
||||
#return "\"{0}\"".format (gdb.parse_and_eval ("mono_type_full_name (&((MonoClass*){0})->byval_arg)".format (str (int ((self.val).cast (gdb.lookup_type ("guint64")))))))
|
||||
#return "\"{}\"".format (gdb.parse_and_eval ("mono_type_full_name (&((MonoClass*){})->byval_arg)".format (str (int ((self.val).cast (gdb.lookup_type ("guint64")))))))
|
||||
|
||||
def lookup_pretty_printer(val):
|
||||
t = str (val.type)
|
||||
@@ -245,4 +245,4 @@ exec_file = gdb.current_objfile ().filename
|
||||
if os.stat (exec_file).st_size != os.lstat (exec_file).st_size:
|
||||
exec_file = os.readlink (exec_file)
|
||||
exec_dir = os.path.dirname (exec_file)
|
||||
gdb.execute ("source {0}/{1}-gdbinit".format (exec_dir, os.path.basename (exec_file)))
|
||||
gdb.execute ("source {}/{}-gdbinit".format (exec_dir, os.path.basename (exec_file)))
|
||||
+16
-16
@@ -48,7 +48,7 @@ def stringify_class_name(ns, name):
|
||||
if ns == "":
|
||||
return name
|
||||
else:
|
||||
return "{0}.{1}".format (ns, name)
|
||||
return "{}.{}".format (ns, name)
|
||||
|
||||
class ArrayPrinter:
|
||||
"Print a C# array"
|
||||
@@ -61,7 +61,7 @@ class ArrayPrinter:
|
||||
def to_string(self):
|
||||
obj = self.val.cast (gdb.lookup_type ("MonoArray").pointer ()).dereference ()
|
||||
length = obj ['max_length']
|
||||
return "{0} [{1}]".format (stringify_class_name (self.class_ns, self.class_name [0:len(self.class_name) - 2]), int(length))
|
||||
return "{} [{}]".format (stringify_class_name (self.class_ns, self.class_name [0:len(self.class_name) - 2]), int(length))
|
||||
|
||||
class ObjectPrinter:
|
||||
"Print a C# object"
|
||||
@@ -91,7 +91,7 @@ class ObjectPrinter:
|
||||
return (field.name, self.obj [field.name])
|
||||
except:
|
||||
# Superclass
|
||||
return (field.name, self.obj.cast (gdb.lookup_type ("{0}".format (field.name))))
|
||||
return (field.name, self.obj.cast (gdb.lookup_type ("{}".format (field.name))))
|
||||
|
||||
def children(self):
|
||||
# FIXME: It would be easier if gdb.Value would support iteration itself
|
||||
@@ -105,7 +105,7 @@ class ObjectPrinter:
|
||||
if class_name [-2:len(class_name)] == "[]":
|
||||
return {}.__iter__ ()
|
||||
try:
|
||||
gdb_type = gdb.lookup_type ("struct {0}_{1}".format (class_ns.replace (".", "_"), class_name))
|
||||
gdb_type = gdb.lookup_type ("struct {}_{}".format (class_ns.replace (".", "_"), class_name))
|
||||
return self._iterator(obj.cast (gdb_type))
|
||||
except:
|
||||
return {}.__iter__ ()
|
||||
@@ -127,12 +127,12 @@ class ObjectPrinter:
|
||||
return ArrayPrinter (self.val,class_ns,class_name).to_string ()
|
||||
if class_ns != "":
|
||||
try:
|
||||
gdb_type = gdb.lookup_type ("struct {0}.{1}".format (class_ns, class_name))
|
||||
gdb_type = gdb.lookup_type ("struct {}.{}".format (class_ns, class_name))
|
||||
except:
|
||||
# Maybe there is no debug info for that type
|
||||
return "{0}.{1}".format (class_ns, class_name)
|
||||
return "{}.{}".format (class_ns, class_name)
|
||||
#return obj.cast (gdb_type)
|
||||
return "{0}.{1}".format (class_ns, class_name)
|
||||
return "{}.{}".format (class_ns, class_name)
|
||||
return class_name
|
||||
except:
|
||||
print (sys.exc_info ()[0])
|
||||
@@ -152,9 +152,9 @@ class MonoMethodPrinter:
|
||||
val = self.val.dereference ()
|
||||
klass = val ["klass"].dereference ()
|
||||
class_name = stringify_class_name (klass ["name_space"].string (), klass ["name"].string ())
|
||||
return "\"{0}:{1} ()\"".format (class_name, val ["name"].string ())
|
||||
return "\"{}:{} ()\"".format (class_name, val ["name"].string ())
|
||||
# This returns more info but requires calling into the inferior
|
||||
#return "\"{0}\"".format (gdb.parse_and_eval ("mono_method_full_name ({0}, 1)".format (str (int (self.val.cast (gdb.lookup_type ("guint64")))))).string ())
|
||||
#return "\"{}\"".format (gdb.parse_and_eval ("mono_method_full_name ({}, 1)".format (str (int (self.val.cast (gdb.lookup_type ("guint64")))))).string ())
|
||||
|
||||
class MonoClassPrinter:
|
||||
"Print a MonoClass structure"
|
||||
@@ -168,11 +168,11 @@ class MonoClassPrinter:
|
||||
klass = self.val.dereference ()
|
||||
class_name = stringify_class_name (klass ["name_space"].string (), klass ["name"].string ())
|
||||
if add_quotes:
|
||||
return "\"{0}\"".format (class_name)
|
||||
return "\"{}\"".format (class_name)
|
||||
else:
|
||||
return class_name
|
||||
# This returns more info but requires calling into the inferior
|
||||
#return "\"{0}\"".format (gdb.parse_and_eval ("mono_type_full_name (&((MonoClass*){0})->byval_arg)".format (str (int ((self.val).cast (gdb.lookup_type ("guint64")))))))
|
||||
#return "\"{}\"".format (gdb.parse_and_eval ("mono_type_full_name (&((MonoClass*){})->byval_arg)".format (str (int ((self.val).cast (gdb.lookup_type ("guint64")))))))
|
||||
|
||||
def to_string(self):
|
||||
try:
|
||||
@@ -220,7 +220,7 @@ class MonoGenericClassPrinter:
|
||||
method_inst_str = ""
|
||||
if int(method_inst.cast (gdb.lookup_type ("guint64"))) != 0:
|
||||
method_inst_str = str(method_inst)
|
||||
return "{0}, [{1}], [{2}]>".format (container_str, class_inst_str, method_inst_str)
|
||||
return "{}, [{}], [{}]>".format (container_str, class_inst_str, method_inst_str)
|
||||
|
||||
def to_string(self):
|
||||
try:
|
||||
@@ -250,9 +250,9 @@ class MonoTypePrinter:
|
||||
info = str(t ["data"]["generic_class"])
|
||||
|
||||
if info != "":
|
||||
return "{{{0}, {1}}}".format (kind, info)
|
||||
return "{{{}, {}}}".format (kind, info)
|
||||
else:
|
||||
return "{{{0}}}".format (kind)
|
||||
return "{{{}}}".format (kind)
|
||||
except:
|
||||
#print (sys.exc_info ()[0])
|
||||
#print (sys.exc_info ()[1])
|
||||
@@ -281,7 +281,7 @@ class MonoMethodRgctxPrinter:
|
||||
if i > 0:
|
||||
inst_str = inst_str + ", "
|
||||
inst_str = inst_str + type_printer.to_string ()
|
||||
return "MRGCTX[{0}, [{1}]]".format (klass_printer.to_string(), inst_str)
|
||||
return "MRGCTX[{}, [{}]]".format (klass_printer.to_string(), inst_str)
|
||||
|
||||
class MonoVTablePrinter:
|
||||
"Print a MonoVTable structure"
|
||||
@@ -296,7 +296,7 @@ class MonoVTablePrinter:
|
||||
klass = vtable ["klass"]
|
||||
klass_printer = MonoClassPrinter (klass)
|
||||
|
||||
return "vtable({0})".format (klass_printer.to_string ())
|
||||
return "vtable({})".format (klass_printer.to_string ())
|
||||
|
||||
def lookup_pretty_printer(val):
|
||||
t = str (val.type)
|
||||
|
||||
@@ -116,7 +116,7 @@
|
||||
<add prefix="http" type="System.Net.HttpRequestCreator, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
|
||||
<add prefix="https" type="System.Net.HttpRequestCreator, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
|
||||
<add prefix="file" type="System.Net.FileWebRequestCreator, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
|
||||
<add prefix="ftp" type="System.Net.FtpWebRequestCreator, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
|
||||
<add prefix="ftp" type="System.Net.FtpRequestCreator, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
|
||||
</webRequestModules>
|
||||
</system.net>
|
||||
|
||||
|
||||
@@ -132,7 +132,7 @@
|
||||
<add prefix="http" type="System.Net.HttpRequestCreator, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
|
||||
<add prefix="https" type="System.Net.HttpRequestCreator, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
|
||||
<add prefix="file" type="System.Net.FileWebRequestCreator, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
|
||||
<add prefix="ftp" type="System.Net.FtpWebRequestCreator, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
|
||||
<add prefix="ftp" type="System.Net.FtpRequestCreator, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
|
||||
</webRequestModules>
|
||||
<settings>
|
||||
<ipv6 enabled="false"/>
|
||||
|
||||
@@ -133,7 +133,7 @@
|
||||
<add prefix="http" type="System.Net.HttpRequestCreator, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
|
||||
<add prefix="https" type="System.Net.HttpRequestCreator, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
|
||||
<add prefix="file" type="System.Net.FileWebRequestCreator, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
|
||||
<add prefix="ftp" type="System.Net.FtpWebRequestCreator, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
|
||||
<add prefix="ftp" type="System.Net.FtpRequestCreator, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
|
||||
</webRequestModules>
|
||||
</system.net>
|
||||
|
||||
|
||||
@@ -136,7 +136,7 @@
|
||||
<add prefix="http" type="System.Net.HttpRequestCreator, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
|
||||
<add prefix="https" type="System.Net.HttpRequestCreator, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
|
||||
<add prefix="file" type="System.Net.FileWebRequestCreator, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
|
||||
<add prefix="ftp" type="System.Net.FtpWebRequestCreator, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
|
||||
<add prefix="ftp" type="System.Net.FtpRequestCreator, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
|
||||
</webRequestModules>
|
||||
</system.net>
|
||||
|
||||
|
||||
+2
-2
@@ -13,10 +13,10 @@ ASSEMBLED_DOCS = \
|
||||
monoapi.tree monoapi.zip
|
||||
|
||||
convert.exe: $(srcdir)/convert.cs AgilityPack.dll
|
||||
$(CSCOMPILE) -r:$(topdir)/class/lib/$(PROFILE)/mscorlib.dll -r:$(topdir)/class/lib/$(PROFILE)/System.Xml.dll -out:$@ $< -r:AgilityPack.dll
|
||||
$(CSCOMPILE) -r:$(topdir)/class/lib/$(PROFILE)/System.Xml.dll -out:$@ $< -r:AgilityPack.dll
|
||||
|
||||
AgilityPack.dll:
|
||||
$(CSCOMPILE) -r:$(topdir)/class/lib/$(PROFILE)/mscorlib.dll -r:$(topdir)/class/lib/$(PROFILE)/System.dll -r:$(topdir)/class/lib/$(PROFILE)/System.Xml.dll -target:library -out:$@ $(srcdir)/HtmlAgilityPack/*.cs
|
||||
$(CSCOMPILE) -r:$(topdir)/class/lib/$(PROFILE)/System.dll -r:$(topdir)/class/lib/$(PROFILE)/System.Xml.dll -target:library -out:$@ $(srcdir)/HtmlAgilityPack/*.cs
|
||||
|
||||
monoapi.zip: monoapi.tree
|
||||
@test -f $@ || { rm -f $< && $(MAKE) $<; }
|
||||
|
||||
+1
-1
@@ -69,5 +69,5 @@ object for filters is passed in a local variable (cfg->exvar).
|
||||
throw: we first save all regs into a sigcontext struct and then call the stack
|
||||
unwinding code.
|
||||
|
||||
catch handler: catch handlers are always called from the stack unwinding
|
||||
catch handler: catch hanlders are always called from the stack unwinding
|
||||
code. The exception object is passed in a local variable (cfg->exvar).
|
||||
-109
@@ -1,109 +0,0 @@
|
||||
# Mono RISC-V Port
|
||||
|
||||
These are some useful links and notes pertaining to the RISC-V port of Mono.
|
||||
|
||||
## Useful RISC-V documents
|
||||
|
||||
* [RISC-V User-Level ISA Specification](https://riscv.org/specifications/)
|
||||
* [RISC-V Privileged ISA Specification](https://riscv.org/specifications/privileged-isa/)
|
||||
* [RISC-V Debug Specification Standard](https://github.com/riscv/riscv-debug-spec/blob/master/riscv-debug-spec.pdf)
|
||||
* [RISC-V Assembly Programmer's Manual](https://github.com/riscv/riscv-asm-manual/blob/master/riscv-asm.md)
|
||||
* [RISC-V ELF psABI Specification](https://github.com/riscv/riscv-elf-psabi-doc/blob/master/riscv-elf.md)
|
||||
|
||||
## Useful RISC-V repositories
|
||||
|
||||
* [RISC-V Organization](https://github.com/riscv)
|
||||
* [RISC-V Linux](https://github.com/riscv/riscv-linux)
|
||||
* [RISC-V LLD](https://github.com/riscv/riscv-lld)
|
||||
* [RISC-V Tools](https://github.com/riscv/riscv-tools)
|
||||
* [RISC-V GNU Toolchain](https://github.com/riscv/riscv-gnu-toolchain)
|
||||
* [RISC-V Binutils](https://github.com/riscv/riscv-binutils-gdb)
|
||||
* [RISC-V GCC](https://github.com/riscv/riscv-gcc)
|
||||
* [RISC-V Glibc](https://github.com/riscv/riscv-glibc)
|
||||
* [RISC-V Newlib](https://github.com/riscv/riscv-newlib)
|
||||
* [RISC-V QEMU](https://github.com/riscv/riscv-qemu)
|
||||
* [RISC-V Opcodes](https://github.com/riscv/riscv-opcodes)
|
||||
* [RISC-V Tests](https://github.com/riscv/riscv-tests)
|
||||
* [lowRISC Organization](https://github.com/lowrisc)
|
||||
* [RISC-V LLVM](https://github.com/lowrisc/riscv-llvm)
|
||||
|
||||
## Setting up a cross environment
|
||||
|
||||
Setting up a cross environment with a Linux toolchain and QEMU is quite easy.
|
||||
|
||||
First, add these to your `.bashrc` (or some other script that you run):
|
||||
|
||||
```bash
|
||||
export RISCV=$HOME/riscv
|
||||
export PATH=$RISCV/bin:$PATH
|
||||
export QEMU_LD_PREFIX=$RISCV/sysroot
|
||||
```
|
||||
|
||||
Install some dependencies needed to build the toolchain:
|
||||
|
||||
```console
|
||||
# apt install sudo apt-get install autoconf automake autotools-dev curl libmpc-dev libmpfr-dev libgmp-dev libusb-1.0-0-dev gawk build-essential bison flex texinfo gperf libtool patchutils bc zlib1g-dev device-tree-compiler pkg-config libexpat-dev
|
||||
```
|
||||
|
||||
Now you can build the toolchain:
|
||||
|
||||
```console
|
||||
$ git clone --recursive [email protected]:riscv/riscv-tools.git
|
||||
$ cd riscv-tools
|
||||
$ ./build.sh
|
||||
$ cd riscv-gnu-toolchain
|
||||
$ ./configure --prefix=$RISCV --enable-multilib
|
||||
$ make linux
|
||||
$ cd ../..
|
||||
$ git clone --recursive [email protected]:riscv/riscv-qemu.git
|
||||
$ cd riscv-qemu
|
||||
$ mkdir build
|
||||
$ cd build
|
||||
$ ../configure --prefix=$RISCV --disable-werror
|
||||
$ make
|
||||
$ make install
|
||||
```
|
||||
|
||||
## Building Mono with a cross toolchain
|
||||
|
||||
Building Mono is quite straightforward:
|
||||
|
||||
```console
|
||||
$ ./autogen.sh --prefix=$RISCV/sysroot --host=riscv64-unknown-linux-gnu
|
||||
$ make
|
||||
$ make install
|
||||
```
|
||||
|
||||
You can set `CFLAGS` as appropriate to change the RISC-V options, such as which
|
||||
standard extensions and ABI to use. For example, to use the 64-bit soft float
|
||||
ABI:
|
||||
|
||||
```console
|
||||
$ CFLAGS="-mabi=lp64" ./autogen.sh --prefix=$RISCV/sysroot --host=riscv64-unknown-linux-gnu
|
||||
```
|
||||
|
||||
Note that, since this is a cross build, the `mcs` directory won't be built. You
|
||||
will have to build the managed libraries and tools through a native build of
|
||||
Mono and copy them into `$RISCV/sysroot`.
|
||||
|
||||
You can run Mono with QEMU like this:
|
||||
|
||||
```console
|
||||
$ qemu-riscv64 $RISCV/sysroot/bin/mono hello.exe
|
||||
```
|
||||
|
||||
## Things to be done
|
||||
|
||||
In no particular order:
|
||||
|
||||
* Complete the soft float port.
|
||||
* Complete the 32-bit port.
|
||||
* Add unwind info to trampolines.
|
||||
* Implement AOT support.
|
||||
* Implement interpreter support.
|
||||
* Implement LLVM support.
|
||||
* Implement SDB support.
|
||||
* Implement `dyn_call` support.
|
||||
* Ensure all runtime tests pass.
|
||||
* Ensure all corlib tests pass.
|
||||
* Set up CI on Jenkins.
|
||||
Vendored
+1
-1
Submodule external/api-snapshot updated: ddf8f364be...2b6a61c962.
Vendored
+1
-1
Submodule external/binary-reference-assemblies updated: bdc6cdaabf...9f07d0746d.
Vendored
+1
-1
Submodule external/bockbuild updated: 4d68269934...e22032cad6.
Vendored
+1
-1
Submodule external/boringssl updated: 41221b45aa...3e0770e188.
Vendored
+1
-1
Submodule external/cecil updated: b6c50e3d34...dfee11e80d.
Vendored
+1
-1
Submodule external/corefx updated: 492f805884...dfd98e7113.
Vendored
+1
-1
Submodule external/corert updated: efd29b5cf8...48dba73801.
Vendored
+1
-1
Submodule external/ikdasm updated: 471d5827c9...465c081555.
Vendored
+1
-1
Submodule external/linker updated: db6d1a3246...ab2053f760.
Vendored
+1
-1
Submodule external/nuget-buildtasks updated: 9955847957...b2c30bc81b.
Vendored
+1
-1
Submodule external/nunit-lite updated: e64e0197a8...a8bef89392.
Vendored
+1
-1
Submodule external/roslyn-binaries updated: 09a97af42a...00da53c474.
Vendored
+1
-1
Submodule external/xunit-binaries updated: 3c3659bc0f...c5a907be25.
@@ -1,11 +1,9 @@
|
||||
|
||||
AM_CPPFLAGS = $(GLIB_CFLAGS)
|
||||
|
||||
glib_libs = $(top_builddir)/mono/eglib/libeglib.la
|
||||
|
||||
lib_LTLIBRARIES = libikvm-native.la
|
||||
|
||||
libikvm_native_la_SOURCES = jni.c os.c jni.h
|
||||
|
||||
libikvm_native_la_LDFLAGS = -avoid-version
|
||||
libikvm_native_la_LIBADD = $(glib_libs)
|
||||
libikvm_native_la_LIBADD = $(GLIB_LIBS)
|
||||
+4
-5
@@ -74,13 +74,12 @@ if test x$NOCONFIGURE = x && test -z "$*"; then
|
||||
echo
|
||||
fi
|
||||
|
||||
am_opt="--add-missing --copy --gnu -Wno-obsolete"
|
||||
|
||||
case $CC in
|
||||
xlc )
|
||||
am_opt="$am_opt --include-deps";;
|
||||
am_opt=--include-deps;;
|
||||
esac
|
||||
|
||||
|
||||
if grep "^AC_PROG_LIBTOOL" configure.ac >/dev/null; then
|
||||
if test -z "$NO_LIBTOOLIZE" ; then
|
||||
echo "Running libtoolize..."
|
||||
@@ -105,8 +104,8 @@ if grep "^AC_CONFIG_HEADERS" configure.ac >/dev/null; then
|
||||
autoheader || { echo "**Error**: autoheader failed."; exit 1; }
|
||||
fi
|
||||
|
||||
echo "Running automake $am_opt ..."
|
||||
automake $am_opt ||
|
||||
echo "Running automake --gnu $am_opt ..."
|
||||
automake --add-missing --gnu -Wno-obsolete $am_opt ||
|
||||
{ echo "**Error**: automake failed."; exit 1; }
|
||||
echo "Running autoconf ..."
|
||||
autoconf || { echo "**Error**: autoconf failed."; exit 1; }
|
||||
|
||||
+1
-2
@@ -396,8 +396,7 @@ GC_bool GC_register_main_static_data()
|
||||
|
||||
# if (defined(LINUX) || defined (__GLIBC__) || defined(NACL)) /* Are others OK here, too? */ \
|
||||
&& (__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2) \
|
||||
|| (__GLIBC__ == 2 && __GLIBC_MINOR__ == 2 && defined(DT_CONFIG))) \
|
||||
|| defined(OPENBSD)
|
||||
|| (__GLIBC__ == 2 && __GLIBC_MINOR__ == 2 && defined(DT_CONFIG)))
|
||||
|
||||
/* We have the header files for a glibc that includes dl_iterate_phdr. */
|
||||
/* It may still not be available in the library on the target system. */
|
||||
|
||||
+9
-49
@@ -42,6 +42,11 @@
|
||||
# define GC_CONST
|
||||
# endif
|
||||
|
||||
# ifdef __cplusplus
|
||||
extern "C" {
|
||||
# endif
|
||||
|
||||
|
||||
/* Define word and signed_word to be unsigned and signed types of the */
|
||||
/* size as char * or void *. There seems to be no way to do this */
|
||||
/* even semi-portably. The following is probably no better/worse */
|
||||
@@ -61,10 +66,6 @@
|
||||
typedef __int64 GC_signed_word;
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Public read-only variables */
|
||||
|
||||
GC_API GC_word GC_gc_no;/* Counter incremented per collection. */
|
||||
@@ -500,17 +501,7 @@ GC_API GC_PTR GC_malloc_atomic_ignore_off_page GC_PROTO((size_t lb));
|
||||
#endif
|
||||
|
||||
#if defined(__linux__) || defined(__GLIBC__)
|
||||
|
||||
#ifdef __cplusplus
|
||||
} // extern "C"
|
||||
#endif
|
||||
|
||||
# include <features.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
# if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1 || __GLIBC__ > 2) \
|
||||
&& !defined(__ia64__)
|
||||
# ifndef GC_HAVE_BUILTIN_BACKTRACE
|
||||
@@ -844,18 +835,6 @@ typedef GC_PTR (*GC_fn_type) GC_PROTO((GC_PTR client_data));
|
||||
GC_API GC_PTR GC_call_with_alloc_lock
|
||||
GC_PROTO((GC_fn_type fn, GC_PTR client_data));
|
||||
|
||||
/*
|
||||
* These are similar to GC_do_blocking () in upstream bdwgc. The design is
|
||||
* simpler in that there is no distinction between active and inactive stack
|
||||
* frames; instead, while a thread is in blocking state, it promises to not
|
||||
* interact with the GC at all, and to not keep any pointers to GC memory
|
||||
* around from before entering blocking state. Additionally, these can be
|
||||
* called unbalanced (they simply set a flag internally).
|
||||
*/
|
||||
GC_API void GC_start_blocking GC_PROTO((void));
|
||||
|
||||
GC_API void GC_end_blocking GC_PROTO((void));
|
||||
|
||||
/* The following routines are primarily intended for use with a */
|
||||
/* preprocessor which inserts calls to check C pointer arithmetic. */
|
||||
/* They indicate failure by invoking the corresponding _print_proc. */
|
||||
@@ -974,17 +953,7 @@ GC_API void (*GC_is_visible_print_proc)
|
||||
|
||||
#if !defined(GC_USE_LD_WRAP) && \
|
||||
(defined(GC_PTHREADS) || defined(GC_SOLARIS_THREADS) || defined(GC_DARWIN_THREADS) || defined(GC_MACOSX_THREADS))
|
||||
|
||||
#ifdef __cplusplus
|
||||
} // extern "C"
|
||||
#endif
|
||||
|
||||
# include "gc_pthread_redirects.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
# if defined(PCR) || defined(GC_SOLARIS_THREADS) || \
|
||||
@@ -1004,17 +973,8 @@ extern void GC_thr_init(void); /* Needed for Solaris/X86 */
|
||||
#endif /* THREADS && !SRC_M3 */
|
||||
|
||||
#if defined(GC_WIN32_THREADS) && !defined(__CYGWIN32__) && !defined(__CYGWIN__)
|
||||
|
||||
#ifdef __cplusplus
|
||||
} // extern "C"
|
||||
#endif
|
||||
|
||||
# include <windows.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
# ifdef GC_INSIDE_DLL
|
||||
BOOL WINAPI GC_DllMain(HINSTANCE inst, ULONG reason, LPVOID reserved);
|
||||
# endif
|
||||
@@ -1109,10 +1069,6 @@ extern "C" {
|
||||
GC_API void GC_win32_free_heap ();
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
} // extern "C"
|
||||
#endif
|
||||
|
||||
#if ( defined(_AMIGA) && !defined(GC_AMIGA_MAKINGLIB) )
|
||||
/* Allocation really goes through GC_amiga_allocwrapper_do */
|
||||
# include "gc_amiga_redirects.h"
|
||||
@@ -1122,4 +1078,8 @@ extern "C" {
|
||||
# include "gc_local_alloc.h"
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* end of extern "C" */
|
||||
#endif
|
||||
|
||||
#endif /* _GC_H */
|
||||
@@ -44,10 +44,6 @@
|
||||
# include "gc.h"
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* The following allocators signal an out of memory condition with */
|
||||
/* return GC_oom_fn(bytes); */
|
||||
|
||||
@@ -114,8 +110,4 @@ extern int GC_gcj_debug_kind;
|
||||
GC_gcj_malloc_ignore_off_page(s,d)
|
||||
# endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
} // extern "C"
|
||||
#endif
|
||||
|
||||
#endif /* GC_GCJ_H */
|
||||
@@ -49,10 +49,6 @@
|
||||
#ifndef GC_LOCAL_ALLOC_H
|
||||
#define GC_LOCAL_ALLOC_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* We assume ANSI C for this interface. */
|
||||
|
||||
GC_PTR GC_local_malloc(size_t bytes);
|
||||
@@ -66,10 +62,6 @@ GC_PTR GC_local_malloc_atomic(size_t bytes);
|
||||
void * ptr_to_struct_containing_descr);
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
} // extern "C"
|
||||
#endif
|
||||
|
||||
# ifdef GC_DEBUG
|
||||
/* We don't really use local allocation in this case. */
|
||||
# define GC_LOCAL_MALLOC(s) GC_debug_malloc(s,GC_EXTRAS)
|
||||
|
||||
@@ -15,11 +15,6 @@
|
||||
/* facility in thr_keycreate. Alternatively, keep a redundant pointer */
|
||||
/* to thread specific data on the thread stack. */
|
||||
# include <thread.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
int GC_thr_create(void *stack_base, size_t stack_size,
|
||||
void *(*start_routine)(void *), void *arg, long flags,
|
||||
thread_t *new_thread);
|
||||
@@ -31,22 +26,11 @@ extern "C" {
|
||||
# define thr_join GC_thr_join
|
||||
# define thr_suspend GC_thr_suspend
|
||||
# define thr_continue GC_thr_continue
|
||||
|
||||
#ifdef __cplusplus
|
||||
} // extern "C"
|
||||
#endif
|
||||
|
||||
#endif /* GC_SOLARIS_THREADS */
|
||||
|
||||
#if defined(GC_SOLARIS_PTHREADS)
|
||||
|
||||
# include <pthread.h>
|
||||
# include <signal.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
extern int GC_pthread_create(pthread_t *new_thread,
|
||||
const pthread_attr_t *attr,
|
||||
void * (*thread_execp)(void *), void *arg);
|
||||
@@ -55,11 +39,6 @@ extern "C" {
|
||||
# define pthread_join GC_pthread_join
|
||||
# define pthread_create GC_pthread_create
|
||||
# define pthread_detach GC_pthread_detach
|
||||
|
||||
#ifdef __cplusplus
|
||||
} // extern "C"
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
#if defined(GC_SOLARIS_PTHREADS) || defined(GC_SOLARIS_THREADS)
|
||||
@@ -72,10 +51,6 @@ extern "C" {
|
||||
# include <pthread.h>
|
||||
# include <signal.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
int GC_pthread_create(pthread_t *new_thread,
|
||||
const pthread_attr_t *attr,
|
||||
void *(*start_routine)(void *), void *arg);
|
||||
@@ -112,10 +87,6 @@ extern "C" {
|
||||
# define dlopen GC_dlopen
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
} // extern "C"
|
||||
#endif
|
||||
|
||||
#endif /* GC_xxxxx_THREADS */
|
||||
|
||||
#endif /* GC_PTHREAD_REDIRECTS_H */
|
||||
@@ -43,17 +43,7 @@
|
||||
*
|
||||
*/
|
||||
# ifdef THREADS
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
void GC_noop1 GC_PROTO((word));
|
||||
|
||||
#ifdef __cplusplus
|
||||
} // extern "C"
|
||||
#endif
|
||||
|
||||
# ifdef PCR_OBSOLETE /* Faster, but broken with multiple lwp's */
|
||||
# include "th/PCR_Th.h"
|
||||
# include "th/PCR_ThCrSec.h"
|
||||
|
||||
@@ -366,10 +366,6 @@ void GC_print_callers GC_PROTO((struct callinfo info[NFRAMES]));
|
||||
# define BZERO(x,n) bzero((char *)(x),(int)(n))
|
||||
# endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#if defined(DARWIN)
|
||||
# if defined(POWERPC)
|
||||
# define GC_MACH_THREAD_STATE_FLAVOR PPC_THREAD_STATE
|
||||
@@ -417,18 +413,7 @@ extern "C" {
|
||||
* Stop and restart mutator threads.
|
||||
*/
|
||||
# ifdef PCR
|
||||
|
||||
#ifdef __cplusplus
|
||||
} // extern "C"
|
||||
#endif
|
||||
|
||||
# include "th/PCR_ThCtl.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
# define STOP_WORLD() \
|
||||
PCR_ThCtl_SetExclusiveMode(PCR_ThCtl_ExclusiveMode_stopNormal, \
|
||||
PCR_allSigsBlocked, \
|
||||
@@ -1330,7 +1315,7 @@ void GC_initiate_gc GC_PROTO((void));
|
||||
/* If the mark state is invalid, this */
|
||||
/* becomes full colleection. Otherwise */
|
||||
/* it's partial. */
|
||||
void GC_push_all (void* bottom, void* top);
|
||||
void GC_push_all GC_PROTO((ptr_t bottom, ptr_t top));
|
||||
/* Push everything in a range */
|
||||
/* onto mark stack. */
|
||||
void GC_push_selected GC_PROTO(( \
|
||||
@@ -1975,10 +1960,6 @@ void GC_err_puts GC_PROTO((GC_CONST char *s));
|
||||
/* some other reason. */
|
||||
# endif /* PARALLEL_MARK */
|
||||
|
||||
#ifdef __cplusplus
|
||||
} // extern "C"
|
||||
#endif
|
||||
|
||||
# if defined(GC_PTHREADS) && !defined(GC_SOLARIS_THREADS)
|
||||
/* We define the thread suspension signal here, so that we can refer */
|
||||
/* to it in the dirty bit implementation, if necessary. Ideally we */
|
||||
|
||||
+4
-6
@@ -1191,13 +1191,11 @@ void GC_mark_init()
|
||||
* Should only be used if there is no possibility of mark stack
|
||||
* overflow.
|
||||
*/
|
||||
void GC_push_all(void_bottom, void_top)
|
||||
void* void_bottom;
|
||||
void* void_top;
|
||||
void GC_push_all(bottom, top)
|
||||
ptr_t bottom;
|
||||
ptr_t top;
|
||||
{
|
||||
ptr_t bottom = (ptr_t)void_bottom;
|
||||
ptr_t top = (ptr_t)void_top;
|
||||
word length;
|
||||
register word length;
|
||||
|
||||
bottom = (ptr_t)(((word) bottom + ALIGNMENT-1) & ~(ALIGNMENT-1));
|
||||
top = (ptr_t)(((word) top) & ~(ALIGNMENT-1));
|
||||
|
||||
@@ -1245,6 +1245,7 @@ void GC_start_blocking(void) {
|
||||
GC_thread me;
|
||||
LOCK();
|
||||
me = GC_lookup_thread(pthread_self());
|
||||
GC_ASSERT(!(me -> thread_blocked));
|
||||
# ifdef SPARC
|
||||
me -> stop_info.stack_ptr = (ptr_t)GC_save_regs_in_stack();
|
||||
# else
|
||||
@@ -1272,6 +1273,7 @@ void GC_end_blocking(void) {
|
||||
GC_thread me;
|
||||
LOCK(); /* This will block if the world is stopped. */
|
||||
me = GC_lookup_thread(pthread_self());
|
||||
GC_ASSERT(me -> thread_blocked);
|
||||
me -> thread_blocked = FALSE;
|
||||
UNLOCK();
|
||||
}
|
||||
|
||||
+1
-47
@@ -48,7 +48,6 @@ struct GC_thread_Rep {
|
||||
/* 0 ==> entry not valid. */
|
||||
/* !in_use ==> stack_base == 0 */
|
||||
GC_bool suspended;
|
||||
GC_bool thread_blocked;
|
||||
|
||||
# ifdef CYGWIN32
|
||||
void *status; /* hold exit value until join in case it's a pointer */
|
||||
@@ -175,7 +174,6 @@ static GC_thread GC_new_thread(void) {
|
||||
/* the world, wait here. Hopefully this can't happen on any */
|
||||
/* systems that don't allow us to block here. */
|
||||
while (GC_please_stop) Sleep(20);
|
||||
GC_ASSERT(!thread_table[i]->thread_blocked);
|
||||
return thread_table + i;
|
||||
}
|
||||
|
||||
@@ -225,6 +223,7 @@ static void GC_delete_thread(DWORD thread_id) {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#ifdef CYGWIN32
|
||||
|
||||
/* Return a GC_thread corresponding to a given pthread_t. */
|
||||
@@ -246,20 +245,6 @@ static GC_thread GC_lookup_thread(pthread_t id)
|
||||
return thread_table + i;
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
static GC_thread GC_lookup_thread(DWORD id)
|
||||
{
|
||||
int i;
|
||||
LONG max = GC_get_max_thread_index();
|
||||
|
||||
for (i = 0; i <= max; i++)
|
||||
if (thread_table[i].in_use && thread_table[i].id == id)
|
||||
return &thread_table[i];
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
#endif /* CYGWIN32 */
|
||||
|
||||
void GC_push_thread_structures GC_PROTO((void))
|
||||
@@ -279,35 +264,6 @@ void GC_push_thread_structures GC_PROTO((void))
|
||||
# endif
|
||||
}
|
||||
|
||||
/* Wrappers for functions that are likely to block for an appreciable */
|
||||
/* length of time. Must be called in pairs, if at all. */
|
||||
/* Nothing much beyond the system call itself should be executed */
|
||||
/* between these. */
|
||||
|
||||
void GC_start_blocking(void) {
|
||||
GC_thread me;
|
||||
LOCK();
|
||||
#ifdef CYGWIN32
|
||||
me = GC_lookup_thread(pthread_self());
|
||||
#else
|
||||
me = GC_lookup_thread(GetCurrentThreadId());
|
||||
#endif
|
||||
me->thread_blocked = TRUE;
|
||||
UNLOCK();
|
||||
}
|
||||
|
||||
void GC_end_blocking(void) {
|
||||
GC_thread me;
|
||||
LOCK(); /* This will block if the world is stopped. */
|
||||
#ifdef CYGWIN32
|
||||
me = GC_lookup_thread(pthread_self());
|
||||
#else
|
||||
me = GC_lookup_thread(GetCurrentThreadId());
|
||||
#endif
|
||||
me->thread_blocked = FALSE;
|
||||
UNLOCK();
|
||||
}
|
||||
|
||||
/* Defined in misc.c */
|
||||
extern CRITICAL_SECTION GC_write_cs;
|
||||
|
||||
@@ -325,8 +281,6 @@ void GC_stop_world()
|
||||
for (i = 0; i <= GC_get_max_thread_index(); i++)
|
||||
if (thread_table[i].stack_base != 0
|
||||
&& thread_table[i].id != thread_id) {
|
||||
if (thread_table [i].thread_blocked)
|
||||
continue;
|
||||
# ifdef MSWINCE
|
||||
/* SuspendThread will fail if thread is running kernel code */
|
||||
while (SuspendThread(thread_table[i].handle) == (DWORD)-1)
|
||||
|
||||
@@ -1,3 +1,2 @@
|
||||
/Makefile
|
||||
/Makefile.in
|
||||
/llvm_config.mk
|
||||
+22
-48
@@ -1,56 +1,30 @@
|
||||
#
|
||||
# Conditional submodule for llvm
|
||||
#
|
||||
# make reset-llvm will checkout a version of llvm which is suitable for this version of mono
|
||||
# into $top_srcdir/llvm/llvm.
|
||||
#
|
||||
|
||||
EXTRA_DIST=SUBMODULES.json build.mk build_llvm_config.sh
|
||||
LLVM_PATH=llvm
|
||||
|
||||
if ENABLE_LLVM
|
||||
SUBMODULES_CONFIG_FILE = $(top_srcdir)/llvm/SUBMODULES.json
|
||||
include $(top_srcdir)/scripts/submodules/versions.mk
|
||||
|
||||
if HOST_WIN32
|
||||
llvm_config=llvm-config.exe
|
||||
else
|
||||
llvm_config=llvm-config
|
||||
endif
|
||||
$(eval $(call ValidateVersionTemplate,llvm,LLVM))
|
||||
|
||||
if HAVE_ZLIB
|
||||
llvm_extra_libs=-lz
|
||||
else
|
||||
llvm_extra_libs=
|
||||
endif
|
||||
# Bump the given submodule to the revision given by the REV make variable
|
||||
# If COMMIT is 1, commit the change
|
||||
bump-llvm: __bump-version-llvm
|
||||
|
||||
if INTERNAL_LLVM
|
||||
# Bump the given submodule to the branch given by the BRANCH/REMOTE_BRANCH make variables
|
||||
# If COMMIT is 1, commit the change
|
||||
bump-branch-llvm: __bump-branch-llvm
|
||||
|
||||
all-local: configure-llvm build-llvm install-llvm llvm_config.mk
|
||||
# Bump the given submodule to its current GIT version
|
||||
# If COMMIT is 1, commit the change
|
||||
bump-current-llvm: __bump-current-version-llvm
|
||||
|
||||
clean-local: clean-llvm clean-llvm-config
|
||||
clean-local:
|
||||
$(RM) -r $(LLVM_PATH)
|
||||
|
||||
$(mono_build_root)/llvm/llvm_config.mk: install-llvm
|
||||
$(top_srcdir)/llvm/build_llvm_config.sh "$(top_srcdir)/llvm/usr/bin/$(llvm_config)" "$(LLVM_CODEGEN_LIBS)" "$(llvm_extra_libs)" > $@
|
||||
|
||||
else
|
||||
all-local: llvm_config.mk
|
||||
|
||||
clean-local: clean-llvm-config
|
||||
|
||||
$(mono_build_root)/llvm/llvm_config.mk: $(top_srcdir)/llvm/Makefile.am
|
||||
$(top_srcdir)/llvm/build_llvm_config.sh "$(EXTERNAL_LLVM_CONFIG)" "$(LLVM_CODEGEN_LIBS)" "$(llvm_extra_libs)" > $@
|
||||
endif
|
||||
|
||||
llvm_config.mk: $(mono_build_root)/llvm/llvm_config.mk
|
||||
|
||||
clean-llvm-config:
|
||||
- rm -rf llvm_config.mk
|
||||
|
||||
else
|
||||
all-local:
|
||||
|
||||
clean-local:
|
||||
endif
|
||||
|
||||
# Override this so we don't try to re-copy llvm when we install mono
|
||||
install:
|
||||
|
||||
if TARGET_WASM
|
||||
LLVM_TARGET=wasm32
|
||||
else
|
||||
LLVM_TARGET=
|
||||
endif
|
||||
|
||||
include build.mk
|
||||
EXTRA_DIST=SUBMODULES.json
|
||||
@@ -2,9 +2,9 @@
|
||||
{
|
||||
"name": "llvm",
|
||||
"url": "git://github.com/mono/llvm.git",
|
||||
"rev": "81376d161cb6c2230834b2dc096ccbdae8d93020",
|
||||
"remote-branch": "origin/release_60",
|
||||
"branch": "release_60",
|
||||
"rev": "9f79399f87282524fee099b328bd8cbf07929daf",
|
||||
"remote-branch": "origin/master",
|
||||
"branch": "master",
|
||||
"directory": "llvm"
|
||||
}
|
||||
]
|
||||
@@ -1,86 +0,0 @@
|
||||
#
|
||||
# Conditional submodule for llvm
|
||||
#
|
||||
# make reset-llvm will checkout a version of llvm which is suitable for this version of mono
|
||||
# into $top_srcdir/llvm/llvm.
|
||||
#
|
||||
# Input variables
|
||||
# - LLVM_TARGET: if set to wasm32 will trigger a 32bits build that enable the experimental WebAssembly backend
|
||||
#
|
||||
|
||||
top_srcdir ?= $(abspath $(CURDIR)/..)
|
||||
|
||||
LLVM_PATH ?= $(abspath $(top_srcdir)/external/llvm)
|
||||
LLVM_BUILD ?= $(abspath $(top_srcdir)/llvm/build)
|
||||
LLVM_PREFIX ?= $(abspath $(top_srcdir)/llvm/usr)
|
||||
|
||||
# FIXME: URL should be http://xamjenkinsartifact.blob.core.windows.net/build-package-osx-llvm-$(NEEDED_LLVM_BRANCH)/llvm-osx64-$(NEEDED_LLVM_VERSION).tar.gz
|
||||
LLVM_DOWNLOAD_LOCATION = "http://xamjenkinsartifact.blob.core.windows.net/build-package-osx-llvm-release60/llvm-osx64-$(NEEDED_LLVM_VERSION).tar.gz"
|
||||
|
||||
CMAKE := $(or $(CMAKE),$(shell which cmake))
|
||||
NINJA := $(shell which ninja)
|
||||
|
||||
SUBMODULES_CONFIG_FILE = $(top_srcdir)/llvm/SUBMODULES.json
|
||||
include $(top_srcdir)/scripts/submodules/versions.mk
|
||||
|
||||
$(eval $(call ValidateVersionTemplate,llvm,LLVM))
|
||||
|
||||
# Bump the given submodule to the revision given by the REV make variable
|
||||
# If COMMIT is 1, commit the change
|
||||
bump-llvm: __bump-version-llvm
|
||||
|
||||
# Bump the given submodule to the branch given by the BRANCH/REMOTE_BRANCH make variables
|
||||
# If COMMIT is 1, commit the change
|
||||
bump-branch-llvm: __bump-branch-llvm
|
||||
|
||||
# Bump the given submodule to its current GIT version
|
||||
# If COMMIT is 1, commit the change
|
||||
bump-current-llvm: __bump-current-version-llvm
|
||||
|
||||
$(LLVM_BUILD) $(LLVM_PREFIX):
|
||||
mkdir -p $@
|
||||
|
||||
$(LLVM_PATH):
|
||||
$(MAKE) -f build.mk reset-llvm
|
||||
|
||||
$(LLVM_PATH)/CMakeLists.txt: | $(LLVM_PATH)
|
||||
|
||||
EXTRA_LLVM_ARGS = $(if $(filter $(LLVM_TARGET),wasm32), -DLLVM_BUILD_32_BITS=On -DLLVM_EXPERIMENTAL_TARGETS_TO_BUILD="WebAssembly",)
|
||||
|
||||
$(LLVM_BUILD)/$(if $(NINJA),build.ninja,Makefile): $(LLVM_PATH)/CMakeLists.txt | $(LLVM_BUILD)
|
||||
cd $(LLVM_BUILD) && $(CMAKE) \
|
||||
$(if $(NINJA),-G Ninja) \
|
||||
-DCMAKE_INSTALL_PREFIX="$(LLVM_PREFIX)" \
|
||||
-DCMAKE_BUILD_TYPE=Release \
|
||||
-DLLVM_BUILD_TESTS=Off \
|
||||
-DLLVM_INCLUDE_TESTS=Off \
|
||||
-DLLVM_BUILD_EXAMPLES=Off \
|
||||
-DLLVM_INCLUDE_EXAMPLES=Off \
|
||||
-DLLVM_TOOLS_TO_BUILD="opt;llc;llvm-config;llvm-dis" \
|
||||
-DLLVM_TARGETS_TO_BUILD="X86;ARM;AArch64" \
|
||||
$(EXTRA_LLVM_ARGS) \
|
||||
-DLLVM_ENABLE_ASSERTIONS=$(if $(INTERNAL_LLVM_ASSERTS),On,Off) \
|
||||
$(LLVM_CMAKE_ARGS) \
|
||||
$(dir $<)
|
||||
|
||||
.PHONY: configure-llvm
|
||||
configure-llvm: $(LLVM_BUILD)/$(if $(NINJA),build.ninja,Makefile)
|
||||
|
||||
# The DESTDIR fix is to prevent the build from trying to install this out-of-build-tree
|
||||
# as the DESTDIR hasn't been created when we're building mono
|
||||
|
||||
.PHONY: build-llvm
|
||||
build-llvm: configure-llvm
|
||||
DESTDIR="" $(if $(NINJA),$(NINJA),$(MAKE)) -C $(LLVM_BUILD)
|
||||
|
||||
.PHONY: install-llvm
|
||||
install-llvm: build-llvm | $(LLVM_PREFIX)
|
||||
DESTDIR="" $(if $(NINJA),$(NINJA),$(MAKE)) -C $(LLVM_BUILD) install
|
||||
|
||||
.PHONY: download-llvm
|
||||
download-llvm:
|
||||
(wget --no-verbose -O - $(LLVM_DOWNLOAD_LOCATION) || curl -L $(LLVM_DOWNLOAD_LOCATION)) | tar -xzf - -C $(dir $(LLVM_PREFIX))
|
||||
|
||||
.PHONY: clean-llvm
|
||||
clean-llvm:
|
||||
$(RM) -r $(LLVM_BUILD) $(LLVM_PREFIX)
|
||||
@@ -1,172 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
llvm_config=$1
|
||||
llvm_codegen_libs="$2"
|
||||
llvm_extra_libs="${@:3}"
|
||||
|
||||
use_llvm_config=1
|
||||
llvm_host_win32=0
|
||||
llvm_host_win32_wsl=0
|
||||
llvm_host_win32_cygwin=0
|
||||
|
||||
function win32_format_path {
|
||||
local formatted_path=$1
|
||||
if [[ $llvm_host_win32_wsl = 1 ]] && [[ $1 != "/mnt/"* ]]; then
|
||||
# if path is not starting with /mnt under WSL it could be a windows path, convert using wslpath.
|
||||
formatted_path="$(wslpath -a "$1")"
|
||||
elif [[ $llvm_host_win32_cygwin = 1 ]] && [[ $1 != "/cygdrive/"* ]]; then
|
||||
# if path is not starting with /cygdrive under CygWin it could be a windows path, convert using cygpath.
|
||||
formatted_path="$(cygpath -a "$1")"
|
||||
fi
|
||||
echo "$formatted_path"
|
||||
}
|
||||
|
||||
if [[ $llvm_config = *".exe" ]]; then
|
||||
llvm_host_win32=1
|
||||
# llvm-config is a windows binary. Check if we are running CygWin or WSL since then we might still be able to run llvm-config.exe
|
||||
host_uname="$(uname -a)"
|
||||
case "$host_uname" in
|
||||
*Microsoft*)
|
||||
use_llvm_config=1
|
||||
llvm_host_win32_wsl=1
|
||||
;;
|
||||
CYGWIN*)
|
||||
use_llvm_config=1
|
||||
llvm_host_win32_cygwin=1
|
||||
;;
|
||||
*)
|
||||
use_llvm_config=0
|
||||
esac
|
||||
fi
|
||||
|
||||
if [[ $llvm_host_win32 = 1 ]]; then
|
||||
llvm_config=$(win32_format_path "$llvm_config")
|
||||
fi
|
||||
|
||||
if [[ $use_llvm_config = 1 ]]; then
|
||||
llvm_api_version=`$llvm_config --mono-api-version` || "0"
|
||||
with_llvm=`$llvm_config --prefix`
|
||||
llvm_config_cflags=`$llvm_config --cflags`
|
||||
llvm_system=`$llvm_config --system-libs`
|
||||
llvm_core_components=`$llvm_config --libs analysis core bitwriter`
|
||||
if [[ $llvm_api_version -lt 600 ]]; then
|
||||
llvm_old_jit=`$llvm_config --libs mcjit jit 2>>/dev/null`
|
||||
else
|
||||
llvm_old_jit=`$llvm_config --libs mcjit 2>>/dev/null`
|
||||
fi
|
||||
llvm_new_jit=`$llvm_config --libs orcjit 2>>/dev/null`
|
||||
|
||||
if [[ ! -z $llvm_codegen_libs ]]; then
|
||||
llvm_extra=`$llvm_config --libs $llvm_codegen_libs`
|
||||
fi
|
||||
|
||||
# When building for Windows subsystem using WSL or CygWin the path returned from llvm-config.exe
|
||||
# could be a Windows style path, make sure to format it into a path usable for WSL/CygWin.
|
||||
if [[ $llvm_host_win32 = 1 ]]; then
|
||||
with_llvm=$(win32_format_path "$with_llvm")
|
||||
fi
|
||||
fi
|
||||
|
||||
# When cross compiling for Windows on system not capable of running Windows binaries, llvm-config.exe can't be used to query for
|
||||
# LLVM parameters. In that scenario we will need to fallback to default values.
|
||||
if [[ $llvm_host_win32 = 1 ]] && [[ $use_llvm_config = 0 ]]; then
|
||||
# Assume we have llvm-config sitting in llvm-install-root/bin directory, get llvm-install-root directory.
|
||||
with_llvm="$(dirname $llvm_config)"
|
||||
with_llvm="$(dirname $with_llvm)"
|
||||
llvm_config_path=$with_llvm/include/llvm/Config/llvm-config.h
|
||||
|
||||
# llvm-config.exe --mono-api-version
|
||||
llvm_api_version=`awk '/MONO_API_VERSION/ { print $3 }' $llvm_config_path`
|
||||
|
||||
# llvm-config.exe --cflags, returned information currently not used.
|
||||
llvm_config_cflags=
|
||||
|
||||
# llvm-config.exe --system-libs
|
||||
if [[ $llvm_api_version -lt 600 ]]; then
|
||||
llvm_system="-limagehlp -lpsapi -lshell32"
|
||||
else
|
||||
llvm_system="-lpsapi -lshell32 -lole32 -luuid -ladvapi32"
|
||||
fi
|
||||
|
||||
# llvm-config.exe --libs analysis core bitwriter
|
||||
if [[ $llvm_api_version -lt 600 ]]; then
|
||||
llvm_core_components="-lLLVMBitWriter -lLLVMAnalysis -lLLVMTarget -lLLVMMC -lLLVMCore -lLLVMSupport"
|
||||
else
|
||||
llvm_core_components="-lLLVMBitWriter -lLLVMAnalysis -lLLVMProfileData -lLLVMObject -lLLVMMCParser -lLLVMMC -lLLVMBitReader -lLLVMCore -lLLVMBinaryFormat -lLLVMSupport -lLLVMDemangle"
|
||||
fi
|
||||
|
||||
# llvm-config.exe --libs mcjit jit
|
||||
if [[ $llvm_api_version -lt 600 ]]; then
|
||||
llvm_old_jit="-lLLVMJIT -lLLVMCodeGen -lLLVMScalarOpts -lLLVMInstCombine -lLLVMTransformUtils -lLLVMipa -lLLVMAnalysis -lLLVMMCJIT -lLLVMTarget -lLLVMRuntimeDyld -lLLVMObject -lLLVMMCParser -lLLVMBitReader -lLLVMExecutionEngine -lLLVMMC -lLLVMCore -lLLVMSupport"
|
||||
else
|
||||
# Current build of LLVM 60 for cross Windows builds doesn't support LLVM JIT.
|
||||
llvm_old_jit=
|
||||
fi
|
||||
|
||||
# LLVM 36 doesn't support new JIT and LLVM 60 is build without LLVM JIT support for cross Windows builds.
|
||||
llvm_new_jit=
|
||||
|
||||
# Check codegen libs and add needed libraries.
|
||||
case "$llvm_codegen_libs" in
|
||||
*x86codegen*)
|
||||
# llvm-config.exe --libs x86codegen
|
||||
if [[ $llvm_api_version -lt 600 ]]; then
|
||||
llvm_extra="-lLLVMX86CodeGen -lLLVMX86Desc -lLLVMX86Info -lLLVMObject -lLLVMBitReader -lLLVMMCDisassembler -lLLVMX86AsmPrinter -lLLVMX86Utils -lLLVMSelectionDAG -lLLVMAsmPrinter -lLLVMMCParser -lLLVMCodeGen -lLLVMScalarOpts -lLLVMInstCombine -lLLVMTransformUtils -lLLVMipa -lLLVMAnalysis -lLLVMTarget -lLLVMMC -lLLVMCore -lLLVMSupport"
|
||||
else
|
||||
llvm_extra="-lLLVMX86CodeGen -lLLVMGlobalISel -lLLVMX86Desc -lLLVMX86Info -lLLVMMCDisassembler -lLLVMX86AsmPrinter -lLLVMX86Utils -lLLVMSelectionDAG -lLLVMAsmPrinter -lLLVMDebugInfoCodeView -lLLVMDebugInfoMSF -lLLVMCodeGen -lLLVMTarget -lLLVMScalarOpts -lLLVMInstCombine -lLLVMTransformUtils -lLLVMBitWriter -lLLVMAnalysis -lLLVMProfileData -lLLVMObject -lLLVMMCParser -lLLVMMC -lLLVMBitReader -lLLVMCore -lLLVMBinaryFormat -lLLVMSupport -lLLVMDemangle"
|
||||
fi
|
||||
;;
|
||||
*armcodegen*)
|
||||
# llvm-config.exe --libs armcodegen
|
||||
if [[ $llvm_api_version -lt 600 ]]; then
|
||||
llvm_extra="-lLLVMARMCodeGen -lLLVMSelectionDAG -lLLVMAsmPrinter -lLLVMMCParser -lLLVMCodeGen -lLLVMScalarOpts -lLLVMInstCombine -lLLVMTransformUtils -lLLVMipa -lLLVMAnalysis -lLLVMTarget -lLLVMCore -lLLVMARMDesc -lLLVMMCDisassembler -lLLVMARMInfo -lLLVMARMAsmPrinter -lLLVMMC -lLLVMSupport"
|
||||
else
|
||||
llvm_extra="-lLLVMARMCodeGen -lLLVMGlobalISel -lLLVMSelectionDAG -lLLVMAsmPrinter -lLLVMDebugInfoCodeView -lLLVMDebugInfoMSF -lLLVMCodeGen -lLLVMTarget -lLLVMScalarOpts -lLLVMInstCombine -lLLVMTransformUtils -lLLVMBitWriter -lLLVMAnalysis -lLLVMProfileData -lLLVMObject -lLLVMMCParser -lLLVMBitReader -lLLVMCore -lLLVMBinaryFormat -lLLVMARMDesc -lLLVMMCDisassembler -lLLVMARMInfo -lLLVMARMAsmPrinter -lLLVMARMUtils -lLLVMMC -lLLVMSupport -lLLVMDemangle"
|
||||
fi
|
||||
;;
|
||||
*aarch64codegen*)
|
||||
# llvm-config.exe --libs aarch64codegen
|
||||
if [[ $llvm_api_version -lt 600 ]]; then
|
||||
llvm_extra="-lLLVMAArch64CodeGen -lLLVMSelectionDAG -lLLVMAsmPrinter -lLLVMMCParser -lLLVMCodeGen -lLLVMScalarOpts -lLLVMInstCombine -lLLVMTransformUtils -lLLVMipa -lLLVMAnalysis -lLLVMTarget -lLLVMCore -lLLVMAArch64Desc -lLLVMAArch64Info -lLLVMAArch64AsmPrinter -lLLVMMC -lLLVMAArch64Utils -lLLVMSupport"
|
||||
else
|
||||
llvm_extra="-lLLVMAArch64CodeGen -lLLVMGlobalISel -lLLVMSelectionDAG -lLLVMAsmPrinter -lLLVMDebugInfoCodeView -lLLVMDebugInfoMSF -lLLVMCodeGen -lLLVMTarget -lLLVMScalarOpts -lLLVMInstCombine -lLLVMTransformUtils -lLLVMBitWriter -lLLVMAnalysis -lLLVMProfileData -lLLVMObject -lLLVMMCParser -lLLVMBitReader -lLLVMCore -lLLVMBinaryFormat -lLLVMAArch64Desc -lLLVMAArch64Info -lLLVMAArch64AsmPrinter -lLLVMMC -lLLVMAArch64Utils -lLLVMSupport -lLLVMDemangle"
|
||||
fi
|
||||
;;
|
||||
*)
|
||||
llvm_extra=$llvm_codegen_libs
|
||||
esac
|
||||
fi
|
||||
|
||||
if [[ $llvm_config_cflags = *"stdlib=libc++"* ]]; then
|
||||
llvm_libc_c="-stdlib=libc++"
|
||||
llvm_libc_link="-lc++"
|
||||
else
|
||||
llvm_libc_c=""
|
||||
llvm_libc_link="-lstdc++"
|
||||
fi
|
||||
|
||||
if [[ $llvm_host_win32 = 1 ]]; then
|
||||
host_cxxflag_additions="-std=gnu++11"
|
||||
host_cflag_additions="-DNDEBUG"
|
||||
else
|
||||
host_cxxflag_additions="-std=c++11"
|
||||
host_cflag_additions=""
|
||||
fi
|
||||
|
||||
if [[ ! -z $llvm_extra_libs ]]; then
|
||||
llvm_extra="$llvm_extra $llvm_extra_libs"
|
||||
fi
|
||||
|
||||
# llvm-config --clfags adds warning and optimization flags we don't want
|
||||
cflags_additions="-I$with_llvm/include -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -DLLVM_API_VERSION=$llvm_api_version $llvm_libc_c $host_cflag_additions"
|
||||
|
||||
cxxflag_additions="-fno-rtti -fexceptions $host_cxxflag_additions"
|
||||
|
||||
ldflags="-L$with_llvm/lib"
|
||||
|
||||
llvm_lib_components="$llvm_core_components $llvm_old_jit $llvm_new_jit $llvm_extra"
|
||||
|
||||
echo "LLVM_CFLAGS_INTERNAL=$cflags_additions"
|
||||
echo "LLVM_CXXFLAGS_INTERNAL=$cflags_additions $cxxflag_additions"
|
||||
echo "LLVM_LDFLAGS_INTERNAL=$ldflags"
|
||||
echo "LLVM_LIBS_INTERNAL=$llvm_lib_components $ldflags $llvm_system $llvm_libc_link"
|
||||
+1
-1
@@ -1 +1 @@
|
||||
EXTRA_DIST = lib-ld.m4 lib-link.m4 lib-prefix.m4 $(wildcard *.m4)
|
||||
EXTRA_DIST = iconv.m4 lib-ld.m4 lib-link.m4 lib-prefix.m4 $(wildcard *.m4)
|
||||
@@ -1,74 +0,0 @@
|
||||
# ===========================================================================
|
||||
# https://www.gnu.org/software/autoconf-archive/ax_check_compile_flag.html
|
||||
# ===========================================================================
|
||||
#
|
||||
# SYNOPSIS
|
||||
#
|
||||
# AX_CHECK_COMPILE_FLAG(FLAG, [ACTION-SUCCESS], [ACTION-FAILURE], [EXTRA-FLAGS], [INPUT])
|
||||
#
|
||||
# DESCRIPTION
|
||||
#
|
||||
# Check whether the given FLAG works with the current language's compiler
|
||||
# or gives an error. (Warnings, however, are ignored)
|
||||
#
|
||||
# ACTION-SUCCESS/ACTION-FAILURE are shell commands to execute on
|
||||
# success/failure.
|
||||
#
|
||||
# If EXTRA-FLAGS is defined, it is added to the current language's default
|
||||
# flags (e.g. CFLAGS) when the check is done. The check is thus made with
|
||||
# the flags: "CFLAGS EXTRA-FLAGS FLAG". This can for example be used to
|
||||
# force the compiler to issue an error when a bad flag is given.
|
||||
#
|
||||
# INPUT gives an alternative input source to AC_COMPILE_IFELSE.
|
||||
#
|
||||
# NOTE: Implementation based on AX_CFLAGS_GCC_OPTION. Please keep this
|
||||
# macro in sync with AX_CHECK_{PREPROC,LINK}_FLAG.
|
||||
#
|
||||
# LICENSE
|
||||
#
|
||||
# Copyright (c) 2008 Guido U. Draheim <[email protected]>
|
||||
# Copyright (c) 2011 Maarten Bosmans <[email protected]>
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public License as published by the
|
||||
# Free Software Foundation, either version 3 of the License, or (at your
|
||||
# option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful, but
|
||||
# WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
|
||||
# Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License along
|
||||
# with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
#
|
||||
# As a special exception, the respective Autoconf Macro's copyright owner
|
||||
# gives unlimited permission to copy, distribute and modify the configure
|
||||
# scripts that are the output of Autoconf when processing the Macro. You
|
||||
# need not follow the terms of the GNU General Public License when using
|
||||
# or distributing such scripts, even though portions of the text of the
|
||||
# Macro appear in them. The GNU General Public License (GPL) does govern
|
||||
# all other use of the material that constitutes the Autoconf Macro.
|
||||
#
|
||||
# This special exception to the GPL applies to versions of the Autoconf
|
||||
# Macro released by the Autoconf Archive. When you make and distribute a
|
||||
# modified version of the Autoconf Macro, you may extend this special
|
||||
# exception to the GPL to apply to your modified version as well.
|
||||
|
||||
#serial 5
|
||||
|
||||
AC_DEFUN([AX_CHECK_COMPILE_FLAG],
|
||||
[AC_PREREQ(2.63)dnl for _AC_LANG_PREFIX and AS_VAR_IF
|
||||
AS_VAR_PUSHDEF([CACHEVAR],[ax_cv_check_[]_AC_LANG_ABBREV[]flags_$4_$1])dnl
|
||||
AC_CACHE_CHECK([whether _AC_LANG compiler accepts $1], CACHEVAR, [
|
||||
ax_check_save_flags=$[]_AC_LANG_PREFIX[]FLAGS
|
||||
_AC_LANG_PREFIX[]FLAGS="$[]_AC_LANG_PREFIX[]FLAGS $4 $1"
|
||||
AC_COMPILE_IFELSE([m4_default([$5],[AC_LANG_PROGRAM()])],
|
||||
[AS_VAR_SET(CACHEVAR,[yes])],
|
||||
[AS_VAR_SET(CACHEVAR,[no])])
|
||||
_AC_LANG_PREFIX[]FLAGS=$ax_check_save_flags])
|
||||
AS_VAR_IF(CACHEVAR,yes,
|
||||
[m4_default([$2], :)],
|
||||
[m4_default([$3], :)])
|
||||
AS_VAR_POPDEF([CACHEVAR])dnl
|
||||
])dnl AX_CHECK_COMPILE_FLAGS
|
||||
+214
@@ -0,0 +1,214 @@
|
||||
# iconv.m4 serial 11 (gettext-0.18.1)
|
||||
dnl Copyright (C) 2000-2002, 2007-2010 Free Software Foundation, Inc.
|
||||
dnl This file is free software; the Free Software Foundation
|
||||
dnl gives unlimited permission to copy and/or distribute it,
|
||||
dnl with or without modifications, as long as this notice is preserved.
|
||||
|
||||
dnl From Bruno Haible.
|
||||
|
||||
AC_DEFUN([AM_ICONV_LINKFLAGS_BODY],
|
||||
[
|
||||
dnl Prerequisites of AC_LIB_LINKFLAGS_BODY.
|
||||
AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
|
||||
AC_REQUIRE([AC_LIB_RPATH])
|
||||
|
||||
dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV
|
||||
dnl accordingly.
|
||||
AC_LIB_LINKFLAGS_BODY([iconv])
|
||||
])
|
||||
|
||||
AC_DEFUN([AM_ICONV_LINK],
|
||||
[
|
||||
dnl Some systems have iconv in libc, some have it in libiconv (OSF/1 and
|
||||
dnl those with the standalone portable GNU libiconv installed).
|
||||
AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
|
||||
|
||||
dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV
|
||||
dnl accordingly.
|
||||
AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY])
|
||||
|
||||
dnl Add $INCICONV to CPPFLAGS before performing the following checks,
|
||||
dnl because if the user has installed libiconv and not disabled its use
|
||||
dnl via --without-libiconv-prefix, he wants to use it. The first
|
||||
dnl AC_TRY_LINK will then fail, the second AC_TRY_LINK will succeed.
|
||||
am_save_CPPFLAGS="$CPPFLAGS"
|
||||
AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCICONV])
|
||||
|
||||
AC_CACHE_CHECK([for iconv], [am_cv_func_iconv], [
|
||||
am_cv_func_iconv="no, consider installing GNU libiconv"
|
||||
am_cv_lib_iconv=no
|
||||
AC_TRY_LINK([#include <stdlib.h>
|
||||
#include <iconv.h>],
|
||||
[iconv_t cd = iconv_open("","");
|
||||
iconv(cd,NULL,NULL,NULL,NULL);
|
||||
iconv_close(cd);],
|
||||
[am_cv_func_iconv=yes])
|
||||
if test "$am_cv_func_iconv" != yes; then
|
||||
am_save_LIBS="$LIBS"
|
||||
LIBS="$LIBS $LIBICONV"
|
||||
AC_TRY_LINK([#include <stdlib.h>
|
||||
#include <iconv.h>],
|
||||
[iconv_t cd = iconv_open("","");
|
||||
iconv(cd,NULL,NULL,NULL,NULL);
|
||||
iconv_close(cd);],
|
||||
[am_cv_lib_iconv=yes]
|
||||
[am_cv_func_iconv=yes])
|
||||
LIBS="$am_save_LIBS"
|
||||
fi
|
||||
])
|
||||
if test "$am_cv_func_iconv" = yes; then
|
||||
AC_CACHE_CHECK([for working iconv], [am_cv_func_iconv_works], [
|
||||
dnl This tests against bugs in AIX 5.1, HP-UX 11.11, Solaris 10.
|
||||
am_save_LIBS="$LIBS"
|
||||
if test $am_cv_lib_iconv = yes; then
|
||||
LIBS="$LIBS $LIBICONV"
|
||||
fi
|
||||
AC_TRY_RUN([
|
||||
#include <iconv.h>
|
||||
#include <string.h>
|
||||
int main ()
|
||||
{
|
||||
/* Test against AIX 5.1 bug: Failures are not distinguishable from successful
|
||||
returns. */
|
||||
{
|
||||
iconv_t cd_utf8_to_88591 = iconv_open ("ISO8859-1", "UTF-8");
|
||||
if (cd_utf8_to_88591 != (iconv_t)(-1))
|
||||
{
|
||||
static const char input[] = "\342\202\254"; /* EURO SIGN */
|
||||
char buf[10];
|
||||
const char *inptr = input;
|
||||
size_t inbytesleft = strlen (input);
|
||||
char *outptr = buf;
|
||||
size_t outbytesleft = sizeof (buf);
|
||||
size_t res = iconv (cd_utf8_to_88591,
|
||||
(char **) &inptr, &inbytesleft,
|
||||
&outptr, &outbytesleft);
|
||||
if (res == 0)
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
/* Test against Solaris 10 bug: Failures are not distinguishable from
|
||||
successful returns. */
|
||||
{
|
||||
iconv_t cd_ascii_to_88591 = iconv_open ("ISO8859-1", "646");
|
||||
if (cd_ascii_to_88591 != (iconv_t)(-1))
|
||||
{
|
||||
static const char input[] = "\263";
|
||||
char buf[10];
|
||||
const char *inptr = input;
|
||||
size_t inbytesleft = strlen (input);
|
||||
char *outptr = buf;
|
||||
size_t outbytesleft = sizeof (buf);
|
||||
size_t res = iconv (cd_ascii_to_88591,
|
||||
(char **) &inptr, &inbytesleft,
|
||||
&outptr, &outbytesleft);
|
||||
if (res == 0)
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
#if 0 /* This bug could be worked around by the caller. */
|
||||
/* Test against HP-UX 11.11 bug: Positive return value instead of 0. */
|
||||
{
|
||||
iconv_t cd_88591_to_utf8 = iconv_open ("utf8", "iso88591");
|
||||
if (cd_88591_to_utf8 != (iconv_t)(-1))
|
||||
{
|
||||
static const char input[] = "\304rger mit b\366sen B\374bchen ohne Augenma\337";
|
||||
char buf[50];
|
||||
const char *inptr = input;
|
||||
size_t inbytesleft = strlen (input);
|
||||
char *outptr = buf;
|
||||
size_t outbytesleft = sizeof (buf);
|
||||
size_t res = iconv (cd_88591_to_utf8,
|
||||
(char **) &inptr, &inbytesleft,
|
||||
&outptr, &outbytesleft);
|
||||
if ((int)res > 0)
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
/* Test against HP-UX 11.11 bug: No converter from EUC-JP to UTF-8 is
|
||||
provided. */
|
||||
if (/* Try standardized names. */
|
||||
iconv_open ("UTF-8", "EUC-JP") == (iconv_t)(-1)
|
||||
/* Try IRIX, OSF/1 names. */
|
||||
&& iconv_open ("UTF-8", "eucJP") == (iconv_t)(-1)
|
||||
/* Try AIX names. */
|
||||
&& iconv_open ("UTF-8", "IBM-eucJP") == (iconv_t)(-1)
|
||||
/* Try HP-UX names. */
|
||||
&& iconv_open ("utf8", "eucJP") == (iconv_t)(-1))
|
||||
return 1;
|
||||
return 0;
|
||||
}], [am_cv_func_iconv_works=yes], [am_cv_func_iconv_works=no],
|
||||
[case "$host_os" in
|
||||
aix* | hpux*) am_cv_func_iconv_works="guessing no" ;;
|
||||
*) am_cv_func_iconv_works="guessing yes" ;;
|
||||
esac])
|
||||
LIBS="$am_save_LIBS"
|
||||
])
|
||||
case "$am_cv_func_iconv_works" in
|
||||
*no) am_func_iconv=no am_cv_lib_iconv=no ;;
|
||||
*) am_func_iconv=yes ;;
|
||||
esac
|
||||
else
|
||||
am_func_iconv=no am_cv_lib_iconv=no
|
||||
fi
|
||||
if test "$am_func_iconv" = yes; then
|
||||
AC_DEFINE([HAVE_ICONV], [1],
|
||||
[Define if you have the iconv() function and it works.])
|
||||
fi
|
||||
if test "$am_cv_lib_iconv" = yes; then
|
||||
AC_MSG_CHECKING([how to link with libiconv])
|
||||
AC_MSG_RESULT([$LIBICONV])
|
||||
else
|
||||
dnl If $LIBICONV didn't lead to a usable library, we don't need $INCICONV
|
||||
dnl either.
|
||||
CPPFLAGS="$am_save_CPPFLAGS"
|
||||
LIBICONV=
|
||||
LTLIBICONV=
|
||||
fi
|
||||
AC_SUBST([LIBICONV])
|
||||
AC_SUBST([LTLIBICONV])
|
||||
])
|
||||
|
||||
dnl Define AM_ICONV using AC_DEFUN_ONCE for Autoconf >= 2.64, in order to
|
||||
dnl avoid warnings like
|
||||
dnl "warning: AC_REQUIRE: `AM_ICONV' was expanded before it was required".
|
||||
dnl This is tricky because of the way 'aclocal' is implemented:
|
||||
dnl - It requires defining an auxiliary macro whose name ends in AC_DEFUN.
|
||||
dnl Otherwise aclocal's initial scan pass would miss the macro definition.
|
||||
dnl - It requires a line break inside the AC_DEFUN_ONCE and AC_DEFUN expansions.
|
||||
dnl Otherwise aclocal would emit many "Use of uninitialized value $1"
|
||||
dnl warnings.
|
||||
m4_define([gl_iconv_AC_DEFUN],
|
||||
m4_version_prereq([2.64],
|
||||
[[AC_DEFUN_ONCE(
|
||||
[$1], [$2])]],
|
||||
[[AC_DEFUN(
|
||||
[$1], [$2])]]))
|
||||
gl_iconv_AC_DEFUN([AM_ICONV],
|
||||
[
|
||||
AM_ICONV_LINK
|
||||
if test "$am_cv_func_iconv" = yes; then
|
||||
AC_MSG_CHECKING([for iconv declaration])
|
||||
AC_CACHE_VAL([am_cv_proto_iconv], [
|
||||
AC_TRY_COMPILE([
|
||||
#include <stdlib.h>
|
||||
#include <iconv.h>
|
||||
extern
|
||||
#ifdef __cplusplus
|
||||
"C"
|
||||
#endif
|
||||
#if defined(__STDC__) || defined(__cplusplus)
|
||||
size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
|
||||
#else
|
||||
size_t iconv();
|
||||
#endif
|
||||
], [], [am_cv_proto_iconv_arg1=""], [am_cv_proto_iconv_arg1="const"])
|
||||
am_cv_proto_iconv="extern size_t iconv (iconv_t cd, $am_cv_proto_iconv_arg1 char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);"])
|
||||
am_cv_proto_iconv=`echo "[$]am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'`
|
||||
AC_MSG_RESULT([
|
||||
$am_cv_proto_iconv])
|
||||
AC_DEFINE_UNQUOTED([ICONV_CONST], [$am_cv_proto_iconv_arg1],
|
||||
[Define as const if the declaration of iconv() needs const.])
|
||||
fi
|
||||
])
|
||||
+17
-113
@@ -111,11 +111,10 @@ directory.
|
||||
.SH OPTIONS
|
||||
.TP
|
||||
.I "--config FILE"
|
||||
Specifies that a DLLMAP Mono config file must be bundled as well. In
|
||||
the simple and cross compiler modes, if no config file is specified
|
||||
the one for the current target is picked (either the system one in the
|
||||
case of the simple mode, or the one that came from the cross
|
||||
compilation target for the cross compiling mode).
|
||||
Specifies that a machine.config file must be bundled as well.
|
||||
Typically this is $prefix/etc/mono/1.0/machine.config or
|
||||
$prefix/etc/mono/2.0/machine.config depending on the profile that you
|
||||
are using (1.0 or 2.0)
|
||||
.TP
|
||||
.I "--config-dir DIR"
|
||||
When passed, DIR will be set for the MONO_CFG_DIR environment variable
|
||||
@@ -203,31 +202,13 @@ Provides mkbundle access to a managed linker to preprocess the assemblies.
|
||||
.TP
|
||||
.I "--machine-config FILE"
|
||||
Uses the given FILE as the machine.config file for the generated
|
||||
application. The machine config contains an XML file that is used by
|
||||
System.Configuration APIs to configure the .NET stack. Typically this
|
||||
is
|
||||
.I $prefix/etc/mono/4.5/machine.config.
|
||||
.Sp
|
||||
If you want to disable this automatic bundling, you can use the
|
||||
.I "--no-machine-config"
|
||||
flag. In the simple and cross compiler modes, if no machine.config file is specified
|
||||
the one for the current target is picked (either the system one in the
|
||||
case of the simple mode, or the one that came from the cross
|
||||
compilation target for the cross compiling mode).
|
||||
.TP
|
||||
.I "--no-config"
|
||||
In simple or cross compiling mode, this prevents mkbundle from
|
||||
automatically bundling a config file.
|
||||
application.
|
||||
.TP
|
||||
.I "--nodeps"
|
||||
This is the default: \fImkbundle\fP will only include the assemblies that
|
||||
were specified on the command line to reduce the size of the resulting
|
||||
image created.
|
||||
.TP
|
||||
.I "--no-machine-config"
|
||||
In simple or cross compiling mode, this prevents mkbundle from
|
||||
automatically bundling a machine.config file.
|
||||
.TP
|
||||
.I "-o filename"
|
||||
Places the output on `out'. If the flag -c is specified, this is the
|
||||
C host program. If not, this contains the resulting executable.
|
||||
@@ -271,36 +252,6 @@ This flag is mutually exlusive with
|
||||
By default the mkbundle tool will download from a Mono server the
|
||||
target runtimes, you can specify a different server to provide
|
||||
cross-compiled runtimes.
|
||||
.TP
|
||||
.I "--mono-api-struct-path FILE"
|
||||
FILE points to a file with the definition of the \fIBundleMonoAPI\fP structure which contains the
|
||||
required pointers to various Mono API functions used throughout the generated code. This mechanism
|
||||
is meant to be used by third parties which embed the Mono runtime and dynamically load and initialize
|
||||
it as part of the application startup, in which case the Mono APIs will not be available for the shared
|
||||
library loader and the bundle will fail to work (one example of such an embedding third party is
|
||||
Xamarin.Android).
|
||||
|
||||
After providing the definition FILE, the embedder must call the \fIvoid initialize_mono_api (const BundleMonoAPI *info)\fP
|
||||
function found in the generated code
|
||||
.B before
|
||||
calling \fIvoid mono_mkbundle_init ()\fP. The structure passed to \fIinitialize_mono_api\fP doesn't need
|
||||
to be dynamically allocated as its contents is copied to the local structure in the generated code and no
|
||||
pointer to the passed structure is retained or used after \fIinitialize_mono_api\fP returns.
|
||||
|
||||
The list of pointers is not documented here. Instead, please look at the \fIbundle-mono-api.inc\fP file
|
||||
found in the mkbundle source directory in your Mono source tree (\fImcs/tools/mkbundle\fP) or in the Mono's
|
||||
GitHub repository, https://github.com/mono/mono/blob/master/mcs/tools/mkbundle/bundle-mono-api.inc
|
||||
|
||||
Please note that your structure must match the one expected by your version of the Mono runtime.
|
||||
|
||||
The file must also define the \fImkbundle_log_error\fP function with the following signature:
|
||||
|
||||
.nf
|
||||
static void mkbundle_log_error (const char *format, ...) {}
|
||||
.fi
|
||||
|
||||
The function should implement logging API specific to the embedder.
|
||||
|
||||
.SH OLD EMBEDDING
|
||||
.PP
|
||||
The old embedding system compiles a small C stub that embeds the
|
||||
@@ -389,80 +340,33 @@ not require runtime code generation. The "llvmonly" setting does the same, but f
|
||||
to go through the llvm backend.
|
||||
|
||||
.SH WINDOWS
|
||||
If you are using the old embedding on Windows systems, it possible to use
|
||||
a Unix-like toolchain like cygwin's and install gcc, gcc-mingw packages or
|
||||
use Visual Studio 2015/2017 VC toolchain together with Clang for Visual Studio as assembler.
|
||||
Clang can be installed as an individual component, "Clang/C2", using Visual Studio installer.
|
||||
.PP
|
||||
Using Visual Studio toolchain, mkbundle will, by default, use latest installed Visual Studio compiler
|
||||
and linker as well as Windows SDK. If executed from one of the Visual Studio developer command prompts,
|
||||
mkbundle will retrieve information directly from that build environment.
|
||||
If you are using the old embedding on Windows systems, it it necessary
|
||||
to have Unix-like toolchain to be installed for \fImkbundle\fP to
|
||||
work. You can use cygwin's and install gcc, gcc-mingw and as
|
||||
packages.
|
||||
.SH ENVIRONMENT VARIABLES
|
||||
.TP
|
||||
.I "AS"
|
||||
Assembler command. The default is "as". For Visual Studio, default is "clang.exe".
|
||||
If "clang.exe" for Visual Studio is not installed, mkbundle will fall back using "as".
|
||||
Assembler command. The default is "as".
|
||||
.TP
|
||||
.I "CC"
|
||||
C compiler command. The default is "cc" for Linux, "gcc"
|
||||
for cygwin and "cl.exe" for Visual Studio.
|
||||
C compiler command. The default is "cc" under Linux and "gcc"
|
||||
under Windows.
|
||||
.TP
|
||||
.I "MONO_BUNDLED_OPTIONS"
|
||||
Options to be passed to the bundled
|
||||
Mono runtime, separated by spaces. See the mono(1) manual page or run mono --help.
|
||||
.SH WINDOWS VISUAL STUDIO ENVIRONMENT VARIABLES
|
||||
.TP
|
||||
.I "VisualStudioVersion"
|
||||
Visual Studio version used in mkbundle build.
|
||||
Default, latest installed Visual Studio version.
|
||||
Values, "14.0" for Visual Studio 2015 or "15.0" for Visual Studio 2017.
|
||||
.TP
|
||||
.I "WindowsSdkVersion"
|
||||
Windows SDK version used in mkbundle build.
|
||||
Default/unknown, latest installed Windows SDK.
|
||||
Values, "8.1", "10.0.10240.0", "10.0.15063.0" etc.
|
||||
.TP
|
||||
.I "VSCMD_ARG_TGT_ARCH"
|
||||
Output target architecture used in mkbundle build.
|
||||
Default/unknown, use architecture of .NET runtime executing mkbundle.
|
||||
Values, "x86" or "x64".
|
||||
NOTE, when running from a Visual Studio command prompt, this variable should already be set
|
||||
by the command prompt and match the rest of that build environment.
|
||||
.TP
|
||||
.I "INCLUDE"
|
||||
Override all custom include paths passed to "cl.exe".
|
||||
Predefined by Visual Studio developer command prompt or auto detected by mkbundle when undefined.
|
||||
.TP
|
||||
.I "LIB"
|
||||
Override all custom library paths passed to "link.exe".
|
||||
Predefined by Visual Studio developer command prompt or auto detected by mkbundle when undefined.
|
||||
.TP
|
||||
.I "MONOPREFIX"
|
||||
Use a custom Mono SDK install root matching the output target architecture (x86/x64).
|
||||
Default, mkbundle will look for installed Mono SDK’s matching targeted architecture.
|
||||
.TP
|
||||
.I "MONOLIB"
|
||||
Use a different mono library name or an absolute path to the mono library passed to linker.
|
||||
Default, mkbundle will use default mono library name depending on mkbundle dynamic/static use case.
|
||||
NOTE, supplied mono library needs to match mkbundle dynamic/static use case and target architecture.
|
||||
.TP
|
||||
.I "VCCRT"
|
||||
Override C-runtime library linker settings.
|
||||
Default "MD", mkbundle will use dynamic C-runtime linking on Windows compatible with Mono SDK distribution.
|
||||
If a custom built Mono runtime using static C-Runtime linkage is used, setting this variable to "MT"
|
||||
will link using static C-runtime libraries.
|
||||
.TP
|
||||
.I "VCSUBSYSTEM"
|
||||
Override Windows subsystem.
|
||||
Default, "windows". If console subsystem is preferred, use "console".
|
||||
NOTE, if console output is expected from output target process then
|
||||
set this variable to "console".
|
||||
.SH FILES
|
||||
This program will load referenced assemblies from the Mono assembly
|
||||
cache.
|
||||
.PP
|
||||
Targets are loaded from ~/.mono/targets/TARGETNAME/mono
|
||||
.SH BUGS
|
||||
The option "--static" is not supported under Windows when using the
|
||||
old embedding.
|
||||
Moreover, a full cygwin environment containing at least "gcc" and "as"
|
||||
is required for the build process. The generated executable does not
|
||||
depend on cygwin.
|
||||
.SH MAILING LISTS
|
||||
Visit http://lists.ximian.com/mailman/listinfo/mono-devel-list for details.
|
||||
.SH WEB SITE
|
||||
|
||||
@@ -2,17 +2,12 @@
|
||||
.SH NAME
|
||||
Mono CIL strip
|
||||
.SH SYNOPSIS
|
||||
.B mono-cil-strip [options] assembly [output-assembly]
|
||||
.B mono-cil-strip assembly [output-assembly]
|
||||
.SH DESCRIPTION
|
||||
mono-cil-strip is a tool which takes an assembly, and empty its method bodies.
|
||||
This is useful to reduce an assembly size when an assembly has already been
|
||||
compiled using Mono's Ahead Of Time compiler (AOT), where the CIL code is no
|
||||
longer necessary, but the metadata still is.
|
||||
.SH OPTIONS
|
||||
The following options are available:
|
||||
.TP
|
||||
.I "-q"
|
||||
Only output errors.
|
||||
.SH COPYRIGHT
|
||||
Copyright (C) 2008 Novell, Inc (http://www.novell.com)
|
||||
.SH MAILING LISTS
|
||||
|
||||
+27
-137
@@ -65,45 +65,6 @@ and
|
||||
See the description for
|
||||
.B MONO_IOMAP
|
||||
in the environment variables section for more details.
|
||||
.SH METHOD DESCRIPTIONS
|
||||
A number of diagnostic command line options take as argument a method
|
||||
description. A method description is a textual representation that
|
||||
can be used to uniquely identify a method. The syntax is as follows:
|
||||
.nf
|
||||
[namespace]classname:methodname[(arguments)]
|
||||
.fi
|
||||
.PP
|
||||
The values in brackets are optional, like the namespace and the
|
||||
arguments. The arguments themselves are either empty, or a
|
||||
comma-separated list of arguments. Both the
|
||||
\fBclassname\fR
|
||||
and
|
||||
\fBmethodname\fR
|
||||
can be set to the special value '*' to match any values (Unix shell
|
||||
users should escape the argument to avoid the shell interpreting
|
||||
this).
|
||||
.PP
|
||||
The arguments, if present should be a comma separated list of types
|
||||
either a full typename, or for built-in types it should use the
|
||||
low-level ILAsm type names for the built-in types,
|
||||
like 'void', 'char', 'bool', 'byte', 'sbyte', 'uint16', 'int16', 'uint',
|
||||
'int', 'ulong', 'long', 'uintptr', 'intptr', 'single', 'double', 'string', 'object'.
|
||||
.PP
|
||||
Pointer types should be the name of the type, followed by a '*',
|
||||
arrays should be the typename followed by '[' one or more commas (to
|
||||
indicate the rank of the array), and ']'.
|
||||
.PP
|
||||
Generic values should use '<', one or more type names, separated by
|
||||
both a comma and a space and '>'.
|
||||
.PP
|
||||
By-reference arguments should include a "&" after the typename.
|
||||
.PP
|
||||
Examples:
|
||||
.nf
|
||||
*:ctor(int) // All constructors that take an int as an argument
|
||||
*:Main // Methods named Main in any class
|
||||
*:Main(string[]) // Methods named Main that take a string array in any class
|
||||
.fi
|
||||
.SH RUNTIME OPTIONS
|
||||
The following options are available:
|
||||
.TP
|
||||
@@ -214,20 +175,6 @@ and
|
||||
.I llvm
|
||||
options. This feature is experimental.
|
||||
.TP
|
||||
.I llvmopts=[options]
|
||||
Use this option to override the built-in set of flags passed to the
|
||||
LLVM optimizer. The list of possible flags that can be passed can be
|
||||
obtained by calling the bundled
|
||||
.I opt
|
||||
program that comes with Mono.
|
||||
.TP
|
||||
.I llvmllc=[options]
|
||||
Use this option to override the built-in set of flags passed to the
|
||||
LLVM static compiler (llc). The list of possible flags that can be passed can be
|
||||
obtained by calling the bundled
|
||||
.I llc
|
||||
program that comes with Mono.
|
||||
.TP
|
||||
.I llvm-outfile=[filename]
|
||||
Gives the path for the temporary LLVM bitcode file created during AOT.
|
||||
.I dedup
|
||||
@@ -381,9 +328,6 @@ Prints additional information about type loading failures.
|
||||
.TP
|
||||
.I write-symbols,no-write-symbols
|
||||
Instructs the AOT compiler to emit (or not emit) debug symbol information.
|
||||
.TP
|
||||
.I no-opt
|
||||
Instructs the AOT compiler tot no call opt when compiling with LLVM.
|
||||
.PP
|
||||
For more information about AOT, see: http://www.mono-project.com/docs/advanced/aot/
|
||||
.RE
|
||||
@@ -488,9 +432,6 @@ in your program, or Mono's class libraries attempts to generate code
|
||||
dynamically. You should test your software upfront and make sure that
|
||||
you do not use any dynamic features.
|
||||
.TP
|
||||
\fB--full-aot-interp\fR
|
||||
Same as --full-aot with fallback to the interpreter.
|
||||
.TP
|
||||
\fB--gc=boehm\fR, \fB--gc=sgen\fR
|
||||
Selects the Garbage Collector engine for Mono to use, Boehm or SGen.
|
||||
Currently this merely ensures that you are running either the
|
||||
@@ -601,11 +542,6 @@ Controls whether the runtime should attempt to inline (the default),
|
||||
or not inline methods invocations
|
||||
.ne
|
||||
.RE
|
||||
\fB--response=FILE\fR
|
||||
Provides a response file, this instructs the Mono command to read
|
||||
other command line options from the specified file, as if the
|
||||
options had been specified on the command line. Useful when you have
|
||||
very long command lines.
|
||||
.TP
|
||||
\fB--runtime=VERSION\fR
|
||||
Mono supports different runtime versions. The version used depends on the program
|
||||
@@ -1151,13 +1087,15 @@ When Mono is built with a soft float fallback on ARM and this variable is set to
|
||||
"1", Mono will always emit soft float code, even if a VFP unit is
|
||||
detected.
|
||||
.TP
|
||||
\fBMONO_DARWIN_USE_KQUEUE_FSW\fR
|
||||
Fall back on the kqueue FileSystemWatcher implementation in Darwin. The default is the FSEvent implementation.
|
||||
.TP
|
||||
\fBMONO_DARWIN_WATCHER_MAXFDS\fR
|
||||
This is a debugging aid used to force limits on the kqueue FileSystemWatcher
|
||||
This is a debugging aid used to force limits on the FileSystemWatcher
|
||||
implementation in Darwin. There is no limit by default.
|
||||
.TP
|
||||
\fBMONO_DISABLE_AIO\fR
|
||||
If set, tells mono NOT to attempt using native asynchronous I/O services. In
|
||||
that case, a default select/poll implementation is used. Currently only epoll()
|
||||
is supported.
|
||||
.TP
|
||||
\fBMONO_DISABLE_MANAGED_COLLATION\fR
|
||||
If this environment variable is `yes', the runtime uses unmanaged
|
||||
collation (which actually means no culture-sensitive collation). It
|
||||
@@ -1183,38 +1121,19 @@ For platforms that do not otherwise have a way of obtaining random bytes
|
||||
this can be set to the name of a file system socket on which an egd or
|
||||
prngd daemon is listening.
|
||||
.TP
|
||||
\fBMONO_ENABLE_AIO\fR
|
||||
If set, tells mono to attempt using native asynchronous I/O services. If not
|
||||
set, a default select/poll implementation is used. Currently epoll and kqueue
|
||||
are supported.
|
||||
.TP
|
||||
\fBMONO_THREADS_SUSPEND\fR
|
||||
Selects a mechanism that Mono will use to suspend threads. May be set to
|
||||
"preemptive", "coop", or "hybrid". Threads may need to be suspended by the
|
||||
debugger, or using some .NET threading APIs, and most commonly when the SGen
|
||||
garbage collector needs to stop all threads during a critical phase of garbage
|
||||
collection. Preemptive mode is the mode that Mono has used historically, going
|
||||
back to the Boehm days, where the garbage collector would run at any point and
|
||||
suspend execution of all threads as required to perform a garbage collection.
|
||||
The cooperative mode on the other hand requires the cooperation of all threads
|
||||
to stop at a safe point. This makes for an easier to debug garbage collector.
|
||||
As of Mono 4.3.0 it is a work in progress, and while it works, it has not been
|
||||
used extensively. This option enables the feature and allows us to find spots
|
||||
that need to be tuned for this mode of operation. Hybrid mode is a combination
|
||||
of the two that retains better compatability with scenarios where Mono is
|
||||
embedded in another application: threads that are running managed code or code
|
||||
that comprises the Mono runtime will be cooperatively suspended, while threads
|
||||
running embedder code will be preemptively suspended.
|
||||
|
||||
Alternatively, coop and hybrid mode can be enabled at compile time by using the
|
||||
--enable-cooperative-suspend or --enable-hybrid-suspend flags, respectively,
|
||||
when calling configure. The \fBMONO_THREADS_SUSPEND\fR environment variable
|
||||
takes priority over the compiled default.
|
||||
.TP
|
||||
\fBMONO_ENABLE_COOP_SUSPEND\fR
|
||||
This environment variable is obsolete, but retained for backward compatibility.
|
||||
Use \fBMONO_THREADS_SUSPEND\fR set to "coop" instead. Note that if configure flags
|
||||
were provided to enable cooperative or hybrid suspend, this variable is ignored.
|
||||
\fBMONO_ENABLE_COOP\fR
|
||||
This makes the Mono runtime and the SGen garbage collector run in cooperative
|
||||
mode as opposed to run on preemptive mode. Preemptive mode is the mode
|
||||
that Mono has used historically, going back to the Boehm days, where the
|
||||
garbage collector would run at any point and suspend execution of all
|
||||
threads as required to perform a garbage collection. The cooperative mode
|
||||
on the other hand requires the cooperation of all threads to stop at a
|
||||
safe point. This makes for an easier to debug garbage collector. As
|
||||
of Mono 4.3.0 it is a work in progress, and while it works, it has not
|
||||
been used extensively. This option enabled the feature and allows us to
|
||||
find spots that need to be tuned for this mode of operation. Alternatively,
|
||||
this mode can be enabled at compile time by using the --with-cooperative-gc
|
||||
flag when calling configure.
|
||||
.TP
|
||||
\fBMONO_ENV_OPTIONS\fR
|
||||
This environment variable allows you to pass command line arguments to
|
||||
@@ -1638,31 +1557,11 @@ home directories that might be shared over the network.
|
||||
If set, extra checks are made during IO operations. Currently, this
|
||||
includes only advisory locks around file writes.
|
||||
.TP
|
||||
\fBMONO_TLS_PROVIDER\fR
|
||||
This environment variable controls which TLS/SSL provider Mono will
|
||||
use. The options are usually determined by the operating system where
|
||||
Mono was compiled and the configuration options that were used for
|
||||
it.
|
||||
.RS
|
||||
.ne 8
|
||||
.TP
|
||||
.I default
|
||||
Uses the default TLS stack that the Mono runtime was configured with.
|
||||
Usually this is configured to use Apple's SSL stack on Apple
|
||||
platforms, and Boring SSL on other platforms.
|
||||
.TP
|
||||
.I apple
|
||||
Forces the use of the Apple SSL stack, only works on Apple platforms.
|
||||
.TP
|
||||
.I btls
|
||||
Forces the use of the BoringSSL stack. See
|
||||
https://opensource.google.com/projects/boringssl for more information
|
||||
about this stack.
|
||||
.TP
|
||||
.I legacy
|
||||
This is the old Mono stack, which only supports SSL and TLS up to
|
||||
version 1.0. It is deprecated and will be removed in the future.
|
||||
.RE
|
||||
\fBMONO_THEME\fR
|
||||
The name of the theme to be used by Windows.Forms. Available themes today
|
||||
include "clearlooks", "nice" and "win32".
|
||||
.Sp
|
||||
The default is "win32".
|
||||
.TP
|
||||
\fBMONO_TLS_SESSION_CACHE_TIMEOUT\fR
|
||||
The time, in seconds, that the SSL/TLS session cache will keep it's entry to
|
||||
@@ -1716,8 +1615,8 @@ Currently, the following options are supported:
|
||||
Enables small structs alignment to 4/8 bytes.
|
||||
.TP
|
||||
\fBarm-use-fallback-tls\fR
|
||||
When this option is set on ARM, a fallback thread local store will be used instead
|
||||
of the default fast thread local storage primitives.
|
||||
When this option is set on ARM, a fallback TLS will be used instead
|
||||
of the default fast TLS.
|
||||
.TP
|
||||
\fBbreak-on-unverified\fR
|
||||
If this variable is set, when the Mono VM runs into a verification
|
||||
@@ -1846,12 +1745,6 @@ This option will suspend the program when an exception occurs.
|
||||
.TP
|
||||
\fBsuspend-on-unhandled\fR
|
||||
This option will suspend the program when an unhandled exception occurs.
|
||||
.TP
|
||||
\fBthread-dump-dir=DIR\fR
|
||||
Use DIR for storage thread dumps created by SIGQUIT.
|
||||
.TP
|
||||
\fBverbose-gdb\fR
|
||||
Make gdb output on native crashes more verbose.
|
||||
.ne
|
||||
.RE
|
||||
.TP
|
||||
@@ -1933,10 +1826,7 @@ for example, to see managed frame names on gdb backtraces.
|
||||
\fBMONO_VERBOSE_METHOD\fR
|
||||
Enables the maximum JIT verbosity for the specified method. This is
|
||||
very helpfull to diagnose a miscompilation problems of a specific
|
||||
method. This can be a semicolon-separated list of method names to
|
||||
match. If the name is simple, this applies to any method with that
|
||||
name, otherwise you can use a mono method description (see the section
|
||||
METHOD DESCRIPTIONS).
|
||||
method.
|
||||
.TP
|
||||
\fBMONO_JIT_DUMP_METHOD\fR
|
||||
Enables sending of the JITs intermediate representation for a specified
|
||||
|
||||
@@ -12,7 +12,6 @@ TestResult-*.xml
|
||||
TestResult*.xml
|
||||
.dep_dirs-*
|
||||
apidiff/*
|
||||
csprojdiff/*
|
||||
errors/*.log
|
||||
errors/dummy.xml
|
||||
class/Mono.Data.Sqlite/test.db
|
||||
|
||||
+3
-15
@@ -47,7 +47,7 @@ all-profiles $(STD_TARGETS:=-profiles): %-profiles: profiles-do--%
|
||||
@:
|
||||
|
||||
profiles-do--%:
|
||||
$(if $(PROFILES),$(MAKE) $(PROFILES:%=profile-do--%--$*))
|
||||
$(MAKE) $(PROFILES:%=profile-do--%--$*)
|
||||
|
||||
# The % below looks like profile-name--target-name
|
||||
profile-do--%:
|
||||
@@ -152,13 +152,9 @@ MONO_API_ASSEMBLIES_IGNORED := $(addprefix $(topdir)class/lib/$(PROFILE)/, Mono.
|
||||
MONO_API_ASSEMBLIES := $(filter-out $(MONO_API_ASSEMBLIES_IGNORED), $(wildcard $(topdir)class/lib/$(PROFILE)/*.dll)) $(wildcard $(topdir)class/lib/$(PROFILE)/Facades/*.dll)
|
||||
MONO_API_ASSEMBLIES_CS := $(MONO_API_ASSEMBLIES:$(topdir)class/lib/$(PROFILE)/%.dll=$(MONO_API_SNAPSHOT_PROFILE_PATH)%.cs)
|
||||
|
||||
apidiff/ignored-attr.txt:
|
||||
$(MONO_API_SNAPSHOT_PROFILE_PATH)%.cs: $(topdir)class/lib/$(PROFILE)/%.dll $(GENAPI) $(MONO_API_SNAPSHOT_PATH)profiles/license-header.txt
|
||||
@mkdir -p $(dir $@)
|
||||
@echo "T:System.Runtime.CompilerServices.CompilerGeneratedAttribute" > $@
|
||||
|
||||
$(MONO_API_SNAPSHOT_PROFILE_PATH)%.cs: $(topdir)class/lib/$(PROFILE)/%.dll $(GENAPI) $(MONO_API_SNAPSHOT_PATH)profiles/license-header.txt apidiff/ignored-attr.txt
|
||||
@mkdir -p $(dir $@)
|
||||
$(Q) MONO_PATH=$(topdir)class/lib/$(BUILD_TOOLS_PROFILE) $(RUNTIME) $(GENAPI) -libPath:$(topdir)class/lib/$(PROFILE),$(topdir)class/lib/$(PROFILE)/Facades -out:$(dir $@) -headerFile:$(MONO_API_SNAPSHOT_PATH)profiles/license-header.txt -assemblyAttributes -typeForwardedTo -assemblyVersion -excludeAttributesList:apidiff/ignored-attr.txt -assembly:$< || echo "Couldn't process assembly." > $@
|
||||
$(Q) MONO_PATH=$(topdir)class/lib/$(BUILD_TOOLS_PROFILE) $(RUNTIME) $(GENAPI) -libPath:$(topdir)class/lib/$(PROFILE),$(topdir)class/lib/$(PROFILE)/Facades -out:$(dir $@) -headerFile:$(MONO_API_SNAPSHOT_PATH)profiles/license-header.txt -assemblyAttributes -typeForwardedTo -assemblyVersion -assembly:$< || echo "Couldn't process assembly." > $@
|
||||
|
||||
mono-api-current: $(MONO_API_ASSEMBLIES_CS)
|
||||
|
||||
@@ -179,11 +175,3 @@ mono-api-diff:
|
||||
@mkdir -p apidiff
|
||||
$(Q) sed -e "/@diffdata@/r temp.patch" -e "/@diffdata@/d" -e "s/@title@/Public API Diff/g" -e "s/@description@/If the changes are intentional, run <code>make -C mcs mono-api-diff<\/code> locally and commit changes in external\/api-snapshot./g" diff.html.in > apidiff/index.html
|
||||
$(Q) if [ -s temp.patch ]; then echo "Error: Found public API differences, see mcs/apidiff/index.html. If the changes are intentional, please go to external/api-snapshot and commit them."; rm -f temp.patch; exit 1; else echo "No differences found."; rm -f temp.patch; fi
|
||||
|
||||
mono-csproj-diff:
|
||||
@echo "Generating csproj diff..."
|
||||
$(Q) git add -A "*.csproj" $(topdir)../bcl.sln
|
||||
$(Q) git diff --no-renames HEAD "*.csproj" $(topdir)../bcl.sln > $(abspath $(topdir))/temp.patch
|
||||
@mkdir -p csprojdiff
|
||||
$(Q) sed -e "/@diffdata@/r temp.patch" -e "/@diffdata@/d" -e "s/@title@/Project Files Diff/g" -e "s/@description@/Use <code>@monojenkins commit csproj<\/code> to commit them./g" diff.html.in > csprojdiff/index.html
|
||||
$(Q) if [ -s temp.patch ]; then echo "Error: Found csproj differences, see mcs/csprojdiff/index.html. If the changes are intentional, please commit them."; rm -f temp.patch; exit 1; else echo "No differences found."; rm -f temp.patch; fi
|
||||
+3
-3
@@ -15,7 +15,7 @@ common/Consts.cs: common/Consts.cs.in $(wildcard config.make)
|
||||
test -n '$(MONO_CORLIB_VERSION)'
|
||||
sed -e 's,@''MONO_VERSION@,$(MONO_VERSION),' -e 's,@''MONO_CORLIB_VERSION@,$(MONO_CORLIB_VERSION),' $< > $@
|
||||
|
||||
PLATFORMS = macos linux win32 unix
|
||||
PLATFORMS = darwin linux win32
|
||||
PROFILES = \
|
||||
basic \
|
||||
build \
|
||||
@@ -33,14 +33,14 @@ COMMON_SRCS = \
|
||||
AssemblyRef.cs
|
||||
|
||||
DISTFILES = \
|
||||
README.makefiles.md \
|
||||
README.makefiles \
|
||||
README.platforms \
|
||||
README.configury \
|
||||
config-default.make \
|
||||
corcompare.make \
|
||||
corcompare-api.xsl \
|
||||
executable.make \
|
||||
gensources.cs \
|
||||
gensources.sh \
|
||||
library.make \
|
||||
rules.make \
|
||||
tests.make \
|
||||
|
||||
@@ -0,0 +1,791 @@
|
||||
The MCS makefiles (-*- outline -*-)
|
||||
Peter Williams <[email protected]>
|
||||
|
||||
The new makefiles try to abstract building on Windows and Linux. They
|
||||
try to provide a consistent set of ways to express the things that our
|
||||
build system needs to let us do, specifically:
|
||||
|
||||
* Build recursively
|
||||
* Build libraries and executables easily
|
||||
* Let developers use different runtimes and class libaries
|
||||
* Make distributions easily
|
||||
* Provide a framework for testing
|
||||
* Build platform-independently whenever possible
|
||||
* Generate, update, and build monodoc documentation.
|
||||
|
||||
|
||||
|
||||
** Makefile structure
|
||||
|
||||
A general makefile looks like this:
|
||||
|
||||
========================================
|
||||
thisdir = class/Mono.My.Library
|
||||
SUBDIRS =
|
||||
include ../../build/rules.make
|
||||
|
||||
all-local:
|
||||
do some stuff
|
||||
|
||||
install-local:
|
||||
$(MKINSTALLDIRS) $(DESTDIR)$(prefix)/share/
|
||||
$(INSTALL_DATA) myfile.txt $(DESTDIR)$(prefix)/share/myfiledir
|
||||
|
||||
clean-local:
|
||||
rm -f my-generated-file
|
||||
|
||||
test-local: my_test_program.exe
|
||||
|
||||
run-test-local:
|
||||
$(RUNTIME) my_test_program.exe
|
||||
|
||||
run-test-ondotnet-local:
|
||||
$(RUNTIME) my_test_program.exe
|
||||
|
||||
DISTFILES = myfile.txt my_test_source.cs
|
||||
|
||||
dist-local: dist-default
|
||||
|
||||
doc-update-local:
|
||||
|
||||
my_test_program.exe: my_test_source.cs
|
||||
$(CSCOMPILE) /target:exe /out:$@ $<
|
||||
========================================
|
||||
|
||||
Each makefile follows the same pattern: it does some setup, includes
|
||||
the standard make rules, and provides rules for eight standard targets:
|
||||
all, install, test, run-test, clean, dist, and doc-update.
|
||||
|
||||
"Some setup" is defining two variables: $(thisdir) and
|
||||
$(SUBDIRS). $(thisdir) is the directory that the makefile lives in,
|
||||
relative to the top directory (ie, class/corlib) and $(SUBDIRS)
|
||||
defines the subdirectories that should be built in.
|
||||
|
||||
The eight targets do the following:
|
||||
|
||||
* all-local builds whatever someone would expect to be built
|
||||
when they just type 'make'. Most likely Foo.dll or Foo.exe
|
||||
|
||||
* install-local installs whatever got built by all-local.
|
||||
|
||||
* test-local _builds_ the test programs or libraries but does
|
||||
_not_ run them.
|
||||
|
||||
* run-test-local actually runs the tests. It shouldn't
|
||||
necessarily exit in an error if the test fails, but should make that
|
||||
situation obvious. It should only run tests that take care of
|
||||
themselves automatically; interactive tests should have an individual
|
||||
target. The idea is that 'make run-test' from the toplevel should be
|
||||
able to proceed unsupervised and test everything that can be tested in
|
||||
such a manner.
|
||||
|
||||
* run-test-ondotnet-local is a variant of run-test-local. It is used only to validate if our tests themselves works fine under Microsoft runtime (on Windows). Basically, in this target, we should not use $(TEST_RUNTIME) to test our libraries.
|
||||
|
||||
* clean-local removes built files; 'make clean' should leave
|
||||
only files that go into a distribution tarball. (But it is not necessarily
|
||||
true that all files that go into a tarball need to be left after a make clean.)
|
||||
|
||||
* dist-local copies files into the distribution tree, which is
|
||||
given by the variable $(distdir). dist-local always depends on the
|
||||
target 'dist-default'. See ** 'make dist' below.
|
||||
|
||||
* doc-update-local should generate or update monodoc documentation,
|
||||
if appropriate. This is usually only appropriate for libraries. It's
|
||||
defined as a standard target so that it can easily be run recursively
|
||||
across all libraries within the module.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
** Build configuration
|
||||
|
||||
In general, MCS needs to be able to build relying only on the
|
||||
existence of a runtime and core libraries (corlib, System,
|
||||
System.Xml). So there shouldn't be any checking for libraries or
|
||||
whatnot; MCS should be able to build out of the box. We try to keep
|
||||
platform detection and feature testing (ie, for HP/UX echo) inside
|
||||
the makefiles; right now, there's no configuration script, and it'd
|
||||
be nice to keep it that way. (I am told that some people build on
|
||||
both Windows and Linux in the same tree, which would be impossible to
|
||||
do if we cached platform-related configury values.)
|
||||
|
||||
That being said, it's very convenient for developers to be able to
|
||||
customize their builds to suit their needs. To allow this, the
|
||||
Makefile rules are set up to allow people to override pretty much any
|
||||
important variable.
|
||||
|
||||
Configuration variables are given defaults in `config-default.make';
|
||||
`rules.make' optionally includes `$(topdir)/build/config.make', so you
|
||||
can customize your build without CVS trying to commit your modified
|
||||
`config-default.make' all the time. Platform-specific variables are
|
||||
defined in `$(topdir)/build/platforms/$(BUILD_PLATFORM).make', where
|
||||
$(BUILD_PLATFORM) is detected in config-default.make. (Currently, the only
|
||||
choices are linux.make and win32.make.)
|
||||
|
||||
The best way to learn what the configuration variables are is to read
|
||||
`config.make' and `platform.make'. There aren't too many and hopefully
|
||||
they should be self-explanatory; see the numerous examples below for
|
||||
more information if you're confused.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
** Recommendations for platform specifics
|
||||
|
||||
If you find yourself needing a platform-specific customization, try
|
||||
and express it in terms of a feature, rather than a platform test. In
|
||||
other words, this is good:
|
||||
|
||||
========================================
|
||||
run-test-local: my-test.exe
|
||||
ifdef PLATFORM_NEEDS_CRAZY_CRAP
|
||||
crazy-crap
|
||||
endif
|
||||
$(RUNTIME) my-test.exe
|
||||
========================================
|
||||
|
||||
and this is bad:
|
||||
|
||||
========================================
|
||||
run-test-local: my-test.exe
|
||||
ifdef WINDOWS
|
||||
crazy-crap
|
||||
else
|
||||
ifdef AMIGA
|
||||
crazy-crap
|
||||
endif
|
||||
endif
|
||||
$(RUNTIME) my-test.exe
|
||||
========================================
|
||||
|
||||
The latter accumulates and gets unpleasant and it sucks. Granted,
|
||||
right now we only have two platforms, so it's not a big deal, but it's
|
||||
good form to get used to and practice. Anyway, take a look at how we
|
||||
do the various corlib building hacks for examples of how we've done
|
||||
platform-specificity. It certainly isn't pretty, but at least it's a
|
||||
little structured.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
** Saving effort
|
||||
|
||||
The point of the build system is to abstract things and take
|
||||
care of all the easy stuff. So if you find yourself writing a
|
||||
Makefile, know that there's probably already infrastructure to do what
|
||||
you want. Here are all the common cases I can think of ...
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
* Compiling C# code? use:
|
||||
|
||||
========================================
|
||||
my-program.exe: my-source.cs
|
||||
$(CSCOMPILE) /target:exe /out:$@ $^
|
||||
========================================
|
||||
|
||||
or
|
||||
|
||||
========================================
|
||||
my-lib.dll: my-source.cs
|
||||
$(CSCOMPILE) /target:library /out:$@ $^
|
||||
========================================
|
||||
|
||||
Note the '$@' and '$^' variables. The former means "the name of the
|
||||
file that I am trying to make" and the latter means "all the
|
||||
dependencies of the file I am trying to make." USE THESE VARIABLES
|
||||
AGGRESSIVELY. Say that you add a new source to your program:
|
||||
|
||||
========================================
|
||||
my-program.exe: my-source.cs my-new-source.cs
|
||||
$(CSCOMPILE) /target:exe /out:$@ $^
|
||||
========================================
|
||||
|
||||
Because of the $^ variable, you don't need to remember to add another
|
||||
file to the command line. Similarly, if you rename your program, you
|
||||
won't need to remember to change the rule:
|
||||
|
||||
========================================
|
||||
MonoVaporizer.exe: my-source.cs my-new-source.cs
|
||||
$(CSCOMPILE) /target:exe /out:$@ $^
|
||||
========================================
|
||||
|
||||
will still work. Another useful variable is $<, which means "the first
|
||||
dependency of whatever I'm building." If you order your dependencies
|
||||
carefully it can be extremely useful.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
* Just building an executable? use:
|
||||
|
||||
========================================
|
||||
PROGRAM = myprogram.exe
|
||||
LOCAL_MCS_FLAGS = /r:System.Xml.dll
|
||||
|
||||
include ../build/executable.make
|
||||
========================================
|
||||
|
||||
executable.make builds a program in the current directory. Its name is
|
||||
held in $(PROGRAM), and its sources are listed in the file
|
||||
$(PROGRAM).sources. It might seem to make more sense to just list the
|
||||
program's sources in the Makefile, but when we build on Windows we
|
||||
need to change slashes around, which is much easier to do if the
|
||||
sources are listed in a file. The variable $(LOCAL_MCS_FLAGS) changes
|
||||
the flags given to the compiler; it is included in $(CSCOMPILE) so you
|
||||
don't need to worry about it.
|
||||
|
||||
executable.make does a lot for you: it builds the program in 'make
|
||||
all-local', installs the program in $(prefix)/bin, distributes the
|
||||
sources, and defines empty test targets. Now, if your program has a
|
||||
test, set the variable HAS_TEST:
|
||||
|
||||
========================================
|
||||
PROGRAM = myprogram.exe
|
||||
LOCAL_MCS_FLAGS = /r:System.Xml.dll
|
||||
HAS_TEST = yes
|
||||
include ../build/executable.make
|
||||
|
||||
test-local: mytester.exe
|
||||
|
||||
run-test-local: mytester.exe
|
||||
$(RUNTIME) $<
|
||||
|
||||
mytester.exe: mytester.cs
|
||||
$(CSCOMPILE) /target:exe /out:$@ mytester.cs
|
||||
========================================
|
||||
|
||||
If your program has NUnit tests, set the variable HAS_NUNIT_TEST:
|
||||
|
||||
========================================
|
||||
PROGRAM = myprogram.exe
|
||||
LOCAL_MCS_FLAGS = /r:System.Xml.dll
|
||||
HAS_NUNIT_TEST = yes
|
||||
include ../build/executable.make
|
||||
========================================
|
||||
|
||||
HAS_NUNIT_TEST tests follow library.make NUnit test conventions:
|
||||
the files should be in a subdirectory called Test/, and if
|
||||
your program is called myprogram.exe, they should be listed in
|
||||
myprogram_test.dll.sources. The names in that files should *not* have
|
||||
the Test/ prefix. 'make test' will build myprogram_test_$(PROFILE).dll
|
||||
in the current directory, automatically supplying the flags to
|
||||
reference the original program and NUnit.Framework.dll.
|
||||
|
||||
If your program has 'built sources', that is, source files generated
|
||||
from other files (say, generated by jay), define a variable called
|
||||
BUILT_SOURCES and do *not* list the sources in $(PROGRAM).sources:
|
||||
|
||||
========================================
|
||||
PROGRAM = myprogram.exe
|
||||
LOCAL_MCS_FLAGS = /r:System.Xml.dll
|
||||
BUILT_SOURCES = parser.cs
|
||||
CLEAN_FILES = y.output
|
||||
|
||||
include ../build/executable.make
|
||||
|
||||
parser.cs: parser.jay
|
||||
$(topdir)/jay/jay $< > $@
|
||||
========================================
|
||||
|
||||
executable.make will automatically delete the $(BUILT_SOURCES) files
|
||||
on 'make clean'. Since this situation is a common occurrence and jay
|
||||
happens to leave behind y.output files, you can also define a variable
|
||||
called $(CLEAN_FILES) that lists extra files to be deleted when 'make clean' is
|
||||
called. (That's in addition to your executable and the built sources).
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
* Buildling a library? Use
|
||||
|
||||
========================================
|
||||
LIBRARY = Mono.MyLib.dll
|
||||
LIB_MCS_FLAGS = /unsafe
|
||||
TEST_MCS_FLAGS = /r:System.Xml.dll
|
||||
|
||||
include ../../build/library.make
|
||||
========================================
|
||||
|
||||
Where you library is called $(LIBRARY); it will be put into
|
||||
$(topdir)/class/lib. LIB_MCS_FLAGS is the set of MCS flags to use when
|
||||
compiling the library; in addition, a global set of flags called
|
||||
$(LIBRARY_FLAGS) is added (that variable is defined in
|
||||
config-defaults.make), as well as the usual $(LOCAL_MCS_FLAGS).
|
||||
|
||||
As in executable.make, the sources for your library are listed in
|
||||
$(LIBRARY).sources. Note: these source lists should have Unix forward
|
||||
slashes and Unix newlines (\n, not \r\n.) If you get an error about
|
||||
"touch: need a filename", that means your .sources file doesn't end in
|
||||
a newline. It should.
|
||||
|
||||
Now library.make also assumes that your library has an NUnit2 test
|
||||
harness. The files should be in a subdirectory called Test/, and if
|
||||
your library is called Mono.Foo.dll, they should be listed in
|
||||
Mono.Foo_test.dll.sources. The names in that files should *not* have
|
||||
the Test/ prefix. 'make test' will build Mono.Foo_test.dll in the
|
||||
current directory, automatically supplying the flags to reference the
|
||||
original library and NUnit.Framework.dll.
|
||||
|
||||
If you don't have a test, just do this:
|
||||
|
||||
========================================
|
||||
LIBRARY = Mono.MyLib.dll
|
||||
LIB_MCS_FLAGS = /unsafe
|
||||
NO_TEST = yes
|
||||
|
||||
include ../../build/library.make
|
||||
========================================
|
||||
|
||||
and feel ashamed. Every good library has a test suite!
|
||||
|
||||
Extra flags needed to compile the test library should be listed in
|
||||
$(TEST_MCS_FLAGS); often you will have a line like this:
|
||||
|
||||
========================================
|
||||
TEST_MCS_FLAGS = $(LIB_MCS_FLAGS)
|
||||
========================================
|
||||
|
||||
Again, library.make does a lot for you: it builds the dll, it
|
||||
generates makefile fragments to track the dependencies, it installs
|
||||
the library, it builds the test dll on 'make test', it runs
|
||||
$(TEST_HARNESS) on it on 'make run-test', it removes the appropriate
|
||||
files on 'make clean', and it distributes all the source files on
|
||||
'make dist'. (TEST_HARNESS defaults to be nunit-console.exe but it may
|
||||
be overridden to, say, nunit-gtk). If you have extra files to
|
||||
distribute when using either library.make or executable.make, use the
|
||||
variable $(EXTRA_DISTFILES):
|
||||
|
||||
========================================
|
||||
EXTRA_DISTFILES = \
|
||||
Test/testcase1.in \
|
||||
Test/testcase1.out \
|
||||
README
|
||||
========================================
|
||||
|
||||
Again, library.make and executable.make do the right things so that we
|
||||
can build on Windows, doing some trickery to invert slashes and
|
||||
overcome command-line length limitations. Use them unless you have a
|
||||
really good reason not to. If you're building a bunch of small
|
||||
executables, check out tools/Makefile or tools/security/Makefile; if
|
||||
all the files are in the current directory, changing slashes isn't a
|
||||
big deal, and command-line lengths won't be a problem, so
|
||||
executable.make isn't necessary (and indeed it won't work, since it
|
||||
can only build one .exe in a directory).
|
||||
|
||||
If you're building a library, library.make is highly recommended; the
|
||||
only DLL that doesn't use it is corlib, because building corlib is a
|
||||
fair bit more complicated than it should be. Oh well.
|
||||
|
||||
library.make also automatically supports generating and updating
|
||||
monodoc documentation. Documentation is stored within the
|
||||
Documentation directory (a sibling to the Test directory), and is
|
||||
generated/updated whenever the doc-update target is executed.
|
||||
Assembling of the documentation so that the monodoc browser can
|
||||
display the documentation is handled separately within the mcs/docs
|
||||
all-local target; see mcs/docs/Makefile for details.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
* Running a C# program? Use $(RUNTIME)
|
||||
|
||||
========================================
|
||||
run-test-local: myprog.exe
|
||||
$(RUNTIME) myprog.exe
|
||||
========================================
|
||||
|
||||
$(RUNTIME) might be empty (if you're on windows), so don't expect to
|
||||
be able to give it any arguments. If you're on a platform which has an
|
||||
interpreter or jitter, $(RUNTIME_FLAGS) is included in $(RUNTIME), so
|
||||
set that variable.
|
||||
|
||||
$(TEST_RUNTIME) is the runtime to use when running tests. Right now it's
|
||||
just "mono --debug".
|
||||
|
||||
|
||||
|
||||
* Calling the compiler directly? Use $(MCS).
|
||||
|
||||
Really, you should use $(CSCOMPILE) whenever possible, but $(MCS) is
|
||||
out there. $(BOOTSTRAP_MCS) is the C# compiler that we use to build
|
||||
mcs.exe; on Linux, we then use mcs.exe to build everything else, but
|
||||
on Windows, we use csc.exe to build everything. Only use
|
||||
$(BOOTSTRAP_MCS) if you know what you're doing.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
* Compiling C code? Use $(CCOMPILE)
|
||||
|
||||
To give it flags, set $(LOCAL_CFLAGS). As with compiling C#, the
|
||||
variable $(CFLAGS) will automatically be included on the command line.
|
||||
|
||||
|
||||
* Compiling resources with resgen
|
||||
|
||||
If you have a resource that should be compiled with resgen and
|
||||
included in your assembly, you can use the RESOURCES_DEFS variable.
|
||||
This variable can contain lists of pairs that are separated by comma
|
||||
to represent the resource ID as embedded in the assembly followed by
|
||||
the file name, like this:
|
||||
|
||||
RESOURCE_DEFS = Messages,TextResources.resx Errors,ErrorList.txt
|
||||
|
||||
|
||||
* Documentation-related needs? Use $(MDOC)
|
||||
|
||||
$(MDOC) is a front-end to the monodoc documentation system, supporting
|
||||
documentation generation, updating, importing from Microsoft XML
|
||||
Documentation and ECMA documentation formats, assembling documentation
|
||||
for use within the monodoc documentation browser, and exporting
|
||||
documentation to various other output formats such as static HTML.
|
||||
|
||||
It is currently only used for library.make's doc-update-local target
|
||||
and for assembling documentation within $topdir/docs.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
* Installing files? Use $(MKINSTALLDIRS), $(INSTALL_DATA) or
|
||||
$(INSTALL_BIN), $(prefix), and $(DESTDIR).
|
||||
|
||||
Every time a file is installed the commands should look like this:
|
||||
|
||||
========================================
|
||||
install-local:
|
||||
$(MKINSTALLDIRS) $(DESTDIR)$(prefix)/my/dir
|
||||
$(INSTALL_DATA) myfile $(DESTDIR)$(prefix)/my/dir
|
||||
========================================
|
||||
|
||||
This way the directory is created recursively if needed (admittedly, we could
|
||||
probably rely on mkdir -p), the file is given the correct permissions,
|
||||
the user can override $(MKINSTALLDIRS) and $(INSTALL) if they need to,
|
||||
and we can support $(DESTDIR) installs. We use $(DESTDIR) to make
|
||||
monocharge tarballs, and it's useful otherwise, so try and use it
|
||||
consistently.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
* 'make dist'? Use $(DISTFILES)
|
||||
|
||||
The 'dist-default' target will copy the files listed in $(DISTFILES)
|
||||
into the distribution directory, as well as Makefile and ChangeLog if
|
||||
they exist. This is almost always all that you need, so ideally your
|
||||
make dist support should only be:
|
||||
|
||||
========================================
|
||||
DISTFILES = README Test/thoughts.txt
|
||||
|
||||
dist-local: dist-default
|
||||
========================================
|
||||
|
||||
DISTFILES will cope correctly with files in subdirectories, by the
|
||||
way. Note that if you put a nonexistant file or a directory in
|
||||
DISTFILES it will *not* complain; it will just ignore it.
|
||||
|
||||
If you want to test your 'make dist' code, you can try
|
||||
|
||||
========================================
|
||||
$ cd class/Mono.MyClass
|
||||
$ make dist-local distdir=TEST
|
||||
========================================
|
||||
|
||||
And your files should be copied into TEST/ in the current directory.
|
||||
There is a toplevel 'make distcheck' target, which will build a dist
|
||||
tarball, try to build it, install files to a temporary prefix, make
|
||||
clean it, make a distribution, and compare the files left over to the
|
||||
files originally in the tarball: they should be the same. But this
|
||||
takes about 15 minutes to run on my 1.1 Ghz computer, so it's not for
|
||||
the faint of heart.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
* Lots of files? Use $(wildcard *.foo)
|
||||
|
||||
When specifying the sources to a library or executable, wildcards are
|
||||
not encouraged; in fact they're not allowed if you use library.make or
|
||||
executable.make. But there are times when they're useful, eg:
|
||||
|
||||
========================================
|
||||
DISTFILES = $(wildcard Test/*.in) $(wildcard Test/*.out)
|
||||
========================================
|
||||
|
||||
Just so you know that 'make' has this feature.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
* Referencing files in other directories? Use $(topdir).
|
||||
|
||||
$(topdir) is the path to the top directory from the current build
|
||||
directory. Basically it's a sequence of ../.. computed from the value
|
||||
that you give $(thisdir) at the top of your Makefile. Try to reference
|
||||
things from $(topdir), so your code can be moved or cut-and-pasted
|
||||
around with a minimum of fuss.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
* Conditional building? Use ifdef/ifndef/endif
|
||||
|
||||
Now in general we want to avoid conditional building, but sometimes
|
||||
something doesn't work on Linux or already exists on Windows or
|
||||
whatnot. (See below on recommended form for how to build
|
||||
platform-specifically.) GNU Make supports the following construction:
|
||||
|
||||
========================================
|
||||
BUILD_EXPERIMENTAL = yes
|
||||
|
||||
ifdef BUILD_EXPERIMENTAL
|
||||
experimental_stuff = my-experiment.exe
|
||||
else
|
||||
experimental_stuff =
|
||||
endif
|
||||
|
||||
all-local: my-sane.exe $(experimental_stuff)
|
||||
========================================
|
||||
|
||||
'ifdef' means 'if the variable is set to nonempty', so you could have
|
||||
|
||||
========================================
|
||||
BUILD_EXPERIMENTAL = colorless green ideas sleep furiously
|
||||
========================================
|
||||
|
||||
and Make would be happy. I hope that the meaning of 'ifndef' should be
|
||||
obvious. If you want to only sometimes build a target, the above
|
||||
construction is the recommended way to go about it; it's nice to have
|
||||
the rules exist in a Makefile even if they aren't invoked.
|
||||
|
||||
If you want to see why conditionals aren't nice, take a look at
|
||||
library.make or class/corlib/Makefile.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
* 'Private' directories that shouldn't be built by default? Use DIST_ONLY_SUBDIRS
|
||||
|
||||
Several of the MCS class libraries have demo or experimental
|
||||
implementations that depend on things not included with MCS (say,
|
||||
Gtk#). We don't want to build them by default, because the user might
|
||||
not have those dependencies installed, but it's nice to have a
|
||||
Makefile for them to be built nicely.
|
||||
|
||||
First of all, there's nothing stopping you from writing a Makefile for
|
||||
such a directory; just don't put it in the SUBDIRS line of its parent
|
||||
directory. That way, you can do all the normal build things like 'make
|
||||
all' or 'make clean' in that directory, but people trying to bootstrap
|
||||
their system won't run into problems.
|
||||
|
||||
At the same time you probably want to include this directory in the
|
||||
distribution so that people can use your demo or experimental code if
|
||||
they know what they're doing. Hence the variable
|
||||
$(DIST_ONLY_SUBDIRS). As you might guess, it's like the SUBDIRS
|
||||
variable: it lists subdirectories that a regular shouldn't recurse
|
||||
into, but should have their 'make dist' rules invoked.
|
||||
|
||||
Say you've written Mono.MyFancyLib.dll and you have
|
||||
a demo app using Gtk# called MyFancyDemo. The Makefile rules might
|
||||
look like this:
|
||||
|
||||
class/Mono.MyFancyLib/Makefile
|
||||
========================================
|
||||
thisdir = class/Mono.MyFancyLib
|
||||
SUBDIRS =
|
||||
DIST_ONLY_SUBDIRS = MyFancyDemo
|
||||
include ../../build/rules.make
|
||||
|
||||
LIBRARY = Mono.MyFancyLib.dll
|
||||
LIB_MCS_FLAGS = /r:System.dll
|
||||
TEST_MCS_FLAGS = $(LIB_MCS_FLAGS)
|
||||
|
||||
include ../../build/library.make
|
||||
========================================
|
||||
|
||||
class/Mono.MyFancyLib/MyFancyDemo/Makefile
|
||||
========================================
|
||||
thisdir = class/Mono.MyFancyLib/MyFancyDemo
|
||||
SUBDIRS =
|
||||
include ../../../build/rules.make
|
||||
|
||||
PROGRAM = FancyDemo.exe
|
||||
LOCAL_MCS_FLAGS = /r:gtk-sharp.dll
|
||||
|
||||
include ../../../build/executable.make
|
||||
========================================
|
||||
|
||||
|
||||
|
||||
|
||||
* Special recursion needs?
|
||||
|
||||
By default, rules.make defines the all, install, clean, etc. targets
|
||||
to look something like this:
|
||||
|
||||
all: all-recursive
|
||||
$(MAKE) all-local
|
||||
|
||||
Sometimes that doesn't cut it; say for example you want to check for
|
||||
something before doing a lengthy recursive build (see
|
||||
$(topdir)/Makefile) or you have a something like this
|
||||
|
||||
class/MyLibrary:
|
||||
Build MyLibrary.dll
|
||||
class/MyLibrary/Test:
|
||||
Build TestMyLibrary.exe
|
||||
|
||||
'make clean test' will fail here, because the build will happen in
|
||||
the Test subdirectory first, so there will be no MyLibrary.dll to link
|
||||
against. (Unless you write a nasty evil relative path rule which is
|
||||
strongly discouraged.)
|
||||
|
||||
Anyway, to solve this problem you can do
|
||||
|
||||
========================================
|
||||
thisdir = class/MyLibrary
|
||||
SUBDIRS = Test
|
||||
include ../../build/rules.make
|
||||
|
||||
# Normally, make runs 'all-recursive' first, and then 'all-local'
|
||||
# With this, we ensure that 'all-local' is executed first.
|
||||
all-recursive: all-local
|
||||
|
||||
test-recursive: test-local
|
||||
...
|
||||
========================================
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
** A few implementation details
|
||||
|
||||
The way rules.make does its recursion is very standard; it maps
|
||||
{all,install,clean, dist,test} to $@-recursive, which executes that rule
|
||||
in each directory in $(SUBDIRS), and then calls $@-local in the current
|
||||
directory. So something that gets built in a subdirectory cannot rely on
|
||||
something that gets built in its parent directory. If this is a problem,
|
||||
see the previous section. Note that the recursive rule for 'dist' is
|
||||
different; it makes dist-recursive in subdirectories, so you at least
|
||||
have to define that rule.
|
||||
|
||||
Note that even a directory that doesn't, for example, have any tests
|
||||
must still define test-local; otherwise 'make test' run from the
|
||||
toplevel directory will break.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
** Flags for Tools
|
||||
|
||||
We want to make it so that the user can specify certain flags to
|
||||
always be given to a tool, so there's a general way of implementing
|
||||
FLAGS variables:
|
||||
|
||||
* $(foo_FLAGS) remains unset or defaulted to something
|
||||
sensible; the user can provide overrides this way.
|
||||
|
||||
* $(LOCAL_foo_FLAGS) is set in a specific Makefile to
|
||||
provide necessary values.
|
||||
|
||||
* $(PLATFORM_foo_FLAGS) is set in the platform configuration
|
||||
to provide platform-specific values.
|
||||
|
||||
* $(PROFILE_foo_FLAGS) is set in the profile configuration
|
||||
to provide profile-specific values.
|
||||
|
||||
* $(USE_foo_FLAGS) is defined to be the combination of all of
|
||||
the above, and it's what is actually passed to $(foo).
|
||||
|
||||
$(MCS_FLAGS) and $(CFLAGS) follow this model. If you end up finding
|
||||
that another tool is used commonly (hm, jay...), please follow this form.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
** Portability tips
|
||||
|
||||
Always use the icky Windows /argument way of passing parameters to the C#
|
||||
compiler so that csc can be used.
|
||||
|
||||
Always use /r:foo.dll, not /r:foo. Windows requires the former.
|
||||
|
||||
Use /r:$(corlib), not /r:corlib.
|
||||
|
||||
If you're writing shell script code as part of a make rule, remember
|
||||
that Windows has command-line length limits. So something like
|
||||
|
||||
========================================
|
||||
mytool $(all_the_sources_to_corlib)
|
||||
========================================
|
||||
|
||||
Is probably going to cause problems. As I understand it,
|
||||
|
||||
========================================
|
||||
for f in $(all_the_sources_to_corlib) ; do ...
|
||||
========================================
|
||||
|
||||
is ok, since the shell itself doesn't have those limitations. Other
|
||||
than that, you should still try to write fairly portable shell
|
||||
script. Linux and Cygwin both use the GNU utilities, but there's at
|
||||
least one hardy soul trying to build Mono on HP/UX, and no doubt there
|
||||
will be ports to more Unices as time goes on.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
** Misc
|
||||
|
||||
We still don't use /d:NET_1_1 ; it causes some build problems right
|
||||
now.
|
||||
|
||||
There's a hack in class/System.Data/Makefile to work around a very
|
||||
strange crash in the runtime with some custom attribute stuff. It'd be
|
||||
nice to fix it.
|
||||
|
||||
Also, there's a /lib:$(prefix)/lib in the System.dll Makefile, which
|
||||
is for some reason necessary if System.Xml.dll hasn't been built yet.
|
||||
(Well, it's necessary because of the /r:System.Xml.dll, but that
|
||||
should be in the search path, it seems.)
|
||||
|
||||
A lot of the weird targets in the old makefiles have been dropped; I
|
||||
have a feeling that a lot of them are archaic and not needed anymore.
|
||||
|
||||
I'd really like to write a build tool in C#. It would be nice to have
|
||||
something really extensible and well-designed and clean. NAnt is,
|
||||
IMHO, an apalling abomination and a tragically bad attempt at solving
|
||||
the software building problem. Just so you know.
|
||||
|
||||
(On the other hand, NUnit is really neat.)
|
||||
|
||||
Peter
|
||||
@@ -1,747 +0,0 @@
|
||||
# The MCS makefiles
|
||||
|
||||
Author: Peter Williams <peter@newton.cx>
|
||||
|
||||
The new makefiles try to abstract building on Windows and Linux. They
|
||||
try to provide a consistent set of ways to express the things that our
|
||||
build system needs to let us do, specifically:
|
||||
|
||||
* Build recursively
|
||||
* Build libraries and executables easily
|
||||
* Let developers use different runtimes and class libaries
|
||||
* Make distributions easily
|
||||
* Provide a framework for testing
|
||||
* Build platform-independently whenever possible
|
||||
* Generate, update, and build monodoc documentation.
|
||||
|
||||
Makefile structure
|
||||
==================
|
||||
|
||||
A general makefile looks like this:
|
||||
|
||||
```
|
||||
thisdir = class/Mono.My.Library
|
||||
SUBDIRS =
|
||||
include ../../build/rules.make
|
||||
|
||||
all-local:
|
||||
do some stuff
|
||||
|
||||
install-local:
|
||||
$(MKINSTALLDIRS) $(DESTDIR)$(prefix)/share/
|
||||
$(INSTALL_DATA) myfile.txt $(DESTDIR)$(prefix)/share/myfiledir
|
||||
|
||||
clean-local:
|
||||
rm -f my-generated-file
|
||||
|
||||
test-local: my_test_program.exe
|
||||
|
||||
run-test-local:
|
||||
$(RUNTIME) my_test_program.exe
|
||||
|
||||
run-test-ondotnet-local:
|
||||
$(RUNTIME) my_test_program.exe
|
||||
|
||||
DISTFILES = myfile.txt my_test_source.cs
|
||||
|
||||
dist-local: dist-default
|
||||
|
||||
doc-update-local:
|
||||
|
||||
my_test_program.exe: my_test_source.cs
|
||||
$(CSCOMPILE) /target:exe /out:$@ $<
|
||||
```
|
||||
|
||||
Each makefile follows the same pattern: it does some setup, includes
|
||||
the standard make rules, and provides rules for eight standard targets:
|
||||
`all`, `install`, `test`, `run-test`, `clean`, `dist`, and `doc-update`.
|
||||
|
||||
"Some setup" is defining two variables: `$(thisdir)` and
|
||||
`$(SUBDIRS)`. `$(thisdir)` is the directory that the makefile lives in,
|
||||
relative to the top directory (ie, `class/corlib`) and `$(SUBDIRS)`
|
||||
defines the subdirectories that should be built in.
|
||||
|
||||
The eight targets do the following:
|
||||
|
||||
* `all-local` builds whatever someone would expect to be built
|
||||
when they just type `make'` Most likely `Foo.dll` or `Foo.exe`
|
||||
|
||||
* `install-local` installs whatever got built by `all-local`.
|
||||
|
||||
* `test-local` _builds_ the test programs or libraries but does
|
||||
_not_ run them.
|
||||
|
||||
* `run-test-local` actually runs the tests. It shouldn't
|
||||
necessarily exit in an error if the test fails, but should make that
|
||||
situation obvious. It should only run tests that take care of
|
||||
themselves automatically; interactive tests should have an individual
|
||||
target. The idea is that `make run-test` from the toplevel should be
|
||||
able to proceed unsupervised and test everything that can be tested in
|
||||
such a manner.
|
||||
|
||||
* `run-xunit-test-local` this is a variation of the above, but it runs the
|
||||
tests that were built with Xunit instead of NUnit.
|
||||
|
||||
* `run-test-ondotnet-local` is a variant of `run-test-local`. It is used only to validate if our tests themselves works fine under Microsoft runtime (on Windows). Basically, in this target, we should not use $(TEST_RUNTIME) to test our libraries.
|
||||
|
||||
* `clean-local` removes built files; `make clean` should leave
|
||||
only files that go into a distribution tarball. (But it is not
|
||||
necessarily true that all files that go into a tarball need to be left
|
||||
after a make clean.)
|
||||
|
||||
* `dist-local` copies files into the distribution tree, which is
|
||||
given by the variable `$(distdir)`. `dist-local` always depends on the
|
||||
target `dist-default`. See ** `make dist` below.
|
||||
|
||||
* `doc-update-local` should generate or update monodoc documentation,
|
||||
if appropriate. This is usually only appropriate for libraries. It's
|
||||
defined as a standard target so that it can easily be run recursively
|
||||
across all libraries within the module.
|
||||
|
||||
Build configuration
|
||||
===================
|
||||
|
||||
In general, MCS needs to be able to build relying only on the
|
||||
existence of a runtime and core libraries (`mscorlib`, `System`,
|
||||
`System.Xml`). So there shouldn't be any checking for libraries or
|
||||
whatnot; MCS should be able to build out of the box. We try to keep
|
||||
platform detection and feature testing (ie, for HP/UX echo) inside
|
||||
the makefiles; right now, there's no configuration script, and it'd
|
||||
be nice to keep it that way. (I am told that some people build on
|
||||
both Windows and Linux in the same tree, which would be impossible to
|
||||
do if we cached platform-related configury values.)
|
||||
|
||||
That being said, it's very convenient for developers to be able to
|
||||
customize their builds to suit their needs. To allow this, the
|
||||
Makefile rules are set up to allow people to override pretty much any
|
||||
important variable.
|
||||
|
||||
Configuration variables are given defaults in `config-default.make`;
|
||||
`rules.make` optionally includes `$(topdir)/build/config.make`, so you
|
||||
can customize your build without CVS trying to commit your modified
|
||||
`config-default.make` all the time. Platform-specific variables are
|
||||
defined in `$(topdir)/build/platforms/$(BUILD_PLATFORM).make`, where
|
||||
`$(BUILD_PLATFORM)` is detected in `config-default.make`. (Currently, the only
|
||||
choices are `linux.make` and `win32.make`)
|
||||
|
||||
The best way to learn what the configuration variables are is to read
|
||||
`config.make` and `platform.make`. There aren't too many and hopefully
|
||||
they should be self-explanatory; see the numerous examples below for
|
||||
more information if you're confused.
|
||||
|
||||
Recommendations for platform specifics
|
||||
--------------------------------------
|
||||
|
||||
If you find yourself needing a platform-specific customization, try
|
||||
and express it in terms of a feature, rather than a platform test. In
|
||||
other words, this is good:
|
||||
|
||||
```
|
||||
run-test-local: my-test.exe
|
||||
ifdef PLATFORM_NEEDS_CRAZY_CRAP
|
||||
crazy-crap
|
||||
endif
|
||||
$(RUNTIME) my-test.exe
|
||||
```
|
||||
|
||||
and this is bad:
|
||||
|
||||
```
|
||||
run-test-local: my-test.exe
|
||||
ifdef WINDOWS
|
||||
crazy-crap
|
||||
else
|
||||
ifdef AMIGA
|
||||
crazy-crap
|
||||
endif
|
||||
endif
|
||||
$(RUNTIME) my-test.exe
|
||||
```
|
||||
|
||||
The latter accumulates and gets unpleasant and it sucks. Granted,
|
||||
right now we only have two platforms, so it's not a big deal, but it's
|
||||
good form to get used to and practice. Anyway, take a look at how we
|
||||
do the various corlib building hacks for examples of how we've done
|
||||
platform-specificity. It certainly isn't pretty, but at least it's a
|
||||
little structured.
|
||||
|
||||
Saving effort
|
||||
=============
|
||||
|
||||
The point of the build system is to abstract things and take
|
||||
care of all the easy stuff. So if you find yourself writing a
|
||||
Makefile, know that there's probably already infrastructure to do what
|
||||
you want. Here are all the common cases I can think of.
|
||||
|
||||
Compiling C# code? use:
|
||||
-----------------------
|
||||
|
||||
```
|
||||
my-program.exe: my-source.cs
|
||||
$(CSCOMPILE) /target:exe /out:$@ $^
|
||||
```
|
||||
|
||||
or
|
||||
|
||||
```
|
||||
my-lib.dll: my-source.cs
|
||||
$(CSCOMPILE) /target:library /out:$@ $^
|
||||
```
|
||||
|
||||
Note the `$@` and `$^` variables. The former means "the name of the
|
||||
file that I am trying to make" and the latter means "all the
|
||||
dependencies of the file I am trying to make." USE THESE VARIABLES
|
||||
AGGRESSIVELY. Say that you add a new source to your program:
|
||||
|
||||
```
|
||||
my-program.exe: my-source.cs my-new-source.cs
|
||||
$(CSCOMPILE) /target:exe /out:$@ $^
|
||||
```
|
||||
|
||||
Because of the $^ variable, you don't need to remember to add another
|
||||
file to the command line. Similarly, if you rename your program, you
|
||||
won't need to remember to change the rule:
|
||||
|
||||
```
|
||||
MonoVaporizer.exe: my-source.cs my-new-source.cs
|
||||
$(CSCOMPILE) /target:exe /out:$@ $^
|
||||
```
|
||||
|
||||
will still work. Another useful variable is $<, which means "the first
|
||||
dependency of whatever I'm building." If you order your dependencies
|
||||
carefully it can be extremely useful.
|
||||
|
||||
Just building an executable?
|
||||
----------------------------
|
||||
|
||||
Then use:
|
||||
|
||||
```
|
||||
PROGRAM = myprogram.exe
|
||||
LOCAL_MCS_FLAGS = /r:System.Xml.dll
|
||||
|
||||
include ../build/executable.make
|
||||
```
|
||||
|
||||
executable.make builds a program in the current directory. Its name is
|
||||
held in `$(PROGRAM)`, and its sources are listed in the file
|
||||
`$(PROGRAM).sources`. It might seem to make more sense to just list the
|
||||
program's sources in the Makefile, but when we build on Windows we
|
||||
need to change slashes around, which is much easier to do if the
|
||||
sources are listed in a file. The variable `$(LOCAL_MCS_FLAGS)` changes
|
||||
the flags given to the compiler; it is included in `$(CSCOMPILE)` so you
|
||||
don't need to worry about it.
|
||||
|
||||
`executable.make` does a lot for you: it builds the program in 'make
|
||||
all-local', installs the program in `$(prefix)/bin`, distributes the
|
||||
sources, and defines empty test targets. Now, if your program has a
|
||||
test, set the variable `HAS_TEST`:
|
||||
|
||||
```
|
||||
PROGRAM = myprogram.exe
|
||||
LOCAL_MCS_FLAGS = /r:System.Xml.dll
|
||||
HAS_TEST = yes
|
||||
include ../build/executable.make
|
||||
|
||||
test-local: mytester.exe
|
||||
|
||||
run-test-local: mytester.exe
|
||||
$(RUNTIME) $<
|
||||
|
||||
mytester.exe: mytester.cs
|
||||
$(CSCOMPILE) /target:exe /out:$@ mytester.cs
|
||||
```
|
||||
|
||||
If your program has NUnit tests, set the variable `HAS_NUNIT_TEST`:
|
||||
|
||||
```
|
||||
PROGRAM = myprogram.exe
|
||||
LOCAL_MCS_FLAGS = /r:System.Xml.dll
|
||||
HAS_NUNIT_TEST = yes
|
||||
include ../build/executable.make
|
||||
```
|
||||
|
||||
`HAS_NUNIT_TEST` tests follow `library.make` NUnit test conventions:
|
||||
the files should be in a subdirectory called `Test/`, and if
|
||||
your program is called `myprogram.exe`, they should be listed in
|
||||
`myprogram_test.dll.sources`. The names in that files should *not* have
|
||||
the `Test/` prefix. `make test'`will build `myprogram_test_$(PROFILE).dll`
|
||||
in the current directory, automatically supplying the flags to
|
||||
reference the original program and `NUnit.Framework.dll`.
|
||||
|
||||
If your program has 'built sources', that is, source files generated
|
||||
from other files (say, generated by jay), define a variable called
|
||||
`BUILT_SOURCES` and do *not* list the sources in `$(PROGRAM).sources`:
|
||||
|
||||
```
|
||||
PROGRAM = myprogram.exe
|
||||
LOCAL_MCS_FLAGS = /r:System.Xml.dll
|
||||
BUILT_SOURCES = parser.cs
|
||||
CLEAN_FILES = y.output
|
||||
|
||||
include ../build/executable.make
|
||||
|
||||
parser.cs: parser.jay
|
||||
$(topdir)/jay/jay $< > $@
|
||||
```
|
||||
|
||||
`executable.make` will automatically delete the `$(BUILT_SOURCES)` files
|
||||
on `make clean`. Since this situation is a common occurrence and jay
|
||||
happens to leave behind y.output files, you can also define a variable
|
||||
called `$(CLEAN_FILES)` that lists extra files to be deleted when
|
||||
`make clean` is called. (That's in addition to your executable and the built sources).
|
||||
|
||||
Buildling a library? Use
|
||||
------------------------
|
||||
|
||||
```
|
||||
LIBRARY = Mono.MyLib.dll
|
||||
LIB_MCS_FLAGS = /unsafe
|
||||
TEST_MCS_FLAGS = /r:System.Xml.dll
|
||||
|
||||
include ../../build/library.make
|
||||
```
|
||||
|
||||
Where you library is called `$(LIBRARY)`; it will be put into
|
||||
`$(topdir)/class/lib`. `LIB_MCS_FLAGS` is the set of MCS flags to use when
|
||||
compiling the library; in addition, a global set of flags called
|
||||
`$(LIBRARY_FLAGS)` is added (that variable is defined in
|
||||
`config-defaults.make`), as well as the usual `$(LOCAL_MCS_FLAGS)`.
|
||||
|
||||
As in `executable.make`, the sources for your library are listed in
|
||||
`$(LIBRARY).sources`. Note: these source lists should have Unix forward
|
||||
slashes and Unix newlines (\n, not \r\n.) If you get an error about
|
||||
"touch: need a filename", that means your .sources file doesn't end in
|
||||
a newline. It should.
|
||||
|
||||
Now `library.make` also assumes that your library has an NUnit2 test
|
||||
harness. The files should be in a subdirectory called `Test/`, and if
|
||||
your library is called `Mono.Foo.dll`, they should be listed in
|
||||
`Mono.Foo_test.dll.sources`. The names in that files should *not* have
|
||||
the `Test/` prefix. `make test` will build `Mono.Foo_test.dll` in the
|
||||
current directory, automatically supplying the flags to reference the
|
||||
original library and `NUnit.Framework.dll`.
|
||||
|
||||
If you don't have a test, just do this:
|
||||
|
||||
```
|
||||
LIBRARY = Mono.MyLib.dll
|
||||
LIB_MCS_FLAGS = /unsafe
|
||||
NO_TEST = yes
|
||||
|
||||
include ../../build/library.make
|
||||
```
|
||||
|
||||
and feel ashamed. Every good library has a test suite!
|
||||
|
||||
Extra flags needed to compile the test library should be listed in
|
||||
$(TEST_MCS_FLAGS); often you will have a line like this:
|
||||
|
||||
```
|
||||
TEST_MCS_FLAGS = $(LIB_MCS_FLAGS)
|
||||
```
|
||||
|
||||
Again, `library.make` does a lot for you: it builds the dll, it
|
||||
generates makefile fragments to track the dependencies, it installs
|
||||
the library, it builds the test dll on `make test`, it runs
|
||||
`$(TEST_HARNESS)` on it on `make run-test`, it removes the appropriate
|
||||
files on 'make clean', and it distributes all the source files on
|
||||
`make dist`. (`TEST_HARNESS` defaults to be `nunit-console.exe` but it may
|
||||
be overridden to, say, `nunit-gtk`). If you have extra files to
|
||||
distribute when using either `library.make` or `executable.make`, use the
|
||||
variable `$(EXTRA_DISTFILES)`:
|
||||
|
||||
```
|
||||
EXTRA_DISTFILES = \
|
||||
Test/testcase1.in \
|
||||
Test/testcase1.out \
|
||||
README
|
||||
```
|
||||
|
||||
Again, `library.make` and `executable.make` do the right things so that we
|
||||
can build on Windows, doing some trickery to invert slashes and
|
||||
overcome command-line length limitations. Use them unless you have a
|
||||
really good reason not to. If you're building a bunch of small
|
||||
executables, check out `tools/Makefile` or `tools/security/Makefile`; if
|
||||
all the files are in the current directory, changing slashes isn't a
|
||||
big deal, and command-line lengths won't be a problem, so
|
||||
executable.make isn't necessary (and indeed it won't work, since it
|
||||
can only build one .exe in a directory).
|
||||
|
||||
If you're building a library, `library.make` is highly recommended; the
|
||||
only DLL that doesn't use it is corlib, because building corlib is a
|
||||
fair bit more complicated than it should be. Oh well.
|
||||
|
||||
`library.make` also automatically supports generating and updating
|
||||
monodoc documentation. Documentation is stored within the
|
||||
Documentation directory (a sibling to the Test directory), and is
|
||||
generated/updated whenever the doc-update target is executed.
|
||||
Assembling of the documentation so that the monodoc browser can
|
||||
display the documentation is handled separately within the mcs/docs
|
||||
all-local target; see mcs/docs/Makefile for details.
|
||||
|
||||
Running a C# program? Use $(RUNTIME)
|
||||
------------------------------------
|
||||
|
||||
```
|
||||
run-test-local: myprog.exe
|
||||
$(RUNTIME) myprog.exe
|
||||
```
|
||||
|
||||
`$(RUNTIME)` might be empty (if you're on windows), so don't expect to
|
||||
be able to give it any arguments. If you're on a platform which has an
|
||||
interpreter or jitter, $(RUNTIME_FLAGS) is included in $(RUNTIME), so
|
||||
set that variable.
|
||||
|
||||
$(TEST_RUNTIME) is the runtime to use when running tests. Right now it's
|
||||
just "mono --debug".
|
||||
|
||||
|
||||
|
||||
Calling the compiler directly? Use $(MCS).
|
||||
------------------------------------------
|
||||
|
||||
Really, you should use $(CSCOMPILE) whenever possible, but $(MCS) is
|
||||
out there. $(BOOTSTRAP_MCS) is the C# compiler that we use to build
|
||||
mcs.exe; on Linux, we then use mcs.exe to build everything else, but
|
||||
on Windows, we use csc.exe to build everything. Only use
|
||||
$(BOOTSTRAP_MCS) if you know what you're doing.
|
||||
|
||||
Compiling C code? Use $(CCOMPILE)
|
||||
---------------------------------
|
||||
|
||||
To give it flags, set $(LOCAL_CFLAGS). As with compiling C#, the
|
||||
variable $(CFLAGS) will automatically be included on the command line.
|
||||
|
||||
|
||||
Compiling resources with resgen
|
||||
-------------------------------
|
||||
|
||||
If you have a resource that should be compiled with resgen and
|
||||
included in your assembly, you can use the RESOURCES_DEFS variable.
|
||||
This variable can contain lists of pairs that are separated by comma
|
||||
to represent the resource ID as embedded in the assembly followed by
|
||||
the file name, like this:
|
||||
|
||||
RESOURCE_DEFS = Messages,TextResources.resx Errors,ErrorList.txt
|
||||
|
||||
|
||||
Documentation-related needs? Use $(MDOC)
|
||||
----------------------------------------
|
||||
|
||||
$(MDOC) is a front-end to the monodoc documentation system, supporting
|
||||
documentation generation, updating, importing from Microsoft XML
|
||||
Documentation and ECMA documentation formats, assembling documentation
|
||||
for use within the monodoc documentation browser, and exporting
|
||||
documentation to various other output formats such as static HTML.
|
||||
|
||||
It is currently only used for library.make's doc-update-local target
|
||||
and for assembling documentation within $topdir/docs.
|
||||
|
||||
Installing files? Use $(MKINSTALLDIRS), $(INSTALL_DATA) or $(INSTALL_BIN), $(prefix), and $(DESTDIR).
|
||||
-----------------------------------------------------------------------------------------------------
|
||||
|
||||
Every time a file is installed the commands should look like this:
|
||||
|
||||
```
|
||||
install-local:
|
||||
$(MKINSTALLDIRS) $(DESTDIR)$(prefix)/my/dir
|
||||
$(INSTALL_DATA) myfile $(DESTDIR)$(prefix)/my/dir
|
||||
```
|
||||
|
||||
This way the directory is created recursively if needed (admittedly, we could
|
||||
probably rely on mkdir -p), the file is given the correct permissions,
|
||||
the user can override $(MKINSTALLDIRS) and $(INSTALL) if they need to,
|
||||
and we can support $(DESTDIR) installs. We use $(DESTDIR) to make
|
||||
monocharge tarballs, and it's useful otherwise, so try and use it
|
||||
consistently.
|
||||
|
||||
'make dist'? Use $(DISTFILES)
|
||||
-----------------------------
|
||||
|
||||
The 'dist-default' target will copy the files listed in $(DISTFILES)
|
||||
into the distribution directory, as well as Makefile and ChangeLog if
|
||||
they exist. This is almost always all that you need, so ideally your
|
||||
make dist support should only be:
|
||||
|
||||
```
|
||||
DISTFILES = README Test/thoughts.txt
|
||||
|
||||
dist-local: dist-default
|
||||
```
|
||||
|
||||
DISTFILES will cope correctly with files in subdirectories, by the
|
||||
way. Note that if you put a nonexistant file or a directory in
|
||||
DISTFILES it will *not* complain; it will just ignore it.
|
||||
|
||||
If you want to test your 'make dist' code, you can try
|
||||
|
||||
```
|
||||
$ cd class/Mono.MyClass
|
||||
$ make dist-local distdir=TEST
|
||||
```
|
||||
|
||||
And your files should be copied into TEST/ in the current directory.
|
||||
There is a toplevel 'make distcheck' target, which will build a dist
|
||||
tarball, try to build it, install files to a temporary prefix, make
|
||||
clean it, make a distribution, and compare the files left over to the
|
||||
files originally in the tarball: they should be the same. But this
|
||||
takes about 15 minutes to run on my 1.1 Ghz computer, so it's not for
|
||||
the faint of heart.
|
||||
|
||||
Lots of files? Use $(wildcard *.foo)
|
||||
------------------------------------
|
||||
|
||||
When specifying the sources to a library or executable, wildcards are
|
||||
not encouraged; in fact they're not allowed if you use library.make or
|
||||
executable.make. But there are times when they're useful, eg:
|
||||
|
||||
```
|
||||
DISTFILES = $(wildcard Test/*.in) $(wildcard Test/*.out)
|
||||
```
|
||||
|
||||
Just so you know that `make` has this feature.
|
||||
|
||||
Referencing files in other directories? Use $(topdir).
|
||||
------------------------------------------------------
|
||||
|
||||
$(topdir) is the path to the top directory from the current build
|
||||
directory. Basically it's a sequence of ../.. computed from the value
|
||||
that you give $(thisdir) at the top of your Makefile. Try to reference
|
||||
things from $(topdir), so your code can be moved or cut-and-pasted
|
||||
around with a minimum of fuss.
|
||||
|
||||
Conditional building? Use ifdef/ifndef/endif
|
||||
--------------------------------------------
|
||||
|
||||
Now in general we want to avoid conditional building, but sometimes
|
||||
something doesn't work on Linux or already exists on Windows or
|
||||
whatnot. (See below on recommended form for how to build
|
||||
platform-specifically.) GNU Make supports the following construction:
|
||||
|
||||
```
|
||||
BUILD_EXPERIMENTAL = yes
|
||||
|
||||
ifdef BUILD_EXPERIMENTAL
|
||||
experimental_stuff = my-experiment.exe
|
||||
else
|
||||
experimental_stuff =
|
||||
endif
|
||||
|
||||
all-local: my-sane.exe $(experimental_stuff)
|
||||
```
|
||||
|
||||
'ifdef' means 'if the variable is set to nonempty', so you could have
|
||||
|
||||
```
|
||||
BUILD_EXPERIMENTAL = colorless green ideas sleep furiously
|
||||
```
|
||||
|
||||
and Make would be happy. I hope that the meaning of 'ifndef' should be
|
||||
obvious. If you want to only sometimes build a target, the above
|
||||
construction is the recommended way to go about it; it's nice to have
|
||||
the rules exist in a Makefile even if they aren't invoked.
|
||||
|
||||
If you want to see why conditionals aren't nice, take a look at
|
||||
library.make or class/corlib/Makefile.
|
||||
|
||||
|
||||
'Private' directories that shouldn't be built by default? Use DIST_ONLY_SUBDIRS
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
Several of the MCS class libraries have demo or experimental
|
||||
implementations that depend on things not included with MCS (say,
|
||||
Gtk#). We don't want to build them by default, because the user might
|
||||
not have those dependencies installed, but it's nice to have a
|
||||
Makefile for them to be built nicely.
|
||||
|
||||
First of all, there's nothing stopping you from writing a Makefile for
|
||||
such a directory; just don't put it in the SUBDIRS line of its parent
|
||||
directory. That way, you can do all the normal build things like 'make
|
||||
all' or 'make clean' in that directory, but people trying to bootstrap
|
||||
their system won't run into problems.
|
||||
|
||||
At the same time you probably want to include this directory in the
|
||||
distribution so that people can use your demo or experimental code if
|
||||
they know what they're doing. Hence the variable
|
||||
$(DIST_ONLY_SUBDIRS). As you might guess, it's like the SUBDIRS
|
||||
variable: it lists subdirectories that a regular shouldn't recurse
|
||||
into, but should have their 'make dist' rules invoked.
|
||||
|
||||
Say you've written Mono.MyFancyLib.dll and you have
|
||||
a demo app using Gtk# called MyFancyDemo. The Makefile rules might
|
||||
look like this:
|
||||
|
||||
class/Mono.MyFancyLib/Makefile
|
||||
```
|
||||
thisdir = class/Mono.MyFancyLib
|
||||
SUBDIRS =
|
||||
DIST_ONLY_SUBDIRS = MyFancyDemo
|
||||
include ../../build/rules.make
|
||||
|
||||
LIBRARY = Mono.MyFancyLib.dll
|
||||
LIB_MCS_FLAGS = /r:System.dll
|
||||
TEST_MCS_FLAGS = $(LIB_MCS_FLAGS)
|
||||
|
||||
include ../../build/library.make
|
||||
```
|
||||
|
||||
class/Mono.MyFancyLib/MyFancyDemo/Makefile
|
||||
```
|
||||
thisdir = class/Mono.MyFancyLib/MyFancyDemo
|
||||
SUBDIRS =
|
||||
include ../../../build/rules.make
|
||||
|
||||
PROGRAM = FancyDemo.exe
|
||||
LOCAL_MCS_FLAGS = /r:gtk-sharp.dll
|
||||
|
||||
include ../../../build/executable.make
|
||||
```
|
||||
|
||||
|
||||
|
||||
|
||||
Special recursion needs?
|
||||
------------------------
|
||||
|
||||
By default, rules.make defines the all, install, clean, etc. targets
|
||||
to look something like this:
|
||||
|
||||
```
|
||||
all: all-recursive
|
||||
$(MAKE) all-local
|
||||
```
|
||||
|
||||
Sometimes that doesn't cut it; say for example you want to check for
|
||||
something before doing a lengthy recursive build (see
|
||||
$(topdir)/Makefile) or you have a something like this
|
||||
|
||||
```
|
||||
class/MyLibrary:
|
||||
Build MyLibrary.dll
|
||||
class/MyLibrary/Test:
|
||||
Build TestMyLibrary.exe
|
||||
```
|
||||
|
||||
`make clean test` will fail here, because the build will happen in
|
||||
the Test subdirectory first, so there will be no `MyLibrary.dll` to link
|
||||
against. (Unless you write a nasty evil relative path rule which is
|
||||
strongly discouraged.)
|
||||
|
||||
Anyway, to solve this problem you can do
|
||||
|
||||
```
|
||||
thisdir = class/MyLibrary
|
||||
SUBDIRS = Test
|
||||
include ../../build/rules.make
|
||||
|
||||
# Normally, make runs 'all-recursive' first, and then 'all-local'
|
||||
# With this, we ensure that 'all-local' is executed first.
|
||||
all-recursive: all-local
|
||||
|
||||
test-recursive: test-local
|
||||
...
|
||||
```
|
||||
|
||||
|
||||
A few implementation details
|
||||
----------------------------
|
||||
|
||||
The way rules.make does its recursion is very standard; it maps
|
||||
`{all,install,clean,dist,test}` to `$@-recursive`, which executes that rule
|
||||
in each directory in `$(SUBDIRS)`, and then calls `$@-local` bin the current
|
||||
directory. So something that gets built in a subdirectory cannot rely on
|
||||
something that gets built in its parent directory. If this is a problem,
|
||||
see the previous section. Note that the recursive rule for 'dist' is
|
||||
different; it makes dist-recursive in subdirectories, so you at least
|
||||
have to define that rule.
|
||||
|
||||
Note that even a directory that doesn't, for example, have any tests
|
||||
must still define test-local; otherwise 'make test' run from the
|
||||
toplevel directory will break.
|
||||
|
||||
Flags for Tools
|
||||
---------------
|
||||
|
||||
We want to make it so that the user can specify certain flags to
|
||||
always be given to a tool, so there's a general way of implementing
|
||||
FLAGS variables:
|
||||
|
||||
* `$(foo_FLAGS)` remains unset or defaulted to something
|
||||
sensible; the user can provide overrides this way.
|
||||
|
||||
* `$(LOCAL_foo_FLAGS)` is set in a specific Makefile to
|
||||
provide necessary values.
|
||||
|
||||
* `$(PLATFORM_foo_FLAGS)` is set in the platform configuration
|
||||
to provide platform-specific values.
|
||||
|
||||
* `$(PROFILE_foo_FLAGS)` is set in the profile configuration
|
||||
to provide profile-specific values.
|
||||
|
||||
* `$(USE_foo_FLAGS)` is defined to be the combination of all of
|
||||
the above, and it's what is actually passed to $(foo).
|
||||
|
||||
`$(MCS_FLAGS)` and `$(CFLAGS)` follow this model. If you end up finding
|
||||
that another tool is used commonly (hm, jay...), please follow this form.
|
||||
|
||||
Portability tips
|
||||
----------------
|
||||
|
||||
Always use the icky Windows /argument way of passing parameters to the C#
|
||||
compiler so that csc can be used.
|
||||
|
||||
Always use `/r:foo.dll`, not `/r:foo`. Windows requires the former.
|
||||
|
||||
Use `/r:$(corlib)`, not `/r:corlib`.
|
||||
|
||||
If you're writing shell script code as part of a make rule, remember
|
||||
that Windows has command-line length limits. So something like
|
||||
|
||||
```
|
||||
mytool $(all_the_sources_to_corlib)
|
||||
```
|
||||
|
||||
Is probably going to cause problems. As I understand it,
|
||||
|
||||
```
|
||||
for f in $(all_the_sources_to_corlib) ; do ...
|
||||
```
|
||||
|
||||
is ok, since the shell itself doesn't have those limitations. Other
|
||||
than that, you should still try to write fairly portable shell
|
||||
script. Linux and Cygwin both use the GNU utilities, but there's at
|
||||
least one hardy soul trying to build Mono on HP/UX, and no doubt there
|
||||
will be ports to more Unices as time goes on.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Misc
|
||||
----
|
||||
|
||||
We still don't use `/d:NET_1_1`; it causes some build problems right
|
||||
now.
|
||||
|
||||
There's a hack in class/System.Data/Makefile to work around a very
|
||||
strange crash in the runtime with some custom attribute stuff. It'd be
|
||||
nice to fix it.
|
||||
|
||||
Also, there's a /lib:$(prefix)/lib in the System.dll Makefile, which
|
||||
is for some reason necessary if System.Xml.dll hasn't been built yet.
|
||||
(Well, it's necessary because of the /r:System.Xml.dll, but that
|
||||
should be in the search path, it seems.)
|
||||
|
||||
A lot of the weird targets in the old makefiles have been dropped; I
|
||||
have a feeling that a lot of them are archaic and not needed anymore.
|
||||
|
||||
I'd really like to write a build tool in C#. It would be nice to have
|
||||
something really extensible and well-designed and clean. NAnt is,
|
||||
IMHO, an apalling abomination and a tragically bad attempt at solving
|
||||
the software building problem. Just so you know.
|
||||
|
||||
(On the other hand, NUnit is really neat.)
|
||||
|
||||
Peter
|
||||
@@ -38,7 +38,7 @@ static class Consts
|
||||
public const string MonoCompany = "Mono development team";
|
||||
public const string MonoProduct = "Mono Common Language Infrastructure";
|
||||
public const string MonoCopyright = "(c) Various Mono authors";
|
||||
public const string MonoCorlibVersion = "@MONO_CORLIB_VERSION@";
|
||||
public const int MonoCorlibVersion = @MONO_CORLIB_VERSION@;
|
||||
|
||||
#if MOBILE
|
||||
// Versions of .NET Framework for Silverlight 4.0
|
||||
|
||||
@@ -45,8 +45,6 @@ static partial class SR
|
||||
{
|
||||
return string.Format (CultureInfo.InvariantCulture, resourceFormat, p1, p2, p3);
|
||||
}
|
||||
|
||||
internal static string GetResourceString (string str) => str;
|
||||
}
|
||||
|
||||
#if !INSIDE_CORLIB
|
||||
|
||||
@@ -1,13 +1,14 @@
|
||||
using System;
|
||||
|
||||
interface II
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
class X
|
||||
{
|
||||
static void Foo (II a = default (II), II b = default, II c = (II) null)
|
||||
class X {
|
||||
// Check installed compiler
|
||||
static void Generic<T> ()
|
||||
{
|
||||
// we use 'var' all around in the compiler sources
|
||||
var x = new X ();
|
||||
}
|
||||
|
||||
void DefaultParametersAvailable (int i = 3)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -41,9 +42,9 @@ class X
|
||||
|
||||
Version min_mono_version;
|
||||
#if __MonoCS__
|
||||
min_mono_version = new Version (5, 19);
|
||||
min_mono_version = new Version (5, 11);
|
||||
#else
|
||||
min_mono_version = new Version (5, 10);
|
||||
min_mono_version = new Version (4, 9);
|
||||
#endif
|
||||
|
||||
if (version < min_mono_version)
|
||||
|
||||
@@ -34,8 +34,7 @@ sysconfdir = $(prefix)/etc
|
||||
RUNTIME = false
|
||||
MONO_PATH_TOP = $(topdir)/class/lib/$(PROFILE_DIRECTORY)/
|
||||
MONO_PATH_TESTS = $(MONO_PATH_TOP)/tests
|
||||
TEST_MONO_PATH = $(MONO_PATH_TOP)$(PLATFORM_PATH_SEPARATOR)$(MONO_PATH_TESTS)
|
||||
TEST_RUNTIME = MONO_PATH="$(TEST_MONO_PATH)$(PLATFORM_PATH_SEPARATOR).$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH" $(RUNTIME) --debug
|
||||
TEST_RUNTIME = MONO_PATH="$(MONO_PATH_TOP)$(PLATFORM_PATH_SEPARATOR)$(TEST_MONO_PATH)$(PLATFORM_PATH_SEPARATOR)$(MONO_PATH_TESTS)$(PLATFORM_PATH_SEPARATOR).$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH" $(RUNTIME) --debug
|
||||
|
||||
# In case you want to add MCS_FLAGS, this lets you not have to
|
||||
# keep track of the default value
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
API_INFO = $(MONO_PATH) $(RUNTIME) $(topdir)/class/lib/$(PROFILE)/mono-api-info.exe
|
||||
API_DIFF = $(MONO_PATH) $(RUNTIME) $(topdir)/class/lib/$(PROFILE)/mono-api-diff.exe
|
||||
API_DIFF = $(MONO_PATH) $(RUNTIME) $(topdir)/tools/corcompare/mono-api-diff.exe
|
||||
TRANSFORM = $(MONO_PATH) $(RUNTIME) $(topdir)/tools/corcompare/transform.exe
|
||||
|
||||
OBJECTS = $(topdir)/build/corcompare/$(LIBRARY_NAME:.dll=.html)
|
||||
|
||||
@@ -42,17 +42,15 @@ executable_CLEAN_FILES += $(build_lib) $(build_lib).so $(build_lib).mdb $(build_
|
||||
|
||||
makefrag = $(depsdir)/$(PROFILE)_$(base_prog).makefrag
|
||||
|
||||
LIB_REFS_ALL = $(DEFAULT_REFERENCES) $(LIB_REFS)
|
||||
|
||||
ifdef TARGET_NET_REFERENCE
|
||||
# System*, mscorlib references come from the TARGET_NET_REFERENCE dir, others from the profile dir
|
||||
LIB_REFS_MONO = $(call _FILTER_OUT,System,$(call _FILTER_OUT,mscorlib,$(LIB_REFS_ALL)))
|
||||
LIB_REFS_SYSTEM = $(filter-out $(LIB_REFS_MONO),$(LIB_REFS_ALL))
|
||||
# System.*.dll references come from the TARGET_NET_REFERENCE dir, others from the profile dir
|
||||
LIB_REFS_MONO = $(call _FILTER_OUT,System,$(LIB_REFS))
|
||||
LIB_REFS_SYSTEM = $(filter-out $(LIB_REFS_MONO),$(LIB_REFS))
|
||||
|
||||
MCS_REFERENCES = $(patsubst %,-r:$(topdir)/../external/binary-reference-assemblies/$(TARGET_NET_REFERENCE)/%.dll,$(LIB_REFS_SYSTEM))
|
||||
MCS_REFERENCES += $(patsubst %,-r:$(topdir)/class/lib/$(PROFILE_DIRECTORY)/%.dll,$(LIB_REFS_MONO))
|
||||
else
|
||||
MCS_REFERENCES = $(patsubst %,-r:$(topdir)/class/lib/$(PROFILE_DIRECTORY)/%.dll,$(LIB_REFS_ALL))
|
||||
MCS_REFERENCES = $(patsubst %,-r:$(topdir)/class/lib/$(PROFILE_DIRECTORY)/%.dll,$(LIB_REFS))
|
||||
endif
|
||||
|
||||
ifdef KEYFILE
|
||||
@@ -191,7 +189,6 @@ csproj-local:
|
||||
echo $(thisdir):$$config_file >> $(topdir)/../msvc/scripts/order; \
|
||||
(echo $(is_boot); \
|
||||
echo $(USE_MCS_FLAGS) $(LIBRARY_FLAGS) $(LIB_MCS_FLAGS) $(patsubst %,-r:%,$(LIB_REFS)); \
|
||||
echo $(sourcefile); \
|
||||
echo $(PROGRAM); \
|
||||
echo $(BUILT_SOURCES_cmdline); \
|
||||
echo $(build_lib); \
|
||||
|
||||
@@ -1,710 +0,0 @@
|
||||
using System;
|
||||
using System.Text;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
|
||||
public static class Program {
|
||||
public static int Main (string[] _args) {
|
||||
var args = new List<string> (_args);
|
||||
bool useStdout = false, showHelp = false, strictMode = false;
|
||||
string baseDir = null;
|
||||
|
||||
for (int i = 0; i < args.Count; i++) {
|
||||
var arg = args[i];
|
||||
if (!arg.StartsWith ("-"))
|
||||
continue;
|
||||
|
||||
string argValue = null;
|
||||
var offset = arg.IndexOf(':');
|
||||
if (offset >= 0) {
|
||||
argValue = arg.Substring (offset + 1);
|
||||
arg = arg.Substring (0, offset);
|
||||
}
|
||||
|
||||
switch (arg) {
|
||||
case "-?":
|
||||
case "--help":
|
||||
case "-h":
|
||||
showHelp = true;
|
||||
break;
|
||||
case "--trace":
|
||||
if (argValue != null)
|
||||
SourcesParser.TraceLevel = int.Parse(argValue);
|
||||
else
|
||||
SourcesParser.TraceLevel = 1;
|
||||
break;
|
||||
case "--stdout":
|
||||
useStdout = true;
|
||||
break;
|
||||
case "--strict":
|
||||
strictMode = true;
|
||||
break;
|
||||
case "--basedir":
|
||||
baseDir = argValue;
|
||||
break;
|
||||
default:
|
||||
Console.Error.WriteLine ($"// Unrecognized switch {arg}. Aborting.");
|
||||
return 1;
|
||||
}
|
||||
|
||||
args.RemoveAt (i);
|
||||
i--;
|
||||
}
|
||||
|
||||
if ((args.Count < 3) || (args.Count > 4))
|
||||
showHelp = true;
|
||||
|
||||
if (showHelp) {
|
||||
Console.Error.WriteLine ("Usage: mcs/build/gensources.exe [options] (outputFileName|--stdout) libraryDirectoryAndName platformName profileName");
|
||||
Console.Error.WriteLine ("or mcs/build/gensources.exe [options] (outputFileName|--stdout) (--baseDir:<dir>) sourcesFile exclusionsFile");
|
||||
Console.Error.WriteLine ("You can specify * for platformName and profileName to read all sources files");
|
||||
Console.Error.WriteLine ("Available options:");
|
||||
Console.Error.WriteLine ("--help -h -?");
|
||||
Console.Error.WriteLine (" Show command line info");
|
||||
Console.Error.WriteLine ("--trace:n");
|
||||
Console.Error.WriteLine (" Enable diagnostic output, at tracing level n (1-4)");
|
||||
Console.Error.WriteLine ("--stdout");
|
||||
Console.Error.WriteLine (" Writes results to standard output (omit outputFileName if you use this)");
|
||||
Console.Error.WriteLine ("--strict");
|
||||
Console.Error.WriteLine (" Produces an error exit code if files or directories are invalid/missing or other warnings occur");
|
||||
Console.Error.WriteLine ("--basedir:<dir>");
|
||||
Console.Error.WriteLine (" Sets the base directory when reading a single sources/exclusions pair (default is the directory containing the sources file)");
|
||||
return 1;
|
||||
}
|
||||
|
||||
var myAssembly = Assembly.GetExecutingAssembly ();
|
||||
var codeBase = new Uri (myAssembly.CodeBase);
|
||||
var executablePath = Path.GetFullPath (codeBase.LocalPath);
|
||||
var executableDirectory = Path.GetDirectoryName (executablePath);
|
||||
|
||||
var outFile = Path.GetFullPath (args[0]);
|
||||
|
||||
var platformsFolder = Path.Combine (executableDirectory, "platforms");
|
||||
var profilesFolder = Path.Combine (executableDirectory, "profiles");
|
||||
if (!Directory.Exists (platformsFolder) || !Directory.Exists (profilesFolder)) {
|
||||
Console.Error.WriteLine ($"// Platforms and/or profiles folders are missing: '{platformsFolder}' '{profilesFolder}'. Aborting.");
|
||||
return 1;
|
||||
}
|
||||
|
||||
var parser = new SourcesParser (platformsFolder, profilesFolder);
|
||||
|
||||
ParseResult result;
|
||||
|
||||
if (args.Count == 3) {
|
||||
var sourcesFile = Path.GetFullPath (args[1]);
|
||||
var excludesFile = Path.GetFullPath (args[2]);
|
||||
var directory = Path.GetDirectoryName (sourcesFile);
|
||||
if ((Path.GetDirectoryName (excludesFile) != directory) && (baseDir == null)) {
|
||||
Console.Error.WriteLine ("// Sources and exclusions files are in different directories. Aborting.");
|
||||
return 1;
|
||||
}
|
||||
|
||||
result = parser.Parse (baseDir ?? directory, sourcesFile, excludesFile);
|
||||
|
||||
if (SourcesParser.TraceLevel > 0)
|
||||
Console.Error.WriteLine ($"// Writing sources from {sourcesFile} minus {excludesFile}, to {outFile}.");
|
||||
} else if (args.Count == 4) {
|
||||
if (baseDir != null)
|
||||
Console.Error.WriteLine ($"// WARNING: baseDir has no effect in this mode");
|
||||
|
||||
var libraryFullName = Path.GetFullPath (args[1]);
|
||||
var platformName = args[2].Trim ();
|
||||
var profileName = args[3].Trim ();
|
||||
var libraryDirectory = Path.GetDirectoryName (libraryFullName);
|
||||
var libraryName = Path.GetFileName (libraryFullName);
|
||||
result = parser.Parse (libraryDirectory, libraryName, platformName, profileName);
|
||||
|
||||
if (SourcesParser.TraceLevel > 0)
|
||||
Console.Error.WriteLine ($"// Writing sources for platform {platformName} and profile {profileName}, relative to {libraryDirectory}, to {outFile}.");
|
||||
} else {
|
||||
throw new Exception ();
|
||||
}
|
||||
|
||||
var fileNames = result.GetMatches ()
|
||||
.OrderBy (e => e.RelativePath, StringComparer.Ordinal)
|
||||
.Select (e => e.RelativePath)
|
||||
.Distinct ()
|
||||
.ToList ();
|
||||
|
||||
var unexpectedEmptyResult = (fileNames.Count == 0);
|
||||
|
||||
// HACK: We have sources files that are literally empty, so as long as *some* sources files were
|
||||
// parsed during this invocation and they are all empty, producing no matching file names is not
|
||||
// an error.
|
||||
if ((result.SourcesFiles.Count > 0) && result.SourcesFiles.Values.All(sf => sf.Sources.Count == 0))
|
||||
unexpectedEmptyResult = false;
|
||||
|
||||
if ((result.ErrorCount > 0) || unexpectedEmptyResult) {
|
||||
Console.Error.WriteLine ($"// gensources produced {result.ErrorCount} error(s) and a set of {fileNames.Count} filename(s)");
|
||||
Console.Error.WriteLine ($"// Invoked with '{Environment.CommandLine}'");
|
||||
Console.Error.WriteLine ($"// Working directory was '{Environment.CurrentDirectory}'");
|
||||
|
||||
if (strictMode) {
|
||||
// HACK: Make ignores non-zero exit codes so we need to delete the sources file ???
|
||||
if (!useStdout && File.Exists (outFile))
|
||||
File.Delete (outFile);
|
||||
|
||||
return result.ErrorCount + 1;
|
||||
}
|
||||
}
|
||||
|
||||
TextWriter output;
|
||||
if (useStdout)
|
||||
output = Console.Out;
|
||||
else
|
||||
output = new StreamWriter (outFile);
|
||||
|
||||
using (output) {
|
||||
foreach (var fileName in fileNames)
|
||||
output.WriteLine (fileName);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
public class SourcesFile {
|
||||
public readonly string FileName;
|
||||
public readonly bool IsExclusion;
|
||||
|
||||
public readonly List<ParseEntry> Sources = new List<ParseEntry> ();
|
||||
public readonly List<ParseEntry> Exclusions = new List<ParseEntry> ();
|
||||
public readonly List<SourcesFile> Includes = new List<SourcesFile> ();
|
||||
|
||||
public SourcesFile (string fileName, bool isExclusion) {
|
||||
FileName = fileName;
|
||||
IsExclusion = isExclusion;
|
||||
}
|
||||
}
|
||||
|
||||
public struct ParseEntry {
|
||||
public string Directory;
|
||||
public string Pattern;
|
||||
}
|
||||
|
||||
public struct MatchEntry {
|
||||
public SourcesFile SourcesFile;
|
||||
public string RelativePath;
|
||||
}
|
||||
|
||||
public class TargetParseResult {
|
||||
public (string hostPlatform, string profile) Key;
|
||||
public SourcesFile Sources, Exclusions;
|
||||
public bool IsFallback;
|
||||
|
||||
public override string ToString () {
|
||||
var fallbackString = IsFallback ? " fallback" : "";
|
||||
return $"{Key}{fallbackString} -> [{Sources?.FileName}, {Exclusions?.FileName}]";
|
||||
}
|
||||
}
|
||||
|
||||
public class ParseResult {
|
||||
public readonly string LibraryDirectory;
|
||||
|
||||
public readonly Dictionary<(string hostPlatform, string profile), TargetParseResult> TargetDictionary = new Dictionary<(string hostPlatform, string profile), TargetParseResult> ();
|
||||
|
||||
public readonly Dictionary<string, SourcesFile> SourcesFiles = new Dictionary<string, SourcesFile> ();
|
||||
public readonly Dictionary<string, SourcesFile> ExclusionFiles = new Dictionary<string, SourcesFile> ();
|
||||
|
||||
// FIXME: This is a bad spot for this value but enumerators don't have outparam support
|
||||
public int ErrorCount = 0;
|
||||
|
||||
public ParseResult (string libraryDirectory) {
|
||||
LibraryDirectory = Path.GetFullPath (libraryDirectory);
|
||||
}
|
||||
|
||||
public IEnumerable<TargetParseResult> Targets {
|
||||
get {
|
||||
return TargetDictionary.Values;
|
||||
}
|
||||
}
|
||||
|
||||
private string GetRelativePath (string fullPath, string relativeToDirectory) {
|
||||
fullPath = fullPath.Replace ("\\", "/");
|
||||
relativeToDirectory = relativeToDirectory.Replace ("\\", "/");
|
||||
|
||||
if (!relativeToDirectory.EndsWith ("/"))
|
||||
relativeToDirectory += "/";
|
||||
|
||||
try {
|
||||
var dirUri = new Uri (relativeToDirectory);
|
||||
var pathUri = new Uri (fullPath);
|
||||
|
||||
var relativePath = Uri.UnescapeDataString (
|
||||
dirUri.MakeRelativeUri (pathUri).OriginalString
|
||||
).Replace ("/", SourcesParser.DirectorySeparator)
|
||||
.Replace (SourcesParser.DirectorySeparator + SourcesParser.DirectorySeparator, SourcesParser.DirectorySeparator);
|
||||
|
||||
return relativePath;
|
||||
} catch (Exception) {
|
||||
Console.Error.WriteLine ($"// Parse error when treating '{fullPath}' as a URI relative to directory '{relativeToDirectory}'");
|
||||
ErrorCount += 1;
|
||||
return fullPath;
|
||||
}
|
||||
|
||||
/*
|
||||
if (SourcesParser.TraceLevel >= 4)
|
||||
Console.Error.WriteLine ($"// {fullPath} -> {relativePath}");
|
||||
*/
|
||||
}
|
||||
|
||||
public IEnumerable<MatchEntry> EnumerateMatches (
|
||||
SourcesFile sourcesFile,
|
||||
IEnumerable<ParseEntry> entries,
|
||||
bool forExclusionsList
|
||||
) {
|
||||
var patternChars = new [] { '*', '?' };
|
||||
|
||||
var isFirstError = true;
|
||||
|
||||
foreach (var entry in entries) {
|
||||
var absolutePath = Path.GetFullPath (Path.Combine (entry.Directory, entry.Pattern));
|
||||
var absoluteDirectory = Path.GetDirectoryName (absolutePath);
|
||||
var absolutePattern = Path.GetFileName (absolutePath);
|
||||
|
||||
if (SourcesParser.TraceLevel >= 4) {
|
||||
if ((absolutePattern != entry.Pattern) || (absoluteDirectory != entry.Directory))
|
||||
Console.Error.WriteLine ($"// {entry.Directory} / {entry.Pattern} -> {absoluteDirectory} / {absolutePattern}");
|
||||
}
|
||||
|
||||
if (!Directory.Exists (absoluteDirectory)) {
|
||||
if (isFirstError) {
|
||||
isFirstError = false;
|
||||
Console.Error.WriteLine ($"// Error(s) in file {sourcesFile.FileName}:");
|
||||
}
|
||||
|
||||
if (forExclusionsList) {
|
||||
Console.Error.WriteLine ($"(ignored) Directory does not exist: '{Path.GetFullPath (absoluteDirectory)}'");
|
||||
} else {
|
||||
Console.Error.WriteLine ($"Directory does not exist: '{Path.GetFullPath (absoluteDirectory)}'");
|
||||
ErrorCount += 1;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
if (absolutePattern.IndexOfAny (patternChars) >= 0) {
|
||||
var matchingFiles = Directory.GetFiles (absoluteDirectory, absolutePattern);
|
||||
if (matchingFiles.Length == 0) {
|
||||
if (SourcesParser.TraceLevel > 0)
|
||||
Console.Error.WriteLine ($"// No matches for pattern '{absolutePattern}'");
|
||||
}
|
||||
|
||||
foreach (var fileName in matchingFiles) {
|
||||
var relativePath = GetRelativePath (fileName, LibraryDirectory);
|
||||
yield return new MatchEntry {
|
||||
SourcesFile = sourcesFile,
|
||||
RelativePath = relativePath,
|
||||
};
|
||||
}
|
||||
} else {
|
||||
if (!File.Exists (absolutePath)) {
|
||||
if (isFirstError) {
|
||||
isFirstError = false;
|
||||
Console.Error.WriteLine ($"// Error(s) in file {sourcesFile.FileName}:");
|
||||
}
|
||||
|
||||
if (forExclusionsList) {
|
||||
Console.Error.WriteLine ($"(ignored) File does not exist: '{absolutePath}'");
|
||||
} else {
|
||||
Console.Error.WriteLine ($"File does not exist: '{absolutePath}'");
|
||||
ErrorCount += 1;
|
||||
}
|
||||
} else {
|
||||
var relativePath = GetRelativePath (absolutePath, LibraryDirectory);
|
||||
yield return new MatchEntry {
|
||||
SourcesFile = sourcesFile,
|
||||
RelativePath = relativePath,
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private IEnumerable<MatchEntry> GetMatchesFromFile (
|
||||
SourcesFile sourcesFile, HashSet<string> excludedFiles = null
|
||||
) {
|
||||
if (sourcesFile == null)
|
||||
yield break;
|
||||
|
||||
if (excludedFiles == null)
|
||||
excludedFiles = new HashSet<string> (StringComparer.Ordinal);
|
||||
|
||||
foreach (var m in EnumerateMatches (sourcesFile, sourcesFile.Exclusions, true))
|
||||
excludedFiles.Add (m.RelativePath);
|
||||
|
||||
foreach (var include in sourcesFile.Includes) {
|
||||
foreach (var m in GetMatchesFromFile (include, excludedFiles))
|
||||
yield return m;
|
||||
}
|
||||
|
||||
// FIXME: This is order-sensitive
|
||||
foreach (var entry in EnumerateMatches (sourcesFile, sourcesFile.Sources, false)) {
|
||||
if (excludedFiles.Contains (entry.RelativePath)) {
|
||||
if (SourcesParser.TraceLevel >= 3)
|
||||
Console.Error.WriteLine ($"// Excluding {entry.RelativePath}");
|
||||
continue;
|
||||
}
|
||||
|
||||
yield return entry;
|
||||
}
|
||||
}
|
||||
|
||||
public IEnumerable<MatchEntry> GetMatches (TargetParseResult target = null) {
|
||||
var excludedFiles = new HashSet<string> (StringComparer.Ordinal);
|
||||
|
||||
if (target == null) {
|
||||
if (TargetDictionary.Count == 0)
|
||||
yield break;
|
||||
|
||||
target = Targets.First ();
|
||||
}
|
||||
|
||||
if (target == null)
|
||||
throw new ArgumentNullException ("target");
|
||||
|
||||
if (SourcesParser.TraceLevel >= 3)
|
||||
Console.Error.WriteLine ($"// Scanning sources file tree for {target.Key}");
|
||||
|
||||
int count = 0;
|
||||
foreach (var m in GetMatchesFromFile (target.Exclusions, excludedFiles))
|
||||
excludedFiles.Add (m.RelativePath);
|
||||
|
||||
foreach (var m in GetMatchesFromFile (target.Sources, excludedFiles)) {
|
||||
count++;
|
||||
yield return m;
|
||||
}
|
||||
|
||||
if (SourcesParser.TraceLevel >= 3)
|
||||
Console.Error.WriteLine ($"// Scan complete. Generated {count} successful matches.");
|
||||
}
|
||||
}
|
||||
|
||||
public class SourcesParser {
|
||||
public static readonly string DirectorySeparator = new String (Path.DirectorySeparatorChar, 1);
|
||||
public static int TraceLevel = 0;
|
||||
|
||||
private class State {
|
||||
public ParseResult Result;
|
||||
public string HostPlatform;
|
||||
public string ProfileName;
|
||||
|
||||
public int SourcesFilesParsed, ExclusionsFilesParsed;
|
||||
}
|
||||
|
||||
public readonly string[] AllHostPlatformNames;
|
||||
public readonly string[] AllProfileNames;
|
||||
|
||||
private int ParseDepth = 0;
|
||||
|
||||
public SourcesParser (
|
||||
string platformsFolder, string profilesFolder
|
||||
) {
|
||||
AllHostPlatformNames = Directory.GetFiles (platformsFolder, "*.make")
|
||||
.Select (Path.GetFileNameWithoutExtension)
|
||||
.ToArray ();
|
||||
AllProfileNames = Directory.GetFiles (profilesFolder, "*.make")
|
||||
.Select (Path.GetFileNameWithoutExtension)
|
||||
.ToArray ();
|
||||
}
|
||||
|
||||
public ParseResult Parse (string libraryDirectory, string sourcesFileName, string exclusionsFileName) {
|
||||
var state = new State {
|
||||
Result = new ParseResult (libraryDirectory)
|
||||
};
|
||||
|
||||
var tpr = new TargetParseResult {
|
||||
Key = (hostPlatform: null, profile: null)
|
||||
};
|
||||
|
||||
var parsedTarget = ParseIntoTarget (state, tpr, sourcesFileName, exclusionsFileName, null, overrideDirectory: libraryDirectory);
|
||||
|
||||
PrintSummary (state, sourcesFileName);
|
||||
return state.Result;
|
||||
}
|
||||
|
||||
public ParseResult Parse (string libraryDirectory, string libraryName, string hostPlatform, string profile) {
|
||||
var state = new State {
|
||||
Result = new ParseResult (libraryDirectory),
|
||||
ProfileName = profile,
|
||||
HostPlatform = hostPlatform
|
||||
};
|
||||
|
||||
var testPath = Path.Combine (libraryDirectory, $"{hostPlatform}_{profile}_{libraryName}");
|
||||
var ok = TryParseTargetInto (state, testPath);
|
||||
|
||||
if (ok) {
|
||||
PrintSummary (state, testPath);
|
||||
return state.Result;
|
||||
}
|
||||
|
||||
state.HostPlatform = null;
|
||||
|
||||
testPath = Path.Combine (libraryDirectory, $"{profile}_{libraryName}");
|
||||
ok = TryParseTargetInto (state, testPath);
|
||||
|
||||
if (ok) {
|
||||
PrintSummary (state, testPath);
|
||||
return state.Result;
|
||||
}
|
||||
|
||||
testPath = Path.Combine (libraryDirectory, $"{hostPlatform}_defaultprofile_{libraryName}");
|
||||
ok = TryParseTargetInto (state, testPath);
|
||||
|
||||
if (ok) {
|
||||
PrintSummary (state, testPath);
|
||||
return state.Result;
|
||||
}
|
||||
|
||||
state.ProfileName = null;
|
||||
|
||||
testPath = Path.Combine (libraryDirectory, libraryName);
|
||||
ok = TryParseTargetInto (state, testPath);
|
||||
|
||||
PrintSummary (state, testPath);
|
||||
|
||||
return state.Result;
|
||||
}
|
||||
|
||||
private void StripFallbackTargetsOrDefaultTarget (
|
||||
State state, TargetParseResult defaultTarget, List<TargetParseResult> fallbackTargets, int maximumCount
|
||||
) {
|
||||
if (fallbackTargets.Count == maximumCount) {
|
||||
// If we didn't find any platform specific targets, remove them and just leave one single
|
||||
// platform-specific target entry
|
||||
foreach (var target in fallbackTargets)
|
||||
state.Result.TargetDictionary.Remove (target.Key);
|
||||
} else if (defaultTarget != null) {
|
||||
// Otherwise, strip the non-platform-specific target
|
||||
state.Result.TargetDictionary.Remove (defaultTarget.Key);
|
||||
}
|
||||
}
|
||||
|
||||
public ParseResult Parse (string libraryDirectory, string libraryName) {
|
||||
var state = new State {
|
||||
Result = new ParseResult (libraryDirectory)
|
||||
};
|
||||
|
||||
string originalTestPath = Path.Combine (libraryDirectory, libraryName);
|
||||
var defaultTarget = ParseTarget (state, originalTestPath, null);
|
||||
var profileFallbackTargets = new List<TargetParseResult> ();
|
||||
|
||||
foreach (var profile in AllProfileNames) {
|
||||
state.ProfileName = profile;
|
||||
state.HostPlatform = null;
|
||||
|
||||
var testPath = Path.Combine (libraryDirectory, $"{profile}_{libraryName}");
|
||||
var profileTarget = ParseTarget (state, testPath, defaultTarget);
|
||||
if ((profileTarget != null) && profileTarget.IsFallback)
|
||||
profileFallbackTargets.Add (profileTarget);
|
||||
|
||||
var fallbackTargets = new List<TargetParseResult> ();
|
||||
|
||||
foreach (var hostPlatform in AllHostPlatformNames) {
|
||||
state.HostPlatform = hostPlatform;
|
||||
|
||||
testPath = Path.Combine (libraryDirectory, $"{hostPlatform}_{profile}_{libraryName}");
|
||||
var target = ParseTarget (state, testPath, profileTarget ?? defaultTarget);
|
||||
if ((target != null) && target.IsFallback)
|
||||
fallbackTargets.Add (target);
|
||||
}
|
||||
|
||||
StripFallbackTargetsOrDefaultTarget (state, profileTarget, fallbackTargets, AllHostPlatformNames.Length);
|
||||
}
|
||||
|
||||
StripFallbackTargetsOrDefaultTarget (state, defaultTarget, profileFallbackTargets, AllProfileNames.Length);
|
||||
|
||||
var platformFallbackTargets = new List<TargetParseResult> ();
|
||||
|
||||
var ambiguousSourcesNames = new List<string> ();
|
||||
|
||||
foreach (var hostPlatform in AllHostPlatformNames) {
|
||||
state.ProfileName = null;
|
||||
state.HostPlatform = hostPlatform;
|
||||
|
||||
var testPath = Path.Combine (libraryDirectory, $"{hostPlatform}_defaultprofile_{libraryName}");
|
||||
var target = ParseTarget (state, testPath, defaultTarget);
|
||||
if ((target != null) && target.IsFallback)
|
||||
platformFallbackTargets.Add (target);
|
||||
|
||||
if ((target == null) || target.IsFallback) {
|
||||
var oldTestPath = Path.Combine (libraryDirectory, $"{hostPlatform}_{libraryName}.sources");
|
||||
if (File.Exists (oldTestPath))
|
||||
ambiguousSourcesNames.Add (oldTestPath);
|
||||
|
||||
oldTestPath = Path.Combine (libraryDirectory, $"{hostPlatform}_{libraryName}.exclude.sources");
|
||||
if (File.Exists (oldTestPath))
|
||||
ambiguousSourcesNames.Add (oldTestPath);
|
||||
}
|
||||
}
|
||||
|
||||
StripFallbackTargetsOrDefaultTarget (state, defaultTarget, platformFallbackTargets, AllHostPlatformNames.Length);
|
||||
|
||||
foreach (var path in ambiguousSourcesNames) {
|
||||
if (!state.Result.SourcesFiles.ContainsKey (path) && !state.Result.ExclusionFiles.ContainsKey (path)) {
|
||||
Console.Error.WriteLine ($"// The file '{path}' was found but not used by sources parsing. Did you mean hostPlatform_defaultprofile_{libraryName}?");
|
||||
state.Result.ErrorCount += 1;
|
||||
}
|
||||
}
|
||||
|
||||
PrintSummary (state, originalTestPath);
|
||||
|
||||
return state.Result;
|
||||
}
|
||||
|
||||
private void PrintSummary (State state, string testPath) {
|
||||
if (TraceLevel > 0)
|
||||
Console.Error.WriteLine ($"// Parsed {state.SourcesFilesParsed} sources file(s) and {state.ExclusionsFilesParsed} exclusions file(s) from path '{testPath}'.");
|
||||
}
|
||||
|
||||
private void HandleMetaDirective (
|
||||
State state, SourcesFile file,
|
||||
string pathDirectory, string includeDirectory,
|
||||
bool asExclusionsList, string directive
|
||||
) {
|
||||
var include = "#include ";
|
||||
if (directive.StartsWith (include)) {
|
||||
var includeName = directive.Substring (include.Length).Trim ();
|
||||
var fileName = Path.Combine (includeDirectory, includeName);
|
||||
if (!File.Exists (fileName)) {
|
||||
Console.Error.WriteLine ($"// Include does not exist: {fileName}");
|
||||
state.Result.ErrorCount++;
|
||||
return;
|
||||
}
|
||||
|
||||
var newFile = ParseSingleFile (state, fileName, asExclusionsList, overrideDirectory: pathDirectory);
|
||||
if (newFile == null) {
|
||||
Console.Error.WriteLine ($"// Failed to parse included file: {fileName}");
|
||||
state.Result.ErrorCount++;
|
||||
return;
|
||||
}
|
||||
|
||||
file.Includes.Add (newFile);
|
||||
}
|
||||
}
|
||||
|
||||
private bool TryParseTargetInto (State state, string prefix) {
|
||||
var result = ParseTarget (state, prefix, null);
|
||||
return (result != null);
|
||||
}
|
||||
|
||||
private TargetParseResult ParseTarget (State state, string prefix, TargetParseResult fallbackTarget) {
|
||||
// FIXME: We determine the prefix for the pair of sources and exclusions,
|
||||
// which may not match intended behavior:
|
||||
// if linux_net_4_x_foo.sources is present, but linux_net_4_x_foo.exclude.sources is not present,
|
||||
// should net_4_x_foo.exclude.sources be used as a fallback? Maybe it should.
|
||||
// This won't do that though.
|
||||
|
||||
var tpr = new TargetParseResult {
|
||||
Key = (hostPlatform: state.HostPlatform, profile: state.ProfileName)
|
||||
};
|
||||
|
||||
var sourcesFileName = prefix + ".sources";
|
||||
var exclusionsFileName = prefix + ".exclude.sources";
|
||||
|
||||
return ParseIntoTarget (state, tpr, sourcesFileName, exclusionsFileName, fallbackTarget);
|
||||
}
|
||||
|
||||
private TargetParseResult ParseIntoTarget (
|
||||
State state, TargetParseResult tpr,
|
||||
string sourcesFileName, string exclusionsFileName,
|
||||
TargetParseResult fallbackTarget, string overrideDirectory = null
|
||||
) {
|
||||
if (!File.Exists (sourcesFileName)) {
|
||||
if (fallbackTarget != null) {
|
||||
if (TraceLevel >= 2)
|
||||
Console.Error.WriteLine($"// Not found: {sourcesFileName}, falling back to {fallbackTarget}");
|
||||
tpr.Sources = fallbackTarget.Sources;
|
||||
tpr.Exclusions = fallbackTarget.Exclusions;
|
||||
tpr.IsFallback = true;
|
||||
state.Result.TargetDictionary.Add (tpr.Key, tpr);
|
||||
return tpr;
|
||||
} else {
|
||||
if (TraceLevel >= 1)
|
||||
Console.Error.WriteLine($"// Not found: {sourcesFileName}");
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
tpr.Sources = ParseSingleFile (state, sourcesFileName, false, overrideDirectory: overrideDirectory);
|
||||
|
||||
if (File.Exists (exclusionsFileName))
|
||||
tpr.Exclusions = ParseSingleFile (state, exclusionsFileName, true, overrideDirectory: overrideDirectory);
|
||||
|
||||
state.Result.TargetDictionary.Add (tpr.Key, tpr);
|
||||
return tpr;
|
||||
}
|
||||
|
||||
private SourcesFile ParseSingleFile (State state, string fileName, bool asExclusionsList, string overrideDirectory = null) {
|
||||
var fileTable = asExclusionsList ? state.Result.ExclusionFiles : state.Result.SourcesFiles;
|
||||
|
||||
var nullStr = "<none>";
|
||||
|
||||
if (fileTable.ContainsKey (fileName)) {
|
||||
if (TraceLevel >= 2)
|
||||
Console.Error.WriteLine ($"// {new String (' ', ParseDepth * 2)}{fileName} (already parsed)");
|
||||
|
||||
return fileTable[fileName];
|
||||
} else {
|
||||
if (TraceLevel >= 2)
|
||||
Console.Error.WriteLine ($"// {new String (' ', ParseDepth * 2)}{fileName} [{state.HostPlatform ?? nullStr}] [{state.ProfileName ?? nullStr}]");
|
||||
}
|
||||
|
||||
ParseDepth += 1;
|
||||
|
||||
var includeDirectory = Path.GetDirectoryName (fileName);
|
||||
var pathDirectory = overrideDirectory ?? includeDirectory;
|
||||
var result = new SourcesFile (fileName, asExclusionsList);
|
||||
fileTable.Add (fileName, result);
|
||||
|
||||
using (var sr = new StreamReader (fileName)) {
|
||||
if (asExclusionsList)
|
||||
state.ExclusionsFilesParsed++;
|
||||
else
|
||||
state.SourcesFilesParsed++;
|
||||
|
||||
string line;
|
||||
while ((line = sr.ReadLine ()) != null) {
|
||||
if (line.StartsWith ("#")) {
|
||||
HandleMetaDirective (state, result, pathDirectory, includeDirectory, asExclusionsList, line);
|
||||
continue;
|
||||
}
|
||||
|
||||
line = line.Trim ();
|
||||
|
||||
if (String.IsNullOrWhiteSpace (line))
|
||||
continue;
|
||||
|
||||
var parts = line.Split (':');
|
||||
|
||||
if (parts.Length > 1) {
|
||||
var explicitExclusions = parts[1].Split (',');
|
||||
|
||||
// gensources.sh implemented these explicit exclusions like so:
|
||||
// ../foo/bar/*.cs:A.cs,B.cs
|
||||
// This would generate exclusions for ../foo/bar/A.cs and ../foo/bar/B.cs,
|
||||
// not ./A.cs and ./B.cs as you might expect
|
||||
|
||||
var mainPatternDirectory = Path.GetDirectoryName (parts[0]);
|
||||
|
||||
foreach (var pattern in explicitExclusions) {
|
||||
result.Exclusions.Add (new ParseEntry {
|
||||
Directory = pathDirectory,
|
||||
Pattern = Path.Combine (mainPatternDirectory, pattern)
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
(asExclusionsList ? result.Exclusions : result.Sources)
|
||||
.Add (new ParseEntry {
|
||||
Directory = pathDirectory,
|
||||
Pattern = parts[0]
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
ParseDepth -= 1;
|
||||
return result;
|
||||
}
|
||||
}
|
||||
Executable
+113
@@ -0,0 +1,113 @@
|
||||
#! /bin/sh
|
||||
|
||||
outfile=$1
|
||||
incfile=$2
|
||||
excfile=$3
|
||||
extfile=$4
|
||||
extexcfile=$5
|
||||
|
||||
process_includes_1() {
|
||||
sed -e '/^[ \t]*$/d' -e '/^[ \t]*#/d' -e '/*/d' $1 > $2
|
||||
if cmp -s $1 $2; then
|
||||
false
|
||||
else
|
||||
sed -n 's,^[ \t]*#include ,,p' $1 |
|
||||
while read inc; do
|
||||
cat $inc >> $2
|
||||
echo $outfile: $inc >> $outfile.makefrag
|
||||
echo $inc: >> $outfile.makefrag
|
||||
done
|
||||
|
||||
# expand wildcards
|
||||
sed -n '/*/p' $1 | grep -v '#' |
|
||||
while read wildc; do
|
||||
# quick syntax to exclude files:
|
||||
# ../../../MyDir/*.cs:FileToExclude1.cs,FileToExclude2.cs
|
||||
wc=`echo $wildc | cut -d \: -f 1` # ../../../MyDir/*.cs
|
||||
qexc=`echo $wildc | cut -d \: -f 2` # FileToExclude1.cs,FileToExclude2.cs
|
||||
|
||||
if test "$wc" = "$qexc"; then
|
||||
# no quick excludes - just expand the wildcard
|
||||
ls $wildc >> $2
|
||||
else
|
||||
wcdir=`echo $wildc | cut -d \* -f 1` # ../../../MyDir/
|
||||
# Enumerate files from 'FileToExclude1.cs,FileToExclude2.cs'
|
||||
# and save to $outfile.exc
|
||||
oldIFS=$IFS
|
||||
IFS=,
|
||||
for i in $qexc; do
|
||||
echo "$wcdir$i" >> $outfile.exc
|
||||
done
|
||||
IFS=$oldIFS
|
||||
ls $wc >> $2
|
||||
fi
|
||||
done
|
||||
fi
|
||||
}
|
||||
|
||||
process_includes() {
|
||||
i=$1; o=$2; t=${2}.tmp
|
||||
while process_includes_1 $i $o; do
|
||||
mv $o $t
|
||||
i=$t
|
||||
done
|
||||
rm -f $t
|
||||
}
|
||||
|
||||
check_newline_eof() {
|
||||
file=$1
|
||||
if ! test -f "$file"; then return; fi
|
||||
if ! test -z "$(tail -c 1 "$file")"; then echo "$file: missing newline at end of file."; exit 1; fi
|
||||
}
|
||||
|
||||
check_newline_eof $incfile
|
||||
check_newline_eof $excfile
|
||||
check_newline_eof $extfile
|
||||
check_newline_eof $extexcfile
|
||||
|
||||
rm -f $outfile.makefrag
|
||||
|
||||
process_includes $incfile $outfile.inc
|
||||
|
||||
if test x$extfile != x -a -f "$extfile"; then
|
||||
process_includes $extfile $outfile.ext.inc
|
||||
cat $outfile.ext.inc >> $outfile.inc
|
||||
rm -f $outfile.ext.inc
|
||||
fi
|
||||
|
||||
sort -u $outfile.inc > $outfile.inc_s
|
||||
rm -f $outfile.inc
|
||||
|
||||
|
||||
if test -n "$excfile" -a -f "$excfile"; then
|
||||
process_includes $excfile $outfile.exc
|
||||
fi
|
||||
|
||||
if test -n "$extexcfile"; then
|
||||
process_includes $extexcfile $outfile.ext_exc
|
||||
cat $outfile.ext_exc >> $outfile.exc
|
||||
rm -f $outfile.ext_exc
|
||||
fi
|
||||
|
||||
if test -f $outfile.exc; then
|
||||
# So what we're doing below with uniq -u is that we take
|
||||
# lines that have not been duplicated. This computes the
|
||||
# symmetric difference between the files. This is not
|
||||
# what we want. If a file is in the excludes but not in
|
||||
# the sources, we want that file not to show up. By duplicating the
|
||||
# excludes, we ensure that we won't end up in this failure state.
|
||||
sort -u $outfile.exc > $outfile.exc_s
|
||||
|
||||
# Duplicate excludes
|
||||
cat $outfile.exc_s >> $outfile.exc_s_dup
|
||||
cat $outfile.exc_s >> $outfile.exc_s_dup
|
||||
|
||||
rm -f $outfile.exc $outfile.exc_s
|
||||
|
||||
cat $outfile.inc_s $outfile.exc_s_dup | sort | uniq -u > $outfile
|
||||
rm -f $outfile.inc_s $outfile.exc_s_dup
|
||||
else
|
||||
mv $outfile.inc_s $outfile
|
||||
fi
|
||||
|
||||
|
||||
+33
-28
@@ -14,22 +14,23 @@
|
||||
# command line.
|
||||
#
|
||||
|
||||
LIB_REFS_FULL = $(call _FILTER_OUT,=, $(LIB_REFS)) $(DEFAULT_REFERENCES)
|
||||
# All dependent libs become dependent dirs for parallel builds
|
||||
# Have to rename to handle differences between assembly/directory names
|
||||
DEP_LIBS=$(patsubst System.Xml,System.XML,$(LIB_REFS))
|
||||
|
||||
LIB_REFS_FULL = $(call _FILTER_OUT,=, $(LIB_REFS))
|
||||
LIB_REFS_ALIAS = $(filter-out $(LIB_REFS_FULL),$(LIB_REFS))
|
||||
|
||||
# All dependent libs become dependent dirs for parallel builds
|
||||
DEP_LIBS = $(filter-out %=, $(subst =,= ,$(LIB_REFS)))
|
||||
|
||||
ifdef TARGET_NET_REFERENCE
|
||||
# System*, mscorlib references come from the TARGET_NET_REFERENCE dir, others from the profile dir
|
||||
LIB_REFS_MONO_FULL = $(call _FILTER_OUT,System,$(call _FILTER_OUT,mscorlib,$(LIB_REFS_FULL)))
|
||||
# System.*.dll references come from the TARGET_NET_REFERENCE dir, others from the profile dir
|
||||
LIB_REFS_MONO_FULL = $(call _FILTER_OUT,System,$(LIB_REFS_FULL))
|
||||
LIB_REFS_MONO_ALIAS = $(call _FILTER_OUT,System,$(LIB_REFS_ALIAS))
|
||||
|
||||
LIB_REFS_NET_FULL = $(filter-out $(LIB_REFS_MONO_FULL),$(LIB_REFS_FULL))
|
||||
LIB_REFS_NET_ALIAS = $(filter-out $(LIB_REFS_MONO_ALIAS),$(LIB_REFS_ALIAS))
|
||||
LIB_REFS_SYSTEM_FULL = $(filter-out $(LIB_REFS_MONO_FULL),$(LIB_REFS_FULL))
|
||||
LIB_REFS_SYSTEM_ALIAS = $(filter-out $(LIB_REFS_MONO_ALIAS),$(LIB_REFS_ALIAS))
|
||||
|
||||
LIB_MCS_FLAGS += $(patsubst %,-r:$(topdir)/../external/binary-reference-assemblies/$(TARGET_NET_REFERENCE)/%.dll,$(LIB_REFS_NET_FULL))
|
||||
LIB_MCS_FLAGS += $(patsubst %,-r:%.dll, $(subst =,=$(topdir)/../external/binary-reference-assemblies/$(TARGET_NET_REFERENCE)/,$(LIB_REFS_NET_ALIAS)))
|
||||
LIB_MCS_FLAGS += $(patsubst %,-r:$(topdir)/../external/binary-reference-assemblies/$(TARGET_NET_REFERENCE)/%.dll,$(LIB_REFS_SYSTEM_FULL))
|
||||
LIB_MCS_FLAGS += $(patsubst %,-r:%.dll, $(subst =,=$(topdir)/../external/binary-reference-assemblies/$(TARGET_NET_REFERENCE)/,$(LIB_REFS_SYSTEM_ALIAS)))
|
||||
|
||||
LIB_MCS_FLAGS += $(patsubst %,-r:$(topdir)/class/lib/$(PROFILE_DIRECTORY)/%.dll,$(LIB_REFS_MONO_FULL))
|
||||
LIB_MCS_FLAGS += $(patsubst %,-r:%.dll, $(subst =,=$(topdir)/class/lib/$(PROFILE_DIRECTORY)/,$(LIB_REFS_MONO_ALIAS)))
|
||||
@@ -74,6 +75,17 @@ endif
|
||||
endif
|
||||
endif
|
||||
|
||||
#
|
||||
# The bare directory contains the plain versions of System and System.Xml
|
||||
#
|
||||
bare_libdir = $(the_libdir_base)bare
|
||||
|
||||
#
|
||||
# The secxml directory contains the System version that depends on
|
||||
# System.Xml and Mono.Security
|
||||
#
|
||||
secxml_libdir = $(the_libdir_base)secxml
|
||||
|
||||
the_libdir = $(the_libdir_base)$(intermediate)
|
||||
|
||||
ifdef LIBRARY_USE_INTERMEDIATE_FILE
|
||||
@@ -124,7 +136,6 @@ csproj-library:
|
||||
echo $(thisdir):$$config_file >> $(topdir)/../msvc/scripts/order; \
|
||||
(echo $(is_boot); \
|
||||
echo $(USE_MCS_FLAGS) $(LIBRARY_FLAGS) $(LIB_MCS_FLAGS) $(KEYFILE_MCS_FLAGS); \
|
||||
echo $(LIBRARY); \
|
||||
echo $(LIBRARY_NAME); \
|
||||
echo $(BUILT_SOURCES_cmdline); \
|
||||
echo $(build_lib); \
|
||||
@@ -213,7 +224,7 @@ test-local run-test-local run-test-ondotnet-local:
|
||||
ccomma = ,
|
||||
define RESOURCE_template
|
||||
$(1).resources: $(2)
|
||||
$$(RESGEN) "$$<" "$$@"
|
||||
$(RESGEN) "$$<" "$$@"
|
||||
|
||||
GEN_RESOURCE_DEPS += $(1).resources
|
||||
GEN_RESOURCE_FLAGS += -resource:$(1).resources
|
||||
@@ -225,12 +236,11 @@ ifdef RESOURCE_DEFS
|
||||
$(foreach pair,$(RESOURCE_DEFS), $(eval $(call RESOURCE_template,$(word 1, $(subst $(ccomma), ,$(pair))), $(word 2, $(subst $(ccomma), ,$(pair))))))
|
||||
endif
|
||||
|
||||
DISTFILES = $(wildcard *.sources) $(EXTRA_DISTFILES) $(DIST_LISTED_RESOURCES)
|
||||
DISTFILES = $(wildcard *$(LIBRARY)*.sources) $(EXTRA_DISTFILES) $(DIST_LISTED_RESOURCES)
|
||||
|
||||
ASSEMBLY = $(LIBRARY)
|
||||
ASSEMBLY_EXT = .dll
|
||||
the_assembly = $(the_lib)
|
||||
|
||||
include $(topdir)/build/tests.make
|
||||
|
||||
ifdef HAVE_CS_TESTS
|
||||
@@ -241,7 +251,6 @@ csproj-test:
|
||||
echo $(thisdir):$$config_file >> $(topdir)/../msvc/scripts/order; \
|
||||
(echo false; \
|
||||
echo $(USE_MCS_FLAGS) -r:$(the_assembly) $(TEST_MCS_FLAGS); \
|
||||
echo $(LIBRARY); \
|
||||
echo $(test_lib); \
|
||||
echo $(BUILT_SOURCES_cmdline); \
|
||||
echo $(test_lib); \
|
||||
@@ -286,18 +295,14 @@ endif
|
||||
# The library
|
||||
|
||||
# If the directory contains the per profile include file, generate list file.
|
||||
# TODO: depend on all *.sources for now and figure out how to list only needed files later
|
||||
PROFILE_sources = $(wildcard *.sources)
|
||||
|
||||
ifneq "x" "x$(PROFILE_RUNTIME)"
|
||||
GENSOURCES_RUNTIME=$(PROFILE_RUNTIME)
|
||||
else
|
||||
GENSOURCES_RUNTIME=MONO_PATH="$(GENSOURCES_LIBDIR)$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH" $(RUNTIME)
|
||||
endif
|
||||
PROFILE_sources := $(firstword $(if $(PROFILE_PLATFORM),$(wildcard $(PROFILE_PLATFORM)_$(PROFILE)_$(LIBRARY).sources)) $(wildcard $(PROFILE)_$(LIBRARY).sources) $(wildcard $(LIBRARY).sources))
|
||||
PROFILE_excludes = $(firstword $(if $(PROFILE_PLATFORM),$(wildcard $(PROFILE_PLATFORM)_$(PROFILE)_$(LIBRARY).exclude.sources)) $(wildcard $(PROFILE)_$(LIBRARY).exclude.sources))
|
||||
|
||||
# Note, gensources.sh can create a $(sourcefile).makefrag if it sees any '#include's
|
||||
# We don't include it in the dependencies since it isn't always created
|
||||
sourcefile = $(depsdir)/$(PROFILE_PLATFORM)_$(PROFILE)_$(LIBRARY_SUBDIR)_$(LIBRARY).sources
|
||||
$(sourcefile): $(PROFILE_sources) $(PROFILE_excludes) $(depsdir)/.stamp $(GENSOURCES_CS)
|
||||
$(GENSOURCES_RUNTIME) --debug $(GENSOURCES_EXE) --strict "$@" "$(LIBRARY)" "$(PROFILE_PLATFORM)" "$(PROFILE)"
|
||||
$(sourcefile): $(PROFILE_sources) $(PROFILE_excludes) $(topdir)/build/gensources.sh $(depsdir)/.stamp
|
||||
$(SHELL) $(topdir)/build/gensources.sh $@ '$(PROFILE_sources)' '$(PROFILE_excludes)'
|
||||
|
||||
library_CLEAN_FILES += $(sourcefile)
|
||||
|
||||
@@ -385,9 +390,9 @@ gen-deps:
|
||||
|
||||
update-corefx-sr-generic:
|
||||
ifneq ($(RESX_STRINGS),)
|
||||
MONO_PATH="$(topdir)/class/lib/$(BUILD_TOOLS_PROFILE)$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH" $(RUNTIME) $(RUNTIME_FLAGS) $(topdir)/class/lib/$(BUILD_TOOLS_PROFILE)/resx2sr.exe $(RESX_EXTRA_ARGUMENTS) $(RESX_STRINGS) >$(SR_OUTPUT)
|
||||
MONO_PATH="$(topdir)/class/lib/$(BUILD_TOOLS_PROFILE)$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH" $(RUNTIME) $(RUNTIME_FLAGS) $(topdir)/class/lib/$(BUILD_TOOLS_PROFILE)/resx2sr.exe $(RESX_STRINGS) >$(SR_OUTPUT)
|
||||
endif
|
||||
|
||||
update-corefx-sr: $(RESX_RESOURCE_STRING) $(XTEST_RESX_RESOURCE_STRING)
|
||||
make SR_OUTPUT=corefx/SR.cs RESX_STRINGS="$(RESX_RESOURCE_STRING)" RESX_EXTRA_ARGUMENTS="$(RESX_EXTRA_ARGUMENTS)" update-corefx-sr-generic \
|
||||
&& make SR_OUTPUT=corefx/SR.tests.cs RESX_STRINGS=$(XTEST_RESX_RESOURCE_STRING) update-corefx-sr-generic
|
||||
make SR_OUTPUT=corefx/SR.cs RESX_STRINGS=$(RESX_RESOURCE_STRING) update-corefx-sr-generic \
|
||||
&& make SR_OUTPUT=corefx/SR.tests.cs RESX_STRINGS=$(XTEST_RESX_RESOURCE_STRING) update-corefx-sr-generic
|
||||
@@ -0,0 +1,36 @@
|
||||
# -*- makefile -*-
|
||||
#
|
||||
# Platform-specific makefile rules. This one's for macOS.
|
||||
#
|
||||
|
||||
PLATFORM_MCS_FLAGS =
|
||||
PLATFORM_RUNTIME = $(RUNTIME)
|
||||
PLATFORM_CORLIB = mscorlib.dll
|
||||
PLATFORM_TEST_HARNESS_EXCLUDES = NotOnMac,MacNotWorking,
|
||||
|
||||
EXTERNAL_MCS = mcs
|
||||
EXTERNAL_MBAS = mbas
|
||||
EXTERNAL_RUNTIME = mono
|
||||
#ILDISASM = monodis
|
||||
ILDISASM = false
|
||||
|
||||
PLATFORM_PATH_SEPARATOR = :
|
||||
|
||||
# Define this if this ever will work on Linux
|
||||
# PLATFORM_MAKE_CORLIB_CMP = yes
|
||||
|
||||
# This is for changing / to \ on windows
|
||||
PLATFORM_CHANGE_SEPARATOR_CMD = cat
|
||||
|
||||
hidden_prefix = .
|
||||
hidden_suffix =
|
||||
|
||||
platform-check:
|
||||
@:
|
||||
# I tried this but apparently Make's version strings aren't that
|
||||
# ... consistent between releases. Whatever.
|
||||
#
|
||||
# @if ! $(MAKE) --version |grep '^GNU Make version 3' 1>/dev/null 2>&1 ; then \
|
||||
# echo "*** You need to build MCS with GNU make. Try \`gmake'" ; \
|
||||
# exit 1 ; \
|
||||
# fi
|
||||
@@ -1,38 +0,0 @@
|
||||
# -*- makefile -*-
|
||||
#
|
||||
# Platform-specific makefile rules. This one's for macOS.
|
||||
#
|
||||
|
||||
PLATFORM_MCS_FLAGS =
|
||||
PLATFORM_RUNTIME = $(RUNTIME)
|
||||
PLATFORM_CORLIB = mscorlib.dll
|
||||
PLATFORM_TEST_HARNESS_EXCLUDES = NotOnMac,MacNotWorking,
|
||||
|
||||
EXTERNAL_MCS = mcs
|
||||
EXTERNAL_MBAS = mbas
|
||||
EXTERNAL_RUNTIME = mono
|
||||
#ILDISASM = monodis
|
||||
ILDISASM = false
|
||||
|
||||
PLATFORM_PATH_SEPARATOR = :
|
||||
|
||||
# Define this if this ever will work on Linux
|
||||
# PLATFORM_MAKE_CORLIB_CMP = yes
|
||||
|
||||
# This is for changing / to \ on windows
|
||||
PLATFORM_CHANGE_SEPARATOR_CMD = cat
|
||||
|
||||
hidden_prefix = .
|
||||
hidden_suffix =
|
||||
|
||||
platform-check:
|
||||
@:
|
||||
# I tried this but apparently Make's version strings aren't that
|
||||
# ... consistent between releases. Whatever.
|
||||
#
|
||||
# @if ! $(MAKE) --version |grep '^GNU Make version 3' 1>/dev/null 2>&1 ; then \
|
||||
# echo "*** You need to build MCS with GNU make. Try \`gmake'" ; \
|
||||
# exit 1 ; \
|
||||
# fi
|
||||
|
||||
PLATFORM_MACOS=1
|
||||
@@ -1,36 +0,0 @@
|
||||
# -*- makefile -*-
|
||||
#
|
||||
# Platform-specific makefile rules. This one's for any unix (FreeBSD, OpenBSD, etc.)
|
||||
#
|
||||
|
||||
PLATFORM_MCS_FLAGS =
|
||||
PLATFORM_RUNTIME = $(RUNTIME)
|
||||
PLATFORM_CORLIB = mscorlib.dll
|
||||
PLATFORM_TEST_HARNESS_EXCLUDES =
|
||||
|
||||
EXTERNAL_MCS = mcs
|
||||
EXTERNAL_MBAS = mbas
|
||||
EXTERNAL_RUNTIME = mono
|
||||
#ILDISASM = monodis
|
||||
ILDISASM = false
|
||||
|
||||
PLATFORM_PATH_SEPARATOR = :
|
||||
|
||||
# Define this if this ever will work on Unix
|
||||
# PLATFORM_MAKE_CORLIB_CMP = yes
|
||||
|
||||
# This is for changing / to \ on windows
|
||||
PLATFORM_CHANGE_SEPARATOR_CMD = cat
|
||||
|
||||
hidden_prefix = .
|
||||
hidden_suffix =
|
||||
|
||||
platform-check:
|
||||
@:
|
||||
# I tried this but apparently Make's version strings aren't that
|
||||
# ... consistent between releases. Whatever.
|
||||
#
|
||||
# @if ! $(MAKE) --version |grep '^GNU Make version 3' 1>/dev/null 2>&1 ; then \
|
||||
# echo "*** You need to build MCS with GNU make. Try \`gmake'" ; \
|
||||
# exit 1 ; \
|
||||
# fi
|
||||
@@ -26,16 +26,11 @@ else
|
||||
endif
|
||||
endif
|
||||
|
||||
ILASM = $(PROFILE_RUNTIME) $(RUNTIME_FLAGS) $(topdir)/class/lib/$(BUILD_TOOLS_PROFILE)/ilasm.exe
|
||||
STRING_REPLACER = $(PROFILE_RUNTIME) $(RUNTIME_FLAGS) $(topdir)/class/lib/$(BUILD_TOOLS_PROFILE)/tmp/cil-stringreplacer.exe
|
||||
MCS = $(BOOTSTRAP_MCS)
|
||||
GENSOURCES_CS = $(topdir)/build/gensources.cs
|
||||
GENSOURCES_DIR = $(topdir)/build
|
||||
GENSOURCES_EXE = $(GENSOURCES_DIR)/gensources.exe
|
||||
|
||||
DEFAULT_REFERENCES = mscorlib
|
||||
DEFAULT_REFERENCES = -r:$(topdir)/class/lib/$(PROFILE)/mscorlib.dll
|
||||
|
||||
PROFILE_MCS_FLAGS = -d:NET_4_0 -d:NET_4_5 -d:MONO -d:WIN_PLATFORM -d:BOOTSTRAP_BASIC -nowarn:1699 -nostdlib
|
||||
PROFILE_MCS_FLAGS = -d:NET_4_0 -d:NET_4_5 -d:MONO -d:WIN_PLATFORM -d:BOOTSTRAP_BASIC -nowarn:1699 -nostdlib $(DEFAULT_REFERENCES)
|
||||
API_BIN_PROFILE = v4.7.1
|
||||
|
||||
NO_SIGN_ASSEMBLY = yes
|
||||
@@ -116,14 +111,9 @@ do-profile-check-monolite: $(depsdir)/.stamp
|
||||
|
||||
endif
|
||||
|
||||
$(PROFILE_EXE): $(topdir)/build/common/basic-profile-check.cs $(GENSOURCES_CS)
|
||||
$(PROFILE_EXE): $(topdir)/build/common/basic-profile-check.cs
|
||||
$(MAKE) $(MAKE_Q) -C $(topdir)/packages
|
||||
$(BOOTSTRAP_MCS) /warn:0 /noconfig /langversion:latest /r:System.dll /r:mscorlib.dll /out:$@.tmp $<
|
||||
$(BOOTSTRAP_MCS) /noconfig /langversion:latest /r:mscorlib.dll /r:System.dll /r:System.Core.dll /out:$(GENSOURCES_EXE).tmp $(GENSOURCES_CS)
|
||||
- rm $(GENSOURCES_EXE)
|
||||
mv $(GENSOURCES_EXE).tmp $(GENSOURCES_EXE)
|
||||
- rm -f $@
|
||||
mv [email protected] $@
|
||||
$(BOOTSTRAP_MCS) /warn:0 /noconfig /r:System.dll /r:mscorlib.dll /out:$@ $<
|
||||
|
||||
$(PROFILE_OUT): $(PROFILE_EXE)
|
||||
$(PROFILE_RUNTIME) $< > $@ 2>&1
|
||||
@@ -6,15 +6,15 @@ BUILD_TOOLS_PROFILE = basic
|
||||
BOOTSTRAP_MCS = MONO_PATH="$(topdir)/class/lib/$(BOOTSTRAP_PROFILE)$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH" $(INTERNAL_CSC)
|
||||
MCS = $(BOOTSTRAP_MCS)
|
||||
|
||||
PLATFORMS = macos linux win32 unix
|
||||
PLATFORMS = darwin linux win32
|
||||
|
||||
# nuttzing!
|
||||
|
||||
profile-check:
|
||||
@:
|
||||
|
||||
DEFAULT_REFERENCES = mscorlib
|
||||
PROFILE_MCS_FLAGS = -d:NET_4_0 -d:NET_4_5 -d:MONO -d:WIN_PLATFORM -nowarn:1699 -nostdlib
|
||||
DEFAULT_REFERENCES = -r:$(topdir)/class/lib/$(PROFILE_DIRECTORY)/mscorlib.dll
|
||||
PROFILE_MCS_FLAGS = -d:NET_4_0 -d:NET_4_5 -d:MONO -d:WIN_PLATFORM -nowarn:1699 -nostdlib $(DEFAULT_REFERENCES)
|
||||
API_BIN_PROFILE = v4.7.1
|
||||
|
||||
NO_SIGN_ASSEMBLY = yes
|
||||
@@ -22,4 +22,3 @@ NO_TEST = yes
|
||||
NO_INSTALL = yes
|
||||
|
||||
FRAMEWORK_VERSION = 4.5
|
||||
|
||||
@@ -8,7 +8,7 @@ MCS = $(BOOTSTRAP_MCS)
|
||||
profile-check:
|
||||
@:
|
||||
|
||||
DEFAULT_REFERENCES = mscorlib
|
||||
DEFAULT_REFERENCES = -r:$(topdir)/class/lib/$(PROFILE)/mscorlib.dll
|
||||
|
||||
PROFILE_MCS_FLAGS = \
|
||||
-d:NET_1_1 \
|
||||
@@ -24,6 +24,7 @@ PROFILE_MCS_FLAGS = \
|
||||
-d:ANDROID \
|
||||
-nowarn:1699 \
|
||||
-nostdlib \
|
||||
$(DEFAULT_REFERENCES) \
|
||||
$(PLATFORM_DEBUG_FLAGS)
|
||||
|
||||
API_BIN_PROFILE = build/monodroid
|
||||
|
||||
@@ -9,9 +9,9 @@ profile-check:
|
||||
@:
|
||||
|
||||
TARGET_NET_REFERENCE = v4.6
|
||||
DEFAULT_REFERENCES = mscorlib
|
||||
DEFAULT_REFERENCES = -r:$(topdir)/../external/binary-reference-assemblies/$(TARGET_NET_REFERENCE)/mscorlib.dll
|
||||
|
||||
PROFILE_MCS_FLAGS = -d:NET_4_6 -d:MONO -d:WIN_PLATFORM -nowarn:1699 -nostdlib $(PLATFORM_DEBUG_FLAGS)
|
||||
PROFILE_MCS_FLAGS = -d:NET_4_6 -d:MONO -d:WIN_PLATFORM -nowarn:1699 -nostdlib $(DEFAULT_REFERENCES) $(PLATFORM_DEBUG_FLAGS)
|
||||
|
||||
FRAMEWORK_VERSION = 4.5
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ MCS = $(BOOTSTRAP_MCS)
|
||||
profile-check:
|
||||
@:
|
||||
|
||||
DEFAULT_REFERENCES = mscorlib
|
||||
DEFAULT_REFERENCES = -r:$(topdir)/class/lib/$(PROFILE)/mscorlib.dll
|
||||
PROFILE_MCS_FLAGS = \
|
||||
-d:NET_1_1 \
|
||||
-d:NET_2_0 \
|
||||
@@ -24,6 +24,7 @@ PROFILE_MCS_FLAGS = \
|
||||
-d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK \
|
||||
-nowarn:1699 \
|
||||
-nostdlib \
|
||||
$(DEFAULT_REFERENCES) \
|
||||
$(PLATFORM_DEBUG_FLAGS) \
|
||||
$(MONOTOUCH_MCS_FLAGS)
|
||||
|
||||
@@ -39,4 +40,3 @@ NO_CONSOLE = yes
|
||||
PROFILE_DISABLE_BTLS=1
|
||||
MONO_FEATURE_APPLETLS=1
|
||||
ONLY_APPLETLS=1
|
||||
ENABLE_GSS=1
|
||||
@@ -5,23 +5,19 @@ BOOTSTRAP_PROFILE = build
|
||||
BOOTSTRAP_MCS = MONO_PATH="$(topdir)/class/lib/$(BOOTSTRAP_PROFILE)$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH" $(INTERNAL_CSC)
|
||||
MCS = $(BOOTSTRAP_MCS)
|
||||
|
||||
PLATFORMS = macos linux win32 unix
|
||||
PLATFORMS = darwin linux win32
|
||||
|
||||
# nuttzing!
|
||||
|
||||
profile-check:
|
||||
@:
|
||||
|
||||
DEFAULT_REFERENCES = mscorlib
|
||||
PROFILE_MCS_FLAGS = -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -d:WIN_PLATFORM -nowarn:1699 -nostdlib $(PLATFORM_DEBUG_FLAGS)
|
||||
DEFAULT_REFERENCES = -r:$(topdir)/class/lib/$(PROFILE_DIRECTORY)/mscorlib.dll
|
||||
PROFILE_MCS_FLAGS = -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -d:WIN_PLATFORM -d:MULTIPLEX_OS -nowarn:1699 -nostdlib $(DEFAULT_REFERENCES) $(PLATFORM_DEBUG_FLAGS)
|
||||
API_BIN_PROFILE = v4.7.1
|
||||
|
||||
FRAMEWORK_VERSION = 4.5
|
||||
XBUILD_VERSION = 4.0
|
||||
MONO_FEATURE_APPLETLS=1
|
||||
|
||||
ENFORCE_LIBRARY_WARN_AS_ERROR = yes
|
||||
|
||||
ifdef PLATFORM_MACOS
|
||||
MONO_FEATURE_APPLETLS=1
|
||||
ENABLE_GSS=1
|
||||
endif
|
||||
@@ -8,7 +8,7 @@ MCS = $(BOOTSTRAP_MCS)
|
||||
profile-check:
|
||||
@:
|
||||
|
||||
DEFAULT_REFERENCES = mscorlib
|
||||
DEFAULT_REFERENCES = -r:$(topdir)/class/lib/$(PROFILE)/mscorlib.dll
|
||||
|
||||
PROFILE_MCS_FLAGS = \
|
||||
-d:NET_1_1 \
|
||||
@@ -26,6 +26,7 @@ PROFILE_MCS_FLAGS = \
|
||||
-d:DISABLE_COM \
|
||||
-nowarn:1699 \
|
||||
-nostdlib \
|
||||
$(DEFAULT_REFERENCES) \
|
||||
$(PLATFORM_DEBUG_FLAGS)
|
||||
|
||||
API_BIN_PROFILE = build/monotouch
|
||||
|
||||
@@ -8,7 +8,7 @@ MCS = $(BOOTSTRAP_MCS)
|
||||
profile-check:
|
||||
@:
|
||||
|
||||
DEFAULT_REFERENCES = mscorlib
|
||||
DEFAULT_REFERENCES = -r:$(topdir)/class/lib/$(PROFILE)/mscorlib.dll
|
||||
|
||||
PROFILE_MCS_FLAGS = \
|
||||
-d:NET_1_1 \
|
||||
@@ -25,6 +25,7 @@ PROFILE_MCS_FLAGS = \
|
||||
-d:DISABLE_COM \
|
||||
-nowarn:1699 \
|
||||
-nostdlib \
|
||||
$(DEFAULT_REFERENCES) \
|
||||
$(PLATFORM_DEBUG_FLAGS)
|
||||
|
||||
API_BIN_PROFILE = build/monotouch
|
||||
|
||||
@@ -8,7 +8,7 @@ MCS = $(BOOTSTRAP_MCS)
|
||||
profile-check:
|
||||
@:
|
||||
|
||||
DEFAULT_REFERENCES = mscorlib
|
||||
DEFAULT_REFERENCES = -r:$(topdir)/class/lib/$(PROFILE)/mscorlib.dll
|
||||
|
||||
PROFILE_MCS_FLAGS = \
|
||||
-d:NET_1_1 \
|
||||
@@ -22,6 +22,7 @@ PROFILE_MCS_FLAGS = \
|
||||
-d:MONO \
|
||||
-nowarn:1699 \
|
||||
-nostdlib \
|
||||
$(DEFAULT_REFERENCES) \
|
||||
$(PLATFORM_DEBUG_FLAGS)
|
||||
|
||||
API_BIN_PROFILE = build/monotouch
|
||||
|
||||
@@ -8,7 +8,7 @@ MCS = $(BOOTSTRAP_MCS)
|
||||
profile-check:
|
||||
@:
|
||||
|
||||
DEFAULT_REFERENCES = mscorlib
|
||||
DEFAULT_REFERENCES = -r:$(topdir)/class/lib/$(PROFILE)/mscorlib.dll
|
||||
|
||||
PROFILE_MCS_FLAGS = \
|
||||
-d:NET_1_1 \
|
||||
@@ -22,6 +22,7 @@ PROFILE_MCS_FLAGS = \
|
||||
-d:MONO \
|
||||
-nowarn:1699 \
|
||||
-nostdlib \
|
||||
$(DEFAULT_REFERENCES) \
|
||||
$(PLATFORM_DEBUG_FLAGS)
|
||||
|
||||
API_BIN_PROFILE = build/monotouch
|
||||
|
||||
@@ -8,7 +8,7 @@ MCS = $(BOOTSTRAP_MCS)
|
||||
profile-check:
|
||||
@:
|
||||
|
||||
DEFAULT_REFERENCES = mscorlib
|
||||
DEFAULT_REFERENCES = -r:$(topdir)/class/lib/$(PROFILE)/mscorlib.dll
|
||||
|
||||
PROFILE_MCS_FLAGS = \
|
||||
-d:NET_1_1 \
|
||||
@@ -24,9 +24,9 @@ PROFILE_MCS_FLAGS = \
|
||||
-d:WASM \
|
||||
-d:DISABLE_REMOTING \
|
||||
-d:DISABLE_COM \
|
||||
-d:FEATURE_NO_BSD_SOCKETS \
|
||||
-nowarn:1699 \
|
||||
-nostdlib \
|
||||
$(DEFAULT_REFERENCES) \
|
||||
$(PLATFORM_DEBUG_FLAGS)
|
||||
|
||||
API_BIN_PROFILE = build/monotouch
|
||||
|
||||
@@ -8,7 +8,7 @@ MCS = $(BOOTSTRAP_MCS)
|
||||
profile-check:
|
||||
@:
|
||||
|
||||
DEFAULT_REFERENCES = mscorlib
|
||||
DEFAULT_REFERENCES = -r:$(topdir)/class/lib/$(PROFILE)/mscorlib.dll
|
||||
|
||||
PROFILE_MCS_FLAGS = \
|
||||
-d:NET_1_1 \
|
||||
@@ -26,6 +26,7 @@ PROFILE_MCS_FLAGS = \
|
||||
-d:WIN_PLATFORM \
|
||||
-nowarn:1699 \
|
||||
-nostdlib \
|
||||
$(DEFAULT_REFERENCES) \
|
||||
$(PLATFORM_DEBUG_FLAGS)
|
||||
|
||||
API_BIN_PROFILE = build/monotouch
|
||||
|
||||
@@ -6,7 +6,7 @@ MCS = $(BOOTSTRAP_MCS)
|
||||
profile-check:
|
||||
@:
|
||||
|
||||
DEFAULT_REFERENCES = mscorlib
|
||||
DEFAULT_REFERENCES = -r:$(topdir)/class/lib/$(PROFILE)/mscorlib.dll
|
||||
|
||||
PROFILE_MCS_FLAGS = \
|
||||
-d:NET_1_1 \
|
||||
@@ -23,6 +23,7 @@ PROFILE_MCS_FLAGS = \
|
||||
-d:XAMARIN_MODERN \
|
||||
-nowarn:1699 \
|
||||
-nostdlib \
|
||||
$(DEFAULT_REFERENCES) \
|
||||
$(PLATFORM_DEBUG_FLAGS) \
|
||||
$(XAMMAC_MCS_FLAGS)
|
||||
|
||||
@@ -35,7 +36,6 @@ MOBILE_DYNAMIC = yes
|
||||
MOBILE_PROFILE = yes
|
||||
NO_CONSOLE = yes
|
||||
|
||||
ENABLE_GSS=1
|
||||
PROFILE_DISABLE_BTLS=1
|
||||
MONO_FEATURE_APPLETLS=1
|
||||
ONLY_APPLETLS=1
|
||||
@@ -1,8 +1,6 @@
|
||||
include $(topdir)/build/profiles/net_4_x.make
|
||||
|
||||
PLATFORMS =
|
||||
|
||||
PROFILE_MCS_FLAGS = -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -nowarn:1699 -nostdlib $(PLATFORM_DEBUG_FLAGS) \
|
||||
PROFILE_MCS_FLAGS = -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -nowarn:1699 -nostdlib $(DEFAULT_REFERENCES) $(PLATFORM_DEBUG_FLAGS) \
|
||||
-d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK \
|
||||
-d:NO_SYSTEM_DRAWING_DEPENDENCY \
|
||||
-d:NO_WINFORMS_DEPENDENCY \
|
||||
@@ -23,4 +21,3 @@ NO_SYSTEM_DIRECTORY_SERVICES_DEPENDENCY=1
|
||||
PROFILE_DISABLE_BTLS=1
|
||||
MONO_FEATURE_APPLETLS=1
|
||||
ONLY_APPLETLS=1
|
||||
ENABLE_GSS=1
|
||||
@@ -5,7 +5,7 @@ include $(topdir)/build/profiles/net_4_x.make
|
||||
PLATFORMS:=
|
||||
|
||||
PARENT_PROFILE = ../net_4_x$(if $(PROFILE_PLATFORM),-$(PROFILE_PLATFORM))/
|
||||
DEFAULT_REFERENCES = ../net_4_x/mscorlib
|
||||
DEFAULT_REFERENCES = -r:$(topdir)/class/lib/net_4_x$(if $(PROFILE_PLATFORM),-$(PROFILE_PLATFORM))/mscorlib.dll
|
||||
PROFILE_MCS_FLAGS += -d:XBUILD_12
|
||||
|
||||
XBUILD_VERSION = 12.0
|
||||
+4
-21
@@ -56,9 +56,7 @@ INTERNAL_CSC = CSC_SDK_PATH_DISABLED= $(RUNTIME) $(RUNTIME_FLAGS) $(CSC_RUNTIME_
|
||||
RESGEN = MONO_PATH="$(topdir)/class/lib/$(BUILD_TOOLS_PROFILE)$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH" $(RUNTIME) $(RUNTIME_FLAGS) $(topdir)/class/lib/$(BUILD_TOOLS_PROFILE)/resgen.exe
|
||||
STRING_REPLACER = MONO_PATH="$(topdir)/class/lib/$(BUILD_TOOLS_PROFILE)$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH" $(RUNTIME) $(RUNTIME_FLAGS) $(topdir)/class/lib/$(BUILD_TOOLS_PROFILE)/cil-stringreplacer.exe
|
||||
ILASM = MONO_PATH="$(topdir)/class/lib/$(BUILD_TOOLS_PROFILE)$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH" $(RUNTIME) $(RUNTIME_FLAGS) $(topdir)/class/lib/$(BUILD_TOOLS_PROFILE)/ilasm.exe
|
||||
GENSOURCES_LIBDIR = $(topdir)/class/lib/$(BUILD_TOOLS_PROFILE)
|
||||
GENSOURCES_CS = $(topdir)/build/gensources.cs
|
||||
GENSOURCES_EXE = $(topdir)/build/gensources.exe
|
||||
|
||||
|
||||
depsdir = $(topdir)/build/deps
|
||||
|
||||
@@ -74,9 +72,6 @@ export MKINSTALLDIRS
|
||||
export BOOTSTRAP_MCS
|
||||
export DESTDIR
|
||||
export RESGEN
|
||||
export GENSOURCES_LIBDIR
|
||||
export GENSOURCES_CS
|
||||
export GENSOURCES_EXE
|
||||
|
||||
# Get this so the platform.make platform-check rule doesn't become the
|
||||
# default target
|
||||
@@ -166,7 +161,7 @@ gacutil = $(topdir)/class/lib/$(BUILD_TOOLS_PROFILE)/gacutil.exe
|
||||
GACUTIL = MONO_PATH="$(topdir)/class/lib/$(BUILD_TOOLS_PROFILE)$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH" $(RUNTIME) $(RUNTIME_FLAGS) $(gacutil)
|
||||
endif
|
||||
|
||||
STD_TARGETS = test xunit-test run-test run-xunit-test run-test-ondotnet clean install uninstall doc-update
|
||||
STD_TARGETS = test run-test run-test-ondotnet clean install uninstall doc-update
|
||||
|
||||
$(STD_TARGETS): %: do-%
|
||||
|
||||
@@ -243,9 +238,6 @@ endif
|
||||
$(if $(filter $*,all), \
|
||||
$(MAKE) $(PROFILE_PARALLEL_SUBDIRS) ENABLE_PARALLEL_SUBDIR_BUILD=1 || { final_exit="exit 1"; $$dk; };, \
|
||||
$(foreach subdir,$(PROFILE_PARALLEL_SUBDIRS),$(MAKE) -C $(subdir) $* || { final_exit="exit 1"; $$dk; };))) \
|
||||
$(if $(FACADES_FOLDER), \
|
||||
$(MAKE) -C $(FACADES_FOLDER) $* || { final_exit="exit 1"; $$dk; }; \
|
||||
) \
|
||||
$$final_exit
|
||||
|
||||
ifdef ENABLE_PARALLEL_SUBDIR_BUILD
|
||||
@@ -267,24 +259,15 @@ endif
|
||||
# directories it depends on.
|
||||
#
|
||||
ifneq ($(PROFILE_PARALLEL_SUBDIRS),)
|
||||
|
||||
dep_dirs = .dep_dirs-$(PROFILE)
|
||||
|
||||
#
|
||||
# This should track dependencies better but the variable can be defined in any
|
||||
# Makefile dependency. On top of that we should also regenerate when any of the
|
||||
# PROFILE_PARALLEL_SUBDIRS Makefile's are changed
|
||||
#
|
||||
$(dep_dirs): Makefile
|
||||
$(if $(V),@echo "Creating $(abspath $@)...",)
|
||||
$(dep_dirs):
|
||||
@echo "Creating $@..."
|
||||
list='$(PROFILE_PARALLEL_SUBDIRS)'; \
|
||||
echo > $@; \
|
||||
for d in $$list; do \
|
||||
$(MAKE) -C $$d gen-deps DEPS_TARGET_DIR=$$d DEPS_FILE=$(abspath $@); \
|
||||
done
|
||||
|
||||
-include $(dep_dirs)
|
||||
|
||||
endif
|
||||
|
||||
.PHONY: gen-deps
|
||||
|
||||
+29
-63
@@ -20,24 +20,13 @@ TEST_RUNTIME_WRAPPERS_PATH = $(shell dirname $(RUNTIME))/_tmpinst/bin
|
||||
ifndef NO_TEST
|
||||
|
||||
test_nunit_lib = nunitlite.dll
|
||||
xunit_core := xunit.core xunit.execution.dotnet xunit.abstractions xunit.assert Xunit.NetCore.Extensions
|
||||
xunit_deps := netstandard System.Runtime
|
||||
xunit_core := xunit.core xunit.execution.desktop xunit.abstractions xunit.assert Xunit.NetCore.Extensions
|
||||
xunit_deps := System.Runtime
|
||||
xunit_src := $(patsubst %,$(topdir)/../external/xunit-binaries/%,BenchmarkAttribute.cs BenchmarkDiscover.cs) $(topdir)/../mcs/class/test-helpers/PlatformDetection.cs
|
||||
|
||||
ifeq ($(USE_XTEST_REMOTE_EXECUTOR), YES)
|
||||
XTEST_REMOTE_EXECUTOR = $(topdir)/class/lib/$(PROFILE)/RemoteExecutorConsoleApp.exe
|
||||
xunit_src += $(topdir)/../mcs/class/test-helpers/AdminHelper.cs \
|
||||
$(topdir)/../external/corefx/src/CoreFx.Private.TestUtilities/src/System/IO/FileCleanupTestBase.cs \
|
||||
$(topdir)/../external/corefx/src/CoreFx.Private.TestUtilities/src/System/Diagnostics/RemoteExecutorTestBase.cs \
|
||||
$(topdir)/../external/corefx/src/Common/src/System/PasteArguments.cs \
|
||||
$(topdir)/../external/corefx/src/Common/src/System/PasteArguments.Unix.cs
|
||||
|
||||
ifeq ($(PROFILE),monodroid)
|
||||
xunit_src += $(topdir)/../mcs/class/test-helpers/RemoteExecutorTestBase.Mobile.cs
|
||||
else
|
||||
xunit_src += $(topdir)/../mcs/class/test-helpers/RemoteExecutorTestBase.Mono.cs \
|
||||
$(topdir)/../external/corefx/src/CoreFx.Private.TestUtilities/src/System/Diagnostics/RemoteExecutorTestBase.Process.cs
|
||||
endif
|
||||
XTEST_REMOTE_EXECUTOR = $(xunit_test_lib)_RemoteExecuter.exe
|
||||
xunit_src += $(topdir)/../mcs/class/test-helpers/AdminHelper.cs $(topdir)/../mcs/class/test-helpers/RemoteExecutorTestBase.Mono.cs $(topdir)/../external/corefx/src/CoreFx.Private.TestUtilities/src/System/IO/FileCleanupTestBase.cs $(topdir)/../external/corefx/src/CoreFx.Private.TestUtilities/src/System/Diagnostics/RemoteExecutorTestBase.Process.cs $(topdir)/../external/corefx/src/CoreFx.Private.TestUtilities/src/System/Diagnostics/RemoteExecutorTestBase.cs $(topdir)/../external/corefx/src/Common/src/System/PasteArguments.cs
|
||||
endif
|
||||
|
||||
xunit_class_deps :=
|
||||
@@ -48,8 +37,8 @@ xunit_libs_ref += $(patsubst %,-r:$(topdir)/class/lib/$(PROFILE)/Facades/%.dll,$
|
||||
xunit_libs_dep = $(xunit_class_deps:%=$(topdir)/class/lib/$(PROFILE)/$(PARENT_PROFILE)%.dll)
|
||||
xunit_libs_ref += $(xunit_libs_dep:%=-r:%)
|
||||
|
||||
TEST_LIB_MCS_FLAGS = $(patsubst %,-r:$(topdir)/class/lib/$(PROFILE)/%.dll,$(TEST_LIB_REFS) $(DEFAULT_REFERENCES))
|
||||
XTEST_LIB_MCS_FLAGS = $(patsubst %,-r:$(topdir)/class/lib/$(PROFILE)/%.dll,$(XTEST_LIB_REFS) $(DEFAULT_REFERENCES))
|
||||
TEST_LIB_MCS_FLAGS = $(patsubst %,-r:$(topdir)/class/lib/$(PROFILE)/%.dll,$(TEST_LIB_REFS))
|
||||
XTEST_LIB_MCS_FLAGS = $(patsubst %,-r:$(topdir)/class/lib/$(PROFILE)/%.dll,$(XTEST_LIB_REFS))
|
||||
|
||||
test_nunit_dep = $(test_nunit_lib:%=$(topdir)/class/lib/$(PROFILE)/$(PARENT_PROFILE)%)
|
||||
test_nunit_ref = $(test_nunit_dep:%=-r:%)
|
||||
@@ -75,7 +64,7 @@ test_assembly_dep = $(the_assembly)
|
||||
endif
|
||||
tests_CLEAN_FILES += $(ASSEMBLY:$(ASSEMBLY_EXT)=_test*.dll) $(ASSEMBLY:$(ASSEMBLY_EXT)=_test*.pdb) $(test_response) $(test_makefrag)
|
||||
|
||||
xtest_sourcefile = $(PROFILE_PLATFORM)_$(PROFILE)_$(ASSEMBLY:$(ASSEMBLY_EXT)=_xtest.dll.sources)
|
||||
xtest_sourcefile = $(PROFILE)_$(ASSEMBLY:$(ASSEMBLY_EXT)=_xtest.dll.sources)
|
||||
xtest_sourcefile_excludes = $(PROFILE)_$(ASSEMBLY:$(ASSEMBLY_EXT)=_xtest.dll.exclude.sources)
|
||||
|
||||
xunit_test_lib = $(PROFILE)_$(ASSEMBLY:$(ASSEMBLY_EXT)=_xunit-test.dll)
|
||||
@@ -162,20 +151,14 @@ endif
|
||||
|
||||
NUNITLITE_CONFIG_FILE=$(topdir)/class/lib/$(PROFILE)/$(PARENT_PROFILE)nunit-lite-console.exe.config
|
||||
|
||||
$(test_lib_output).nunitlite.config: $(topdir)/tools/nunit-lite/nunit-lite-console/nunit-lite-console.exe.config.tmpl $(TEST_NUNITLITE_APP_CONFIG_GLOBAL) $(TEST_NUNITLITE_APP_CONFIG_RUNTIME) $(TEST_NUNITLITE_APP_CONFIG_SUPPLEMENTAL)
|
||||
cp -f $(topdir)/tools/nunit-lite/nunit-lite-console/nunit-lite-console.exe.config.tmpl $(test_lib_output).nunitlite.config
|
||||
patch-nunitlite-appconfig:
|
||||
cp -f $(topdir)/tools/nunit-lite/nunit-lite-console/nunit-lite-console.exe.config.tmpl $(NUNITLITE_CONFIG_FILE)
|
||||
ifdef TEST_NUNITLITE_APP_CONFIG_GLOBAL
|
||||
sed -i -e "/__INSERT_CUSTOM_APP_CONFIG_GLOBAL__/r $(TEST_NUNITLITE_APP_CONFIG_GLOBAL)" $(test_lib_output).nunitlite.config
|
||||
sed -i -e "/__INSERT_CUSTOM_APP_CONFIG_GLOBAL__/r $(TEST_NUNITLITE_APP_CONFIG_GLOBAL)" $(NUNITLITE_CONFIG_FILE)
|
||||
endif
|
||||
ifdef TEST_NUNITLITE_APP_CONFIG_RUNTIME
|
||||
sed -i -e "/__INSERT_CUSTOM_APP_CONFIG_RUNTIME__/r $(TEST_NUNITLITE_APP_CONFIG_RUNTIME)" $(test_lib_output).nunitlite.config
|
||||
sed -i -e "/__INSERT_CUSTOM_APP_CONFIG_RUNTIME__/r $(TEST_NUNITLITE_APP_CONFIG_RUNTIME)" $(NUNITLITE_CONFIG_FILE)
|
||||
endif
|
||||
ifdef TEST_NUNITLITE_APP_CONFIG_SUPPLEMENTAL
|
||||
cp -f $(TEST_NUNITLITE_APP_CONFIG_SUPPLEMENTAL) $(test_lib_output).nunitlite.config.$(TEST_NUNITLITE_APP_CONFIG_SUPPLEMENTAL)
|
||||
endif
|
||||
|
||||
copy-nunitlite-appconfig: $(test_lib_output).nunitlite.config
|
||||
cp -f $(test_lib_output).nunitlite.config $(NUNITLITE_CONFIG_FILE)
|
||||
|
||||
ifdef PLATFORM_AOT_SUFFIX
|
||||
|
||||
@@ -217,14 +200,14 @@ ifneq ($(wildcard $(MKBUNDLE_TEST_BIN)),)
|
||||
TEST_HARNESS_EXEC=$(MKBUNDLE_TEST_BIN)
|
||||
TEST_HARNESS_EXCLUDES:=$(TEST_HARNESS_EXCLUDES),StaticLinkedAotNotWorking
|
||||
else
|
||||
TEST_HARNESS_EXEC=$(TEST_RUNTIME) $(TEST_RUNTIME_FLAGS) $(TEST_COVERAGE_FLAGS) $(AOT_RUN_FLAGS) $(TEST_HARNESS)
|
||||
TEST_HARNESS_EXEC=$(TEST_RUNTIME) $(RUNTIME_FLAGS) $(TEST_COVERAGE_FLAGS) $(AOT_RUN_FLAGS) $(TEST_HARNESS)
|
||||
endif
|
||||
|
||||
## FIXME: i18n problem in the 'sed' command below
|
||||
run-test-lib: test-local test-local-aot-compile copy-nunitlite-appconfig
|
||||
run-test-lib: test-local test-local-aot-compile patch-nunitlite-appconfig
|
||||
ok=:; \
|
||||
PATH="$(TEST_RUNTIME_WRAPPERS_PATH):$(PATH)" MONO_REGISTRY_PATH="$(HOME)/.mono/registry" MONO_TESTS_IN_PROGRESS="yes" DBG_RUNTIME_ARGS="$(TEST_RUNTIME_FLAGS)" $(TEST_HARNESS_EXEC) $(test_assemblies) $(NOSHADOW_FLAG) $(TEST_HARNESS_FLAGS) $(LOCAL_TEST_HARNESS_FLAGS) $(TEST_HARNESS_EXCLUDES) $(LABELS_ARG) -format:nunit2 -result:TestResult-$(PROFILE).xml $(FIXTURE_ARG) $(TESTNAME_ARG)|| ok=false; \
|
||||
if [ ! -f "TestResult-$(PROFILE).xml" ]; then echo "<?xml version='1.0' encoding='utf-8'?><test-results failures='1' total='1' not-run='0' name='bcl-tests' date='$$(date +%F)' time='$$(date +%T)'><test-suite name='$(strip $(test_assemblies))' success='False' time='0'><results><test-case name='$(notdir $(strip $(test_assemblies))).crash' executed='True' success='False' time='0'><failure><message>The test runner didn't produce a test result XML, probably due to a crash of the runtime. Check the log for more details.</message><stack-trace></stack-trace></failure></test-case></results></test-suite></test-results>" > TestResult-$(PROFILE).xml; fi; \
|
||||
PATH="$(TEST_RUNTIME_WRAPPERS_PATH):$(PATH)" MONO_REGISTRY_PATH="$(HOME)/.mono/registry" MONO_TESTS_IN_PROGRESS="yes" $(TEST_HARNESS_EXEC) $(test_assemblies) $(NOSHADOW_FLAG) $(TEST_HARNESS_FLAGS) $(LOCAL_TEST_HARNESS_FLAGS) $(TEST_HARNESS_EXCLUDES) $(LABELS_ARG) -format:nunit2 -result:TestResult-$(PROFILE).xml $(FIXTURE_ARG) $(TESTNAME_ARG)|| ok=false; \
|
||||
if [ ! -f "TestResult-$(PROFILE).xml" ]; then echo "<?xml version='1.0' encoding='utf-8'?><test-results failures='1' total='1' not-run='0' name='bcl-tests' date='$$(date +%F)' time='$$(date +%T)'><test-suite name='$(strip $(test_assemblies))' success='False' time='0'><results><test-case name='crash' executed='True' success='False' time='0'><failure><message>The test runner didn't produce a test result XML, probably due to a crash of the runtime. Check the log for more details.</message><stack-trace></stack-trace></failure></test-case></results></test-suite></test-results>" > TestResult-$(PROFILE).xml; fi; \
|
||||
$$ok
|
||||
|
||||
## Instructs compiler to compile to target .net execution, it can be usefull in rare cases when runtime detection is not possible
|
||||
@@ -248,25 +231,15 @@ ifdef HAVE_CS_TESTS
|
||||
$(test_lib_dir):
|
||||
mkdir -p $@
|
||||
|
||||
$(test_lib_output): $(test_assembly_dep) $(test_response) $(test_nunit_dep) $(test_lib_dir) $(test_lib_output).nunitlite.config
|
||||
$(test_lib_output): $(test_assembly_dep) $(test_response) $(test_nunit_dep) $(test_lib_dir)
|
||||
$(TEST_COMPILE) $(LIBRARY_FLAGS) -target:library -out:$@ $(test_flags) $(LOCAL_TEST_COMPILER_ONDOTNET_FLAGS) @$(test_response)
|
||||
|
||||
test_response_preprocessed = $(test_response)_preprocessed
|
||||
|
||||
ifneq "x" "x$(PROFILE_RUNTIME)"
|
||||
GENSOURCES_RUNTIME=$(PROFILE_RUNTIME)
|
||||
else
|
||||
ifneq "x" "x$(TEST_RUNTIME)"
|
||||
GENSOURCES_RUNTIME=$(TEST_RUNTIME)
|
||||
else
|
||||
GENSOURCES_RUNTIME=MONO_PATH="$(GENSOURCES_LIBDIR)$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH" $(RUNTIME)
|
||||
endif
|
||||
endif
|
||||
|
||||
# This handles .excludes/.sources pairs, as well as resolving the
|
||||
# includes that occur in .sources files
|
||||
$(test_response_preprocessed): $(test_sourcefile) $(wildcard $(test_sourcefile_excludes)) $(GENSOURCES_CS)
|
||||
$(GENSOURCES_RUNTIME) --debug $(GENSOURCES_EXE) --basedir:./Test --strict "$@" "$(test_sourcefile)" "$(test_sourcefile_excludes)"
|
||||
$(test_response_preprocessed): $(test_sourcefile) $(wildcard $(test_sourcefile_excludes))
|
||||
$(SHELL) $(topdir)/build/gensources.sh $@ '$(test_sourcefile)' '$(test_sourcefile_excludes)'
|
||||
|
||||
$(test_response): $(test_response_preprocessed)
|
||||
# @echo Creating $@ ...
|
||||
@@ -286,17 +259,10 @@ endif
|
||||
|
||||
ifdef HAVE_CS_XTESTS
|
||||
|
||||
XTEST_HARNESS_PATH := $(topdir)/../external/xunit-binaries
|
||||
XTEST_HARNESS_PATH = $(topdir)/../external/xunit-binaries
|
||||
XTEST_HARNESS = $(XTEST_HARNESS_PATH)/xunit.console.exe
|
||||
XTEST_RESULT_FILE := TestResult-$(PROFILE)-xunit.xml
|
||||
XTEST_HARNESS_FLAGS := -noappdomain -noshadow -parallel none -nunit $(XTEST_RESULT_FILE)
|
||||
XTEST_HARNESS_FLAGS := -noappdomain -noshadow -parallel none -nunit TestResult-$(PROFILE)-xunit.xml
|
||||
XTEST_TRAIT := -notrait category=failing -notrait category=nonmonotests -notrait Benchmark=true -notrait category=outerloop
|
||||
# The logic is double inverted so this actually excludes tests not intented for current platform
|
||||
# best to search for `property name="category"` in the xml output to see what's going on
|
||||
# https://github.com/dotnet/buildtools/blob/master/src/xunit.netcore.extensions/Discoverers/PlatformSpecificDiscoverer.cs
|
||||
XTEST_TRAIT_PLATFORM := -notrait category=non$(XTEST_PLATFORM)tests
|
||||
|
||||
TEST_MONO_PATH := $(TEST_MONO_PATH)$(PLATFORM_PATH_SEPARATOR)$(XTEST_HARNESS_PATH)
|
||||
|
||||
ifdef FIXTURE
|
||||
XTEST_HARNESS_FLAGS += -class $(FIXTURE)
|
||||
@@ -311,21 +277,21 @@ XTEST_COVERAGE_FLAGS = -O=-aot --profile=coverage:output=$(topdir)/class/lib/$(P
|
||||
endif
|
||||
|
||||
check: run-xunit-test-local
|
||||
run-xunit-test: run-xunit-test-local
|
||||
xunit-test-local: $(xunit_test_lib)
|
||||
run-xunit-test-local: run-xunit-test-lib
|
||||
|
||||
# cp -rf is a HACK for xunit runner to require xunit.execution.dOTNET.dll file in local folder on .net only
|
||||
# cp -rf is a HACK for xunit runner to require xunit.execution.desktop.dll file in local folder on .net only
|
||||
run-xunit-test-lib: xunit-test-local $(XTEST_REMOTE_EXECUTOR)
|
||||
@cp -rf $(XTEST_HARNESS_PATH)/xunit.execution.dotnet.dll xunit.execution.dotnet.dll
|
||||
@cp -rf $(XTEST_HARNESS_PATH)/xunit.execution.desktop.dll xunit.execution.desktop.dll
|
||||
ok=:; \
|
||||
PATH="$(TEST_RUNTIME_WRAPPERS_PATH):$(PATH)" REMOTE_EXECUTOR=$(XTEST_REMOTE_EXECUTOR) $(TEST_RUNTIME) $(TEST_RUNTIME_FLAGS) $(XTEST_COVERAGE_FLAGS) $(AOT_RUN_FLAGS) $(XTEST_HARNESS) $(xunit_test_lib) $(XTEST_HARNESS_FLAGS) $(XTEST_TRAIT) $(XTEST_TRAIT_PLATFORM) || ok=false; \
|
||||
if [ -n "$$MONO_BABYSITTER_NUNIT_XML_LIST_FILE" ]; then echo "$(abspath $(XTEST_RESULT_FILE))" >> "$$MONO_BABYSITTER_NUNIT_XML_LIST_FILE"; fi; \
|
||||
PATH="$(TEST_RUNTIME_WRAPPERS_PATH):$(PATH)" $(TEST_RUNTIME) $(TEST_RUNTIME_FLAGS) $(XTEST_COVERAGE_FLAGS) $(AOT_RUN_FLAGS) $(XTEST_HARNESS) $(xunit_test_lib) $(XTEST_HARNESS_FLAGS) $(XTEST_TRAIT) || ok=false; \
|
||||
$$ok
|
||||
@rm -f xunit.execution.dotnet.dll
|
||||
@rm -f xunit.execution.desktop.dll
|
||||
|
||||
# Some xunit tests want to be executed in a separate process (see RemoteExecutorTestBase)
|
||||
$(XTEST_REMOTE_EXECUTOR): $(topdir)/../external/corefx/src/Common/tests/System/Diagnostics/RemoteExecutorConsoleApp/RemoteExecutorConsoleApp.cs
|
||||
$(TEST_COMPILE) -r:$(topdir)/class/lib/$(PROFILE)/mscorlib.dll $< -out:$@
|
||||
$(XTEST_REMOTE_EXECUTOR): $(topdir)/../mcs/class/test-helpers/RemoteExecutorConsoleApp.cs
|
||||
$(TEST_COMPILE) $(topdir)/../mcs/class/test-helpers/RemoteExecutorConsoleApp.cs -r:$(xunit_test_lib) $(xtest_flags) /debug-
|
||||
|
||||
$(xunit_test_lib): $(the_assembly) $(xtest_response) $(xunit_libs_dep) $(xunit_src)
|
||||
$(TEST_COMPILE) $(LIBRARY_FLAGS) $(XTEST_LIB_FLAGS) -target:library -out:$@ $(xtest_flags) @$(xtest_response) $(xunit_src)
|
||||
@@ -334,8 +300,8 @@ xtest_response_preprocessed = $(xtest_response)_preprocessed
|
||||
|
||||
# This handles .excludes/.sources pairs, as well as resolving the
|
||||
# includes that occur in .sources files
|
||||
$(xtest_response): $(xtest_sourcefile) $(wildcard *xtest.dll.sources) $(wildcard $(xtest_sourcefile_excludes)) $(GENSOURCES_CS)
|
||||
$(GENSOURCES_RUNTIME) --debug $(GENSOURCES_EXE) --strict "$@" "$(xtest_sourcefile)" "$(xtest_sourcefile_excludes)"
|
||||
$(xtest_response): $(xtest_sourcefile) $(wildcard $(xtest_sourcefile_excludes))
|
||||
$(SHELL) $(topdir)/build/gensources.sh $@ '$(xtest_sourcefile)' '$(xtest_sourcefile_excludes)'
|
||||
|
||||
$(xtest_makefrag): $(xtest_response)
|
||||
@echo Creating $@ ...
|
||||
|
||||
@@ -0,0 +1,92 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->
|
||||
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProductVersion>9.0.30729</ProductVersion>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<ProjectGuid>{E51283DC-7090-479E-B723-01C0953F18EA}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<NoWarn>1699</NoWarn>
|
||||
<LangVersion>latest</LangVersion>
|
||||
<HostPlatform Condition=" '$(HostPlatform)' == '' and '$(OS)' == 'Windows_NT'">win32</HostPlatform>
|
||||
<HostPlatform Condition=" '$(HostPlatform)' == '' and '$(OS)' == 'Unix' and $([System.IO.File]::Exists('/usr/lib/libc.dylib'))">darwin</HostPlatform>
|
||||
<HostPlatform Condition=" '$(HostPlatform)' == '' and '$(OS)' == 'Unix'">linux</HostPlatform>
|
||||
<OutputPath>./../../class/lib/net_4_x-$(HostPlatform)</OutputPath>
|
||||
<IntermediateOutputPath>obj-net_4_x-$(HostPlatform)</IntermediateOutputPath>
|
||||
<GenerateTargetFrameworkAttribute>false</GenerateTargetFrameworkAttribute>
|
||||
<NoStdLib>True</NoStdLib>
|
||||
|
||||
<NoConfig>True</NoConfig>
|
||||
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>
|
||||
</RootNamespace>
|
||||
<AssemblyName>Accessibility</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<SignAssembly>true</SignAssembly>
|
||||
<AssemblyOriginatorKeyFile>../msfinal.pub</AssemblyOriginatorKeyFile>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<NoWarn>1699</NoWarn>
|
||||
<Optimize>false</Optimize>
|
||||
<DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;WIN_PLATFORM;MULTIPLEX_OS</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<NoWarn>1699</NoWarn>
|
||||
<Optimize>true</Optimize>
|
||||
<DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;WIN_PLATFORM;MULTIPLEX_OS</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<!-- Set AddAdditionalExplicitAssemblyReferences to false, otherwise if targetting .NET4.0,
|
||||
Microsoft.NETFramework.props will force a dependency on the assembly System.Core. This
|
||||
is a problem to compile the Mono mscorlib.dll -->
|
||||
<PropertyGroup>
|
||||
<AddAdditionalExplicitAssemblyReferences>false</AddAdditionalExplicitAssemblyReferences>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<ItemGroup>
|
||||
<Compile Include="..\..\build\common\Consts.cs" />
|
||||
<Compile Include="Accessibility\IAccessible.cs" />
|
||||
<Compile Include="Accessibility\IAccessibleHandler.cs" />
|
||||
<Compile Include="Assembly\AssemblyInfo.cs" />
</ItemGroup>
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
<Target Name="BeforeBuild">
|
||||
</Target>
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
<PropertyGroup>
|
||||
<PreBuildEvent Condition=" '$(OS)' != 'Windows_NT' ">
|
||||
|
||||
</PreBuildEvent>
|
||||
<PreBuildEvent Condition=" '$(OS)' == 'Windows_NT' ">
|
||||
|
||||
</PreBuildEvent>
|
||||
<PostBuildEvent Condition=" '$(OS)' != 'Windows_NT' ">
|
||||
|
||||
</PostBuildEvent>
|
||||
<PostBuildEvent Condition=" '$(OS)' == 'Windows_NT' ">
|
||||
|
||||
</PostBuildEvent>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="../corlib/corlib-net_4_x.csproj">
|
||||
<Project>{2CA6026B-2DC8-4C4C-A12C-1E8234049DB7}</Project>
|
||||
<Name>corlib-net_4_x</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Folder Include="Properties\" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
|
||||
@@ -1,75 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->
|
||||
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">net_4_x</Platform>
|
||||
<ProjectGuid>{2CFDD4F5-4B13-4FF4-A421-0361F2FC825F}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<NoWarn>1699</NoWarn>
|
||||
<LangVersion>latest</LangVersion>
|
||||
<HostPlatform Condition=" '$(HostPlatform)' == '' and '$(OS)' == 'Windows_NT'">win32</HostPlatform>
|
||||
<HostPlatform Condition=" '$(HostPlatform)' == '' and '$(OS)' == 'Unix' and $([System.IO.File]::Exists('/usr/lib/libc.dylib'))">darwin</HostPlatform>
|
||||
<HostPlatform Condition=" '$(HostPlatform)' == '' and '$(OS)' == 'Unix'">linux</HostPlatform>
|
||||
<GenerateTargetFrameworkAttribute>false</GenerateTargetFrameworkAttribute>
|
||||
<NoStdLib>True</NoStdLib>
|
||||
<NoConfig>True</NoConfig>
|
||||
<AssemblyName>Accessibility</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.6.2</TargetFrameworkVersion>
|
||||
<SignAssembly>true</SignAssembly>
|
||||
<AssemblyOriginatorKeyFile>../msfinal.pub</AssemblyOriginatorKeyFile>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<!-- Set AddAdditionalExplicitAssemblyReferences to false, otherwise if targetting .NET4.0,
|
||||
Microsoft.NETFramework.props will force a dependency on the assembly System.Core. This
|
||||
is a problem to compile the Mono mscorlib.dll -->
|
||||
<AddAdditionalExplicitAssemblyReferences>false</AddAdditionalExplicitAssemblyReferences>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Platform)' == 'net_4_x' ">
|
||||
<OutputPath>./../../class/lib/net_4_x-$(HostPlatform)</OutputPath>
|
||||
<IntermediateOutputPath>./../../class/obj/$(AssemblyName)-net_4_x-$(HostPlatform)</IntermediateOutputPath>
|
||||
<DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;WIN_PLATFORM</DefineConstants>
|
||||
</PropertyGroup>
|
||||
<!-- @ALL_PROFILE_PROPERTIES@ -->
|
||||
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<!-- TRACE is set only for Debug configuration, so inherit from platform-specific value -->
|
||||
<DefineConstants>TRACE;$(DefineConstants)</DefineConstants>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<!-- @BUILT_SOURCES@ -->
|
||||
<!--Common files-->
|
||||
<ItemGroup>
|
||||
<Compile Include="..\..\build\common\Consts.cs" />
|
||||
<Compile Include="Accessibility\IAccessible.cs" />
|
||||
<Compile Include="Accessibility\IAccessibleHandler.cs" />
|
||||
<Compile Include="Assembly\AssemblyInfo.cs" />
|
||||
<ProjectReference Include="$(SolutionDir)\msvc\scripts\genconsts.csproj">
|
||||
<Name>genconsts</Name>
|
||||
<Project>{702AE2C0-71DD-4112-9A06-E4FABCA59986}</Project>
|
||||
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
|
||||
<CopyToOutputDirectory>Never</CopyToOutputDirectory>
|
||||
<Private>false</Private>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<!--End of common files-->
|
||||
<!-- @ALL_SOURCES@ -->
|
||||
<!-- @COMMON_PROJECT_REFERENCES@ -->
|
||||
<ItemGroup Condition=" '$(Platform)' == 'net_4_x' ">
|
||||
<ProjectReference Include="../corlib/corlib.csproj" />
|
||||
</ItemGroup>
|
||||
<!-- @ALL_REFERENCES@ -->
|
||||
<!-- @ALL_RESOURCES@ -->
|
||||
<PropertyGroup>
|
||||
<!-- Force the pre-build event to run after references have been resolved. The default
|
||||
behavior is to run them before resolving references, which can cause things like
|
||||
culevel.exe to be used before they have been built. -->
|
||||
<PreBuildEventDependsOn>ResolveReferences</PreBuildEventDependsOn>
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
@@ -0,0 +1,143 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->
|
||||
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProductVersion>9.0.30729</ProductVersion>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<ProjectGuid>{FFFE76FE-98EE-4FF7-81D9-35C0FE1D3718}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<NoWarn>1699</NoWarn>
|
||||
<LangVersion>latest</LangVersion>
|
||||
<HostPlatform Condition=" '$(HostPlatform)' == '' and '$(OS)' == 'Windows_NT'">win32</HostPlatform>
|
||||
<HostPlatform Condition=" '$(HostPlatform)' == '' and '$(OS)' == 'Unix' and $([System.IO.File]::Exists('/usr/lib/libc.dylib'))">darwin</HostPlatform>
|
||||
<HostPlatform Condition=" '$(HostPlatform)' == '' and '$(OS)' == 'Unix'">linux</HostPlatform>
|
||||
<OutputPath>./../../class/lib/net_4_x-$(HostPlatform)</OutputPath>
|
||||
<IntermediateOutputPath>obj-net_4_x-$(HostPlatform)</IntermediateOutputPath>
|
||||
<GenerateTargetFrameworkAttribute>false</GenerateTargetFrameworkAttribute>
|
||||
<NoStdLib>True</NoStdLib>
|
||||
|
||||
<NoConfig>True</NoConfig>
|
||||
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>
|
||||
</RootNamespace>
|
||||
<AssemblyName>Commons.Xml.Relaxng</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<SignAssembly>true</SignAssembly>
|
||||
<AssemblyOriginatorKeyFile>../mono.pub</AssemblyOriginatorKeyFile>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<NoWarn>1699</NoWarn>
|
||||
<Optimize>false</Optimize>
|
||||
<DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;WIN_PLATFORM;MULTIPLEX_OS</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<NoWarn>1699</NoWarn>
|
||||
<Optimize>true</Optimize>
|
||||
<DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;WIN_PLATFORM;MULTIPLEX_OS</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<!-- Set AddAdditionalExplicitAssemblyReferences to false, otherwise if targetting .NET4.0,
|
||||
Microsoft.NETFramework.props will force a dependency on the assembly System.Core. This
|
||||
is a problem to compile the Mono mscorlib.dll -->
|
||||
<PropertyGroup>
|
||||
<AddAdditionalExplicitAssemblyReferences>false</AddAdditionalExplicitAssemblyReferences>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<ItemGroup>
|
||||
<Compile Include="..\..\build\common\Consts.cs" />
|
||||
<Compile Include="..\..\build\common\Locale.cs" />
|
||||
<Compile Include="Assembly\AssemblyInfo.cs" />
|
||||
<Compile Include="Commons.Xml.Nvdl\NvdlBuiltInValidationProvider.cs" />
|
||||
<Compile Include="Commons.Xml.Nvdl\NvdlCompileContext.cs" />
|
||||
<Compile Include="Commons.Xml.Nvdl\NvdlConfig.cs" />
|
||||
<Compile Include="Commons.Xml.Nvdl\NvdlException.cs" />
|
||||
<Compile Include="Commons.Xml.Nvdl\NvdlFilteredXmlReader.cs" />
|
||||
<Compile Include="Commons.Xml.Nvdl\NvdlReader.cs" />
|
||||
<Compile Include="Commons.Xml.Nvdl\NvdlRelaxngSupport.cs" />
|
||||
<Compile Include="Commons.Xml.Nvdl\NvdlSimplified.cs" />
|
||||
<Compile Include="Commons.Xml.Nvdl\NvdlStructures.cs" />
|
||||
<Compile Include="Commons.Xml.Nvdl\NvdlValidatingReader.cs" />
|
||||
<Compile Include="Commons.Xml.Nvdl\NvdlValidationProvider.cs" />
|
||||
<Compile Include="Commons.Xml.Nvdl\NvdlValidator.cs" />
|
||||
<Compile Include="Commons.Xml.Nvdl\NvdlXsdSupport.cs" />
|
||||
<Compile Include="Commons.Xml.Relaxng.Derivative\RdpContentType.cs" />
|
||||
<Compile Include="Commons.Xml.Relaxng.Derivative\RdpNameClasses.cs" />
|
||||
<Compile Include="Commons.Xml.Relaxng.Derivative\RdpObjects.cs" />
|
||||
<Compile Include="Commons.Xml.Relaxng.Derivative\RdpPatterns.cs" />
|
||||
<Compile Include="Commons.Xml.Relaxng.Derivative\Util.cs" />
|
||||
<Compile Include="Commons.Xml.Relaxng.Inference\RelaxngInference.cs" />
|
||||
<Compile Include="Commons.Xml.Relaxng.Rnc\RncTokenizer.cs" />
|
||||
<Compile Include="Commons.Xml.Relaxng.Rnc\RncWriter.cs" />
|
||||
<Compile Include="Commons.Xml.Relaxng.Rnc\XmlChar.cs" />
|
||||
<Compile Include="Commons.Xml.Relaxng\Misc.cs" />
|
||||
<Compile Include="Commons.Xml.Relaxng\RelaxngDatatype.cs" />
|
||||
<Compile Include="Commons.Xml.Relaxng\RelaxngDatatypeProvider.cs" />
|
||||
<Compile Include="Commons.Xml.Relaxng\RelaxngDefaultDatatypes.cs" />
|
||||
<Compile Include="Commons.Xml.Relaxng\RelaxngException.cs" />
|
||||
<Compile Include="Commons.Xml.Relaxng\RelaxngGrammar.cs" />
|
||||
<Compile Include="Commons.Xml.Relaxng\RelaxngMergedProvider.cs" />
|
||||
<Compile Include="Commons.Xml.Relaxng\RelaxngNameClass.cs" />
|
||||
<Compile Include="Commons.Xml.Relaxng\RelaxngPattern.cs" />
|
||||
<Compile Include="Commons.Xml.Relaxng\RelaxngPatternType.cs" />
|
||||
<Compile Include="Commons.Xml.Relaxng\RelaxngReader.cs" />
|
||||
<Compile Include="Commons.Xml.Relaxng\RelaxngValidatingReader.cs" />
|
||||
<Compile Include="Commons.Xml.Relaxng\XsdDatatypeProvider.cs" />
|
||||
<Compile Include="Commons.Xml\XmlDefaultReader.cs" />
|
||||
<Compile Include="Commons.Xml.Relaxng.Rnc\RncParser.cs" />
</ItemGroup>
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
<Target Name="BeforeBuild">
|
||||
</Target>
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
<PropertyGroup>
|
||||
<PreBuildEvent Condition=" '$(OS)' != 'Windows_NT' ">
|
||||
$(ProjectDir)\..\..\jay\jay -ct < $(ProjectDir)\..\..\jay\skeleton.cs $(ProjectDir)\Commons.Xml.Relaxng.Rnc\RncParser.jay > $(ProjectDir)\Commons.Xml.Relaxng.Rnc\RncParser.cs
|
||||
|
||||
</PreBuildEvent>
|
||||
<PreBuildEvent Condition=" '$(OS)' == 'Windows_NT' ">
|
||||
$(ProjectDir)\..\..\jay\jay -ct < $(ProjectDir)\..\..\jay\skeleton.cs $(ProjectDir)\Commons.Xml.Relaxng.Rnc\RncParser.jay > $(ProjectDir)\Commons.Xml.Relaxng.Rnc\RncParser.cs
|
||||
|
||||
</PreBuildEvent>
|
||||
<PostBuildEvent Condition=" '$(OS)' != 'Windows_NT' ">
|
||||
|
||||
</PostBuildEvent>
|
||||
<PostBuildEvent Condition=" '$(OS)' == 'Windows_NT' ">
|
||||
|
||||
</PostBuildEvent>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="../corlib/corlib-net_4_x.csproj">
|
||||
<Project>{2CA6026B-2DC8-4C4C-A12C-1E8234049DB7}</Project>
|
||||
<Name>corlib-net_4_x</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="../System/System-net_4_x.csproj">
|
||||
<Project>{2762E921-91A8-4C87-91E9-BA628013F753}</Project>
|
||||
<Name>System-net_4_x</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="../System.XML/System.Xml-net_4_x.csproj">
|
||||
<Project>{87FD2F0F-5222-4AE6-BD63-2D4975E11E5B}</Project>
|
||||
<Name>System.Xml-net_4_x</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Folder Include="Properties\" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="resources/relaxng.rng">
|
||||
<LogicalName>relaxng.rng</LogicalName>
|
||||
</EmbeddedResource>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
|
||||
Loaded 100 of 4245 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user