mirror of
https://github.com/BepInEx/mono.git
synced 2026-11-16 01:41:18 -10:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5077205a44 | ||
|
|
0d6f6f8f40 | ||
|
|
d6c24517f4 | ||
|
|
0f5c24054c | ||
|
|
3511ffcb2d | ||
|
|
188c235ca4 | ||
|
|
25ac18a9b7 | ||
|
|
d95d7d30fe | ||
|
|
82d42e61b1 | ||
|
|
4c98dc2006 | ||
|
|
4dc09dc922 | ||
|
|
d27287c77b | ||
|
|
1298269b88 | ||
|
|
2ce82742e8 | ||
|
|
81da99eb76 | ||
|
|
9667aa6485 | ||
|
|
1e856f02ff | ||
|
|
6ab979c9df | ||
|
|
02b6c24e5d | ||
|
|
87ad2c3690 | ||
|
|
3cde98344e | ||
|
|
1d0445bfc7 | ||
|
|
1d389ea02c | ||
|
|
ad60bf18b7 | ||
|
|
c20c0b3b81 | ||
|
|
d33f7f6de9 | ||
|
|
c8c005f137 | ||
|
|
1aa58e9a46 | ||
|
|
5673411799 | ||
|
|
1434f9c879 | ||
|
|
3598a4ab55 | ||
|
|
72cdd51acb | ||
|
|
ea3996571a | ||
|
|
bdf17346a6 | ||
|
|
37f8c76e38 | ||
|
|
cda97d6fc1 | ||
|
|
198ff835e9 | ||
|
|
ba317ed4e6 | ||
|
|
450d4d7a9e | ||
|
|
5da5fa26fb | ||
|
|
bee954cff2 | ||
|
|
762430b83e | ||
|
|
d717e1b1ea | ||
|
|
5a3893de5c | ||
|
|
6dc5ddd3d9 | ||
|
|
6f6232707c | ||
|
|
64a055b079 | ||
|
|
34a69b5e81 | ||
|
|
b8c96604c5 | ||
|
|
440fff5aee | ||
|
|
502a6a5e1b | ||
|
|
02f0d6ee9d | ||
|
|
4242008df5 | ||
|
|
12f8ebafed | ||
|
|
e6a3b54b37 | ||
|
|
b6255d35cd | ||
|
|
ff7a2e46e7 | ||
|
|
b83bdfd396 | ||
|
|
c686827dba | ||
|
|
b9b2d23f1a | ||
|
|
d845201db4 | ||
|
|
10fe0e89c0 | ||
|
|
83ca242114 | ||
|
|
5309190d7d | ||
|
|
98e0d8c486 | ||
|
|
a9d142eeb2 | ||
|
|
6149b5d569 | ||
|
|
851b6c7654 | ||
|
|
6462e3fc8e | ||
|
|
2eced64a82 | ||
|
|
e6c0a86e70 | ||
|
|
ad88c52d8e | ||
|
|
7e2f9aa7e8 | ||
|
|
dda961cf9a | ||
|
|
55a698e07d | ||
|
|
67489264b7 | ||
|
|
f23dca66a7 | ||
|
|
590080c39e | ||
|
|
452f94286b | ||
|
|
f342dae059 | ||
|
|
8fafb67859 | ||
|
|
71cc0a16c9 | ||
|
|
78c2486dcb | ||
|
|
f47f6a1dab | ||
|
|
052d1c2867 | ||
|
|
bdc6fd7f03 | ||
|
|
90faddac77 | ||
|
|
809fa3a3a8 | ||
|
|
7ce4e861df | ||
|
|
4e11ba5c8b | ||
|
|
9dafa35db6 | ||
|
|
51f9a82ecd | ||
|
|
5a3b524b60 | ||
|
|
d4df2e7aa9 | ||
|
|
4d40922fde | ||
|
|
082289cc15 | ||
|
|
ef4352cde5 | ||
|
|
9ed0907eea | ||
|
|
339c5249a7 | ||
|
|
df9df437ae | ||
|
|
d15985c4af | ||
|
|
98a9c23d70 | ||
|
|
4b82d60bbc | ||
|
|
c3452996bd | ||
|
|
65d1d7cdae | ||
|
|
d424096c05 | ||
|
|
6d11ff42da | ||
|
|
1c7614193f | ||
|
|
be6441b30d | ||
|
|
66f8f1aa53 | ||
|
|
a5c496fd46 | ||
|
|
b92bdff265 | ||
|
|
d27cc030bb | ||
|
|
5f5f25f58a | ||
|
|
0d0be3e704 | ||
|
|
414feeffc7 | ||
|
|
06060e290d | ||
|
|
37a593df33 | ||
|
|
c34e267b4c | ||
|
|
582b140f7d | ||
|
|
16c75ce329 | ||
|
|
72eabfe658 | ||
|
|
c8e14aa2ea | ||
|
|
ffcc54965d | ||
|
|
2d56aa09df | ||
|
|
ac26b00ca4 | ||
|
|
f77c835faf | ||
|
|
e319507866 | ||
|
|
cd5d8a9d1b | ||
|
|
5eae4df2ee | ||
|
|
9ecfd9f23a | ||
|
|
37de1b5b0d | ||
|
|
68392d0c90 | ||
|
|
715991f427 | ||
|
|
503f379a22 | ||
|
|
a36202bfea | ||
|
|
bbf84b172e | ||
|
|
62a0e75dd8 | ||
|
|
80e1e3a964 | ||
|
|
303981e264 | ||
|
|
05ff99fc73 | ||
|
|
24e82a5385 | ||
|
|
cd2579f7ce | ||
|
|
760ac86dd9 | ||
|
|
2b14612b1c | ||
|
|
94ced23f9a | ||
|
|
66905636c1 | ||
|
|
2fb26892dc | ||
|
|
4b62516d17 | ||
|
|
d78c35091b | ||
|
|
836896684c | ||
|
|
9528721b39 | ||
|
|
eff6063589 | ||
|
|
b600314281 | ||
|
|
a5808f9c71 | ||
|
|
785c82b5d1 | ||
|
|
dcc3c6090b | ||
|
|
08f150b1d9 | ||
|
|
a417e02c2d | ||
|
|
1a1d71d808 | ||
|
|
152e22549b | ||
|
|
ae2e60c61c | ||
|
|
9f78eca1af | ||
|
|
8cbef676c3 | ||
|
|
724c7df79c | ||
|
|
15e53eba9b | ||
|
|
7323343a64 | ||
|
|
c69dae3bcb | ||
|
|
661495317c | ||
|
|
2415374524 | ||
|
|
fa1030da6f | ||
|
|
a17a84caee | ||
|
|
44560f1e67 | ||
|
|
c52c4bd713 | ||
|
|
c8ca5929c7 | ||
|
|
d60a36ee80 | ||
|
|
cee57b3c78 | ||
|
|
fe75a6ee2f | ||
|
|
65956a952d | ||
|
|
b6b7ce3eff | ||
|
|
e6409c5953 | ||
|
|
2cc99a1681 | ||
|
|
d8b4f5d2ab | ||
|
|
0c315e92b0 | ||
|
|
5d7e4c9cf6 | ||
|
|
23fb3fe800 | ||
|
|
679777b17b | ||
|
|
f0c0314e4d | ||
|
|
10ee1bafc9 | ||
|
|
bceca5b359 | ||
|
|
4560d3c57f | ||
|
|
1c41089315 | ||
|
|
cb922c0fa6 | ||
|
|
fe9c5ebe97 | ||
|
|
51403d818e | ||
|
|
459d47bb9b | ||
|
|
63dde6cce0 | ||
|
|
640d5a03e4 | ||
|
|
19b866517a | ||
|
|
8953abc7d3 | ||
|
|
b78f4f6e5f | ||
|
|
9bd54596bb | ||
|
|
74d31d88ef | ||
|
|
d66823b37b | ||
|
|
f01f6476b5 | ||
|
|
bcf75c0b8c | ||
|
|
84b7173fcb | ||
|
|
2b673c3022 | ||
|
|
ff9ce3b7ff | ||
|
|
97056ba86a | ||
|
|
ceaa04d0b8 | ||
|
|
87a92c89c2 | ||
|
|
de1a4a0229 | ||
|
|
2f1bfa9788 | ||
|
|
6caddcd9d1 | ||
|
|
8a3e2b11e1 | ||
|
|
e2fa30543b | ||
|
|
8a113e88b3 | ||
|
|
d8e522c16c | ||
|
|
e476b1ac33 | ||
|
|
6fbe05fe9a | ||
|
|
440cd5475c | ||
|
|
dc34ec682c | ||
|
|
9deeb95816 | ||
|
|
171ba52158 | ||
|
|
4393b68452 | ||
|
|
76da2e9ed8 | ||
|
|
5006bcc901 | ||
|
|
50c26943d4 | ||
|
|
5596255efe | ||
|
|
a41069ad76 | ||
|
|
f70bda0c06 | ||
|
|
3ed19e6630 | ||
|
|
f404e04d6d | ||
|
|
6019eeb483 | ||
|
|
e37d7a2ce9 | ||
|
|
2440b14865 | ||
|
|
4f4cb919cf | ||
|
|
42a5eeb95a | ||
|
|
b65e5ee577 | ||
|
|
672282c892 |
No files matched your search
+4
-7
@@ -1,6 +1,3 @@
|
||||
# diff settings
|
||||
*.cs diff=csharp
|
||||
|
||||
# ensure LF endings on all checkouts
|
||||
configure.ac crlf=input
|
||||
config.rpath crlf=input
|
||||
@@ -16,11 +13,11 @@ mkinstalldirs crlf=input
|
||||
*.h crlf
|
||||
*.cs crlf
|
||||
*.il crlf
|
||||
*.sln crlf
|
||||
*.*proj* crlf
|
||||
|
||||
# don't do anything to line-endings. Let CRLFs/LFs go into the repo, and CRLF/LFs on checkout
|
||||
*.bat -crlf
|
||||
# don't do anything to line-endings. Let CRLFs go into the repo, and CRLF on checkout
|
||||
*.bat -crlf
|
||||
*.sln -crlf
|
||||
*.*proj* -crlf
|
||||
*.xml -crlf
|
||||
|
||||
# CRLF Handling
|
||||
|
||||
@@ -1,161 +0,0 @@
|
||||
# Mono Code Owners File
|
||||
#
|
||||
# GitHub uses this file to determine who to assign for reviews
|
||||
# on pull requests. Please keep this file alphabetically sorted.
|
||||
#
|
||||
# References:
|
||||
#
|
||||
# https://github.com/blog/2392-introducing-code-owners
|
||||
# https://help.github.com/articles/about-codeowners
|
||||
|
||||
|
||||
# These owners will be the default owners for everything in the repo.
|
||||
* @marek-safar
|
||||
|
||||
# Order is important. The last matching pattern has the most precedence.
|
||||
|
||||
/acceptance-tests @akoeplinger @kg
|
||||
/acceptance-tests/profiler-stress* @BrzVlad @akoeplinger
|
||||
|
||||
/data @directhex @akoeplinger
|
||||
/data/gdb @lewurm @vargaz
|
||||
/data/lldb @lewurm @vargaz
|
||||
|
||||
/docs @marek-safar @akoeplinger
|
||||
/docs/riscv.md @alexrp @lewurm
|
||||
/docs/sources/mono-api-profiler.html @BrzVlad
|
||||
|
||||
/external @akoeplinger @marek-safar
|
||||
/external/api-snapshot @marek-safar @akoeplinger
|
||||
/external/binary-reference-assemblies @marek-safar @akoeplinger
|
||||
/external/bockbuild @akoeplinger @alexischr
|
||||
/external/boringssl @baulig
|
||||
/external/cecil @marek-safar @akoeplinger
|
||||
/external/corefx @akoeplinger @marek-safar @egorbo @steveisok
|
||||
/external/corert @akoeplinger @marek-safar @egorbo @steveisok
|
||||
/external/linker @marek-safar
|
||||
/external/llvm-project @SamMonoRT @vargaz @imhameed
|
||||
/external/nuget-buildtasks @radical @akoeplinger
|
||||
/external/roslyn-binaries @kg @marek-safar @akoeplinger @lewing
|
||||
|
||||
/libgc @BrzVlad @vargaz @naricc
|
||||
|
||||
/llvm @vargaz @SamMonoRT @imhameed
|
||||
|
||||
/man @marek-safar @miguel
|
||||
/man/*prof* @BrzVlad
|
||||
|
||||
/mcs @marek-safar @akoeplinger @egorbo
|
||||
|
||||
/mcs/build @marek-safar @akoeplinger
|
||||
|
||||
/mcs/class @steveisok @akoeplinger
|
||||
/mcs/class/corlib/System.Reflection*/ @vargaz @lambdageek
|
||||
/mcs/class/corlib/System.Security.Cryptography.X509Certificates @baulig @steveisok
|
||||
/mcs/class/Mono.Btls.Interface @baulig @steveisok
|
||||
/mcs/class/Mono.Data.Tds @egorbo
|
||||
/mcs/class/Mono.Debugger.Soft @vargaz @thaystg
|
||||
/mcs/class/Mono.Options @jonpryor @marek-safar
|
||||
/mcs/class/Mono.Profiler.Log @lambdageek
|
||||
/mcs/class/Mono.Security/Mono.Security/Interface @baulig @steveisok
|
||||
/mcs/class/System/Mono.AppleTls @baulig @rolf
|
||||
/mcs/class/System/Mono.Btls @baulig @marek-safar
|
||||
/mcs/class/System/Mono.Net.Security @baulig @steveisok
|
||||
/mcs/class/System/Mono.Security.Interface @baulig @steveisok
|
||||
/mcs/class/System/System.Security.Cryptography.X509Certificates @baulig @steveisok
|
||||
/mcs/class/System.Data* @egorbo @steveisok
|
||||
|
||||
/mcs/errors @marek-safar @lewurm
|
||||
/mcs/ilasm @marek-safar @lewurm
|
||||
/mcs/jay @marek-safar @lewurm
|
||||
/mcs/mcs @marek-safar @lewurm
|
||||
/mcs/tests @marek-safar @lewurm
|
||||
|
||||
/mcs/tools @marek-safar @akoeplinger @steveisok
|
||||
/mcs/tools/gensources @kg @akoeplinger
|
||||
/mcs/tools/resx2sr @baulig
|
||||
/mcs/tools/upload-to-sentry @directhex @akoeplinger
|
||||
|
||||
/mono/arch @vargaz @lewurm
|
||||
|
||||
/mono/btls @baulig @marek-safar
|
||||
/mono/dis @lambdageek @vargaz
|
||||
/mono/eglib @vargaz @lambdageek
|
||||
|
||||
/mono/benchmark @SamMonoRT @lewurm
|
||||
|
||||
/mono/metadata @vargaz @lambdageek @thaystg
|
||||
/mono/metadata/*profiler* @lambdageek
|
||||
/mono/metadata/handle* @lambdageek @vargaz
|
||||
/mono/metadata/monitor* @brzvlad @vargaz
|
||||
/mono/metadata/sgen* @brzvlad @vargaz @naricc
|
||||
/mono/metadata/thread* @lateralusX @lambdageek
|
||||
/mono/metadata/w32* @lateralusX @lambdageek
|
||||
/mono/metadata/*-win* @lateralusX @lambdageek
|
||||
/mono/metadata/appdomain* @vargaz @lambdageek @CoffeeFlux
|
||||
/mono/metadata/assembly* @vargaz @lambdageek @CoffeeFlux
|
||||
/mono/metadata/domain* @vargaz @lambdageek @CoffeeFlux
|
||||
/mono/metadata/loader* @vargaz @lambdageek @CoffeeFlux
|
||||
/mono/metadata/native-library* @vargaz @lambdageek @CoffeeFlux
|
||||
/mono/metadata/*-unix* @lambdageek @CoffeeFlux
|
||||
|
||||
/mono/mini @vargaz @lewurm @lambdageek @SamMonoRT
|
||||
/mono/mini/*cfgdump* @lewurm @vargaz
|
||||
/mono/mini/*exceptions* @lewurm @vargaz @BrzVlad
|
||||
/mono/mini/*ppc* @lewurm @vargaz
|
||||
/mono/mini/*riscv* @alexrp @lewurm
|
||||
/mono/mini/*type-check* @lewurm @lambdageek
|
||||
/mono/mini/*llvm* @vargaz @imhameed
|
||||
/mono/mini/interp/* @lewurm @BrzVlad
|
||||
/mono/mini/*profiler* @BrzVlad @lambdageek
|
||||
/mono/mini/debugger-agent.c @vargaz @thaystg @DavidKarlas @lambdageek
|
||||
|
||||
/mono/native @baulig @egorbo @alexischr @marek-safar
|
||||
|
||||
/mono/profiler @BrzVlad @lambdageek
|
||||
|
||||
/mono/sgen @BrzVlad @lambdageek
|
||||
|
||||
/mono/utils @vargaz @lewurm @lambdageek
|
||||
/mono/utils/atomic* @lewurm @vargaz
|
||||
/mono/utils/mono-hwcap* @lewurm @vargaz
|
||||
/mono/utils/mono-mem* @lewurm @vargaz
|
||||
/mono/utils/mono-merp* @alexischr @lambdageek
|
||||
/mono/utils/mono-state* @alexischr @lambdageek
|
||||
/mono/utils/mono-threads* @lambdageek @vargaz
|
||||
/mono/utils/*-win* @lateralusX @lambdageek
|
||||
|
||||
/msvc @lateralusX @kg @akoeplinger
|
||||
/msvc/scripts @akoeplinger @kg
|
||||
|
||||
/netcore @marek-safar @akoeplinger @egorbo @vargaz @steveisok
|
||||
|
||||
/packaging @alexischr @akoeplinger @directhex
|
||||
/packaging/MacSDK/msbuild.py @radical @akoeplinger
|
||||
|
||||
/runtime @akoeplinger @marek-safar
|
||||
|
||||
/samples @lambdageek @lewurm
|
||||
/samples/profiler @BrzVlad @lambdageek
|
||||
/samples/size @alexrp @lambdageek
|
||||
|
||||
/scripts @akoeplinger @directhex
|
||||
/scripts/ci @akoeplinger @directhex
|
||||
|
||||
/sdks @marek-safar @lewurm @vargaz @lambdageek
|
||||
/sdks/builds/android* @alexischr @jonpryor
|
||||
/sdks/builds/mxe* @alexischr @jonpryor
|
||||
/sdks/builds/ios* @vargaz @rolfbjarne
|
||||
/sdks/builds/wasm* @vargaz @kjpou1 @lewing
|
||||
/sdks/wasm @vargaz @kjpou1 @kg @lewing
|
||||
/sdks/ios @vargaz @rolfbjarne
|
||||
/sdks/android @alexischr @jonpryor
|
||||
|
||||
/support @lambdageek @vargaz
|
||||
|
||||
/tools @lambdageek @vargaz
|
||||
/tools/locale-builder @marek-safar @egorbo
|
||||
/tools/nuget-hash-extractor @marek-safar @radical @akoeplinger
|
||||
/tools/offsets-tool @lewurm @rolfbjarne
|
||||
/tools/pedump @lambdageek @lewurm
|
||||
/tools/sgen @brzvlad @vargaz @naricc
|
||||
@@ -1,47 +0,0 @@
|
||||
<!--
|
||||
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.
|
||||
2.
|
||||
3.
|
||||
|
||||
<!--
|
||||
You may drag & drop the attachment (repro code/solution, screenshot, etc.) onto the issue.
|
||||
-->
|
||||
|
||||
### Current Behavior
|
||||
|
||||
<!--
|
||||
What is the current behavior?
|
||||
-->
|
||||
|
||||
### Expected Behavior
|
||||
|
||||
<!--
|
||||
Please describe the behavior you are expecting
|
||||
-->
|
||||
|
||||
## On which platforms did you notice this
|
||||
|
||||
[ ] macOS
|
||||
[ ] Linux
|
||||
[ ] Windows
|
||||
|
||||
**Version Used**:
|
||||
|
||||
<!--
|
||||
You can use `mono --version` or About dialog to obtain this information.
|
||||
-->
|
||||
|
||||
## Stacktrace
|
||||
|
||||
```
|
||||
Please paste the stack trace 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
-21
@@ -24,6 +24,7 @@
|
||||
*.tlh
|
||||
*.bak
|
||||
*.ilk
|
||||
*.log
|
||||
*.lib
|
||||
*.sbr
|
||||
*.sdf
|
||||
@@ -39,12 +40,10 @@ Ankh.NoLoad
|
||||
*.gpState
|
||||
.vscode/
|
||||
*.exp
|
||||
.vs/
|
||||
|
||||
# Tooling
|
||||
_ReSharper*/
|
||||
*.resharper
|
||||
.idea/*
|
||||
[Tt]est[Rr]esult*
|
||||
*.orig
|
||||
*.rej
|
||||
@@ -88,9 +87,7 @@ stamp-h.in
|
||||
*~
|
||||
*.swp
|
||||
*.o
|
||||
*.dylib
|
||||
.deps
|
||||
.libs
|
||||
|
||||
# Libtool
|
||||
libtool.m4
|
||||
@@ -128,24 +125,7 @@ docs/perlmod*
|
||||
compile
|
||||
mono.h
|
||||
mono-*.tar.*
|
||||
mono_crash*
|
||||
tmpinst-dir.stamp
|
||||
msvc/scripts/inputs/
|
||||
extensions-config.h
|
||||
*.dylib.dSYM
|
||||
*.mlpd
|
||||
llvm/build/
|
||||
llvm/usr/
|
||||
sdks/builds/llvm-*/
|
||||
sdks/builds/android-*/
|
||||
mcs/build/compiler-server.log
|
||||
tools/offsets-tool-py/offtool/
|
||||
tools/offsets-tool-py/clang/__pycache__
|
||||
|
||||
##############################################################################
|
||||
# Arcade output directories
|
||||
##############################################################################
|
||||
|
||||
.packages
|
||||
artifacts
|
||||
.dotnet
|
||||
+7
-22
@@ -7,6 +7,7 @@
|
||||
[submodule "external/cecil"]
|
||||
path = external/cecil
|
||||
url = git://github.com/mono/cecil.git
|
||||
branch = mono-2017-02
|
||||
[submodule "external/rx"]
|
||||
path = external/rx
|
||||
url = git://github.com/mono/rx.git
|
||||
@@ -20,12 +21,18 @@
|
||||
[submodule "external/reference-assemblies"]
|
||||
path = external/binary-reference-assemblies
|
||||
url = git://github.com/mono/reference-assemblies.git
|
||||
[submodule "external/Lucene.Net.Light"]
|
||||
path = external/Lucene.Net.Light
|
||||
url = git://github.com/mono/Lucene.Net.Light.git
|
||||
[submodule "external/nunit-lite"]
|
||||
path = external/nunit-lite
|
||||
url = git://github.com/mono/NUnitLite.git
|
||||
[submodule "external/nuget-buildtasks"]
|
||||
path = external/nuget-buildtasks
|
||||
url = git://github.com/mono/NuGet.BuildTasks
|
||||
[submodule "external/buildtools"]
|
||||
path = external/buildtools
|
||||
url = git://github.com/mono/buildtools.git
|
||||
[submodule "external/cecil-legacy"]
|
||||
path = external/cecil-legacy
|
||||
url = git://github.com/mono/cecil.git
|
||||
@@ -49,25 +56,3 @@
|
||||
[submodule "external/corert"]
|
||||
path = external/corert
|
||||
url = git://github.com/mono/corert.git
|
||||
[submodule "external/xunit-binaries"]
|
||||
path = external/xunit-binaries
|
||||
url = git://github.com/mono/xunit-binaries.git
|
||||
[submodule "external/api-doc-tools"]
|
||||
path = external/api-doc-tools
|
||||
url = git://github.com/mono/api-doc-tools.git
|
||||
[submodule "external/api-snapshot"]
|
||||
path = external/api-snapshot
|
||||
url = git://github.com/mono/api-snapshot.git
|
||||
[submodule "external/helix-binaries"]
|
||||
path = external/helix-binaries
|
||||
url = git://github.com/mono/helix-binaries.git
|
||||
[submodule "external/illinker-test-assets"]
|
||||
path = external/illinker-test-assets
|
||||
url = git://github.com/mono/illinker-test-assets.git
|
||||
[submodule "external/llvm-project"]
|
||||
path = external/llvm-project
|
||||
url = git://github.com/dotnet/llvm-project.git
|
||||
branch = release/6.x
|
||||
[submodule "external/bdwgc"]
|
||||
path = external/bdwgc
|
||||
url = git://github.com/Unity-Technologies/bdwgc.git
|
||||
Vendored
-90
@@ -1,90 +0,0 @@
|
||||
{
|
||||
"configurations": [
|
||||
{
|
||||
"name": "Mac",
|
||||
"includePath": [
|
||||
"${default}",
|
||||
"/usr/local/include",
|
||||
"${workspaceRoot}",
|
||||
"${workspaceRoot}/mono",
|
||||
"${workspaceRoot}/mono/eglib",
|
||||
"${workspaceRoot}/support"
|
||||
],
|
||||
"defines": [],
|
||||
"intelliSenseMode": "clang-x64",
|
||||
"browse": {
|
||||
"path": [
|
||||
"${default}",
|
||||
"/usr/local/include",
|
||||
"${workspaceRoot}",
|
||||
"${workspaceRoot}/mono",
|
||||
"${workspaceRoot}/mono/eglib",
|
||||
"${workspaceRoot}/support"
|
||||
],
|
||||
"limitSymbolsToIncludedHeaders": true,
|
||||
"databaseFilename": ""
|
||||
},
|
||||
"macFrameworkPath": [
|
||||
"${default}",
|
||||
"/System/Library/Frameworks",
|
||||
"/Library/Frameworks"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Linux",
|
||||
"includePath": [
|
||||
"${default}",
|
||||
"/usr/include",
|
||||
"/usr/local/include",
|
||||
"${workspaceRoot}",
|
||||
"${workspaceRoot}/mono",
|
||||
"${workspaceRoot}/mono/eglib",
|
||||
"${workspaceRoot}/support"
|
||||
],
|
||||
"defines": [],
|
||||
"intelliSenseMode": "clang-x64",
|
||||
"browse": {
|
||||
"path": [
|
||||
"${default}",
|
||||
"/usr/include",
|
||||
"/usr/local/include",
|
||||
"${workspaceRoot}",
|
||||
"${workspaceRoot}/mono",
|
||||
"${workspaceRoot}/mono/eglib",
|
||||
"${workspaceRoot}/support"
|
||||
],
|
||||
"limitSymbolsToIncludedHeaders": true,
|
||||
"databaseFilename": ""
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "Win32",
|
||||
"includePath": [
|
||||
"${default}",
|
||||
"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": [
|
||||
"${default}",
|
||||
"C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/include/*",
|
||||
"${workspaceRoot}",
|
||||
"${workspaceRoot}/mono",
|
||||
"${workspaceRoot}/mono/eglib",
|
||||
"${workspaceRoot}/support"
|
||||
],
|
||||
"limitSymbolsToIncludedHeaders": true,
|
||||
"databaseFilename": ""
|
||||
}
|
||||
}
|
||||
],
|
||||
"version": 4
|
||||
}
|
||||
@@ -23,7 +23,7 @@ License
|
||||
|
||||
The Mono runtime, compilers, and tools and most of the class libraries
|
||||
are licensed under the MIT license. But include some bits of code
|
||||
licensed under different licenses. The exact list is [available here](https://github.com/mono/mono/blob/master/LICENSE).
|
||||
licensed under different licenses. The exact list is [available here] (https://github.com/mono/mono/blob/master/LICENSE).
|
||||
|
||||
Different parts of Mono use different licenses. The actual details of
|
||||
which licenses are used for which parts are detailed on the LICENSE
|
||||
@@ -32,12 +32,7 @@ file in this directory.
|
||||
CLA
|
||||
=======
|
||||
|
||||
Contributions are now taken under the [.NET Foundation CLA](https://cla.dotnetfoundation.org/).
|
||||
|
||||
Code Review
|
||||
=======
|
||||
We are requiring code reviews before merging a pull request.
|
||||
GitHub won't let you merge a PR until someone from the Mono team approves it.
|
||||
Contributions are now taken under the [.NET Foundation CLA] (https://cla2.dotnetfoundation.org/).
|
||||
|
||||
Testing
|
||||
=======
|
||||
@@ -28,6 +28,8 @@ Mono itself, and does not end up in the redistributable part of Mono:
|
||||
|
||||
* mcs/jay: 4-clause BSD licensed
|
||||
|
||||
* mcs/nunit24: MS-PL
|
||||
|
||||
* mcs/class/I18N/mklist.sh, tools/cvt.sh: GNU GPLv2
|
||||
|
||||
Runtime Code
|
||||
@@ -44,7 +46,7 @@ embeddable runtime:
|
||||
|
||||
* mono/utils/bsearch.c: BSD license.
|
||||
|
||||
* mono/metadata/w32file-unix-glob.c, w32file-unix-glob.h: BSD license
|
||||
* mono/io-layer/wapi_glob.h, wapi_glob.c: BSD license
|
||||
|
||||
Class Library code
|
||||
==================
|
||||
|
||||
+39
-51
@@ -2,7 +2,7 @@ ACLOCAL_AMFLAGS = -I m4
|
||||
|
||||
AM_CFLAGS = $(WERROR_CFLAGS)
|
||||
|
||||
MONOTOUCH_SUBDIRS = $(libgc_dir) mono
|
||||
MONOTOUCH_SUBDIRS = $(libgc_dir) eglib/src mono
|
||||
|
||||
# Some tools might not build when cross-compiling
|
||||
if CROSS_COMPILING
|
||||
@@ -11,29 +11,15 @@ else
|
||||
tools_dir = tools
|
||||
endif
|
||||
|
||||
if ENABLE_MSVC
|
||||
build_with_msvc = msvc
|
||||
build_without_msvc =
|
||||
else
|
||||
build_with_msvc =
|
||||
build_without_msvc = msvc
|
||||
endif
|
||||
|
||||
if ENABLE_NETCORE
|
||||
update_submodules =
|
||||
SUBDIRS = mk llvm mono runtime netcore
|
||||
else
|
||||
update_submodules = update_submodules
|
||||
SUBDIRS = $(build_with_msvc) mk po $(libgc_dir) llvm mono $(ikvm_native_dir) support data runtime scripts man samples $(tools_dir) $(build_without_msvc) $(docs_dir) acceptance-tests
|
||||
endif
|
||||
|
||||
SUBDIRS = po $(libgc_dir) eglib mono $(ikvm_native_dir) support data runtime scripts man samples $(tools_dir) msvc $(docs_dir) acceptance-tests llvm
|
||||
# Keep in sync with SUBDIRS
|
||||
DIST_SUBDIRS = $(build_with_msvc) m4 mk po $(libgc_dir) llvm mono ikvm-native support data runtime scripts man samples tools $(build_without_msvc) docs acceptance-tests netcore netcore/corerun
|
||||
DIST_SUBDIRS = m4 po $(libgc_dir) eglib mono ikvm-native support data runtime scripts man samples tools msvc docs acceptance-tests llvm
|
||||
|
||||
all: $(update_submodules)
|
||||
all: update_submodules
|
||||
|
||||
SUBMODULE_ERROR='Could not recursively update all git submodules. You may experience compilation problems if some submodules are out of date'
|
||||
update_submodules:
|
||||
@cd $(srcdir) && scripts/update_submodules.sh
|
||||
@$(srcdir)/scripts/update_submodules.sh
|
||||
|
||||
.PHONY: update_submodules
|
||||
|
||||
@@ -46,10 +32,9 @@ EXTRA_DIST= \
|
||||
winconfig.h \
|
||||
code_of_conduct.md \
|
||||
external \
|
||||
netcore/Makefile \
|
||||
mcs/class/referencesource
|
||||
|
||||
DISTCHECK_CONFIGURE_FLAGS = EXTERNAL_RUNTIME=false
|
||||
DISTCHECK_CONFIGURE_FLAGS = EXTERNAL_MCS=false EXTERNAL_RUNTIME=false
|
||||
|
||||
# Distribute the 'mcs' tree too
|
||||
GIT_DIR ?= $(srcdir)/.git
|
||||
@@ -57,42 +42,33 @@ dist-hook:
|
||||
test -d $(distdir)/mcs || mkdir $(distdir)/mcs
|
||||
d=`cd $(distdir)/mcs && pwd`; cd $(mcs_topdir) && $(MAKE) distdir=$$d dist-recursive
|
||||
rm -rf `find $(top_distdir)/external -path '*\.git'`
|
||||
rm -rf `find $(top_distdir)/external -path '*\.libs'`
|
||||
rm -rf `find $(top_distdir)/external -path '*\.deps'`
|
||||
rm -f `find $(top_distdir)/external -path '*\.o'`
|
||||
rm -f `find $(top_distdir)/external -path '*\.so'`
|
||||
rm -f `find $(top_distdir)/external -path '*\.lo'`
|
||||
rm -f `find $(top_distdir)/external -path '*\.Plo'`
|
||||
rm -f `find $(top_distdir)/external -name '\.dirstamp'`
|
||||
rm -f `find $(top_distdir)/external -path '*\.exe' -not -path '*/roslyn-binaries/*'`
|
||||
rm -f `find $(top_distdir)/external -path '*\.dll' -not -path '*/binary-reference-assemblies/*' -not -path '*/roslyn-binaries/*' -not -path '*/helix-binaries/*'`
|
||||
rm -rf "$(top_distdir)/external/linker/test"
|
||||
rm -rf "$(top_distdir)/external/llvm-project/lldb/test"
|
||||
rm -rf "$(top_distdir)/external/llvm-project/libcxx/test"
|
||||
rm -rf "$(top_distdir)/external/llvm-project/clang/test"
|
||||
rm -f `find $(top_distdir)/external -path '*\.dll' -not -path '*/binary-reference-assemblies/*' -not -path '*/roslyn-binaries/*'`
|
||||
|
||||
mac-sdk-package:
|
||||
external/bockbuild/bb MacSDK --package
|
||||
|
||||
pkgconfigdir = $(libdir)/pkgconfig
|
||||
noinst_DATA = mono-uninstalled.pc
|
||||
DISTCLEANFILES= mono-uninstalled.pc
|
||||
|
||||
# building with monolite
|
||||
mcslib = $(mcs_topdir)/class/lib
|
||||
monolite_url = https://download.mono-project.com/monolite/monolite-$(MONO_CORLIB_VERSION)-latest.tar.gz
|
||||
.PHONY: get-monolite-latest
|
||||
get-monolite-latest:
|
||||
$(MAKE) -C $(mcs_topdir)/class get-monolite-latest
|
||||
-rm -fr $(mcslib)/monolite/$(MONO_CORLIB_VERSION)
|
||||
-mkdir -p $(mcslib)/monolite
|
||||
cd $(mcslib) && { (wget -O- $(monolite_url) || curl -L $(monolite_url)) | gzip -d | tar xf - ; }
|
||||
cd $(mcslib) && mv -f monolite-* monolite/$(MONO_CORLIB_VERSION)
|
||||
|
||||
if BITCODE
|
||||
BITCODE_CHECK=yes
|
||||
endif
|
||||
|
||||
if DEFAULT_TESTS
|
||||
CI_TEST_SCRIPT=$(srcdir)/scripts/ci/run-test-default.sh
|
||||
else
|
||||
CI_TEST_SCRIPT=$(srcdir)/scripts/ci/run-test-$(TEST_PROFILE).sh
|
||||
endif
|
||||
|
||||
.PHONY: check-ci
|
||||
check-ci:
|
||||
MONO_LLVMONLY=$(BITCODE_CHECK) $(CI_TEST_SCRIPT)
|
||||
MONO_LLVMONLY=$(BITCODE_CHECK) $(srcdir)/scripts/ci/run-test-$(TEST_PROFILE).sh
|
||||
|
||||
.PHONY: validate do-build-mono-mcs mcs-do-clean mcs-do-tests
|
||||
validate: do-build-mono-mcs
|
||||
@@ -141,12 +117,29 @@ monotouch-do-clean:
|
||||
|
||||
endif
|
||||
|
||||
win32getdeps:
|
||||
wget http://www.go-mono.com/archive/pkgconfig-0.11-20020310.zip
|
||||
wget http://www.go-mono.com/archive/glib-2.0.4-20020703.zip
|
||||
wget http://www.go-mono.com/archive/glib-dev-2.0.4-20020703.zip
|
||||
wget http://www.go-mono.com/archive/libiconv-1.7.zip
|
||||
wget http://www.go-mono.com/archive/libiconv-dev-1.7.zip
|
||||
wget http://www.go-mono.com/archive/libintl-0.10.40-20020101.zip
|
||||
unzip -n -d / pkgconfig-0.11-20020310.zip
|
||||
unzip -n -d / glib-2.0.4-20020703.zip
|
||||
unzip -n -d / glib-dev-2.0.4-20020703.zip
|
||||
unzip -n -d / libiconv-1.7.zip
|
||||
unzip -n -d / libiconv-dev-1.7.zip
|
||||
unzip -n -d / libintl-0.10.40-20020101.zip
|
||||
|
||||
win32setup:
|
||||
makensis /DMILESTONE=$(VERSION) /DSOURCE_INSTALL_DIR=$(SOURCE_INSTALL_DIR) /DBUILDNUM=$(BUILDNUM) monowiz.win32.nsi
|
||||
|
||||
update-csproj:
|
||||
-rm msvc/scripts/order
|
||||
-rm msvc/scripts/order.xml
|
||||
-rm -rf msvc/scripts/inputs
|
||||
-mkdir msvc/scripts/inputs
|
||||
(cd runtime; $(MAKE) V=1 extra_targets=csproj-local)
|
||||
(cd runtime; make V=1 extra_targets=csproj-local)
|
||||
|
||||
package-inputs:
|
||||
echo '<?xml version="1.0" encoding="utf-8"?>' > msvc/scripts/order.xml
|
||||
@@ -157,7 +150,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>"; \
|
||||
@@ -176,10 +168,6 @@ 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))
|
||||
|
||||
update-solution-files-with-tests:
|
||||
$(MAKE) "GENPROJ_ARGS=2012 true true" update-solution-files
|
||||
make update-csproj
|
||||
make package-inputs
|
||||
(cd msvc/scripts; make genproj.exe; mono genproj.exe)
|
||||
@@ -1,8 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<configuration>
|
||||
<packageSources>
|
||||
<clear />
|
||||
<add key="dotnet-core" value="https://dotnetfeed.blob.core.windows.net/dotnet-core/index.json" />
|
||||
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" />
|
||||
</packageSources>
|
||||
</configuration>
|
||||
@@ -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,32 +19,29 @@ 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 6.1 | ppc64 (cs) | [![aix-ppc64][23]][24] |
|
||||
| FreeBSD 12 | amd64 (cs) | [![freebsd-amd64][25]][26] |
|
||||
|
||||
_(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
|
||||
@@ -53,14 +50,8 @@ _(cs) = community supported architecture_
|
||||
[16]: https://jenkins.mono-project.com/job/z/label=w64/
|
||||
[17]: https://jenkins.mono-project.com/job/z/label=w32/badge/icon
|
||||
[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
|
||||
[25]: https://jenkins.mono-project.com/job/test-mono-mainline-community/label=freebsd-12-amd64/badge/icon
|
||||
[26]: https://jenkins.mono-project.com/job/test-mono-mainline-community/label=freebsd-12-amd64
|
||||
[19]: https://jenkins.mono-project.com/job/z/label=centos-s390x/badge/icon
|
||||
[20]: https://jenkins.mono-project.com/job/z/label=centos-s390x
|
||||
|
||||
Compilation and Installation
|
||||
============================
|
||||
@@ -69,15 +60,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
|
||||
---------------------------------------------
|
||||
@@ -117,7 +108,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
|
||||
|
||||
@@ -134,14 +125,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
|
||||
@@ -156,69 +139,44 @@ 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
|
||||
==============
|
||||
|
||||
To submit bug reports, please [open an issue on the mono GitHub repo](https://github.com/mono/mono/issues/new).
|
||||
To submit bug reports, please use [Xamarin's
|
||||
Bugzilla](https://bugzilla.xamarin.com/)
|
||||
|
||||
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
|
||||
@@ -232,27 +190,31 @@ disable the compilation of a Mono runtime with the SGen garbage
|
||||
collector.
|
||||
|
||||
* On platforms that support it, after building Mono, you will have
|
||||
both a `mono-boehm` binary and a `mono-sgen` binary. `mono-boehm` uses Boehm,
|
||||
both a `mono` binary and a `mono-sgen` binary. `mono` uses Boehm,
|
||||
while `mono-sgen` uses the Simple Generational GC.
|
||||
|
||||
* `--with-libgc=[included, none]` - Selects the default Boehm
|
||||
* `--with-gc=[included, boehm, none]` - Selects the default Boehm
|
||||
garbage collector engine to use.
|
||||
|
||||
* *included*: (*slightly modified Boehm GC*) This is the default
|
||||
value for the Boehm GC, and it's the most feature complete, it will
|
||||
allow Mono to use typed allocations and support the debugger.
|
||||
|
||||
* *boehm*: This is used to use a system-install Boehm GC, it is
|
||||
useful to test new features available in Boehm GC, but we do not
|
||||
recommend that people use this, as it disables a few features.
|
||||
|
||||
* *none*:
|
||||
Disables the inclusion of a Boehm garbage collector.
|
||||
Disables the inclusion of a 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`
|
||||
|
||||
@@ -309,9 +271,6 @@ faster under the Xen virtualization system.
|
||||
|
||||
* `--with-large-heap=yes,no` - Enable support for GC heaps larger than 3GB.
|
||||
|
||||
* This only applies only to the Boehm garbage collector, the SGen garbage
|
||||
collector does not use this configuration option.
|
||||
|
||||
* This defaults to `no`.
|
||||
|
||||
* `--enable-small-config=yes,no` - Enable some tweaks to reduce memory usage
|
||||
@@ -350,6 +309,16 @@ should be used.
|
||||
|
||||
* Or you can specify a path to a libgdiplus.
|
||||
|
||||
* `--disable-shared-memory`
|
||||
|
||||
* Use this option to disable the use of shared memory in
|
||||
Mono (this is equivalent to setting the MONO_DISABLE_SHM
|
||||
environment variable, although this removes the feature
|
||||
completely).
|
||||
|
||||
* Disabling the shared memory support will disable certain
|
||||
features like cross-process named mutexes.
|
||||
|
||||
* `--enable-minimal=LIST`
|
||||
|
||||
* Use this feature to specify optional runtime
|
||||
@@ -441,7 +410,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
|
||||
@@ -510,21 +479,11 @@ 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.
|
||||
|
||||
* `--enable-wasm`
|
||||
|
||||
* Use this option to configure mono to run on WebAssembly. It will
|
||||
set both host and target to the WebAssembly triplet. This overrides
|
||||
the values passed to `--host` or `--target` and ignored what config.sub guesses.
|
||||
|
||||
This is a workaround to enable usage of old automake versions that don't
|
||||
recognize the wasm triplet.
|
||||
|
||||
|
||||
Working With Submodules
|
||||
=======================
|
||||
|
||||
@@ -584,7 +543,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
|
||||
============================================
|
||||
|
||||
@@ -1,185 +0,0 @@
|
||||
|
||||
Mono uses third-party libraries or other resources that may be
|
||||
distributed under licenses different than the Mono software.
|
||||
|
||||
Attributions and license notices for test cases originally authored by
|
||||
third parties can be found in the respective test directories.
|
||||
|
||||
In the event that we accidentally failed to list a required notice, please
|
||||
bring it to our attention. Post an issue or email us:
|
||||
|
||||
[email protected]
|
||||
|
||||
The attached notices are provided for information only.
|
||||
|
||||
License notice for Mono
|
||||
-----------------------
|
||||
|
||||
Note: multiple license notices are provided that occure in source code.
|
||||
They are equivalent forms of the the MIT license from various copyright holders.
|
||||
|
||||
// Dual licensed under the terms of the MIT X11 or GNU GPL
|
||||
// Copyright 2003-2011 Novell, Inc.
|
||||
// Copyright 2011 Xamarin Inc
|
||||
|
||||
/**
|
||||
*
|
||||
* Copyright 2001-2003 Ximian, Inc
|
||||
* Copyright 2003-2010 Novell, Inc.
|
||||
* Copyright (C) 2012 Xamarin Inc
|
||||
*
|
||||
* Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||
*/
|
||||
|
||||
/******************************************************************************
|
||||
* The MIT License
|
||||
* Copyright (c) 2003 Novell Inc. www.novell.com
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the Software), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*******************************************************************************/
|
||||
|
||||
License notice for Apple
|
||||
-------------------------
|
||||
Content: https://github.com/mono/mono/blob/435f968102d0820ca65d63e1e741e4130b4d1303/support/ios/net/route.h
|
||||
License: https://opensource.apple.com/apsl/
|
||||
|
||||
License for GCC
|
||||
---------------
|
||||
|
||||
License: http://gcc.gnu.org/onlinedocs/gcc-4.6.4/libstdc++/manual/manual/license.html
|
||||
Content: https://github.com/mono/mono/blob/c398e19d3515c6bbb6046ed014b2095594a15229/mono/mini
|
||||
Example: https://github.com/mono/mono/blob/c398e19d3515c6bbb6046ed014b2095594a15229/mono/mini/decompose.c#L967
|
||||
|
||||
GCC RUNTIME LIBRARY EXCEPTION
|
||||
|
||||
Version 3.1, 31 March 2009
|
||||
|
||||
Copyright (C) 2009 Free Software Foundation, Inc.
|
||||
|
||||
Everyone is permitted to copy and distribute verbatim copies of this
|
||||
license document, but changing it is not allowed.
|
||||
|
||||
This GCC Runtime Library Exception ("Exception") is an additional
|
||||
permission under section 7 of the GNU General Public License, version
|
||||
3 ("GPLv3"). It applies to a given file (the "Runtime Library") that
|
||||
bears a notice placed by the copyright holder of the file stating that
|
||||
the file is governed by GPLv3 along with this Exception.
|
||||
|
||||
When you use GCC to compile a program, GCC may combine portions of
|
||||
certain GCC header files and runtime libraries with the compiled
|
||||
program. The purpose of this Exception is to allow compilation of
|
||||
non-GPL (including proprietary) programs to use, in this way, the
|
||||
header files and runtime libraries covered by this Exception.
|
||||
|
||||
0. Definitions.
|
||||
|
||||
A file is an "Independent Module" if it either requires the Runtime
|
||||
Library for execution after a Compilation Process, or makes use of an
|
||||
interface provided by the Runtime Library, but is not otherwise based
|
||||
on the Runtime Library.
|
||||
|
||||
"GCC" means a version of the GNU Compiler Collection, with or without
|
||||
modifications, governed by version 3 (or a specified later version) of
|
||||
the GNU General Public License (GPL) with the option of using any
|
||||
subsequent versions published by the FSF.
|
||||
|
||||
"GPL-compatible Software" is software whose conditions of propagation,
|
||||
modification and use would permit combination with GCC in accord with
|
||||
the license of GCC.
|
||||
|
||||
"Target Code" refers to output from any compiler for a real or virtual
|
||||
target processor architecture, in executable form or suitable for
|
||||
input to an assembler, loader, linker and/or execution
|
||||
phase. Notwithstanding that, Target Code does not include data in any
|
||||
format that is used as a compiler intermediate representation, or used
|
||||
for producing a compiler intermediate representation.
|
||||
|
||||
The "Compilation Process" transforms code entirely represented in
|
||||
non-intermediate languages designed for human-written code, and/or in
|
||||
Java Virtual Machine byte code, into Target Code. Thus, for example,
|
||||
use of source code generators and preprocessors need not be considered
|
||||
part of the Compilation Process, since the Compilation Process can be
|
||||
understood as starting with the output of the generators or
|
||||
preprocessors.
|
||||
|
||||
A Compilation Process is "Eligible" if it is done using GCC, alone or
|
||||
with other GPL-compatible software, or if it is done without using any
|
||||
work based on GCC. For example, using non-GPL-compatible Software to
|
||||
optimize any GCC intermediate representations would not qualify as an
|
||||
Eligible Compilation Process.
|
||||
|
||||
1. Grant of Additional Permission.
|
||||
|
||||
You have permission to propagate a work of Target Code formed by
|
||||
combining the Runtime Library with Independent Modules, even if such
|
||||
propagation would otherwise violate the terms of GPLv3, provided that
|
||||
all Target Code was generated by Eligible Compilation Processes. You
|
||||
may then convey such a combination under terms of your choice,
|
||||
consistent with the licensing of the Independent Modules.
|
||||
|
||||
2. No Weakening of GCC Copyleft.
|
||||
|
||||
The availability of this Exception does not imply any general
|
||||
presumption that third-party software is unaffected by the copyleft
|
||||
requirements of the license of GCC.
|
||||
|
||||
|
||||
Hopefully that text is self-explanatory. If it isn't, you need to speak to your lawyer, or the Free Software Foundation.
|
||||
|
||||
License notice for Silicon Graphics and HP
|
||||
------------------------------------------
|
||||
|
||||
/*
|
||||
* Copyright (c) 1996-1997
|
||||
* Silicon Graphics Computer Systems, Inc.
|
||||
*
|
||||
* Permission to use, copy, modify, distribute and sell this software
|
||||
* and its documentation for any purpose is hereby granted without fee,
|
||||
* provided that the above copyright notice appear in all copies and
|
||||
* that both that copyright notice and this permission notice appear
|
||||
* in supporting documentation. Silicon Graphics makes no
|
||||
* representations about the suitability of this software for any
|
||||
* purpose. It is provided "as is" without express or implied warranty.
|
||||
*
|
||||
* Copyright (c) 2002
|
||||
* Hewlett-Packard Company
|
||||
*
|
||||
* Permission to use, copy, modify, distribute and sell this software
|
||||
* and its documentation for any purpose is hereby granted without fee,
|
||||
* provided that the above copyright notice appear in all copies and
|
||||
* that both that copyright notice and this permission notice appear
|
||||
* in supporting documentation. Hewlett-Packard Company makes no
|
||||
* representations about the suitability of this software for any
|
||||
* purpose. It is provided "as is" without express or implied warranty.
|
||||
*/
|
||||
|
||||
/*
|
||||
* This implements standard-conforming allocators that interact with
|
||||
* the garbage collector. Gc_alloctor<T> allocates garbage-collectable
|
||||
* objects of type T. Traceable_allocator<T> allocates objects that
|
||||
* are not temselves garbage collected, but are scanned by the
|
||||
* collector for pointers to collectable objects. Traceable_alloc
|
||||
* should be used for explicitly managed STL containers that may
|
||||
* point to collectable objects.
|
||||
*
|
||||
* This code was derived from an earlier version of the GNU C++ standard
|
||||
* library, which itself was derived from the SGI STL implementation.
|
||||
*/
|
||||
|
||||
Content: https://github.com/mono/mono/blob/d58dfa185af1d48fb93efdef1d046762f214f0a7/libgc/include/gc_allocator.h
|
||||
@@ -4,4 +4,3 @@ Makefile
|
||||
*.dll
|
||||
*.mdb
|
||||
coreclr-testlist.txt
|
||||
microbench-perf.sh
|
||||
@@ -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 ();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3,10 +3,9 @@ BENCHMARKER_PATH=$(ACCEPTANCE_TESTS_PATH)/benchmarker
|
||||
ROSLYN_PATH=$(ACCEPTANCE_TESTS_PATH)/roslyn
|
||||
CORECLR_PATH=$(ACCEPTANCE_TESTS_PATH)/coreclr
|
||||
MSTESTSUITE_PATH=$(ACCEPTANCE_TESTS_PATH)/ms-test-suite
|
||||
DEBIANSHOOTOUTMONO_PATH=$(ACCEPTANCE_TESTS_PATH)/DebianShootoutMono
|
||||
|
||||
CLEANFILES = *.dll *.exe *.mdb
|
||||
EXTRA_DIST=README.md SUBMODULES.json microbench.mk 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
|
||||
@@ -15,10 +14,8 @@ RUNTIME = MONO_PATH=$(CLASS) $(abs_top_builddir)/runtime/mono-wrapper --debug
|
||||
TOOLS_RUNTIME = MONO_PATH=$(TOOLS_CLASS) $(abs_top_builddir)/runtime/mono-wrapper --debug
|
||||
MCS = $(TOOLS_RUNTIME) $(CSC) -nologo -noconfig -lib:$(CLASS) -r:System.dll -r:System.Core.dll -r:System.Xml.dll -r:Microsoft.CSharp.dll
|
||||
ILASM = $(TOOLS_RUNTIME) $(TOOLS_CLASS)/ilasm.exe
|
||||
XUNIT = $(RUNTIME) $(abs_top_builddir)/external/xunit-binaries/xunit.console.exe
|
||||
|
||||
include versions.mk
|
||||
include microbench.mk
|
||||
include profiler-stress.mk
|
||||
include roslyn.mk
|
||||
include coreclr.mk
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
[
|
||||
{
|
||||
"name": "roslyn",
|
||||
"url": "git://github.com/mono/roslyn.git",
|
||||
"rev": "6bfcd4e770609a38b8523e83ce1ec943162f30bb",
|
||||
"remote-branch": "origin/mono-testing",
|
||||
"branch": "mono-testing",
|
||||
"url": "git://github.com/dotnet/roslyn.git",
|
||||
"rev": "322bd5b2bbf07df6a67de35cbcb2365484412f70",
|
||||
"remote-branch": "origin/master",
|
||||
"branch": "master",
|
||||
"directory": "roslyn"
|
||||
},
|
||||
{
|
||||
"name": "coreclr",
|
||||
"url": "git://github.com/mono/coreclr.git",
|
||||
"rev": "90f7060935732bb624e1f325d23f63072433725f",
|
||||
"rev": "c7da48acf72c40c0c0ed1a80ebfacea21bb3a271",
|
||||
"remote-branch": "origin/mono",
|
||||
"branch": "mono",
|
||||
"directory": "coreclr"
|
||||
@@ -18,7 +18,7 @@
|
||||
{
|
||||
"name": "ms-test-suite",
|
||||
"url": "[email protected]:xamarin/ms-test-suite.git",
|
||||
"rev": "39b1b222e8a3690a1b8ea018ce54d2a826f5246e",
|
||||
"rev": "55b6637eb1de61c743323ec82db1e0cadfee5b32",
|
||||
"remote-branch": "origin/master",
|
||||
"branch": "master",
|
||||
"directory": "ms-test-suite"
|
||||
@@ -30,13 +30,5 @@
|
||||
"remote-branch": "origin/master",
|
||||
"branch": "master",
|
||||
"directory": "benchmarker"
|
||||
},
|
||||
{
|
||||
"name": "DebianShootoutMono",
|
||||
"url": "https://github.com/alexanderkyte/DebianShootoutMono.git",
|
||||
"rev": "3fde2ced806c1fe7eed81120a40d99474fa009f0",
|
||||
"remote-branch": "origin/release_11_15_2018",
|
||||
"branch": "release_11_15_2018",
|
||||
"directory": "DebianShootoutMono"
|
||||
}
|
||||
]
|
||||
]
|
||||
+12
-13
@@ -32,7 +32,7 @@ coreclr-runtest-coremanglib: coreclr-validate test-runner.exe $(CORECLR_COREMANG
|
||||
check-coreclr: coreclr-compile-tests coreclr-runtest-basic coreclr-runtest-coremanglib
|
||||
|
||||
coreclr-gcstress: coreclr-validate GCStressTests.exe $(CORECLR_STRESSTESTSI_CS)
|
||||
BVT_ROOT=$(realpath $(CORECLR_PATH)/tests/src/GC/Stress/Tests) $(RUNTIME) GCStressTests.exe $(CORECLR_PATH)/tests/src/GC/Stress/$(if $(CI_PR),testmix_gc_pr.config,testmix_gc.config); if [ $$? -ne 100 ]; then exit 1; fi
|
||||
BVT_ROOT=$(realpath $(CORECLR_PATH)/tests/src/GC/Stress/Tests) $(RUNTIME) GCStressTests.exe $(CORECLR_PATH)/tests/src/GC/Stress/testmix_gc.config; if [ $$? -ne 100 ]; then exit 1; fi
|
||||
|
||||
# Output a variable in $(2) to the file $(1), separated by newline characters
|
||||
# we need to do it in groups of 100 entries to make sure we don't exceed shell char limits
|
||||
@@ -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 \
|
||||
@@ -3175,6 +3177,7 @@ CORECLR_COREMANGLIB_TEST_CS_SRC= \
|
||||
$(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/runtime/interopservices/inattribute/inattributector.cs \
|
||||
$(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/runtime/interopservices/layoutkind/layoutkindauto.cs \
|
||||
$(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/runtime/interopservices/layoutkind/layoutkindsequential.cs \
|
||||
$(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/runtime/interopservices/marshal/marshalgetlastwin32error.cs \
|
||||
$(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/runtime/interopservices/marshal/marshalreadint641.cs \
|
||||
$(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/runtime/interopservices/marshal/marshalsizeof1.cs \
|
||||
$(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/runtime/interopservices/marshalasattribute/marshalasattributearraysubtype.cs \
|
||||
@@ -3240,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 \
|
||||
@@ -3688,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 \
|
||||
@@ -3711,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 \
|
||||
@@ -3851,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 \
|
||||
@@ -3959,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 \
|
||||
@@ -3977,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 \
|
||||
@@ -4965,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 \
|
||||
@@ -5056,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
|
||||
|
||||
@@ -1,17 +0,0 @@
|
||||
#! /bin/sh
|
||||
r='@mono_build_root@'
|
||||
aotpattern="--aot="
|
||||
|
||||
# if this is an aot invoke
|
||||
if [[ $@ =~ $aotpattern ]];
|
||||
then
|
||||
# just aot the code
|
||||
echo "$r/runtime/mono-wrapper $@"
|
||||
exec $r/runtime/mono-wrapper $@
|
||||
else
|
||||
# else run it under perf
|
||||
echo "$MONO_PERF_BINARY record -o $r/acceptance-tests/perf.data -v -s -g -- $r/mono/mini/mono-sgen $@"
|
||||
exec $MONO_PERF_BINARY record -o $r/acceptance-tests/perf.data -v -s -g $r/mono/mini/mono-sgen $@
|
||||
fi
|
||||
|
||||
|
||||
@@ -1,119 +0,0 @@
|
||||
check-microbench: DebianShootoutMono.stamp
|
||||
@$(MAKE) test-run-microbench
|
||||
|
||||
DebianShootoutMono.stamp:
|
||||
@$(MAKE) validate-DebianShootoutMono RESET_VERSIONS=1
|
||||
@$(MAKE) prepare-dlls
|
||||
@touch $@
|
||||
|
||||
abs_top_srcdir = $(abspath $(top_srcdir))
|
||||
TEST_EXE_PATH=$(abs_top_srcdir)/acceptance-tests/external/DebianShootoutMono/release/
|
||||
NET_4_X_RUNTIME=MONO_PATH=$(TEST_EXE_PATH):$(abs_top_srcdir)/mcs/class/lib/net_4_x $(abs_top_srcdir)/runtime/mono-wrapper
|
||||
FULL_AOT_RUNTIME=MONO_PATH=$(abs_top_srcdir)/mcs/class/lib/testing_aot_full $(abs_top_srcdir)/runtime/mono-wrapper
|
||||
|
||||
PERF_BINARY=$(if $(MONO_PERF_BINARY),$(MONO_PERF_BINARY),perf)
|
||||
PERF_RUNTIME=$(abs_top_srcdir)/acceptance-tests/microbench-perf.sh
|
||||
|
||||
define BenchmarkDotNetTemplate
|
||||
|
||||
run-microbench-$(1):: DebianShootoutMono.stamp
|
||||
MONO_BENCH_AOT_RUN="$(AOT_RUN_FLAGS)" \
|
||||
MONO_BENCH_AOT_BUILD="$(AOT_BUILD_FLAGS)" \
|
||||
MONO_BENCH_EXECUTABLE="$(abs_top_srcdir)/runtime/mono-wrapper" \
|
||||
MONO_BENCH_PATH="$(abs_top_srcdir)/mcs/class/lib/$(TEST_PROFILE)" \
|
||||
MONO_BENCH_INPUT="$(2)" \
|
||||
$(NET_4_X_RUNTIME) \
|
||||
$(TEST_EXE_PATH)/DebianShootoutMono.exe $(1)
|
||||
|
||||
test-run-microbench:: run-microbench-$(1)
|
||||
|
||||
run-microbench-debug-$(1):: DebianShootoutMono.stamp
|
||||
echo MONO_PATH="$(abs_top_srcdir)/mcs/class/lib/$(TEST_PROFILE)" $(abs_top_srcdir)/runtime/mono-wrapper $(AOT_BUILD_FLAGS) $(TEST_EXE_PATH)/DebianShootoutMono.exe
|
||||
MONO_BENCH_INPUT="$(2)" \
|
||||
MONO_PATH="$(abs_top_srcdir)/mcs/class/lib/$(TEST_PROFILE)" \
|
||||
$(abs_top_srcdir)/runtime/mono-wrapper $(AOT_RUN_FLAGS) $(TEST_EXE_PATH)/DebianShootoutMono.exe Run $(1)
|
||||
|
||||
test-run-microbench-debug:: run-microbench-debug-$(1)
|
||||
|
||||
if HOST_LINUX
|
||||
run-microbench-profiled-$(1):: microbench-results/$(1).perf.data
|
||||
|
||||
microbench-results/$(1).perf.data: DebianShootoutMono.stamp
|
||||
mkdir -p microbench-results
|
||||
MONO_PERF_BINARY="$(PERF_BINARY)" \
|
||||
MONO_BENCH_EXECUTABLE="$(PERF_RUNTIME)" \
|
||||
MONO_BENCH_AOT_RUN="$(AOT_RUN_FLAGS)"\
|
||||
MONO_BENCH_AOT_BUILD="$(AOT_BUILD_FLAGS)"\
|
||||
MONO_BENCH_PATH="$(abs_top_srcdir)/mcs/class/lib/$(TEST_PROFILE)" \
|
||||
MONO_BENCH_INPUT="$(2)" \
|
||||
$(NET_4_X_RUNTIME) \
|
||||
$(TEST_EXE_PATH)/DebianShootoutMono.exe $(1) $(2)
|
||||
mv perf.data microbench-results/$(1).perf.data
|
||||
|
||||
microbench-results/$(1).tmp.perf: microbench-results/$(1).perf.data
|
||||
$(PERF_BINARY) script -i microbench-results/$(1).perf.data > microbench-results/$(1).tmp.perf
|
||||
|
||||
microbench-results/$(1).perf-flame.svg: microbench-results/$(1).tmp.perf
|
||||
cat microbench-results/$(1).tmp.perf | ./external/DebianShootoutMono/FlameGraph/stackcollapse-perf.pl > microbench-results/$(1).perf-folded
|
||||
./external/DebianShootoutMono/FlameGraph/flamegraph.pl microbench-results/$(1).perf-folded > microbench-results/$(1).perf-flame.svg
|
||||
rm microbench-results/$(1).tmp.perf
|
||||
rm microbench-results/$(1).perf-folded
|
||||
|
||||
MONO_PERF_FLAGS=--show-cpu-utilization -n --hierarchy -T $(MONO_PERF_ADDITIONAL_FLAGS)
|
||||
|
||||
microbench-results/$(1).perf.report: microbench-results/$(1).perf.data
|
||||
$(PERF_BINARY) report -i microbench-results/$(1).perf.data $(MONO_PERF_FLAGS) > microbench-results/$(1).perf.report
|
||||
|
||||
test-run-microbench-profiled:: run-microbench-profiled-$(1)
|
||||
|
||||
test-run-microbench-publish-collect:: microbench-results/$(1).perf.data microbench-results/$(1).perf.report microbench-results/$(1).perf-flame.svg
|
||||
|
||||
endif
|
||||
|
||||
endef
|
||||
|
||||
if HOST_LINUX
|
||||
|
||||
test-run-microbench-perf-check:
|
||||
$(PERF_BINARY) record -a -o perf.data -- echo "testing"
|
||||
rm perf.data
|
||||
|
||||
microbench-results/perf-data.zip:
|
||||
zip microbench-results/perf-data.zip microbench-results/*.perf.data
|
||||
rm microbench-results/*.perf.data
|
||||
|
||||
perf-report: microbench-results/perf-data.zip
|
||||
|
||||
perf-report-total: test-run-microbench-publish-collect
|
||||
@$(MAKE) perf-report
|
||||
|
||||
endif
|
||||
|
||||
.PHONY: prepare-dlls
|
||||
|
||||
if FULL_AOT_TESTS
|
||||
prepare-dlls:
|
||||
$(FULL_AOT_RUNTIME) $(AOT_BUILD_FLAGS) $(TEST_EXE_PATH)/*.{dll,exe}
|
||||
|
||||
else
|
||||
|
||||
prepare-dlls:
|
||||
|
||||
endif
|
||||
|
||||
FIXTURE_DIR=$(abs_top_srcdir)/acceptance-tests/external/DebianShootoutMono/fixtures
|
||||
|
||||
$(eval $(call BenchmarkDotNetTemplate,Mandelbrot,))
|
||||
$(eval $(call BenchmarkDotNetTemplate,RegexRedux,$(FIXTURE_DIR)/regexredux-input.txt))
|
||||
$(eval $(call BenchmarkDotNetTemplate,KNucleotide,$(FIXTURE_DIR)/knucleotide-input.txt))
|
||||
|
||||
$(eval $(call BenchmarkDotNetTemplate,BinaryTrees,))
|
||||
$(eval $(call BenchmarkDotNetTemplate,NBodyTest,))
|
||||
$(eval $(call BenchmarkDotNetTemplate,SpectralNorm,))
|
||||
$(eval $(call BenchmarkDotNetTemplate,Fannkuchredux,))
|
||||
$(eval $(call BenchmarkDotNetTemplate,Fasta,))
|
||||
|
||||
$(eval $(call BenchmarkDotNetTemplate,RevComp,$(FIXTURE_DIR)/revcomp-input.txt))
|
||||
|
||||
#$(eval $(call BenchmarkDotNetTemplate,GistBenchmark,$(MONO_BENCH_GIST_URL))) broken in BDN, bug filed
|
||||
|
||||
@@ -1,11 +1,9 @@
|
||||
check-ms-test-suite: $(CLASS)/nunitlite.dll
|
||||
@if $(MAKE) validate-ms-test-suite RESET_VERSIONS=1; then \
|
||||
$(MAKE) -C $(MSTESTSUITE_PATH)/conformance build MCS="$(MCS) -debug:portable -t:library -warn:1 -r:$(CLASS)/nunitlite.dll" && \
|
||||
$(MAKE) -C $(MSTESTSUITE_PATH)/systemruntimebringup build MCS="$(MCS) -debug:portable -t:library -warn:1 -r:$(CLASS)/nunitlite.dll" && \
|
||||
$(MAKE) -C $(MSTESTSUITE_PATH)/System.Linq.Expressions build MCS="$(MCS) -debug:portable -t:library -warn:1 -r:$(CLASS)/nunitlite.dll" && \
|
||||
$(MAKE) -C $(MSTESTSUITE_PATH)/conformance run NUNIT-CONSOLE="$(RUNTIME) $(CLASS)/nunit-lite-console.exe -exclude=MonoBug,BadTest -format:nunit2" NUNIT_XML_RESULT="-result:$(abs_top_builddir)/acceptance-tests/TestResult-ms-test-suite-conformance.xml" || EXIT_CODE=1; \
|
||||
$(MAKE) -C $(MSTESTSUITE_PATH)/systemruntimebringup run NUNIT-CONSOLE="$(RUNTIME) $(CLASS)/nunit-lite-console.exe -exclude=MonoBug,BadTest -format:nunit2" NUNIT_XML_RESULT="-result:$(abs_top_builddir)/acceptance-tests/TestResult-ms-test-suite-systemruntimebringup.xml" || EXIT_CODE=1; \
|
||||
$(MAKE) -C $(MSTESTSUITE_PATH)/System.Linq.Expressions run NUNIT-CONSOLE="$(RUNTIME) $(CLASS)/nunit-lite-console.exe -exclude=MonoBug,BadTest -format:nunit2" NUNIT_XML_RESULT="-result:$(abs_top_builddir)/acceptance-tests/TestResult-ms-test-suite-systemlinqexpressions.xml" || EXIT_CODE=1; \
|
||||
$(MAKE) -C $(MSTESTSUITE_PATH)/systemruntimebringup build MCS="$(MCS) -debug:portable -warn:1" && \
|
||||
$(MAKE) -C $(MSTESTSUITE_PATH)/systemruntimebringup run MONO="$(RUNTIME)" || EXIT_CODE=1; \
|
||||
exit $$EXIT_CODE; \
|
||||
else \
|
||||
echo "*** [ms-test-suite] Getting the repository failed, you probably don't have access to this Xamarin-internal resource. Skipping."; \
|
||||
|
||||
@@ -9,5 +9,5 @@ SYS_REFS = \
|
||||
|
||||
check-profiler-stress:
|
||||
@$(MAKE) validate-benchmarker RESET_VERSIONS=1
|
||||
cd profiler-stress && $(MCS) -debug -define:ARCH_$(arch_target) -target:exe $(addprefix -r:, $(SYS_REFS)) -out:runner.exe @runner.exe.sources
|
||||
cd profiler-stress && $(MCS) -target:exe $(addprefix -r:, $(SYS_REFS)) -out:runner.exe @runner.exe.sources
|
||||
cd profiler-stress && $(RUNTIME) runner.exe
|
||||
@@ -38,134 +38,51 @@ namespace Mono.Profiling.Tests.Stress {
|
||||
public ProcessStartInfo StartInfo { get; set; }
|
||||
public Stopwatch Stopwatch { get; set; } = new Stopwatch ();
|
||||
public int? ExitCode { get; set; }
|
||||
public string StandardOutput { get; set; }
|
||||
public string StandardError { get; set; }
|
||||
public StringBuilder StandardOutput { get; set; } = new StringBuilder ();
|
||||
public StringBuilder StandardError { get; set; } = new StringBuilder ();
|
||||
}
|
||||
|
||||
static class Program {
|
||||
|
||||
static readonly string[] _options = new [] {
|
||||
"exception",
|
||||
"monitor",
|
||||
"gc",
|
||||
"gcalloc",
|
||||
"gcmove",
|
||||
"gcroot",
|
||||
"gchandle",
|
||||
"finalization",
|
||||
"counter",
|
||||
"jit",
|
||||
};
|
||||
|
||||
static readonly TimeSpan _timeout = TimeSpan.FromHours (6);
|
||||
|
||||
const RegexOptions _regexOptions = RegexOptions.Compiled | RegexOptions.Singleline;
|
||||
|
||||
static readonly Dictionary<string, Predicate<Benchmark>> _filters = new Dictionary<string, Predicate<Benchmark>> {
|
||||
{ "ironjs-v8", FilterNotOnArm },
|
||||
{ "msbiology", FilterNever },
|
||||
};
|
||||
|
||||
static bool FilterNever (Benchmark benchmark)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
static bool FilterNotOnArm (Benchmark benchmark)
|
||||
{
|
||||
#if ARCH_arm || ARCH_arm64
|
||||
return false;
|
||||
#else
|
||||
return true;
|
||||
#endif
|
||||
}
|
||||
|
||||
static bool IsSupported (Benchmark benchmark)
|
||||
{
|
||||
return _filters.TryGetValue (benchmark.Name, out var filter) ? filter (benchmark) : true;
|
||||
}
|
||||
|
||||
static string ReplaceInvalidXmlChars (string text) {
|
||||
static string FilterInvalidXmlChars (string text) {
|
||||
return Regex.Replace (text, @"[^\x09\x0A\x0D\x20-\uD7FF\uE000-\uFFFD\u10000-\u10FFFF]", string.Empty);
|
||||
}
|
||||
|
||||
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)
|
||||
.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];
|
||||
|
||||
var sampleFreq = rand.Next (-1000, 1001);
|
||||
var sampleMode = rand.Next (0, 2) == 1 ? "-real" : string.Empty;
|
||||
var sampleFreq = rand.Next (0, 1001);
|
||||
var sampleMode = rand.Next (0, 2) == 1 ? "real" : "process";
|
||||
var maxSamples = rand.Next (0, cpus * 2000 + 1);
|
||||
var heapShotFreq = rand.Next (-10, 11);
|
||||
var heapShotFreq = rand.Next (0, 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 allocMode = rand.Next (0, 2) == 1 ? "alloc" : "noalloc";
|
||||
|
||||
var profOptions = "nodefaults,output=/dev/null,";
|
||||
|
||||
if (options == null) {
|
||||
profOptions += $"maxframes={maxFrames},";
|
||||
|
||||
if (sampleFreq > 0)
|
||||
profOptions += $"sample{sampleMode}={sampleFreq},maxsamples={maxSamples},";
|
||||
|
||||
if (heapShotFreq > 0)
|
||||
profOptions += $"heapshot={heapShotFreq}gc,";
|
||||
|
||||
profOptions += string.Join (",", flags);
|
||||
} else
|
||||
profOptions += options;
|
||||
var profOptions = $"sample=cycles/{sampleFreq},sampling-{sampleMode},maxsamples={maxSamples},heapshot={heapShotFreq}gc,maxframes={maxFrames},{allocMode},output=/dev/null";
|
||||
|
||||
var info = new ProcessStartInfo {
|
||||
UseShellExecute = false,
|
||||
@@ -179,9 +96,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;
|
||||
@@ -196,19 +110,14 @@ namespace Mono.Profiling.Tests.Stress {
|
||||
using (var proc = new Process ()) {
|
||||
proc.StartInfo = info;
|
||||
|
||||
var stdout = new StringBuilder ();
|
||||
var stderr = new StringBuilder ();
|
||||
|
||||
proc.OutputDataReceived += (sender, args) => {
|
||||
if (args.Data != null)
|
||||
lock (result)
|
||||
stdout.AppendLine (args.Data);
|
||||
result.StandardOutput.AppendLine (args.Data);
|
||||
};
|
||||
|
||||
proc.ErrorDataReceived += (sender, args) => {
|
||||
if (args.Data != null)
|
||||
lock (result)
|
||||
stderr.AppendLine (args.Data);
|
||||
result.StandardError.AppendLine (args.Data);
|
||||
};
|
||||
|
||||
result.Stopwatch.Start ();
|
||||
@@ -218,7 +127,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);
|
||||
@@ -231,11 +140,6 @@ namespace Mono.Profiling.Tests.Stress {
|
||||
result.ExitCode = proc.ExitCode;
|
||||
|
||||
result.Stopwatch.Stop ();
|
||||
|
||||
lock (result) {
|
||||
result.StandardOutput = stdout.ToString ();
|
||||
result.StandardError = stderr.ToString ();
|
||||
}
|
||||
}
|
||||
|
||||
var resultStr = result.ExitCode == null ? "timed out" : $"exited with code: {result.ExitCode}";
|
||||
@@ -249,13 +153,13 @@ namespace Mono.Profiling.Tests.Stress {
|
||||
Console.WriteLine ("===== stdout =====");
|
||||
Console.ResetColor ();
|
||||
|
||||
Console.WriteLine (result.StandardOutput);
|
||||
Console.WriteLine (result.StandardOutput.ToString ());
|
||||
|
||||
Console.ForegroundColor = ConsoleColor.Red;
|
||||
Console.WriteLine ("===== stderr =====");
|
||||
Console.ResetColor ();
|
||||
|
||||
Console.WriteLine (result.StandardError);
|
||||
Console.WriteLine (result.StandardError.ToString ());
|
||||
}
|
||||
|
||||
results.Add (result);
|
||||
@@ -274,7 +178,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");
|
||||
@@ -335,11 +239,11 @@ namespace Mono.Profiling.Tests.Stress {
|
||||
writer.WriteStartElement ("failure");
|
||||
|
||||
writer.WriteStartElement ("message");
|
||||
writer.WriteCData (ReplaceInvalidXmlChars (result.StandardOutput));
|
||||
writer.WriteCData (FilterInvalidXmlChars (result.StandardOutput.ToString ()));
|
||||
writer.WriteEndElement ();
|
||||
|
||||
writer.WriteStartElement ("stack-trace");
|
||||
writer.WriteCData (ReplaceInvalidXmlChars (result.StandardError));
|
||||
writer.WriteCData (FilterInvalidXmlChars (result.StandardError.ToString ()));
|
||||
writer.WriteEndElement ();
|
||||
|
||||
writer.WriteEndElement ();
|
||||
|
||||
@@ -1,7 +1,18 @@
|
||||
check-roslyn:
|
||||
@echo "Runnning roslyn tests using mono from PATH:"
|
||||
mono --version
|
||||
@$(MAKE) validate-roslyn RESET_VERSIONS=1
|
||||
@if [ -z $$PREFIX ]; then echo "You need to set PREFIX to the prefix of the Mono installation that should be used for testing Roslyn." && exit 1; fi
|
||||
sed -i -e 's/\\4.5-api"/\\4.5"/g' $$PREFIX/lib/mono/xbuild-frameworks/.NETFramework/v4.5/RedistList/FrameworkList.xml; \
|
||||
export MSBuildExtensionsPath=$$PREFIX/lib/mono/xbuild; \
|
||||
MONO_DOTNET_PORTABLE_DIR=$$PREFIX/lib/mono/xbuild-frameworks/.NETPortable/; \
|
||||
if [ ! -d "$$MONO_DOTNET_PORTABLE_DIR/v4.6" ]; then \
|
||||
mkdir -p $$MONO_DOTNET_PORTABLE_DIR; \
|
||||
curl -SL "http://download.mono-project.com/third-party/RoslynBuildDependencies.zip" > /tmp/RoslynBuildDependencies.zip; \
|
||||
unzip -o /tmp/RoslynBuildDependencies.zip -d /tmp/RoslynBuildDependencies; \
|
||||
cp -r /tmp/RoslynBuildDependencies/PortableReferenceAssemblies/* $$MONO_DOTNET_PORTABLE_DIR; \
|
||||
fi; \
|
||||
cd $(ROSLYN_PATH); \
|
||||
./build.sh --restore --build --test --mono || exit; \
|
||||
echo "done"
|
||||
sed -i -e 'N; s/bootstrapArg=".*\n.*"/bootstrapArg=""/g' cibuild.sh; \
|
||||
sed -i -e 's#-xml Binaries/\$$BUILD_CONFIGURATION/xUnitResults/#-nunit $(abs_top_builddir)/acceptance-tests/TestResult-#g' cibuild.sh; \
|
||||
./cibuild.sh --mono-path $$PREFIX/bin || EXIT_CODE=1; \
|
||||
sed -i -e 's/\\4.5"/\\4.5-api"/g' $$PREFIX/lib/mono/xbuild-frameworks/.NETFramework/v4.5/RedistList/FrameworkList.xml; \
|
||||
exit $$EXIT_CODE
|
||||
@@ -7,7 +7,6 @@ $(eval $(call ValidateVersionTemplate,benchmarker,BENCHMARKER))
|
||||
$(eval $(call ValidateVersionTemplate,roslyn,ROSLYN))
|
||||
$(eval $(call ValidateVersionTemplate,coreclr,CORECLR))
|
||||
$(eval $(call ValidateVersionTemplate,ms-test-suite,MSTESTSUITE))
|
||||
$(eval $(call ValidateVersionTemplate,DebianShootoutMono,DEBIANSHOOTOUTMONO))
|
||||
|
||||
# Bump the given submodule to the revision given by the REV make variable
|
||||
# If COMMIT is 1, commit the change
|
||||
@@ -15,7 +14,6 @@ bump-benchmarker: __bump-benchmarker
|
||||
bump-roslyn: __bump-version-roslyn
|
||||
bump-coreclr: __bump-version-coreclr
|
||||
bump-ms-test-suite: __bump-version-ms-test-suite
|
||||
bump-DebianShootoutMono: __bump-version-DebianShootoutMono
|
||||
|
||||
# Bump the given submodule to the branch given by the BRANCH/REMOTE_BRANCH make variables
|
||||
# If COMMIT is 1, commit the change
|
||||
@@ -23,7 +21,6 @@ bump-branch-benchmarker: __bump-branch-benchmarker
|
||||
bump-branch-roslyn: __bump-branch-roslyn
|
||||
bump-branch-coreclr: __bump-branch-coreclr
|
||||
bump-branch-ms-test-suite: __bump-branch-ms-test-suite
|
||||
bump-branch-DebianShootoutMono: __bump-branch-DebianShootoutMono
|
||||
|
||||
# Bump the given submodule to its current GIT version
|
||||
# If COMMIT is 1, commit the change
|
||||
@@ -31,7 +28,6 @@ bump-current-benchmarker: __bump-current-benchmarker
|
||||
bump-current-roslyn: __bump-current-version-roslyn
|
||||
bump-current-coreclr: __bump-current-version-coreclr
|
||||
bump-current-ms-test-suite: __bump-current-version-ms-test-suite
|
||||
bump-current-DebianShootoutMono: __bump-current-version-DebianShootoutMono
|
||||
|
||||
commit-bump-benchmarker:
|
||||
$(MAKE) bump-benchmarker COMMIT=1
|
||||
@@ -45,9 +41,6 @@ commit-bump-coreclr:
|
||||
commit-bump-ms-test-suite:
|
||||
$(MAKE) bump-ms-test-suite COMMIT=1
|
||||
|
||||
commit-bump-DebianShootoutMono:
|
||||
$(MAKE) bump-DebianShootoutMono COMMIT=1
|
||||
|
||||
commit-bump-current-benchmarker:
|
||||
$(MAKE) bump-current-benchmarker COMMIT=1
|
||||
|
||||
@@ -59,6 +52,3 @@ commit-bump-current-coreclr:
|
||||
|
||||
commit-bump-current-ms-test-suite:
|
||||
$(MAKE) bump-current-ms-test-suite COMMIT=1
|
||||
|
||||
commit-bump-current-DebianShootoutMono:
|
||||
$(MAKE) bump-current-DebianShootoutMono COMMIT=1
|
||||
+15
-23
@@ -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
|
||||
|
||||
|
||||
@@ -120,7 +118,7 @@ for PARAM; do
|
||||
done
|
||||
|
||||
if test x$has_ext_mod = xtrue; then
|
||||
pushd $top_srcdir../mono-extensions/scripts
|
||||
pushd ../mono-extensions/scripts
|
||||
sh ./prepare-repo.sh $ext_mod_args || exit 1
|
||||
popd
|
||||
else
|
||||
@@ -144,35 +142,29 @@ 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; }
|
||||
|
||||
if test -d $srcdir/external/bdwgc; then
|
||||
echo Running external/bdwgc/autogen.sh ...
|
||||
(cd $srcdir/external/bdwgc ; NOCONFIGURE=1 ./autogen.sh "$@")
|
||||
echo Done running external/bdwgc/autogen.sh ...
|
||||
if test -d $srcdir/libgc; then
|
||||
echo Running libgc/autogen.sh ...
|
||||
(cd $srcdir/libgc ; NOCONFIGURE=1 ./autogen.sh "$@")
|
||||
echo Done running libgc/autogen.sh ...
|
||||
fi
|
||||
|
||||
if test -d $srcdir/eglib; then
|
||||
echo Running eglib/autogen.sh ...
|
||||
(cd $srcdir/eglib ; NOCONFIGURE=1 ./autogen.sh "$@")
|
||||
echo Done running eglib/autogen.sh ...
|
||||
fi
|
||||
|
||||
if test x$MONO_EXTRA_CONFIGURE_FLAGS != x; then
|
||||
echo "MONO_EXTRA_CONFIGURE_FLAGS is $MONO_EXTRA_CONFIGURE_FLAGS"
|
||||
fi
|
||||
|
||||
host_conf_flag=
|
||||
build_uname_all=`(uname -a) 2>/dev/null`
|
||||
case "$build_uname_all" in
|
||||
CYGWIN*)
|
||||
if [[ "$@" != *"--host="* ]]; then
|
||||
echo "Missing --host parameter, configure using ./configure --host=i686-w64-mingw32 or --host=x86_64-w64-mingw32"
|
||||
echo "Falling back using --host=x86_64-w64-mingw32 as default."
|
||||
host_conf_flag="--host=x86_64-w64-mingw32"
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
||||
conf_flags="$MONO_EXTRA_CONFIGURE_FLAGS --enable-maintainer-mode --enable-compile-warnings $host_conf_flag" #--enable-iso-c
|
||||
conf_flags="$MONO_EXTRA_CONFIGURE_FLAGS --enable-maintainer-mode --enable-compile-warnings" #--enable-iso-c
|
||||
|
||||
if test x$NOCONFIGURE = x; then
|
||||
echo Running $srcdir/configure $conf_flags "$@" ...
|
||||
|
||||
+691
-3144
File diff suppressed because it is too large.
Load diff
+3
-3
@@ -7,7 +7,7 @@ EXTRA_DIST = \
|
||||
config.in \
|
||||
browscap.ini mono.supp mono.d README \
|
||||
mono.pc.in mono-2.pc.in monosgen-2.pc.in mint.pc.in dotnet.pc.in dotnet35.pc.in wcf.pc.in monodoc.pc.in \
|
||||
mono-cairo.pc.in mono-options.pc.in cecil.pc.in \
|
||||
mono-nunit.pc.in mono-cairo.pc.in mono-options.pc.in cecil.pc.in \
|
||||
mono-lineeditor.pc.in system.web.extensions_1.0.pc.in system.web.extensions.design_1.0.pc.in\
|
||||
dtrace-prelink.sh system.web.mvc.pc.in system.web.mvc2.pc.in system.web.mvc3.pc.in aspnetwebstack.pc.in \
|
||||
reactive.pc.in xbuild12.pc \
|
||||
@@ -25,10 +25,10 @@ else
|
||||
SGENPCFILE=
|
||||
endif
|
||||
|
||||
pkgconfig_DATA= mono.pc mono-2.pc dotnet.pc dotnet35.pc wcf.pc mono-cairo.pc mono-options.pc cecil.pc monodoc.pc mono-lineeditor.pc system.web.extensions_1.0.pc \
|
||||
pkgconfig_DATA= mono.pc mono-2.pc dotnet.pc dotnet35.pc wcf.pc mono-nunit.pc mono-cairo.pc mono-options.pc cecil.pc monodoc.pc mono-lineeditor.pc system.web.extensions_1.0.pc \
|
||||
system.web.extensions.design_1.0.pc system.web.mvc.pc system.web.mvc2.pc system.web.mvc3.pc aspnetwebstack.pc reactive.pc xbuild12.pc $(SGENPCFILE)
|
||||
|
||||
DISTCLEANFILES= mono-2.pc mono.pc mint.pc dotnet.pc dotnet35.pc wcf.pc mono-cairo.pc mono-options.pc cecil.pc monodoc.pc mono-lineeditor.pc system.web.extensions_1.0.pc \
|
||||
DISTCLEANFILES= mono-2.pc mono.pc mint.pc dotnet.pc dotnet35.pc wcf.pc mono-nunit.pc mono-cairo.pc mono-options.pc cecil.pc monodoc.pc mono-lineeditor.pc system.web.extensions_1.0.pc \
|
||||
system.web.extensions.design_1.0.pc system.web.mvc.pc system.web.mvc2.pc system.web.mvc3.pc aspnetwebstack.pc reactive.pc $(SGENPCFILE) mono-sgen-gdb.py
|
||||
|
||||
mono_DATA = config \
|
||||
|
||||
+1
-10
@@ -6,14 +6,11 @@
|
||||
<dllmap dll="libintl" name="bind_textdomain_codeset" target="@LIBC@" os="solaris"/>
|
||||
<dllmap dll="libintl" target="@INTL@" os="!windows"/>
|
||||
<dllmap dll="i:libxslt.dll" target="libxslt@libsuffix@" os="!windows"/>
|
||||
<dllmap dll="i:odbc32.dll" target="@ODBC@" os="!windows"/>
|
||||
<dllmap dll="i:odbc32.dll" target="libodbc@libsuffix@" os="!windows"/>
|
||||
<dllmap dll="i:odbc32.dll" target="libiodbc.dylib" os="osx"/>
|
||||
<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/@MONO_NATIVE_LIBRARY_NAME@@libsuffix@" os="!windows" />
|
||||
<dllmap dll="System.Net.Security.Native" target="$mono_libdir/@MONO_NATIVE_LIBRARY_NAME@@libsuffix@" os="!windows" />
|
||||
<dllmap dll="System.Security.Cryptography.Native.Apple" target="$mono_libdir/@MONO_NATIVE_LIBRARY_NAME@@libsuffix@" os="osx" />
|
||||
<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"/>
|
||||
@@ -21,14 +18,8 @@
|
||||
<dllmap dll="sqlite3" target="@SQLITE3@" os="!windows"/>
|
||||
<dllmap dll="libX11" target="@X11@" os="!windows" />
|
||||
<dllmap dll="libgdk-x11-2.0" target="@GDKX11@" os="!windows"/>
|
||||
<dllmap dll="libgdk_pixbuf-2.0" target="libgdk_pixbuf-2.0.so.0" os="!windows"/>
|
||||
<dllmap dll="libgtk-x11-2.0" target="@GTKX11@" os="!windows"/>
|
||||
<dllmap dll="libglib-2.0" target="libglib-2.0.so.0" os="!windows"/>
|
||||
<dllmap dll="libgobject-2.0" target="libgobject-2.0.so.0" os="!windows"/>
|
||||
<dllmap dll="libgnomeui-2" target="libgnomeui-2.so.0" os="!windows"/>
|
||||
<dllmap dll="librsvg-2" target="librsvg-2.so.2" os="!windows"/>
|
||||
<dllmap dll="libXinerama" target="@XINERAMA@" os="!windows" />
|
||||
<dllmap dll="libasound" target="libasound.so.2" os="!windows" />
|
||||
<dllmap dll="libcairo-2.dll" target="libcairo.so.2" os="!windows"/>
|
||||
<dllmap dll="libcairo-2.dll" target="libcairo.2.dylib" os="osx"/>
|
||||
<dllmap dll="libcups" target="libcups.so.2" os="!windows"/>
|
||||
|
||||
Executable → Regular
File mode changed.
+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)
|
||||
|
||||
+8
-31
@@ -1,46 +1,24 @@
|
||||
import lldb
|
||||
import traceback
|
||||
|
||||
def print_frames(thread, num_frames, current_thread):
|
||||
# TODO: Make output header similar to bt.
|
||||
print('%c thread #%i' % ('*' if current_thread else ' ', thread.idx))
|
||||
print '%c thread #%i' % ('*' if current_thread else ' ', thread.idx)
|
||||
|
||||
if current_thread:
|
||||
selected_frame = thread.GetSelectedFrame()
|
||||
|
||||
for frame in thread.frames[:+num_frames]:
|
||||
pc = str(frame.addr)
|
||||
fmt = ' %c %s'
|
||||
var = frame
|
||||
function_name = frame.GetFunctionName()
|
||||
if function_name == "interp_exec_method_full":
|
||||
try:
|
||||
s = 'frame->imethod->method'
|
||||
methoddesc = frame.EvaluateExpression('(char*) mono_method_full_name (' + s + ', 1)').summary[1:-1]
|
||||
|
||||
ipoffset = frame.EvaluateExpression('ip').GetValueAsUnsigned()
|
||||
insn = ''
|
||||
if ipoffset != 0:
|
||||
ipoffset -= frame.EvaluateExpression('frame->imethod->code').GetValueAsUnsigned()
|
||||
insn = "\"" + frame.EvaluateExpression('mono_interp_opname (*ip)').summary[1:-1] + "\""
|
||||
var = '%s @ %d %s || %s' % (methoddesc, ipoffset, insn, frame)
|
||||
except Exception as e:
|
||||
traceback.print_exc()
|
||||
elif function_name == "mono_interp_transform_method":
|
||||
try:
|
||||
s = 'runtime_method->method'
|
||||
klassname = frame.EvaluateExpression('(char*) ' + s + '->klass->name').summary[1:-1]
|
||||
methodname = frame.EvaluateExpression('(char*) ' + s + '->name').summary[1:-1]
|
||||
var = 'transforming %s::%s || %s' % (klassname, methodname, frame)
|
||||
except Exception as e:
|
||||
print("DBG: transformfail:" + str(e))
|
||||
elif pc[0] == '0':
|
||||
if pc[0] == '0':
|
||||
try:
|
||||
framestr = frame.EvaluateExpression('(char*)mono_pmip((void*)%s)' % pc).summary[1:-1]
|
||||
var = 'frame #%i: %s%s' % (frame.idx, pc, framestr)
|
||||
except:
|
||||
pass
|
||||
|
||||
print(' %c %s' % ('*' if current_thread and frame.idx == selected_frame.idx else ' ', var))
|
||||
print fmt % ('*' if current_thread and frame.idx == selected_frame.idx else ' ', var)
|
||||
|
||||
def monobt(debugger, command, result, dict):
|
||||
opts = {'all_bt': False, 'num_frames': None}
|
||||
@@ -50,20 +28,20 @@ def monobt(debugger, command, result, dict):
|
||||
elif command.isdigit():
|
||||
opts['num_frames'] = int(command)
|
||||
elif command != '':
|
||||
print('error: monobt [<number>|all]')
|
||||
print 'error: monobt [<number>|all]'
|
||||
return
|
||||
|
||||
target = debugger.GetSelectedTarget()
|
||||
process = target.process
|
||||
|
||||
if not process.IsValid():
|
||||
print('error: invalid process')
|
||||
print 'error: invalid process'
|
||||
return
|
||||
|
||||
if opts['all_bt']:
|
||||
for thread in process.threads:
|
||||
print_frames(thread, len(thread), process.selected_thread == thread)
|
||||
print('')
|
||||
print ''
|
||||
else:
|
||||
thread = process.selected_thread
|
||||
num_frames = len(thread) if opts['num_frames'] is None else opts['num_frames']
|
||||
@@ -75,5 +53,4 @@ def __lldb_init_module (debugger, dict):
|
||||
# This initializer is being run from LLDB in the embedded command interpreter
|
||||
# Add any commands contained in this module to LLDB
|
||||
debugger.HandleCommand('command script add -f monobt.monobt monobt')
|
||||
debugger.HandleCommand('command alias mbt monobt')
|
||||
print('"monobt" command installed')
|
||||
print '"monobt" command installed'
|
||||
@@ -86,7 +86,7 @@ LOCK RULES
|
||||
Simple locks:
|
||||
Can be acquired at any point regardless of which locks are taken or not.
|
||||
No other locks can be acquired or released while holding a simple lock.
|
||||
Reentrancy is not recommended. (warning)
|
||||
Reentrancy is not recomended. (warning)
|
||||
Simple locks are leaf locks on the lock lattice.
|
||||
|
||||
Complex locks:
|
||||
@@ -129,7 +129,7 @@ ERROR: tried to acquire lock DomainLock at mono_domain_code_reserve_align while
|
||||
WARNING: tried to acquire lock ImageDataLock at mono_image_init_name_cache while holding ImageDataLock at mono_class_from_name
|
||||
WARNING: tried to acquire lock ImageDataLock at mono_image_init_name_cache while holding ImageDataLock at mono_image_add_to_name_cache
|
||||
Both of those happen when filling up the name_cache, as it needs to alloc image memory.
|
||||
This one is fixable by splitting mono_image_init_name_cache into a locked and an unlocked variants and calling them appropriately.
|
||||
This one is fixable by spliting mono_image_init_name_cache into a locked and an unlocked variants and calling them appropriatedly.
|
||||
|
||||
*/
|
||||
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
prefix=${pcfiledir}/../..
|
||||
exec_prefix=${prefix}
|
||||
libdir=${exec_prefix}/lib
|
||||
|
||||
|
||||
Name: Mono NUnit
|
||||
Description: Mono's version of NUnit
|
||||
Version: @VERSION@
|
||||
Libs: -r:${libdir}/mono/4.5/nunit.core.dll -r:${libdir}/mono/4.5/nunit.core.interfaces.dll -r:${libdir}/mono/4.5/nunit.core.extensions.dll -r:${libdir}/mono/4.5/nunit.framework.dll -r:${libdir}/mono/4.5/nunit.framework.extensions.dll -r:${libdir}/mono/4.5/nunit.mocks.dll -r:${libdir}/mono/4.5/nunit.util.dll -r:${libdir}/mono/4.5/nunit-console-runner.dll
|
||||
@@ -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>
|
||||
|
||||
|
||||
@@ -11,11 +11,11 @@
|
||||
<section name="assemblyBinding" type="System.Configuration.IgnoreSection, System.Configuration, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" allowLocation="false" />
|
||||
<section name="satelliteassemblies" type="System.Configuration.IgnoreSection, System.Configuration, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" allowLocation="false" />
|
||||
<section name="startup" type="System.Configuration.IgnoreSection, System.Configuration, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" allowLocation="false"/>
|
||||
<section name="system.codedom" type="System.CodeDom.Compiler.CodeDomConfigurationHandler, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
|
||||
<section name="system.data" type="System.Data.Common.DbProviderFactoriesConfigurationHandler, System.Data, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
|
||||
<section name="system.diagnostics" type="System.Diagnostics.SystemDiagnosticsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
|
||||
<section name="system.runtime.remoting" type="System.Configuration.IgnoreSection, System.Configuration, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowLocation="false"/>
|
||||
<section name="system.windows.forms" type="System.Windows.Forms.WindowsFormsSection, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
|
||||
<section name="system.codedom" type="System.CodeDom.Compiler.CodeDomConfigurationHandler, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
|
||||
<section name="windows" type="System.Configuration.IgnoreSection, System.Configuration, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" allowLocation="false" />
|
||||
<section name="strongNames" type="System.Configuration.IgnoreSection, System.Configuration, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowLocation="false"/>
|
||||
<sectionGroup name="system.runtime.serialization" type="System.Runtime.Serialization.Configuration.SerializationSectionGroup, System.Runtime.Serialization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
@@ -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>
|
||||
|
||||
|
||||
+3
-4
@@ -52,8 +52,7 @@ EXTRA_DIST = \
|
||||
|
||||
-include $(mcs_topdir)/build/config.make
|
||||
|
||||
DOC_PROFILE:=net_4_x
|
||||
CLASS=$(mcs_topdir)/class/lib/$(DOC_PROFILE)
|
||||
CLASS=$(mcs_topdir)/class/lib/$(DEFAULT_PROFILE)
|
||||
|
||||
dist-hook:
|
||||
$(mkdir_p) $(distdir)/sources
|
||||
@@ -69,7 +68,7 @@ clean-local:
|
||||
-rm -f deploy/* convert.exe* AgilityPack.dll*
|
||||
-rm -f $(ASSEMBLED_DOCS)
|
||||
|
||||
TOOL_MAKE=$(MAKE) -f $(srcdir)/docs.make topdir=$(srcdir)/../mcs srcdir=$(srcdir) PROFILE=$(DOC_PROFILE)
|
||||
TOOL_MAKE=$(MAKE) -f $(srcdir)/docs.make topdir=$(srcdir)/../mcs srcdir=$(srcdir)
|
||||
|
||||
monoapi.zip: monoapi.tree
|
||||
|
||||
@@ -88,7 +87,7 @@ mono-file-formats.zip: mono-file-formats.tree
|
||||
mono-file-formats.tree: $(srcdir)/docs.make $(srcdir)/Makefile.am $(srcdir)/deploy/.stamp
|
||||
$(TOOL_MAKE) $@
|
||||
|
||||
deploy/.stamp: convert.exe Makefile.am exdoc
|
||||
deploy/.stamp: convert.exe Makefile.am
|
||||
$(mkdir_p) html
|
||||
runtimedir=`cd ../runtime && pwd`; export runtimedir; \
|
||||
MONO_PATH=$(CLASS) perl $(srcdir)/exdoc -h $(srcdir) -t . $(srcdir)/../mono/*/*.c
|
||||
|
||||
@@ -26,7 +26,7 @@ some combination of the two.
|
||||
|
||||
To be clearer, and give an idea of what the algorithm can and
|
||||
cannot do without describing it in detail... keep in mind that
|
||||
only "redundant" checks cannot be removed. By "redundant", I
|
||||
only "redunant" checks cannot be removed. By "redundant", I
|
||||
mean "already explicitly checked" in the method code.
|
||||
|
||||
Unfortunately, analyzing complex expressions is not so easy
|
||||
@@ -136,7 +136,7 @@ some combination of the two.
|
||||
In the first case, the BB has exactly two exit BBs, and their
|
||||
execution conditions are easy to get from the condition of the
|
||||
branch (see the "get_relation_from_branch_instruction"
|
||||
function, and especially the end of "analyze_block" in
|
||||
function, and expecially the end of "analyze_block" in
|
||||
abcremoval.c.
|
||||
|
||||
If there is a switch, the jump condition of every exit BB is
|
||||
@@ -303,7 +303,7 @@ some combination of the two.
|
||||
each BB tried to examine all possible conditions between all
|
||||
variables, filling a sort of "evaluation matrix". The problem
|
||||
was that the complexity of this evaluation was quadratic (or
|
||||
worse) on the number of variables, and that many variables
|
||||
worse) on the number of variables, and that many wariables
|
||||
were examined even if they were not involved in any array
|
||||
access.
|
||||
|
||||
@@ -332,7 +332,7 @@ some combination of the two.
|
||||
|
||||
[1b] Prepare the evaluation graph (empty)
|
||||
|
||||
[1b] Summarize each variable definition, and put
|
||||
[1b] Summarize each varible definition, and put
|
||||
the resulting relations in the evaluation
|
||||
graph
|
||||
|
||||
|
||||
@@ -43,16 +43,6 @@
|
||||
line-height: 0px;
|
||||
}
|
||||
|
||||
.mapi-codeblock {
|
||||
display: block;
|
||||
padding: 5pt 5pt;
|
||||
margin: 10pt;
|
||||
white-space: pre;
|
||||
font-family: monospace;
|
||||
border: 1px solid rgba(233,233,233,1);
|
||||
background-color: rgba(249,249,249,1);
|
||||
}
|
||||
|
||||
.mapi-entry code {
|
||||
border: none;
|
||||
background-color: transparent;
|
||||
|
||||
+2
-25
@@ -13,31 +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
|
||||
|
||||
ifdef MCS_MODE
|
||||
monoapi.zip:
|
||||
touch $@
|
||||
|
||||
monoapi.tree: monoapi.zip
|
||||
touch $@
|
||||
|
||||
mono-tools.zip:
|
||||
touch $@
|
||||
|
||||
mono-tools.tree: mono-tools.zip
|
||||
touch $@
|
||||
|
||||
mono-file-formats.zip:
|
||||
touch $@
|
||||
|
||||
mono-file-formats.tree: mono-file-formats.zip
|
||||
touch $@
|
||||
|
||||
else
|
||||
$(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) $<; }
|
||||
@@ -57,7 +36,5 @@ mono-file-formats.zip: mono-file-formats.tree
|
||||
mono-file-formats.tree: $(srcdir)/mono-file-formats.config $(srcdir)/docs.make
|
||||
$(MDOC) assemble -o mono-file-formats -f man $<
|
||||
|
||||
endif
|
||||
|
||||
.doc-stamp:
|
||||
|
||||
+4
-6
@@ -19,7 +19,7 @@ ENUM_VALUES_PER_LINE = 1
|
||||
EXCLUDE_SYMLINKS = NO
|
||||
EXPAND_ONLY_PREDEF = NO
|
||||
EXTENSION_MAPPING = c=C h=C
|
||||
EXTRACT_ALL = NO
|
||||
EXTRACT_ALL = YES
|
||||
EXTRACT_STATIC = YES
|
||||
EXT_LINKS_IN_WINDOW = NO
|
||||
FILE_PATTERNS = *.c *.h
|
||||
@@ -27,9 +27,9 @@ FULL_PATH_NAMES = YES
|
||||
GENERATE_BUGLIST = YES
|
||||
GENERATE_DEPRECATEDLIST = YES
|
||||
GENERATE_HTML = YES
|
||||
GENERATE_PERLMOD = YES
|
||||
GENERATE_LEGEND = YES
|
||||
GENERATE_PERLMOD = NO
|
||||
GENERATE_TESTLIST = NO
|
||||
GENERATE_TESTLIST = YES
|
||||
GENERATE_TODOLIST = YES
|
||||
GENERATE_TREEVIEW = YES
|
||||
GRAPHICAL_HIERARCHY = YES
|
||||
@@ -60,7 +60,6 @@ MULTILINE_CPP_IS_BRIEF = NO
|
||||
OPTIMIZE_OUTPUT_FOR_C = YES
|
||||
OUTPUT_DIRECTORY = doxygen-output
|
||||
OUTPUT_LANGUAGE = English
|
||||
PREDEFINED = "HAVE_SGEN_GC="
|
||||
PROJECT_NAME = "Mono"
|
||||
QT_AUTOBRIEF = NO
|
||||
QUIET = NO
|
||||
@@ -78,7 +77,6 @@ SHOW_USED_FILES = YES
|
||||
SKIP_FUNCTION_MACROS = YES
|
||||
SORT_BRIEF_DOCS = YES
|
||||
SORT_GROUP_NAMES = YES
|
||||
SORT_MEMBER_DOCS = YES
|
||||
SOURCE_BROWSER = YES
|
||||
SOURCE_TOOLTIPS = YES
|
||||
STRIP_CODE_COMMENTS = NO
|
||||
@@ -91,4 +89,4 @@ VERBATIM_HEADERS = YES
|
||||
WARNINGS = YES
|
||||
WARN_IF_DOC_ERROR = YES
|
||||
WARN_IF_UNDOCUMENTED = YES
|
||||
WARN_NO_PARAMDOC = YES
|
||||
WARN_NO_PARAMDOC = NO
|
||||
+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).
|
||||
+259
-452
@@ -1,311 +1,91 @@
|
||||
#!/usr/bin/perl
|
||||
|
||||
use warnings;
|
||||
use strict;
|
||||
|
||||
use Getopt::Long;
|
||||
use Pod::Usage;
|
||||
|
||||
# Options
|
||||
my $HELP = 0;
|
||||
my $SOURCE_DIR = '';
|
||||
my $TARGET_DIR = '';
|
||||
my $WARNINGS = 0;
|
||||
|
||||
GetOptions(
|
||||
"help" => \$HELP,
|
||||
"html|h=s" => \$SOURCE_DIR,
|
||||
"target|t=s" => \$TARGET_DIR,
|
||||
"warnings|W" => \$WARNINGS,
|
||||
) or pod2usage(1);
|
||||
|
||||
pod2usage(0) if $HELP;
|
||||
|
||||
exdoc();
|
||||
|
||||
#
|
||||
# Main entry point.
|
||||
#
|
||||
sub exdoc {
|
||||
my %templates = ();
|
||||
my %docs = ();
|
||||
my $stylesheet = load_stylesheet($SOURCE_DIR);
|
||||
load_templates($SOURCE_DIR, \%templates);
|
||||
process_source_files(\%docs);
|
||||
merge(\%docs, \%templates, \$stylesheet);
|
||||
if ($ARGV[0] eq "-h"){
|
||||
$sourcedir = $ARGV[1];
|
||||
$dir = $sourcedir;
|
||||
$html = 1;
|
||||
shift @ARGV;
|
||||
shift @ARGV;
|
||||
}
|
||||
open (FILE, "$dir/api-style.css" || die "Did not find $dir/api-style.css");
|
||||
while (<FILE>){
|
||||
$css = $css . $_;
|
||||
}
|
||||
|
||||
#
|
||||
# Load CSS stylesheet.
|
||||
#
|
||||
sub load_stylesheet {
|
||||
my ($dir_path) = @_;
|
||||
my $file_path = "$dir_path/api-style.css";
|
||||
open (my $file, '<', $file_path) or die "Could not open $file_path";
|
||||
local $/;
|
||||
my $contents = <$file>;
|
||||
close $file;
|
||||
return $contents;
|
||||
if ($ARGV[0] eq "-t"){
|
||||
$dir = $ARGV[1];
|
||||
shift @ARGV;
|
||||
}
|
||||
|
||||
#
|
||||
# Load HTML templates.
|
||||
#
|
||||
sub load_templates {
|
||||
my ($dir_path, $templates) = @_;
|
||||
opendir (my $dir, "$dir_path/sources/") or die "Could not open $dir_path";
|
||||
while (my $file_name = readdir ($dir)) {
|
||||
next if $file_name !~ /mono-api-.*\.html$/;
|
||||
open (my $file, "$dir_path/sources/$file_name") or die "Could not open $file_name";
|
||||
my $contents = '';
|
||||
my @api = ();
|
||||
while (<$file>) {
|
||||
$contents .= $_;
|
||||
if (/name="api:(.*?)"/) {
|
||||
s/.*name="api:(\w+?)".*/$1/;
|
||||
push @api, $_;
|
||||
}
|
||||
}
|
||||
close $file;
|
||||
$templates->{$file_name}->{contents} = $contents;
|
||||
$templates->{$file_name}->{api} = \@api;
|
||||
}
|
||||
closedir $dir;
|
||||
}
|
||||
|
||||
#
|
||||
# Extract documentation from all source files.
|
||||
#
|
||||
sub process_source_files {
|
||||
my ($docs) = @_;
|
||||
for my $file_path (@ARGV) {
|
||||
process_source_file($file_path, $docs);
|
||||
if ($html){
|
||||
opendir (D, "$sourcedir/sources/") || die "Can not open $dir";
|
||||
while ($n = readdir (D)){
|
||||
if ($n =~ /mono-api-.*\.html$/){
|
||||
open (IN, "$sourcedir/sources/$n") || die "Can not open $n";
|
||||
$files[$filecount] = $n;
|
||||
while (<IN>){
|
||||
@files_content[$filecount] .= $_;
|
||||
if (/name="api:(.*?)"/){
|
||||
$_ =~ s/.*name="api:(\w+?)".*/\1/;
|
||||
$apis[$filecount] .= "$_";
|
||||
}
|
||||
}
|
||||
$filecount++;
|
||||
close IN;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#
|
||||
# Extract documentation from a single source file.
|
||||
#
|
||||
sub process_source_file {
|
||||
my ($file_path, $docs) = @_;
|
||||
open (my $file, '<', $file_path) or die "Could not open $file_path";
|
||||
while (<$file>) {
|
||||
next if (!/\/\*\* *\n/);
|
||||
process_function($file, $file_path, $docs);
|
||||
}
|
||||
close $file;
|
||||
while (<ARGV>){
|
||||
if (/\/\*\* *\n/){
|
||||
&process_doc;
|
||||
} else {
|
||||
#print "IGNORING: $_";
|
||||
}
|
||||
}
|
||||
|
||||
#
|
||||
# Extract documentation from a single function.
|
||||
#
|
||||
sub process_function {
|
||||
|
||||
my ($file, $file_path, $docs) = @_;
|
||||
|
||||
my $PARAMETER_SECTION = 0;
|
||||
my $BODY_SECTION = 1;
|
||||
my $RETURN_SECTION = 2;
|
||||
my $section = $PARAMETER_SECTION;
|
||||
|
||||
my $name = do {
|
||||
$_ = <$file>;
|
||||
chomp;
|
||||
s/^ \* //;
|
||||
s/:$//;
|
||||
$_
|
||||
};
|
||||
|
||||
# Ignore irrelevant functions, and those with the wrong doc format.
|
||||
return if $name !~ /^mono_\w+$/;
|
||||
|
||||
my $deprecated;
|
||||
my @parameters = ();
|
||||
my $body = '';
|
||||
my $returns = '';
|
||||
my $prototype = '';
|
||||
my $codeblock = 'false';
|
||||
|
||||
while (<$file>) {
|
||||
|
||||
# We've reached the last line in the documentation block.
|
||||
if (/^ \*\*?\//) {
|
||||
|
||||
# Grab function prototype.
|
||||
while (<$file>) {
|
||||
$prototype .= $_;
|
||||
last if /\{/;
|
||||
}
|
||||
|
||||
# Clean up prototype.
|
||||
$prototype = do {
|
||||
$_ = $prototype;
|
||||
# Strip braces and trailing whitespace.
|
||||
s/{//;
|
||||
s/ +$//;
|
||||
# Turn "Type * xxx" into "Type* xxx"
|
||||
s/^(\w+)\W+\*/$1*/;
|
||||
$_;
|
||||
};
|
||||
|
||||
# Process formatting within sections.
|
||||
for my $parameter (@parameters) {
|
||||
process_formatting(\$parameter->{description}, $file_path, $.);
|
||||
}
|
||||
process_formatting(\$returns, $file_path, $.);
|
||||
process_formatting(\$body, $file_path, $.);
|
||||
if (defined($deprecated)) {
|
||||
process_formatting(\$deprecated, $file_path, $.);
|
||||
}
|
||||
|
||||
if (exists($docs->{body}->{$name})) {
|
||||
my $origin = $docs->{origin}->{$name};
|
||||
if ($WARNINGS) {
|
||||
warn
|
||||
"$file_path:$.: Redundant documentation for $name\n",
|
||||
"$origin->{file}:$origin->{line}: Previously defined here\n";
|
||||
}
|
||||
}
|
||||
$docs->{origin}->{$name} = { file => $file_path, line => $. };
|
||||
$docs->{body}->{$name} = $body;
|
||||
$docs->{parameters}->{$name} = \@parameters;
|
||||
$docs->{deprecated}->{$name} = $deprecated if defined $deprecated;
|
||||
$docs->{return}->{$name} = $returns;
|
||||
$docs->{prototype}->{$name} = $prototype;
|
||||
last;
|
||||
|
||||
}
|
||||
|
||||
# Strip newlines and asterisk prefix.
|
||||
chomp;
|
||||
s/^ +\*//;
|
||||
|
||||
if (/\s*\\code$/) {
|
||||
$codeblock = 'true';
|
||||
} elsif (/\s*\\endcode$/) {
|
||||
$codeblock = 'false';
|
||||
}
|
||||
|
||||
# Replace blank lines with paragraph breaks if we're not in a code block.
|
||||
if (/^\s*$/) {
|
||||
$_ = '<p>' if $codeblock eq 'false';
|
||||
}
|
||||
|
||||
if ($section == $PARAMETER_SECTION) {
|
||||
if (/\s*\\param +(\w+)(.*)/) {
|
||||
# print "$file_path:$.: warning: Got parameter $1\n";
|
||||
push @parameters, { name => $1, description => $2 };
|
||||
} elsif (/\s*\\deprecated(.*)/) {
|
||||
# print "$file_path:$.: warning: Got deprecated annotation\n";
|
||||
$deprecated = $1;
|
||||
} elsif (/\s*(\w+):(.*)/) {
|
||||
if ($1 eq 'deprecated') {
|
||||
warn "$file_path:$.: Old-style monodoc notation 'deprecated:' used\n"
|
||||
if $WARNINGS;
|
||||
$deprecated = $2;
|
||||
} else {
|
||||
warn "$file_path:$.: Old-style monodoc notation 'param:' used\n"
|
||||
if $WARNINGS;
|
||||
push @parameters, { name => $1, description => $2 };
|
||||
}
|
||||
} else {
|
||||
# $body = "\t$_\n";
|
||||
$section = $BODY_SECTION;
|
||||
redo;
|
||||
}
|
||||
} elsif ($section == $BODY_SECTION) {
|
||||
if (s/(Returns?:\s*|\\returns?\s*)//) {
|
||||
$returns = "\t$_\n";
|
||||
$section = $RETURN_SECTION;
|
||||
} else {
|
||||
$body .= "\n$_";
|
||||
}
|
||||
} elsif ($section == $RETURN_SECTION) {
|
||||
$returns .= "\n\t$_";
|
||||
} else {
|
||||
die "Invalid section $section\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#
|
||||
# Substitute formatting within documentation text.
|
||||
#
|
||||
sub process_formatting {
|
||||
my ($content, $file_path, $current_line) = @_;
|
||||
$_ = $$content;
|
||||
|
||||
# General formatting
|
||||
s{\\b +(\w+)}{<strong>$1</strong>}g;
|
||||
s{\\a +(\w+)}{<i>$1</i>}g;
|
||||
s{\\e +(\w+)}{<i>$1</i>}g;
|
||||
s{\\em +(\w+)}{<i>$1</i>}g;
|
||||
|
||||
# Constants
|
||||
s{NULL}{<code>NULL</code>}g;
|
||||
s{TRUE}{<code>TRUE</code>}g;
|
||||
s{FALSE}{<code>FALSE</code>}g;
|
||||
|
||||
# Parameters
|
||||
warn "$file_path:$current_line: Old-style monodoc notation '\@param' used\n"
|
||||
if s{@(\w+)}{<i>$1</i>}g && $WARNINGS;
|
||||
s{\\p +(\w+)}{<i>$1</i>}g;
|
||||
|
||||
# Code
|
||||
warn "$file_path:$current_line: Old-style monodoc notation '#code' used\n"
|
||||
if s{#(\w+)}{<code>$1</code>}g && $WARNINGS;
|
||||
warn "$file_path:$current_line: Old-style monodoc notation '`code`' used\n"
|
||||
if s{\`((?!api:)[:.\w\*]+)\`}{<code>$1</code>}g && $WARNINGS;
|
||||
s{\\c +(\S+(?<![.,:;]))}{<code>$1</code>}g;
|
||||
s{\\code}{<pre><code class="mapi-codeblock">}g;
|
||||
s{\\endcode}{</code></pre>}g;
|
||||
|
||||
$$content = $_;
|
||||
}
|
||||
|
||||
#
|
||||
# Merge templates with stylesheet and documentation extracted from sources.
|
||||
#
|
||||
sub merge {
|
||||
my ($docs, $templates, $stylesheet) = @_;
|
||||
my $last = '';
|
||||
for my $name (keys %$templates) {
|
||||
open (my $output_file, '>', "$TARGET_DIR/html/$name")
|
||||
or die "Could not create $TARGET_DIR/html/$name";
|
||||
print "Merging: $name\n";
|
||||
print $output_file <<EOF;
|
||||
if ($html){
|
||||
for ($f = 0; $f < $filecount; $f++){
|
||||
$name = $files[$f];
|
||||
open (OUT, "> $dir/html/$name") || die "Can not create $dir/html/$name";
|
||||
print "Merging: $name\n";
|
||||
print OUT<<EOF;
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<title>$name</title>
|
||||
<style type="text/css">
|
||||
$stylesheet
|
||||
$css
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="mapi-docs">
|
||||
EOF
|
||||
my @a = split (/\n/, $templates->{$name}->{contents});
|
||||
my $strike = '';
|
||||
my $strikeextra = '';
|
||||
my $api_shown = 0;
|
||||
for (my $ai = 0; $ai < $#a; $ai++) {
|
||||
my $line = $a[$ai];
|
||||
if (my ($api, $caption) = ($line =~ /<h4><a name=\"api:(\w+)\">(\w+)<\/a><\/h4>/)) {
|
||||
if ($api_shown == 1) {
|
||||
print $output_file "</div> <!-- class=mapi -->\n\n";
|
||||
if ($docs->{deprecated}->{$api}) {
|
||||
$strike = "mapi-strike";
|
||||
$strikeextra = "</div><br><div class='mapi-deprecated'><b>Deprecated:</b> " . $docs->{deprecated}->{$api};
|
||||
} else {
|
||||
$strike = "";
|
||||
$strikeextra = "";
|
||||
}
|
||||
}
|
||||
$api_shown = 1;
|
||||
my $proto = $docs->{prototype}->{$api} // $api;
|
||||
@a = split (/\n/, $files_content[$f]);
|
||||
$strikeextra = "";
|
||||
$api_shown = 0;
|
||||
for ($ai = 0; $ai < $#a; $ai++){
|
||||
$line = $a[$ai];
|
||||
|
||||
($api,$caption) = $line =~ /<h4><a name=\"api:(\w+)\">(\w+)<\/a><\/h4>/;
|
||||
if ($api ne ""){
|
||||
if ($api_shown == 1){
|
||||
print OUT "</div> <!-- class=mapi -->\n\n";
|
||||
if ($deprecated{$api}){
|
||||
$strike = "mapi-strike";
|
||||
$strikeextra = "</div><br><div class='mapi-deprecated'><b>Deprecated:</b> " . $deprecated{$api};
|
||||
} else {
|
||||
$strike = "";
|
||||
$strikeextra = "";
|
||||
}
|
||||
}
|
||||
$api_shown = 1;
|
||||
$proto = $prototype{$api};
|
||||
if ($proto eq ""){
|
||||
$proto = "$api";
|
||||
}
|
||||
|
||||
print $output_file <<EOF;
|
||||
print OUT<<EOF;
|
||||
<a name="api:$api"></a>
|
||||
<div class="mapi">
|
||||
<div class="mapi-entry $strike"><code>$api$strikeextra</code></div>
|
||||
@@ -318,201 +98,228 @@ EOF
|
||||
<div class="mapi-prototype">$proto</div>
|
||||
<p>
|
||||
EOF
|
||||
if (exists ($docs->{parameters}->{$api})) {
|
||||
my $ppars = $docs->{parameters}->{$api};
|
||||
if (@$ppars) {
|
||||
print $output_file
|
||||
" <div class=\"mapi-section\">Parameters</div>\n",
|
||||
" <table class=\"mapi-parameters\"><tbody>",
|
||||
render_parameters($ppars),
|
||||
"</tbody></table>";
|
||||
}
|
||||
}
|
||||
$ppars = $arguments{$api};
|
||||
if ($ppars ne "" && (!($ppars =~ /^[ \t]+$/))){
|
||||
print OUT " <div class=\"mapi-section\">Parameters</div>\n";
|
||||
print OUT " <table class=\"mapi-parameters\"><tbody>".${arguments{$api}}."</tbody></table>";
|
||||
}
|
||||
|
||||
&opt_print ("Return value", $returns{$api}, 0);
|
||||
&opt_print ("Description", $bodies{$api}, 0);
|
||||
print OUT " </div><!--mapi-description-->\n </div><!--height container-->\n";
|
||||
} else {
|
||||
if ($line =~ /@API_IDX@/){
|
||||
$apis_toc = &create_toc ($apis[$f]);
|
||||
$line =~ s/\@API_IDX\@/$apis_toc/;
|
||||
}
|
||||
if ($line =~ /^<h4/){
|
||||
print OUT "</div>\n";
|
||||
$api_shown = 0;
|
||||
}
|
||||
if ($line =~ /`/){
|
||||
}
|
||||
print OUT "$line\n";
|
||||
}
|
||||
}
|
||||
print OUT<<EOF;
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
EOF
|
||||
close OUT;
|
||||
system ("$ENV{runtimedir}/mono-wrapper convert.exe $dir/html/$name $dir/html/x-$name");
|
||||
|
||||
opt_print ($output_file, "Return value", $docs->{return}->{$api});
|
||||
opt_print ($output_file, "Description", $docs->{body}->{$api});
|
||||
print $output_file " </div><!--mapi-description-->\n </div><!--height container-->\n";
|
||||
} else {
|
||||
if ($line =~ /\@API_IDX\@/) {
|
||||
my $apis_toc = create_toc ($docs, $templates->{$name}->{api});
|
||||
$line =~ s/\@API_IDX\@/$apis_toc/;
|
||||
}
|
||||
if ($line =~ /^<h4/) {
|
||||
print $output_file "</div>\n";
|
||||
$api_shown = 0;
|
||||
}
|
||||
if ($line =~ /`/) {
|
||||
}
|
||||
print $output_file "$line\n";
|
||||
}
|
||||
}
|
||||
print $output_file
|
||||
" </div>",
|
||||
"</body>",
|
||||
"</html>";
|
||||
close $output_file;
|
||||
system ("$ENV{runtimedir}/mono-wrapper convert.exe $TARGET_DIR/html/$name $TARGET_DIR/html/x-$name");
|
||||
|
||||
# Clean up the mess that AgilityPack makes (it CDATAs our CSS).
|
||||
open (my $hack_input, '<', "$TARGET_DIR/html/x-$name")
|
||||
or die "Could not open $TARGET_DIR/html/x-$name";
|
||||
open (my $hack_output, '>', "$TARGET_DIR/deploy/$name")
|
||||
or die "Could not open output";
|
||||
# clean up the mess that AgilityPack does, it CDATAs our CSS
|
||||
open HACK, "$dir/html/x-$name" || die "Could not open $dir/html/x-$name";
|
||||
open HACKOUT, ">$dir/deploy/$name" || die "Could not open output";
|
||||
|
||||
my $line = 0;
|
||||
my $doprint = 0;
|
||||
while (<$hack_input>) {
|
||||
print $hack_output $last if ($doprint);
|
||||
$line++;
|
||||
s/^\/\/<!\[CDATA\[//;
|
||||
s/^\/\/\]\]>\/\///;
|
||||
$line = 0;
|
||||
$doprint = 0;
|
||||
while (<HACK>){
|
||||
print HACKOUT $last if ($doprint);
|
||||
$line++;
|
||||
s/^\/\/<!\[CDATA\[//;
|
||||
s/^\/\/\]\]>\/\///;
|
||||
|
||||
# Remove the junk <span> wrapper generated by AgilityPack.
|
||||
if ($line==1) {
|
||||
s/<span>//;
|
||||
}
|
||||
if (/<style type/) {
|
||||
# Replace the CSS in the XHTML output with the original CSS.
|
||||
print $hack_output $_;
|
||||
print $hack_output $$stylesheet;
|
||||
while (<$hack_input>) {
|
||||
last if (/<\/style>/);
|
||||
}
|
||||
}
|
||||
$last = $_;
|
||||
$doprint = 1;
|
||||
}
|
||||
if (!($last =~ /span/)) {
|
||||
print $hack_output $last;
|
||||
}
|
||||
# system ("cp.exe $TARGET_DIR/html/$name $TARGET_DIR/deploy/$name");
|
||||
# Remove the junk <span> wrapper generated by AgilityPack
|
||||
if ($line==1){
|
||||
s/<span>//;
|
||||
}
|
||||
if (/<style type/){
|
||||
# Replace the CSS in the XHTML output with the original CSS
|
||||
print HACKOUT $_;
|
||||
print HACKOUT $css;
|
||||
while (<HACK>){
|
||||
last if (/<\/style>/);
|
||||
}
|
||||
}
|
||||
$last = $_;
|
||||
$doprint = 1;
|
||||
}
|
||||
if (!($last =~ /span/)){
|
||||
print HACKOUT $last;
|
||||
}
|
||||
|
||||
#system ("cp.exe $dir/html/$name $dir/deploy/$name");
|
||||
}
|
||||
}
|
||||
|
||||
sub process_doc {
|
||||
$doc = "";
|
||||
$func = <>;
|
||||
chop $func;
|
||||
$func =~ s/^ \* //;
|
||||
$func =~ s/:$//;
|
||||
print "Function: $func\n" if (!$html);
|
||||
$args = "";
|
||||
$inbody = 0;
|
||||
$returns = "";
|
||||
$body = "";
|
||||
$functions[$fn++] = $func;
|
||||
$deprecated = 0;
|
||||
# Process arguments
|
||||
while (<>){
|
||||
s/NULL/<code>NULL<\/code>/g;
|
||||
s/TRUE/<code>TRUE<\/code>/g;
|
||||
s/FALSE/<code>FALSE<\/code>/g;
|
||||
if (/^ \*\*?\//){
|
||||
$body =~ s/@(\w+)/<i>\1<\/i>/g;
|
||||
$returns =~ s/@(\w+)/<i>\1<\/i>/g;
|
||||
$args =~ s/@(\w+)/<i>\1<\/i>/g;
|
||||
|
||||
$body =~ s/#(\w+)/<code>\1<\/code>/g;
|
||||
$returns =~ s/#(\w+)/<code>\1<\/code>/g;
|
||||
$args =~ s/#(\w+)/<code>\1<\/code>/g;
|
||||
|
||||
$returns =~ s/\`([:.\w\*]+)\`/<code>\1<\/code>/g;
|
||||
$args =~ s/\`([:.\w\*]+)\`/<code>\1<\/code>/g;
|
||||
$body =~ s/\`([:.\w\*]+)\`/<code>\1<\/code>/g;
|
||||
|
||||
$body =~ s/\n/ /;
|
||||
$bodies{$func} = $body;
|
||||
$arguments{$func} = $args;
|
||||
$deprecated{$func} = $deprecated;
|
||||
$returns{$func} = $returns;
|
||||
$proto = "";
|
||||
while (<>){
|
||||
$proto .= $_;
|
||||
last if (/\{/);
|
||||
}
|
||||
$proto =~ s/{//;
|
||||
# clean it up a little, remove newlines, empty space at end
|
||||
$proto =~ s/ +$//;
|
||||
# Turn "Type * xxx" into "Type* xxx"
|
||||
$proto =~ s/^(\w+)\W+\*/\1\*/;
|
||||
$prototype{$func} = $proto;
|
||||
return;
|
||||
}
|
||||
chop;
|
||||
s/^\ \*//;
|
||||
$_ = "<p>" if (/^\s*$/);
|
||||
|
||||
if ($inbody == 0){
|
||||
if (/\s*(\w+):(.*)/){
|
||||
if ($1 eq "deprecated"){
|
||||
$deprecated = $2;
|
||||
} else {
|
||||
#$args .= "<dt><i>$1:</i></dt><dd>$2</dd>";
|
||||
$args .= "<tr><td><i>$1</i><td>$2</td></td></tr>";
|
||||
}
|
||||
} else {
|
||||
|
||||
$body = "\t$_\n";
|
||||
|
||||
$inbody = 1;
|
||||
}
|
||||
} elsif ($inbody == 1) {
|
||||
if (/Returns?:/){
|
||||
s/Returns?://;
|
||||
$returns = "\t$_\n";
|
||||
$inbody = 2;
|
||||
} else {
|
||||
$body .= "\n\t$_";
|
||||
}
|
||||
} else {
|
||||
$returns .= "\n\t$_";
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
sub create_toc {
|
||||
my ($docs, $apis_listed) = @_;
|
||||
my ($apis_listed) = @_;
|
||||
my $type_size = 0;
|
||||
my $name_size = 0;
|
||||
my ($ret, $xname, $args);
|
||||
my $apis_toc = "";
|
||||
my $ret, $xname, $args, $line;
|
||||
$apis_toc = "";
|
||||
|
||||
# Try to align things; compute type size, method size, and arguments.
|
||||
foreach my $line (split /\n/, $apis_listed) {
|
||||
if (exists ($docs->{prototype}->{$line})) {
|
||||
my $p = $docs->{prototype}->{$line};
|
||||
if (my ($ret, $xname, $args) = ($p =~ /(.*)\n(\w+)[ \t](.*)/)) {
|
||||
my $tl = length ($ret);
|
||||
my $pl = length ($xname);
|
||||
$type_size = $tl if ($tl > $type_size);
|
||||
$name_size = $pl if ($pl > $name_size);
|
||||
}
|
||||
}
|
||||
|
||||
# Try to align things, so compute type size, method size, and arguments
|
||||
foreach $line (split /\n/, $apis_listed){
|
||||
$p = $prototype{$line};
|
||||
($ret, $xname, $args) = $p =~ /(.*)\n(\w+)[ \t](.*)/;
|
||||
$tl = length ($ret);
|
||||
$pl = length ($xname);
|
||||
|
||||
$type_size = $tl if ($tl > $type_size);
|
||||
$name_size = $pl if ($pl > $name_size);
|
||||
}
|
||||
|
||||
$type_size++;
|
||||
$name_size++;
|
||||
|
||||
foreach my $line (split /\n/, $apis_listed) {
|
||||
chomp($line);
|
||||
if (exists($docs->{prototype}->{$line})) {
|
||||
my $p = $docs->{prototype}->{$line};
|
||||
if (my ($ret, $xname, $args) = ($p =~ /(.*)\n(\w+)[ \t](.*)/)) {
|
||||
$xname = $line if $xname eq "";
|
||||
my $rspace = " " x ($type_size - length ($ret));
|
||||
my $nspace = " " x ($name_size - length ($xname));
|
||||
$args = wrap ($args, length ($ret . $rspace . $xname . $nspace), 60);
|
||||
$apis_toc .= "$ret$rspace<a href=\"\#api:$line\">$xname</a>$nspace$args\n";
|
||||
}
|
||||
}
|
||||
foreach $line (split /\n/, $apis_listed){
|
||||
chop;
|
||||
$p = $prototype{$line};
|
||||
($ret, $xname, $args) = $p =~ /(.*)\n(\w+)[ \t](.*)/;
|
||||
if ($xname eq ""){
|
||||
$xname = $line;
|
||||
}
|
||||
|
||||
$rspace = " " x ($type_size - length ($ret));
|
||||
$nspace = " " x ($name_size - length ($xname));
|
||||
$args = &format ($args, length ($ret . $rspace . $xname . $nspace), 60);
|
||||
$apis_toc .= "$ret$rspace<a href=\"\#api:$line\">$xname</a>$nspace$args\n";
|
||||
}
|
||||
return $apis_toc;
|
||||
}
|
||||
|
||||
sub wrap {
|
||||
#
|
||||
# Formats the rest of the arguments in a way that will fit in N columns
|
||||
#
|
||||
sub format {
|
||||
my ($args, $size, $limit) = @_;
|
||||
my $sret = "";
|
||||
|
||||
# return $args if ((length (args) + size) < $limit);
|
||||
# return $args if ((length (args) + size) < $limit);
|
||||
|
||||
my $remain = $limit - $size;
|
||||
my @sa = split /,/, $args;
|
||||
my $linelen = $size;
|
||||
foreach my $arg (@sa) {
|
||||
if ($sret eq "") {
|
||||
$sret = $arg . ", ";
|
||||
$linelen += length ($sret);
|
||||
} else {
|
||||
if ($linelen + length ($arg) < $limit) {
|
||||
$sret .= "FITS" . $arg . ", ";
|
||||
} else {
|
||||
my $newline = " " x ($size) . $arg . ", ";
|
||||
my $linelen = length ($newline);
|
||||
$sret .= "\n" . $newline;
|
||||
}
|
||||
}
|
||||
$remain = $limit - $size;
|
||||
@sa = split /,/, $args;
|
||||
$linelen = $size;
|
||||
foreach $arg (@sa){
|
||||
if ($sret eq ""){
|
||||
$sret = $arg . ", ";
|
||||
$linelen += length ($sret);
|
||||
} else {
|
||||
if ($linelen + length ($arg) < $limit){
|
||||
$sret .= "FITS" . $arg . ", ";
|
||||
} else {
|
||||
$newline = " " x ($size) . $arg . ", ";
|
||||
$linelen = length ($newline);
|
||||
$sret .= "\n" . $newline;
|
||||
}
|
||||
}
|
||||
}
|
||||
$sret =~ s/, $/;/;
|
||||
return $sret;
|
||||
}
|
||||
|
||||
#
|
||||
# Print a section if non-empty.
|
||||
#
|
||||
sub opt_print {
|
||||
my ($output, $caption, $opttext) = @_;
|
||||
if (defined($opttext) && $opttext ne '' && $opttext !~ /^[ \t]+$/) {
|
||||
print $output
|
||||
" <div class=\"mapi-section\">$caption</div>\n",
|
||||
" <div>$opttext</div>\n";
|
||||
my ($caption, $opttext, $quote) = @_;
|
||||
|
||||
if ($opttext ne "" && (!($opttext =~ /^[ \t]+$/))){
|
||||
print OUT " <div class=\"mapi-section\">$caption</div>\n";
|
||||
print OUT " <div>$opttext</div>\n";
|
||||
}
|
||||
}
|
||||
|
||||
#
|
||||
# Render parameter information as table.
|
||||
#
|
||||
sub render_parameters {
|
||||
my ($parameters) = @_;
|
||||
my $result = '';
|
||||
for my $parameter (@$parameters) {
|
||||
$result .= "<tr><td><i>$parameter->{name}</i></td><td>$parameter->{description}</td></tr>";
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
__END__
|
||||
|
||||
=head1 NAME
|
||||
|
||||
exdoc - Compiles API docs from Mono sources and HTML templates.
|
||||
|
||||
=head1 SYNOPSIS
|
||||
|
||||
exdoc [OPTIONS] [FILE...]
|
||||
|
||||
=head1 OPTIONS
|
||||
|
||||
=over 4
|
||||
|
||||
=item B<--help>
|
||||
|
||||
Print this help message.
|
||||
|
||||
=item B<--html> I<DIR>, B<-h> I<DIR>
|
||||
|
||||
Use I<DIR> as the input path for HTML sources.
|
||||
|
||||
=item B<--target> I<DIR>, B<-t> I<DIR>
|
||||
|
||||
Use I<DIR> as the target path for output.
|
||||
|
||||
=item B<--warnings>, B<-W>
|
||||
|
||||
Enable warnings about documentation errors.
|
||||
|
||||
=back
|
||||
|
||||
=head1 DESCRIPTION
|
||||
|
||||
Reads HTML templates and C sources, extracting documentation from the sources and splicing it into the templates.
|
||||
|
||||
=cut
|
||||
@@ -37,6 +37,7 @@
|
||||
<manpage name="mono-xmltool(1)" page="../man/mono-xmltool.1" />
|
||||
<manpage name="mozroots(1)" page="../man/mozroots.1" />
|
||||
<manpage name="permview(1)" page="../man/permview.1" />
|
||||
<manpage name="prj2make(1)" page="../man/prj2make.1" />
|
||||
<manpage name="resgen(1)" page="../man/resgen.1" />
|
||||
<manpage name="secutil(1)" page="../man/secutil.1" />
|
||||
<manpage name="setreg(1)" page="../man/setreg.1" />
|
||||
|
||||
-138
@@ -1,138 +0,0 @@
|
||||
# Mono RISC-V Port
|
||||
|
||||
These are some useful links and notes pertaining to the RISC-V port of Mono.
|
||||
|
||||
## Useful RISC-V documentation
|
||||
|
||||
* [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](https://riscv.org/specifications/debug-specification)
|
||||
* [RISC-V ELF psABI Specification](https://github.com/riscv/riscv-elf-psabi-doc)
|
||||
* [RISC-V C API Specification](https://github.com/riscv/riscv-c-api-doc)
|
||||
* [RISC-V Toolchain Conventions](https://github.com/riscv/riscv-toolchain-conventions)
|
||||
* [RISC-V Assembly Programmer's Manual](https://github.com/riscv/riscv-asm-manual)
|
||||
|
||||
## Useful RISC-V repositories
|
||||
|
||||
* [RISC-V Organization](https://github.com/riscv)
|
||||
* [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 Tools](https://github.com/riscv/riscv-tools)
|
||||
* [RISC-V Opcodes](https://github.com/riscv/riscv-opcodes)
|
||||
* [RISC-V Tests](https://github.com/riscv/riscv-tests)
|
||||
|
||||
## Setting up a cross environment
|
||||
|
||||
### Debian/Ubuntu packages
|
||||
|
||||
This is the most painless way of getting a functional toolchain installed. Note
|
||||
that these packages may not be available on older distributions; this is tested
|
||||
on Ubuntu 19.04.
|
||||
|
||||
First, add this to your `$HOME/.bashrc` (or some other script that you run):
|
||||
|
||||
```bash
|
||||
export RISCV=$HOME/riscv
|
||||
export PATH=$RISCV/bin:$PATH
|
||||
export QEMU_LD_PREFIX=/usr/riscv64-linux-gnu
|
||||
```
|
||||
|
||||
Next, install the toolchain packages like so:
|
||||
|
||||
```bash
|
||||
# apt install autoconf automake binutils-riscv64-linux-gnu build-essential gcc-riscv64-linux-gnu gdb-multiarch g++-riscv64-linux-gnu libtool qemu qemu-system-misc qemu-user qemu-user-static
|
||||
```
|
||||
|
||||
You will now have all the toolchain binaries in `/usr/bin`.
|
||||
|
||||
### Building manually
|
||||
|
||||
This approach may be somewhat unstable since you will be using the latest
|
||||
versions of the various parts of the toolchain.
|
||||
|
||||
First, add this to your `$HOME/.bashrc` (or some other script that you run):
|
||||
|
||||
```bash
|
||||
export RISCV=$HOME/riscv
|
||||
export PATH=$RISCV/bin:$PATH
|
||||
export QEMU_LD_PREFIX=$RISCV/sysroot
|
||||
```
|
||||
|
||||
Next, install some dependencies needed to build the toolchain:
|
||||
|
||||
```console
|
||||
# apt install autoconf automake autotools-dev curl libmpc-dev libmpfr-dev libgmp-dev gawk build-essential bison flex texinfo gperf libtool patchutils bc zlib1g-dev libexpat-dev
|
||||
```
|
||||
|
||||
Finally, build the toolchain:
|
||||
|
||||
```console
|
||||
$ git clone --recursive [email protected]:riscv/riscv-gnu-toolchain.git
|
||||
$ cd riscv-gnu-toolchain
|
||||
$ ./configure --prefix=$RISCV --enable-linux --enable-multilib --with-arch=rv64imafdc --with-abi=lp64d
|
||||
$ make linux
|
||||
```
|
||||
|
||||
This will install the built toolchain binaries in `$RISCV/bin`.
|
||||
|
||||
## Building Mono with a cross toolchain
|
||||
|
||||
Building Mono is quite straightforward:
|
||||
|
||||
```console
|
||||
$ ./autogen.sh --prefix=$RISCV/sysroot --host=riscv64-linux-gnu
|
||||
$ make
|
||||
$ make install
|
||||
```
|
||||
|
||||
(Note: You may need to use `--host=riscv64-unknown-linux-gnu` instead if you
|
||||
built the toolchain manually.)
|
||||
|
||||
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-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 ./mono/mini/mono hello.exe
|
||||
```
|
||||
|
||||
## Debugging
|
||||
|
||||
Debugging with GDB currently requires a manually built toolchain.
|
||||
|
||||
It can be done like so:
|
||||
|
||||
```console
|
||||
$ qemu-riscv64 -g 12345 ./mono/mini/mono --interp basic.exe &
|
||||
$ riscv64-unknown-elf-gdb -ex 'target remote localhost:12345' -ex 'b main' -ex 'c' ./mono/mini/mono
|
||||
```
|
||||
|
||||
## Things to be done
|
||||
|
||||
Things that need to be done beyond the basic 64-bit port, 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.
|
||||
@@ -109,12 +109,6 @@ typedef struct {
|
||||
|
||||
<h3>Write Barriers</h3>
|
||||
|
||||
<p>SGen is a concurrent and generational GC, features which require
|
||||
tracking changes to the state of the heap. This is achieved through
|
||||
write barriers. Whenever native code is changing the state of the
|
||||
heap by storing references into another managed object, it needs to
|
||||
do it using this write barrier API.
|
||||
|
||||
<h4><a name="api:mono_gc_wbarrier_arrayref_copy">mono_gc_wbarrier_arrayref_copy</a></h4>
|
||||
<h4><a name="api:mono_gc_wbarrier_generic_nostore">mono_gc_wbarrier_generic_nostore</a></h4>
|
||||
<h4><a name="api:mono_gc_wbarrier_generic_store">mono_gc_wbarrier_generic_store</a></h4>
|
||||
|
||||
@@ -27,6 +27,7 @@ typedef enum {
|
||||
|
||||
<h3>Opening and closing MonoImages</h3>
|
||||
|
||||
<h4><a name="api:mono_load_image">mono_load_image</a></h4>
|
||||
<h4><a name="api:mono_image_open">mono_image_open</a></h4>
|
||||
<h4><a name="api:mono_image_open_full">mono_image_open_full</a></h4>
|
||||
<h4><a name="api:mono_image_open_from_data">mono_image_open_from_data</a></h4>
|
||||
|
||||
@@ -40,6 +40,7 @@
|
||||
<h4><a name="api:mono_marshal_get_delegate_invoke">mono_marshal_get_delegate_invoke</a></h4>
|
||||
<h4><a name="api:mono_marshal_get_icall_wrapper">mono_marshal_get_icall_wrapper</a></h4>
|
||||
<h4><a name="api:mono_marshal_get_isinst">mono_marshal_get_isinst</a></h4>
|
||||
<h4><a name="api:mono_marshal_get_ldfld_remote_wrapper">mono_marshal_get_ldfld_remote_wrapper</a></h4>
|
||||
<h4><a name="api:mono_marshal_get_ldfld_wrapper">mono_marshal_get_ldfld_wrapper</a></h4>
|
||||
<h4><a name="api:mono_marshal_get_managed_wrapper">mono_marshal_get_managed_wrapper</a></h4>
|
||||
<h4><a name="api:mono_marshal_get_native_wrapper">mono_marshal_get_native_wrapper</a></h4>
|
||||
@@ -50,6 +51,7 @@
|
||||
<h4><a name="api:mono_marshal_get_remoting_invoke_with_check">mono_marshal_get_remoting_invoke_with_check</a></h4>
|
||||
<h4><a name="api:mono_marshal_get_runtime_invoke">mono_marshal_get_runtime_invoke</a></h4>
|
||||
<h4><a name="api:mono_marshal_get_stelemref">mono_marshal_get_stelemref</a></h4>
|
||||
<h4><a name="api:mono_marshal_get_stfld_remote_wrapper">mono_marshal_get_stfld_remote_wrapper</a></h4>
|
||||
<h4><a name="api:mono_marshal_get_stfld_wrapper">mono_marshal_get_stfld_wrapper</a></h4>
|
||||
<h4><a name="api:mono_marshal_get_struct_to_ptr">mono_marshal_get_struct_to_ptr</a></h4>
|
||||
<h4><a name="api:mono_marshal_get_synchronized_wrapper">mono_marshal_get_synchronized_wrapper</a></h4>
|
||||
@@ -57,9 +59,47 @@
|
||||
<h4><a name="api:mono_marshal_get_xappdomain_invoke">mono_marshal_get_xappdomain_invoke</a></h4>
|
||||
<h4><a name="api:mono_marshal_load_type_info">mono_marshal_load_type_info</a></h4>
|
||||
<h4><a name="api:mono_marshal_method_from_wrapper">mono_marshal_method_from_wrapper</a></h4>
|
||||
<h4><a name="api:mono_marshal_realloc">mono_marshal_realloc</a></h4>
|
||||
<h4><a name="api:mono_marshal_set_last_error">mono_marshal_set_last_error</a></h4>
|
||||
<h4><a name="api:mono_marshal_type_size">mono_marshal_type_size</a></h4>
|
||||
|
||||
<h2>Metadata Loading Errors</h2>
|
||||
|
||||
<p>The routines in this section are used to cope with errors
|
||||
during metadata loading. Errors in metadata handling can
|
||||
happen for many reason, and these include (this is not an
|
||||
exhaustive list).
|
||||
|
||||
<ul>
|
||||
<li>An assembly referenced is missing.
|
||||
<li>Fields referenced are missing.
|
||||
<li>Methods referenced are missing.
|
||||
</ul>
|
||||
|
||||
<p>The <tt>mono_loader_set_*</tt> routines are invoked during
|
||||
metadata loading to flag that an error has happened. The
|
||||
class loading errros are flagged in a per-thread basis.
|
||||
|
||||
<P>In various spots in the runtime the
|
||||
<tt>mono_loader_get_last_error</tt> routine is called to check
|
||||
if there was a problem, and then errors are propagated upwards
|
||||
on the stack until we reach a point where an exception can be
|
||||
raised and no runtime locks are held.
|
||||
|
||||
<p>The <tt>mono_loader_error_prepare_exception</tt> takes a
|
||||
<tt>MonoLoaderError</tt> structure (the value returned from
|
||||
<tt>mono_loader_get_last_error</tt>), turns that into an
|
||||
exception and clears the error condition from the current
|
||||
thread.
|
||||
|
||||
<h4><a name="api:mono_loader_set_error_field_load">mono_loader_set_error_field_load</a></h4>
|
||||
<h4><a name="api:mono_loader_set_error_method_load">mono_loader_set_error_method_load</a></h4>
|
||||
<h4><a name="api:mono_loader_set_error_type_load">mono_loader_set_error_type_load</a></h4>
|
||||
|
||||
<h4><a name="api:mono_loader_get_last_error">mono_loader_get_last_error</a></h4>
|
||||
<h4><a name="api:mono_loader_clear_error">mono_loader_clear_error</a></h4>
|
||||
<h4><a name="api:mono_loader_error_prepare_exception">mono_loader_error_prepare_exception</a></h4>
|
||||
|
||||
<h2>Metadata Loader Locking: Internals</h2>
|
||||
|
||||
<p>The locking functions here are used by code in class.c and
|
||||
@@ -74,6 +114,10 @@
|
||||
<p>The internal interface of the Mono GC is the interface used
|
||||
between the runtime engine and the garbage collector.
|
||||
|
||||
<h4><a name="api:mono_gc_disable">mono_gc_disable</a></h4>
|
||||
<h4><a name="api:mono_gc_enable">mono_gc_enable</a></h4>
|
||||
<h4><a name="api:mono_gc_start_world">mono_gc_start_world</a></h4>
|
||||
<h4><a name="api:mono_gc_stop_world">mono_gc_stop_world</a></h4>
|
||||
<h4><a name="api:mono_gc_alloc_fixed">mono_gc_alloc_fixed</a></h4>
|
||||
<h4><a name="api:mono_gc_free_fixed">mono_gc_free_fixed</a></h4>
|
||||
<h4><a name="api:mono_gc_make_descr_from_bitmap">mono_gc_make_descr_from_bitmap</a></h4>
|
||||
|
||||
@@ -31,12 +31,17 @@
|
||||
<h4><a name="api:mono_g_hash_table_destroy">mono_g_hash_table_destroy</a></h4>
|
||||
<h4><a name="api:mono_g_hash_table_foreach">mono_g_hash_table_foreach</a></h4>
|
||||
<h4><a name="api:mono_g_hash_table_foreach_remove">mono_g_hash_table_foreach_remove</a></h4>
|
||||
<h4><a name="api:mono_g_hash_table_foreach_steal">mono_g_hash_table_foreach_steal</a></h4>
|
||||
<h4><a name="api:mono_g_hash_table_insert">mono_g_hash_table_insert</a></h4>
|
||||
<h4><a name="api:mono_g_hash_table_lookup">mono_g_hash_table_lookup</a></h4>
|
||||
<h4><a name="api:mono_g_hash_table_lookup_extended">mono_g_hash_table_lookup_extended</a></h4>
|
||||
<h4><a name="api:mono_g_hash_table_new">mono_g_hash_table_new</a></h4>
|
||||
<h4><a name="api:mono_g_hash_table_new_full">mono_g_hash_table_new_full</a></h4>
|
||||
<h4><a name="api:mono_g_hash_table_remap">mono_g_hash_table_remap</a></h4>
|
||||
<h4><a name="api:mono_g_hash_table_remove">mono_g_hash_table_remove</a></h4>
|
||||
<h4><a name="api:mono_g_hash_table_replace">mono_g_hash_table_replace</a></h4>
|
||||
<h4><a name="api:mono_g_hash_table_size">mono_g_hash_table_size</a></h4>
|
||||
<h4><a name="api:mono_g_hash_table_steal">mono_g_hash_table_steal</a></h4>
|
||||
|
||||
|
||||
<h3>Memory Pools</h3>
|
||||
@@ -62,6 +67,7 @@
|
||||
<h4><a name="api:mono_mempool_destroy">mono_mempool_destroy</a></h4>
|
||||
<h4><a name="api:mono_mempool_alloc">mono_mempool_alloc</a></h4>
|
||||
<h4><a name="api:mono_mempool_alloc0">mono_mempool_alloc0</a></h4>
|
||||
<h4><a name="api:mono_mempool_empty">mono_mempool_empty</a></h4>
|
||||
<h4><a name="api:mono_mempool_invalidate">mono_mempool_invalidate</a></h4>
|
||||
<h4><a name="api:mono_mempool_stats">mono_mempool_stats</a></h4>
|
||||
<h4><a name="api:mono_mempool_contains_addr">mono_mempool_contains_addr</a></h4>
|
||||
@@ -147,4 +153,6 @@
|
||||
<h4><a name="api:mono_profiler_startup">mono_profiler_startup</a></h4>
|
||||
<h4><a name="api:mono_profiler_gc_event">mono_profiler_gc_event</a></h4>
|
||||
<h4><a name="api:mono_profiler_gc_heap_resize">mono_profiler_gc_heap_resize</a></h4>
|
||||
<h4><a name="api:mono_profiler_gc_event">mono_profiler_gc_event</a></h4>
|
||||
<h4><a name="api:mono_profiler_gc_heap_resize">mono_profiler_gc_heap_resize</a></h4>
|
||||
<h4><a name="api:mono_profiler_stat_hit">mono_profiler_stat_hit</a></h4>
|
||||
@@ -669,12 +669,15 @@ MONO_TYPESPEC_SIZE
|
||||
<h4><a name="api:mono_metadata_parse_method_signature">mono_metadata_parse_method_signature</a></h4>
|
||||
<h4><a name="api:mono_metadata_parse_mh">mono_metadata_parse_mh</a></h4>
|
||||
<h4><a name="api:mono_metadata_parse_param">mono_metadata_parse_param</a></h4>
|
||||
<h4><a name="api:mono_metadata_parse_ret_type">mono_metadata_parse_ret_type</a></h4>
|
||||
<h4><a name="api:mono_metadata_parse_signature">mono_metadata_parse_signature</a></h4>
|
||||
<h4><a name="api:mono_metadata_parse_typedef_or_ref">mono_metadata_parse_typedef_or_ref</a></h4>
|
||||
<h4><a name="api:mono_metadata_parse_type">mono_metadata_parse_type</a></h4>
|
||||
|
||||
<h2>Generics Support</h2>
|
||||
|
||||
<h4><a name="api:mono_metadata_generic_class_equal">mono_metadata_generic_class_equal</a></h4>
|
||||
<h4><a name="api:mono_metadata_generic_class_hash">mono_metadata_generic_class_hash</a></h4>
|
||||
<h4><a name="api:mono_metadata_generic_class_is_valuetype">mono_metadata_generic_class_is_valuetype</a></h4>
|
||||
|
||||
<h2>Tokens</h2>
|
||||
|
||||
@@ -1,193 +1,73 @@
|
||||
<h1>Runtime Profiler API</h1>
|
||||
<h1>Profiling Interface</h1>
|
||||
|
||||
<p>The profiler API can be used by dynamically loaded profiler
|
||||
modules to monitor different aspects of a running program. The
|
||||
API is also usable by embedders without having to compile a
|
||||
profiler module.
|
||||
<h3>Profiler Operation</h3>
|
||||
|
||||
<h2>Profiler Modules</h2>
|
||||
<p>The following methods can be used by dynamic profiler
|
||||
methods to monitor different aspects of the program.
|
||||
|
||||
<p>A profiler module is simply a shared library with a single
|
||||
exported function which is the entry point that Mono calls at
|
||||
startup. It must have the following signature:
|
||||
<p>A custom profiler will have one public method defined in
|
||||
the shared library which is the entry point that Mono calls at
|
||||
startup, it has the following signature:
|
||||
|
||||
<pre><code class="mapi-codeblock">
|
||||
void mono_profiler_startup_example (const char *desc)
|
||||
</code></pre>
|
||||
<pre>
|
||||
void mono_profiler_startup (const char *desc)
|
||||
</pre>
|
||||
|
||||
<p>Here, the <code>example</code> portion of the function name is
|
||||
the name of the profiler module. It must match the shared library
|
||||
name (i.e. <code>libmono-profiler-example.so</code>). <i>desc</i>
|
||||
is the set of arguments that were passed from the command line.
|
||||
<p>Where "desc" is the set of arguments that were passed from
|
||||
the command line. This routine will call
|
||||
<tt>mono_profiler_install</tt> to activate the profiler and
|
||||
will install one or more filters (one of the various
|
||||
<tt>mono_profiler_install_</tt> functions).
|
||||
|
||||
<p>For example, a bare bones profiler module might look like this
|
||||
(<code>example.c</code>):
|
||||
<p>In addition, a profiler developer will typically call
|
||||
<tt>mono_profiler_set_events</tt> to register which kinds of
|
||||
traces should be enabled, these can be an OR-ed combination of
|
||||
the following:
|
||||
|
||||
<pre><code class="mapi-codeblock">
|
||||
#include <mono/metadata/profiler.h>
|
||||
#include <stdio.h>
|
||||
<pre>
|
||||
MONO_PROFILE_NONE
|
||||
MONO_PROFILE_APPDOMAIN_EVENTS
|
||||
MONO_PROFILE_ASSEMBLY_EVENTS
|
||||
MONO_PROFILE_MODULE_EVENTS
|
||||
MONO_PROFILE_CLASS_EVENTS
|
||||
MONO_PROFILE_JIT_COMPILATION
|
||||
MONO_PROFILE_INLINING
|
||||
MONO_PROFILE_EXCEPTIONS
|
||||
MONO_PROFILE_ALLOCATIONS
|
||||
MONO_PROFILE_GC
|
||||
MONO_PROFILE_THREADS
|
||||
MONO_PROFILE_REMOTING
|
||||
MONO_PROFILE_TRANSITIONS
|
||||
MONO_PROFILE_ENTER_LEAVE
|
||||
MONO_PROFILE_COVERAGE
|
||||
MONO_PROFILE_INS_COVERAGE
|
||||
MONO_PROFILE_STATISTICAL
|
||||
</pre>
|
||||
|
||||
struct _MonoProfiler {
|
||||
int dummy;
|
||||
}
|
||||
<p>Developers can change the set of monitored events at
|
||||
runtime by calling <tt>mono_profiler_set_events</tt>.
|
||||
|
||||
<h4><a name="api:mono_profiler_install">mono_profiler_install</a></h4>
|
||||
<h4><a name="api:mono_profiler_install_allocation">mono_profiler_install_allocation</a></h4>
|
||||
<h4><a name="api:mono_profiler_install_appdomain">mono_profiler_install_appdomain</a></h4>
|
||||
<h4><a name="api:mono_profiler_install_assembly">mono_profiler_install_assembly</a></h4>
|
||||
<h4><a name="api:mono_profiler_install_class">mono_profiler_install_class</a></h4>
|
||||
<h4><a name="api:mono_profiler_install_coverage_filter">mono_profiler_install_coverage_filter</a></h4>
|
||||
<h4><a name="api:mono_profiler_install_enter_leave">mono_profiler_install_enter_leave</a></h4>
|
||||
<h4><a name="api:mono_profiler_install_jit_compile">mono_profiler_install_jit_compile</a></h4>
|
||||
<h4><a name="api:mono_profiler_install_module">mono_profiler_install_module</a></h4>
|
||||
<h4><a name="api:mono_profiler_install_thread">mono_profiler_install_thread</a></h4>
|
||||
<h4><a name="api:mono_profiler_install_transition">mono_profiler_install_transition</a></h4>
|
||||
<h4><a name="api:mono_profiler_install_gc">mono_profiler_install_gc</a></h4>
|
||||
<h4><a name="api:mono_profiler_install_statistical">mono_profiler_install_statistical</a></h4>
|
||||
<h4><a name="api:mono_profiler_set_events">mono_profiler_set_events</a></h4>
|
||||
<h4><a name="api:mono_profiler_get_events">mono_profiler_get_events</a></h4>
|
||||
|
||||
static MonoProfiler profiler;
|
||||
<h3>Coverage</h3>
|
||||
|
||||
static void
|
||||
runtime_inited (MonoProfiler *prof)
|
||||
{
|
||||
printf ("Hello World");
|
||||
}
|
||||
<p>To support profiling modules that need to do code coverage
|
||||
analysis, the following routines is provided:
|
||||
|
||||
<h4><a name="api:mono_profiler_coverage_get">mono_profiler_coverage_get</a></h4>
|
||||
|
||||
void
|
||||
mono_profiler_init_example (const char *desc)
|
||||
{
|
||||
MonoProfilerHandle handle = mono_profiler_create (&profiler);
|
||||
mono_profiler_set_runtime_initialized_callback (handle, runtime_inited);
|
||||
}
|
||||
</code></pre>
|
||||
|
||||
<p>To compile this module, a C compiler must be invoked in a
|
||||
similar fashion to this, on Linux:
|
||||
|
||||
<pre><code class="mapi-codeblock">
|
||||
gcc -fPIC -shared -o libmono-profiler-example.so example.c `pkg-config --cflags mono-2`
|
||||
</code></pre>
|
||||
|
||||
<p>Or on OS X:
|
||||
|
||||
<pre><code class="mapi-codeblock">
|
||||
gcc -undefined suppress -flat_namespace -o libmono-profiler-example.so example.c `pkg-config --cflags mono-2`
|
||||
</code></pre>
|
||||
|
||||
<p>You can then load the module using:
|
||||
|
||||
<pre><code class="mapi-codeblock">
|
||||
mono --profile=example hello.exe
|
||||
</code></pre>
|
||||
|
||||
<p>(Note that adjusting <code>LD_LIBRARY_PATH</code> may be
|
||||
necessary in order for the dynamic linker to find the module.)
|
||||
|
||||
<h2>Profiler Functions</h2>
|
||||
|
||||
<p>These are the functions usable for profiling programs.
|
||||
|
||||
<p>Each function has a note indicating whether they're async
|
||||
safe. An async safe function can be invoked in a signal handler
|
||||
or when the world is stopped by the GC. Conversely, a function
|
||||
that is not async safe must not be invoked in such a context or
|
||||
undefined behavior can occur (crashes, deadlocks, etc).
|
||||
|
||||
<p>Some functions may only be invoked from a profiler module's
|
||||
init function (or prior to running managed code in the case of
|
||||
embedding). This is noted explicitly only if applicable to a
|
||||
function.
|
||||
|
||||
<h3>Basic Functions</h3>
|
||||
|
||||
<p>These functions are used to load and install profilers.
|
||||
|
||||
<h4><a name="api:mono_profiler_load">mono_profiler_load</a></h4>
|
||||
<h4><a name="api:mono_profiler_create">mono_profiler_create</a></h4>
|
||||
<h4><a name="api:mono_profiler_set_cleanup_callback">mono_profiler_set_cleanup_callback</a></h4>
|
||||
|
||||
<h3>Code Coverage</h3>
|
||||
|
||||
<p>These functions provide access to the JIT compiler's code
|
||||
coverage support. This functionality can be used to collect
|
||||
information about how many times certain code paths have been
|
||||
executed.
|
||||
|
||||
<h4><a name="api:mono_profiler_enable_coverage">mono_profiler_enable_coverage</a></h4>
|
||||
<h4><a name="api:mono_profiler_set_coverage_filter_callback">mono_profiler_set_coverage_filter_callback</a></h4>
|
||||
<h4><a name="api:mono_profiler_get_coverage_data">mono_profiler_get_coverage_data</a></h4>
|
||||
|
||||
<h3>Statistical Sampling</h3>
|
||||
|
||||
<p>Statistical sampling can be used to interrupt managed threads
|
||||
based on a certain mode and frequency for the purpose of
|
||||
collecting data about their current work.
|
||||
|
||||
<p>One common use case for this functionality, usually referred
|
||||
to as call sampling, is to collect a backtrace from every thread
|
||||
when a sampling hit event arrives. This data can then be compiled
|
||||
into a report indicating where a program spends most of its time.
|
||||
|
||||
<h4><a name="api:mono_profiler_enable_sampling">mono_profiler_enable_sampling</a></h4>
|
||||
<h4><a name="api:mono_profiler_set_sample_mode">mono_profiler_set_sample_mode</a></h4>
|
||||
<h4><a name="api:mono_profiler_get_sample_mode">mono_profiler_get_sample_mode</a></h4>
|
||||
|
||||
<p>A callback must be registered to receive sample hit events.
|
||||
Please see the <i>Callback Registration</i> section below.
|
||||
|
||||
<h3>GC Allocations</h3>
|
||||
|
||||
<p>Profilers can be notified about all GC allocations performed
|
||||
by a program or the Mono runtime.
|
||||
|
||||
<h4><a name="api:mono_profiler_enable_allocations">mono_profiler_enable_allocations</a></h4>
|
||||
|
||||
<p>A callback must be registered to receive allocation events.
|
||||
Please see the <i>Callback Registration</i> section below.
|
||||
|
||||
<h3>Call Instrumentation</h3>
|
||||
|
||||
<p>The JIT compiler supports instrumenting managed method entry
|
||||
and exit points so that a profiler callback will be invoked.
|
||||
|
||||
<p>While such callbacks by themselves have traditionally only
|
||||
been useful for call count profiling and the like, Mono gives
|
||||
these callbacks access to the arguments, locals, and return
|
||||
value of instrumented methods (together referred to as the 'call
|
||||
context'). This enables many profiling scenarios that would
|
||||
otherwise have required explicit hooks in the base class
|
||||
libraries.
|
||||
|
||||
<h4><a name="api:mono_profiler_set_call_instrumentation_filter_callback">mono_profiler_set_call_instrumentation_filter_callback</a></h4>
|
||||
<h4><a name="api:mono_profiler_enable_call_context_introspection">mono_profiler_enable_call_context_introspection</a></h4>
|
||||
<h4><a name="api:mono_profiler_call_context_get_this">mono_profiler_call_context_get_this</a></h4>
|
||||
<h4><a name="api:mono_profiler_call_context_get_argument">mono_profiler_call_context_get_argument</a></h4>
|
||||
<h4><a name="api:mono_profiler_call_context_get_local">mono_profiler_call_context_get_local</a></h4>
|
||||
<h4><a name="api:mono_profiler_call_context_get_result">mono_profiler_call_context_get_result</a></h4>
|
||||
<h4><a name="api:mono_profiler_call_context_free_buffer">mono_profiler_call_context_free_buffer</a></h4>
|
||||
|
||||
<p>Callbacks must be registered to receive method entry and exit
|
||||
events. Please see the <i>Callback Registration</i> section
|
||||
below.
|
||||
|
||||
<h3>Callback Registration</h3>
|
||||
|
||||
<p>In addition to the above functions, there's a large set of
|
||||
functions for installing generic profiler event callbacks. These
|
||||
are generated from C macros and so are not documented here.
|
||||
Please refer to the <code>mono/metadata/profiler.h</code> and
|
||||
<code>mono/metadata/profiler-events.h</code> headers for a full
|
||||
listing of these.
|
||||
|
||||
<p>Callback registration functions are all async safe and can be
|
||||
safely invoked from multiple threads at the same time, with the
|
||||
caveat that altering a registered callback from one thread will
|
||||
not immediately affect another thread that is already invoking
|
||||
the current callback.
|
||||
|
||||
<h2>API Stability</h2>
|
||||
|
||||
<p>The profiler API does not have the same API stability
|
||||
garantees that the rest of the Mono embedding API does. While
|
||||
a breaking change to the profiler API is extremely rare, it has
|
||||
happened in the past when changing the API in a backwards
|
||||
compatible way was deemed to be too much work for too little
|
||||
gain.
|
||||
|
||||
<p>Therefore, developers of profiler modules may rarely need to
|
||||
update their code to work with new versions of the profiler API.
|
||||
|
||||
<p>Developers who wish to support older versions of the API can
|
||||
perform a compile time check of the
|
||||
<code>MONO_PROFILER_API_VERSION</code> macro and maintain code
|
||||
for both old and new versions.
|
||||
|
||||
<p>To aid with transitioning to a new version of the profiler
|
||||
API, the Mono runtime will detect and reject loading profiler
|
||||
modules which were compiled against older profiler API versions.
|
||||
@@ -0,0 +1,22 @@
|
||||
/
|
||||
/depcomp
|
||||
/config.guess
|
||||
/config.sub
|
||||
/ltmain.sh
|
||||
/eglib-*.tar.gz
|
||||
/missing
|
||||
/install-sh
|
||||
/compile
|
||||
/Makefile
|
||||
/Makefile.in
|
||||
/stamp-h1
|
||||
/config.h.in
|
||||
/libtool
|
||||
/autom4te.cache
|
||||
/aclocal.m4
|
||||
/config.log
|
||||
/configure
|
||||
/config.h
|
||||
/config.status
|
||||
/INSTALL
|
||||
dolt*
|
||||
File renamed without changes.
@@ -0,0 +1,17 @@
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to
|
||||
deal in the Software without restriction, including without limitation the
|
||||
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
||||
sell copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
||||
IN THE SOFTWARE.
|
||||
@@ -0,0 +1,19 @@
|
||||
ACLOCAL_AMFLAGS = -I m4
|
||||
|
||||
AM_CFLAGS = $(WERROR_CFLAGS)
|
||||
|
||||
if HOST_WIN32
|
||||
SUBDIRS = m4 src
|
||||
else
|
||||
if PLATFORM_DARWIN
|
||||
SUBDIRS = m4 src
|
||||
else
|
||||
if CROSS_COMPILING
|
||||
SUBDIRS = m4 src
|
||||
else
|
||||
SUBDIRS = m4 src test
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
||||
EXTRA_DIST = autogen.sh README NEWS AUTHORS winconfig.h
|
||||
File renamed without changes.
@@ -0,0 +1,54 @@
|
||||
|
||||
The purpose of eglib is to be an X11-licensed subset of glib that can
|
||||
be used with Mono when the Mono runtime is explicitly relicensed under
|
||||
a different license by Novell.
|
||||
|
||||
The implementation is done from the public documentation available here:
|
||||
|
||||
http://developer.gnome.org/doc/API/2.0/glib/
|
||||
|
||||
Currently this is only being built standalone, use:
|
||||
|
||||
./autogen.sh --prefix=/tmp/test
|
||||
|
||||
Currently all the definitions go into a single file: glib.h, there are
|
||||
no separate files, please try to follow the convetions in the source code
|
||||
|
||||
* Tests
|
||||
|
||||
Please read the README in tests/
|
||||
|
||||
* Features
|
||||
|
||||
The source code is designed to allow for different operating
|
||||
system builds of the eglib code.
|
||||
|
||||
Files in src that:
|
||||
|
||||
* Have a plain name: are cross platform, and should work on
|
||||
every operating system.
|
||||
|
||||
* That end in -unix.c: These files contain Unix specific code.
|
||||
|
||||
* That end in -win32.c: These files contain Win32 specific code.
|
||||
|
||||
* That end in -posix.c: Will work on both Windows and Unix,
|
||||
but should not be included for other operating systems.
|
||||
|
||||
* Plans: short and long term.
|
||||
|
||||
The short term plans for eglib is to allow Mono to optionally
|
||||
build with it instead of using glib, gmodule and gthread, but
|
||||
the default build will continue to be done against glib 2.0.
|
||||
|
||||
In the long-term we are considering dropping glib as a
|
||||
dependency, considering that Mono requires a modern Unix
|
||||
system to run anyways (for its thread support) it would allow
|
||||
us to fix some of the glib API limitations we have to live
|
||||
with (explicit thread support for example), rework the API to
|
||||
use types from stdint.h and we would be able to drop three
|
||||
external shared libraries.
|
||||
|
||||
This would reduce memory usage for the handful of routines
|
||||
that we use from glib, dynamic linker overhead for those and
|
||||
would allow us to tune the implementation to Mono's needs.
|
||||
+33
@@ -0,0 +1,33 @@
|
||||
* Missing code
|
||||
|
||||
* Process launching
|
||||
3 g_shell_quote
|
||||
1 g_shell_unquote
|
||||
|
||||
----------------------------------------------------------------------
|
||||
|
||||
* Should implement, for better performance:
|
||||
|
||||
Macros:
|
||||
6 G_UNLIKELY
|
||||
4 G_LIKELY
|
||||
|
||||
* Unimplemented, not supported currently:
|
||||
|
||||
(none as yet.)
|
||||
|
||||
* Dead Code
|
||||
|
||||
The GMainLoop code was no longer in use in Mono.
|
||||
|
||||
* Windows implementations needed
|
||||
|
||||
Directory, File manipulation:
|
||||
|
||||
g_dir_open, g_dir_close, g_dir_read_name
|
||||
|
||||
We're missing a native windows implementation. The unix one is in place.
|
||||
|
||||
* Information retrieval
|
||||
1 g_win32_getlocale
|
||||
|
||||
@@ -0,0 +1,182 @@
|
||||
dnl dolt, a replacement for libtool
|
||||
dnl Copyright © 2007-2008 Josh Triplett <[email protected]>
|
||||
dnl Copying and distribution of this file, with or without modification,
|
||||
dnl are permitted in any medium without royalty provided the copyright
|
||||
dnl notice and this notice are preserved.
|
||||
dnl
|
||||
dnl To use dolt, invoke the DOLT macro immediately after the libtool macros.
|
||||
dnl Optionally, copy this file into acinclude.m4, to avoid the need to have it
|
||||
dnl installed when running autoconf on your project.
|
||||
|
||||
AC_DEFUN([DOLT], [
|
||||
AC_REQUIRE([AC_CANONICAL_HOST])
|
||||
# dolt, a replacement for libtool
|
||||
# Josh Triplett <[email protected]>
|
||||
AC_PATH_PROG(DOLT_BASH, bash)
|
||||
AC_MSG_CHECKING([if dolt supports this host])
|
||||
dolt_supported=yes
|
||||
if test x$DOLT_BASH = x; then
|
||||
dolt_supported=no
|
||||
fi
|
||||
if test x$GCC != xyes; then
|
||||
dolt_supported=no
|
||||
fi
|
||||
case $host in
|
||||
i?86-*-linux*|i?86-apple-darwin*|x86_64-*-linux*|powerpc-*-linux*|powerpc64-*-linux* \
|
||||
|amd64-*-freebsd*|i?86-*-freebsd*|ia64-*-freebsd*|arm*-*-linux*|sparc*-*-linux*|mips*-*-linux*|x86_64-apple-darwin*|aarch64*)
|
||||
pic_options='-fPIC'
|
||||
;;
|
||||
?86-pc-cygwin*|i?86-pc-cygwin*|i?86-pc-mingw32*)
|
||||
pic_options='-DDLL_EXPORT'
|
||||
;;
|
||||
i?86-apple-darwin*|arm-apple-darwin*)
|
||||
pic_options='-fno-common'
|
||||
;;
|
||||
*)
|
||||
dolt_supported=no
|
||||
;;
|
||||
esac
|
||||
if test x$dolt_supported = xno ; then
|
||||
AC_MSG_RESULT([no, falling back to libtool])
|
||||
LTCOMPILE='$(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(COMPILE)'
|
||||
LTCXXCOMPILE='$(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXXCOMPILE)'
|
||||
else
|
||||
AC_MSG_RESULT([yes, replacing libtool])
|
||||
|
||||
dnl Start writing out doltcompile.
|
||||
cat <<__DOLTCOMPILE__EOF__ >doltcompile
|
||||
#!$DOLT_BASH
|
||||
__DOLTCOMPILE__EOF__
|
||||
cat <<'__DOLTCOMPILE__EOF__' >>doltcompile
|
||||
args=("$[]@")
|
||||
for ((arg=0; arg<${#args@<:@@@:>@}; arg++)) ; do
|
||||
if test x"${args@<:@$arg@:>@}" = x-o ; then
|
||||
objarg=$((arg+1))
|
||||
break
|
||||
fi
|
||||
done
|
||||
if test x$objarg = x ; then
|
||||
echo 'Error: no -o on compiler command line' 1>&2
|
||||
exit 1
|
||||
fi
|
||||
lo="${args@<:@$objarg@:>@}"
|
||||
obj="${lo%.lo}"
|
||||
if test x"$lo" = x"$obj" ; then
|
||||
echo "Error: libtool object file name \"$lo\" does not end in .lo" 1>&2
|
||||
exit 1
|
||||
fi
|
||||
objbase="${obj##*/}"
|
||||
__DOLTCOMPILE__EOF__
|
||||
|
||||
dnl Write out shared compilation code.
|
||||
if test x$enable_shared = xyes; then
|
||||
cat <<'__DOLTCOMPILE__EOF__' >>doltcompile
|
||||
libobjdir="${obj%$objbase}.libs"
|
||||
if test ! -d "$libobjdir" ; then
|
||||
mkdir_out="$(mkdir "$libobjdir" 2>&1)"
|
||||
mkdir_ret=$?
|
||||
if test "$mkdir_ret" -ne 0 && test ! -d "$libobjdir" ; then
|
||||
echo "$mkdir_out" 1>&2
|
||||
exit $mkdir_ret
|
||||
fi
|
||||
fi
|
||||
pic_object="$libobjdir/$objbase.o"
|
||||
args@<:@$objarg@:>@="$pic_object"
|
||||
__DOLTCOMPILE__EOF__
|
||||
cat <<__DOLTCOMPILE__EOF__ >>doltcompile
|
||||
"\${args@<:@@@:>@}" $pic_options -DPIC || exit \$?
|
||||
__DOLTCOMPILE__EOF__
|
||||
fi
|
||||
|
||||
dnl Write out static compilation code.
|
||||
dnl Avoid duplicate compiler output if also building shared objects.
|
||||
if test x$enable_static = xyes; then
|
||||
cat <<'__DOLTCOMPILE__EOF__' >>doltcompile
|
||||
non_pic_object="$obj.o"
|
||||
args@<:@$objarg@:>@="$non_pic_object"
|
||||
__DOLTCOMPILE__EOF__
|
||||
if test x$enable_shared = xyes; then
|
||||
cat <<'__DOLTCOMPILE__EOF__' >>doltcompile
|
||||
"${args@<:@@@:>@}" >/dev/null 2>&1 || exit $?
|
||||
__DOLTCOMPILE__EOF__
|
||||
else
|
||||
cat <<'__DOLTCOMPILE__EOF__' >>doltcompile
|
||||
"${args@<:@@@:>@}" || exit $?
|
||||
__DOLTCOMPILE__EOF__
|
||||
fi
|
||||
fi
|
||||
|
||||
dnl Write out the code to write the .lo file.
|
||||
dnl The second line of the .lo file must match "^# Generated by .*libtool"
|
||||
cat <<'__DOLTCOMPILE__EOF__' >>doltcompile
|
||||
{
|
||||
echo "# $lo - a libtool object file"
|
||||
echo "# Generated by doltcompile, not libtool"
|
||||
__DOLTCOMPILE__EOF__
|
||||
|
||||
if test x$enable_shared = xyes; then
|
||||
cat <<'__DOLTCOMPILE__EOF__' >>doltcompile
|
||||
echo "pic_object='.libs/${objbase}.o'"
|
||||
__DOLTCOMPILE__EOF__
|
||||
else
|
||||
cat <<'__DOLTCOMPILE__EOF__' >>doltcompile
|
||||
echo pic_object=none
|
||||
__DOLTCOMPILE__EOF__
|
||||
fi
|
||||
|
||||
if test x$enable_static = xyes; then
|
||||
cat <<'__DOLTCOMPILE__EOF__' >>doltcompile
|
||||
echo "non_pic_object='${objbase}.o'"
|
||||
__DOLTCOMPILE__EOF__
|
||||
else
|
||||
cat <<'__DOLTCOMPILE__EOF__' >>doltcompile
|
||||
echo non_pic_object=none
|
||||
__DOLTCOMPILE__EOF__
|
||||
fi
|
||||
|
||||
cat <<'__DOLTCOMPILE__EOF__' >>doltcompile
|
||||
} > "$lo"
|
||||
__DOLTCOMPILE__EOF__
|
||||
|
||||
dnl Done writing out doltcompile; substitute it for libtool compilation.
|
||||
chmod +x doltcompile
|
||||
LTCOMPILE='$(top_builddir)/doltcompile $(COMPILE)'
|
||||
LTCXXCOMPILE='$(top_builddir)/doltcompile $(CXXCOMPILE)'
|
||||
|
||||
dnl automake ignores LTCOMPILE and LTCXXCOMPILE when it has separate CFLAGS for
|
||||
dnl a target, so write out a libtool wrapper to handle that case.
|
||||
dnl Note that doltlibtool does not handle inferred tags or option arguments
|
||||
dnl without '=', because automake does not use them.
|
||||
cat <<__DOLTLIBTOOL__EOF__ > doltlibtool
|
||||
#!$DOLT_BASH
|
||||
__DOLTLIBTOOL__EOF__
|
||||
cat <<'__DOLTLIBTOOL__EOF__' >>doltlibtool
|
||||
top_builddir_slash="${0%%doltlibtool}"
|
||||
: ${top_builddir_slash:=./}
|
||||
args=()
|
||||
modeok=false
|
||||
tagok=false
|
||||
for arg in "$[]@"; do
|
||||
case "$arg" in
|
||||
--silent) ;;
|
||||
--mode=compile) modeok=true ;;
|
||||
--tag=CC|--tag=CXX) tagok=true ;;
|
||||
--quiet) ;;
|
||||
*) args@<:@${#args[@]}@:>@="$arg" ;;
|
||||
esac
|
||||
done
|
||||
if $modeok && $tagok ; then
|
||||
. ${top_builddir_slash}doltcompile "${args@<:@@@:>@}"
|
||||
else
|
||||
exec ${top_builddir_slash}libtool "$[]@"
|
||||
fi
|
||||
__DOLTLIBTOOL__EOF__
|
||||
|
||||
dnl Done writing out doltlibtool; substitute it for libtool.
|
||||
chmod +x doltlibtool
|
||||
LIBTOOL='$(top_builddir)/doltlibtool'
|
||||
fi
|
||||
AC_SUBST(LTCOMPILE)
|
||||
AC_SUBST(LTCXXCOMPILE)
|
||||
# end dolt
|
||||
])
|
||||
Executable
+136
@@ -0,0 +1,136 @@
|
||||
#!/bin/sh
|
||||
# Run this to generate all the initial makefiles, etc.
|
||||
# Ripped off from GNOME macros version
|
||||
|
||||
DIE=0
|
||||
|
||||
srcdir=`dirname $0`
|
||||
test -z "$srcdir" && srcdir=.
|
||||
|
||||
if [ -n "$MONO_PATH" ]; then
|
||||
# from -> /mono/lib:/another/mono/lib
|
||||
# to -> /mono /another/mono
|
||||
for i in `echo ${MONO_PATH} | tr ":" " "`; do
|
||||
i=`dirname ${i}`
|
||||
if [ -n "{i}" -a -d "${i}/share/aclocal" ]; then
|
||||
ACLOCAL_FLAGS="-I ${i}/share/aclocal $ACLOCAL_FLAGS"
|
||||
fi
|
||||
if [ -n "{i}" -a -d "${i}/bin" ]; then
|
||||
PATH="${i}/bin:$PATH"
|
||||
fi
|
||||
done
|
||||
export PATH
|
||||
fi
|
||||
|
||||
(autoconf --version) < /dev/null > /dev/null 2>&1 || {
|
||||
echo
|
||||
echo "**Error**: You must have \`autoconf' installed to compile Mono."
|
||||
echo "Download the appropriate package for your distribution,"
|
||||
echo "or get the source tarball at ftp://ftp.gnu.org/pub/gnu/"
|
||||
DIE=1
|
||||
}
|
||||
|
||||
if [ -z "$LIBTOOLIZE" ]; then
|
||||
LIBTOOLIZE=`which glibtoolize 2>/dev/null`
|
||||
if [ ! -x "$LIBTOOLIZE" ]; then
|
||||
LIBTOOLIZE=`which libtoolize`
|
||||
fi
|
||||
fi
|
||||
|
||||
(grep "^AM_PROG_LIBTOOL" $srcdir/configure.ac >/dev/null) && {
|
||||
($LIBTOOLIZE --version) < /dev/null > /dev/null 2>&1 || {
|
||||
echo
|
||||
echo "**Error**: You must have \`libtoolize' installed to compile Mono."
|
||||
echo "Get ftp://ftp.gnu.org/gnu/libtool/libtool-1.2.tar.gz"
|
||||
echo "(or a newer version if it is available)"
|
||||
DIE=1
|
||||
}
|
||||
}
|
||||
|
||||
grep "^AM_GNU_GETTEXT" $srcdir/configure.ac >/dev/null && {
|
||||
grep "sed.*POTFILES" $srcdir/configure.ac >/dev/null || \
|
||||
(gettext --version) < /dev/null > /dev/null 2>&1 || {
|
||||
echo
|
||||
echo "**Error**: You must have \`gettext' installed to compile Mono."
|
||||
echo "Get ftp://alpha.gnu.org/gnu/gettext-0.10.35.tar.gz"
|
||||
echo "(or a newer version if it is available)"
|
||||
DIE=1
|
||||
}
|
||||
}
|
||||
|
||||
(automake --version) < /dev/null > /dev/null 2>&1 || {
|
||||
echo
|
||||
echo "**Error**: You must have \`automake' installed to compile Mono."
|
||||
echo "Get ftp://ftp.gnu.org/pub/gnu/automake-1.3.tar.gz"
|
||||
echo "(or a newer version if it is available)"
|
||||
DIE=1
|
||||
NO_AUTOMAKE=yes
|
||||
}
|
||||
|
||||
|
||||
# if no automake, don't bother testing for aclocal
|
||||
test -n "$NO_AUTOMAKE" || (aclocal --version) < /dev/null > /dev/null 2>&1 || {
|
||||
echo
|
||||
echo "**Error**: Missing \`aclocal'. The version of \`automake'"
|
||||
echo "installed doesn't appear recent enough."
|
||||
echo "Get ftp://ftp.gnu.org/pub/gnu/automake-1.3.tar.gz"
|
||||
echo "(or a newer version if it is available)"
|
||||
DIE=1
|
||||
}
|
||||
|
||||
if test "$DIE" -eq 1; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if test x$NOCONFIGURE = x && test -z "$*"; then
|
||||
echo "**Warning**: I am going to run \`configure' with no arguments."
|
||||
echo "If you wish to pass any to it, please specify them on the"
|
||||
echo \`$0\'" command line."
|
||||
echo
|
||||
fi
|
||||
|
||||
case $CC in
|
||||
xlc )
|
||||
am_opt=--include-deps;;
|
||||
esac
|
||||
|
||||
|
||||
if grep "^AM_PROG_LIBTOOL" configure.ac >/dev/null; then
|
||||
if test -z "$NO_LIBTOOLIZE" ; then
|
||||
echo "Running libtoolize..."
|
||||
$LIBTOOLIZE --force --copy
|
||||
fi
|
||||
fi
|
||||
|
||||
echo "Running aclocal -I m4 $ACLOCAL_FLAGS ..."
|
||||
aclocal -I m4 $ACLOCAL_FLAGS || {
|
||||
echo
|
||||
echo "**Error**: aclocal failed. This may mean that you have not"
|
||||
echo "installed all of the packages you need, or you may need to"
|
||||
echo "set ACLOCAL_FLAGS to include \"-I \$prefix/share/aclocal\""
|
||||
echo "for the prefix where you installed the packages whose"
|
||||
echo "macros were not found"
|
||||
exit 1
|
||||
}
|
||||
|
||||
if grep "^AC_CONFIG_HEADERS" configure.ac >/dev/null; then
|
||||
echo "Running autoheader..."
|
||||
autoheader || { echo "**Error**: autoheader failed."; exit 1; }
|
||||
fi
|
||||
|
||||
echo "Running automake --gnu $am_opt ..."
|
||||
automake --add-missing --gnu $am_opt ||
|
||||
{ echo "**Error**: automake failed."; exit 1; }
|
||||
echo "Running autoconf ..."
|
||||
autoconf || { echo "**Error**: autoconf failed."; exit 1; }
|
||||
|
||||
|
||||
conf_flags="--enable-maintainer-mode" #--enable-compile-warnings --enable-iso-c
|
||||
|
||||
if test x$NOCONFIGURE = x; then
|
||||
echo Running $srcdir/configure $conf_flags "$@" ...
|
||||
$srcdir/configure $conf_flags "$@" \
|
||||
&& echo Now type \`make\' to compile $PKG_NAME || exit 1
|
||||
else
|
||||
echo Skipping configure process.
|
||||
fi
|
||||
Executable
+672
@@ -0,0 +1,672 @@
|
||||
#! /bin/sh
|
||||
# Output a system dependent set of variables, describing how to set the
|
||||
# run time search path of shared libraries in an executable.
|
||||
#
|
||||
# Copyright 1996-2010 Free Software Foundation, Inc.
|
||||
# Taken from GNU libtool, 2001
|
||||
# Originally by Gordon Matzigkeit <[email protected]>, 1996
|
||||
#
|
||||
# This file is free software; the Free Software Foundation gives
|
||||
# unlimited permission to copy and/or distribute it, with or without
|
||||
# modifications, as long as this notice is preserved.
|
||||
#
|
||||
# The first argument passed to this file is the canonical host specification,
|
||||
# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
|
||||
# or
|
||||
# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
|
||||
# The environment variables CC, GCC, LDFLAGS, LD, with_gnu_ld
|
||||
# should be set by the caller.
|
||||
#
|
||||
# The set of defined variables is at the end of this script.
|
||||
|
||||
# Known limitations:
|
||||
# - On IRIX 6.5 with CC="cc", the run time search patch must not be longer
|
||||
# than 256 bytes, otherwise the compiler driver will dump core. The only
|
||||
# known workaround is to choose shorter directory names for the build
|
||||
# directory and/or the installation directory.
|
||||
|
||||
# All known linkers require a `.a' archive for static linking (except MSVC,
|
||||
# which needs '.lib').
|
||||
libext=a
|
||||
shrext=.so
|
||||
|
||||
host="$1"
|
||||
host_cpu=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
|
||||
host_vendor=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
|
||||
host_os=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
|
||||
|
||||
# Code taken from libtool.m4's _LT_CC_BASENAME.
|
||||
|
||||
for cc_temp in $CC""; do
|
||||
case $cc_temp in
|
||||
compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
|
||||
distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
|
||||
\-*) ;;
|
||||
*) break;;
|
||||
esac
|
||||
done
|
||||
cc_basename=`echo "$cc_temp" | sed -e 's%^.*/%%'`
|
||||
|
||||
# Code taken from libtool.m4's _LT_COMPILER_PIC.
|
||||
|
||||
wl=
|
||||
if test "$GCC" = yes; then
|
||||
wl='-Wl,'
|
||||
else
|
||||
case "$host_os" in
|
||||
aix*)
|
||||
wl='-Wl,'
|
||||
;;
|
||||
darwin*)
|
||||
case $cc_basename in
|
||||
xlc*)
|
||||
wl='-Wl,'
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
mingw* | cygwin* | pw32* | os2* | cegcc*)
|
||||
;;
|
||||
hpux9* | hpux10* | hpux11*)
|
||||
wl='-Wl,'
|
||||
;;
|
||||
irix5* | irix6* | nonstopux*)
|
||||
wl='-Wl,'
|
||||
;;
|
||||
newsos6)
|
||||
;;
|
||||
linux* | k*bsd*-gnu)
|
||||
case $cc_basename in
|
||||
ecc*)
|
||||
wl='-Wl,'
|
||||
;;
|
||||
icc* | ifort*)
|
||||
wl='-Wl,'
|
||||
;;
|
||||
lf95*)
|
||||
wl='-Wl,'
|
||||
;;
|
||||
pgcc | pgf77 | pgf90)
|
||||
wl='-Wl,'
|
||||
;;
|
||||
ccc*)
|
||||
wl='-Wl,'
|
||||
;;
|
||||
como)
|
||||
wl='-lopt='
|
||||
;;
|
||||
*)
|
||||
case `$CC -V 2>&1 | sed 5q` in
|
||||
*Sun\ C*)
|
||||
wl='-Wl,'
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
osf3* | osf4* | osf5*)
|
||||
wl='-Wl,'
|
||||
;;
|
||||
rdos*)
|
||||
;;
|
||||
solaris*)
|
||||
wl='-Wl,'
|
||||
;;
|
||||
sunos4*)
|
||||
wl='-Qoption ld '
|
||||
;;
|
||||
sysv4 | sysv4.2uw2* | sysv4.3*)
|
||||
wl='-Wl,'
|
||||
;;
|
||||
sysv4*MP*)
|
||||
;;
|
||||
sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
|
||||
wl='-Wl,'
|
||||
;;
|
||||
unicos*)
|
||||
wl='-Wl,'
|
||||
;;
|
||||
uts4*)
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
|
||||
# Code taken from libtool.m4's _LT_LINKER_SHLIBS.
|
||||
|
||||
hardcode_libdir_flag_spec=
|
||||
hardcode_libdir_separator=
|
||||
hardcode_direct=no
|
||||
hardcode_minus_L=no
|
||||
|
||||
case "$host_os" in
|
||||
cygwin* | mingw* | pw32* | cegcc*)
|
||||
# FIXME: the MSVC++ port hasn't been tested in a loooong time
|
||||
# When not using gcc, we currently assume that we are using
|
||||
# Microsoft Visual C++.
|
||||
if test "$GCC" != yes; then
|
||||
with_gnu_ld=no
|
||||
fi
|
||||
;;
|
||||
interix*)
|
||||
# we just hope/assume this is gcc and not c89 (= MSVC++)
|
||||
with_gnu_ld=yes
|
||||
;;
|
||||
openbsd*)
|
||||
with_gnu_ld=no
|
||||
;;
|
||||
esac
|
||||
|
||||
ld_shlibs=yes
|
||||
if test "$with_gnu_ld" = yes; then
|
||||
# Set some defaults for GNU ld with shared library support. These
|
||||
# are reset later if shared libraries are not supported. Putting them
|
||||
# here allows them to be overridden if necessary.
|
||||
# Unlike libtool, we use -rpath here, not --rpath, since the documented
|
||||
# option of GNU ld is called -rpath, not --rpath.
|
||||
hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
|
||||
case "$host_os" in
|
||||
aix[3-9]*)
|
||||
# On AIX/PPC, the GNU linker is very broken
|
||||
if test "$host_cpu" != ia64; then
|
||||
ld_shlibs=no
|
||||
fi
|
||||
;;
|
||||
amigaos*)
|
||||
hardcode_libdir_flag_spec='-L$libdir'
|
||||
hardcode_minus_L=yes
|
||||
# Samuel A. Falvo II <[email protected]> reports
|
||||
# that the semantics of dynamic libraries on AmigaOS, at least up
|
||||
# to version 4, is to share data among multiple programs linked
|
||||
# with the same dynamic library. Since this doesn't match the
|
||||
# behavior of shared libraries on other platforms, we cannot use
|
||||
# them.
|
||||
ld_shlibs=no
|
||||
;;
|
||||
beos*)
|
||||
if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
|
||||
:
|
||||
else
|
||||
ld_shlibs=no
|
||||
fi
|
||||
;;
|
||||
cygwin* | mingw* | pw32* | cegcc*)
|
||||
# hardcode_libdir_flag_spec is actually meaningless, as there is
|
||||
# no search path for DLLs.
|
||||
hardcode_libdir_flag_spec='-L$libdir'
|
||||
if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
|
||||
:
|
||||
else
|
||||
ld_shlibs=no
|
||||
fi
|
||||
;;
|
||||
interix[3-9]*)
|
||||
hardcode_direct=no
|
||||
hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
|
||||
;;
|
||||
gnu* | linux* | k*bsd*-gnu)
|
||||
if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
|
||||
:
|
||||
else
|
||||
ld_shlibs=no
|
||||
fi
|
||||
;;
|
||||
netbsd*)
|
||||
;;
|
||||
solaris*)
|
||||
if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then
|
||||
ld_shlibs=no
|
||||
elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
|
||||
:
|
||||
else
|
||||
ld_shlibs=no
|
||||
fi
|
||||
;;
|
||||
sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
|
||||
case `$LD -v 2>&1` in
|
||||
*\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*)
|
||||
ld_shlibs=no
|
||||
;;
|
||||
*)
|
||||
if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
|
||||
hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`'
|
||||
else
|
||||
ld_shlibs=no
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
sunos4*)
|
||||
hardcode_direct=yes
|
||||
;;
|
||||
*)
|
||||
if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
|
||||
:
|
||||
else
|
||||
ld_shlibs=no
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
if test "$ld_shlibs" = no; then
|
||||
hardcode_libdir_flag_spec=
|
||||
fi
|
||||
else
|
||||
case "$host_os" in
|
||||
aix3*)
|
||||
# Note: this linker hardcodes the directories in LIBPATH if there
|
||||
# are no directories specified by -L.
|
||||
hardcode_minus_L=yes
|
||||
if test "$GCC" = yes; then
|
||||
# Neither direct hardcoding nor static linking is supported with a
|
||||
# broken collect2.
|
||||
hardcode_direct=unsupported
|
||||
fi
|
||||
;;
|
||||
aix[4-9]*)
|
||||
if test "$host_cpu" = ia64; then
|
||||
# On IA64, the linker does run time linking by default, so we don't
|
||||
# have to do anything special.
|
||||
aix_use_runtimelinking=no
|
||||
else
|
||||
aix_use_runtimelinking=no
|
||||
# Test if we are trying to use run time linking or normal
|
||||
# AIX style linking. If -brtl is somewhere in LDFLAGS, we
|
||||
# need to do runtime linking.
|
||||
case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*)
|
||||
for ld_flag in $LDFLAGS; do
|
||||
if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
|
||||
aix_use_runtimelinking=yes
|
||||
break
|
||||
fi
|
||||
done
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
hardcode_direct=yes
|
||||
hardcode_libdir_separator=':'
|
||||
if test "$GCC" = yes; then
|
||||
case $host_os in aix4.[012]|aix4.[012].*)
|
||||
collect2name=`${CC} -print-prog-name=collect2`
|
||||
if test -f "$collect2name" && \
|
||||
strings "$collect2name" | grep resolve_lib_name >/dev/null
|
||||
then
|
||||
# We have reworked collect2
|
||||
:
|
||||
else
|
||||
# We have old collect2
|
||||
hardcode_direct=unsupported
|
||||
hardcode_minus_L=yes
|
||||
hardcode_libdir_flag_spec='-L$libdir'
|
||||
hardcode_libdir_separator=
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
# Begin _LT_AC_SYS_LIBPATH_AIX.
|
||||
echo 'int main () { return 0; }' > conftest.c
|
||||
${CC} ${LDFLAGS} conftest.c -o conftest
|
||||
aix_libpath=`dump -H conftest 2>/dev/null | sed -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
|
||||
}'`
|
||||
if test -z "$aix_libpath"; then
|
||||
aix_libpath=`dump -HX64 conftest 2>/dev/null | sed -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
|
||||
}'`
|
||||
fi
|
||||
if test -z "$aix_libpath"; then
|
||||
aix_libpath="/usr/lib:/lib"
|
||||
fi
|
||||
rm -f conftest.c conftest
|
||||
# End _LT_AC_SYS_LIBPATH_AIX.
|
||||
if test "$aix_use_runtimelinking" = yes; then
|
||||
hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
|
||||
else
|
||||
if test "$host_cpu" = ia64; then
|
||||
hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib'
|
||||
else
|
||||
hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
|
||||
fi
|
||||
fi
|
||||
;;
|
||||
amigaos*)
|
||||
hardcode_libdir_flag_spec='-L$libdir'
|
||||
hardcode_minus_L=yes
|
||||
# see comment about different semantics on the GNU ld section
|
||||
ld_shlibs=no
|
||||
;;
|
||||
bsdi[45]*)
|
||||
;;
|
||||
cygwin* | mingw* | pw32* | cegcc*)
|
||||
# When not using gcc, we currently assume that we are using
|
||||
# Microsoft Visual C++.
|
||||
# hardcode_libdir_flag_spec is actually meaningless, as there is
|
||||
# no search path for DLLs.
|
||||
hardcode_libdir_flag_spec=' '
|
||||
libext=lib
|
||||
;;
|
||||
darwin* | rhapsody*)
|
||||
hardcode_direct=no
|
||||
if test "$GCC" = yes ; then
|
||||
:
|
||||
else
|
||||
case $cc_basename in
|
||||
xlc*)
|
||||
;;
|
||||
*)
|
||||
ld_shlibs=no
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
;;
|
||||
dgux*)
|
||||
hardcode_libdir_flag_spec='-L$libdir'
|
||||
;;
|
||||
freebsd1*)
|
||||
ld_shlibs=no
|
||||
;;
|
||||
freebsd2.2*)
|
||||
hardcode_libdir_flag_spec='-R$libdir'
|
||||
hardcode_direct=yes
|
||||
;;
|
||||
freebsd2*)
|
||||
hardcode_direct=yes
|
||||
hardcode_minus_L=yes
|
||||
;;
|
||||
freebsd* | dragonfly*)
|
||||
hardcode_libdir_flag_spec='-R$libdir'
|
||||
hardcode_direct=yes
|
||||
;;
|
||||
hpux9*)
|
||||
hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
|
||||
hardcode_libdir_separator=:
|
||||
hardcode_direct=yes
|
||||
# hardcode_minus_L: Not really in the search PATH,
|
||||
# but as the default location of the library.
|
||||
hardcode_minus_L=yes
|
||||
;;
|
||||
hpux10*)
|
||||
if test "$with_gnu_ld" = no; then
|
||||
hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
|
||||
hardcode_libdir_separator=:
|
||||
hardcode_direct=yes
|
||||
# hardcode_minus_L: Not really in the search PATH,
|
||||
# but as the default location of the library.
|
||||
hardcode_minus_L=yes
|
||||
fi
|
||||
;;
|
||||
hpux11*)
|
||||
if test "$with_gnu_ld" = no; then
|
||||
hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
|
||||
hardcode_libdir_separator=:
|
||||
case $host_cpu in
|
||||
hppa*64*|ia64*)
|
||||
hardcode_direct=no
|
||||
;;
|
||||
*)
|
||||
hardcode_direct=yes
|
||||
# hardcode_minus_L: Not really in the search PATH,
|
||||
# but as the default location of the library.
|
||||
hardcode_minus_L=yes
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
;;
|
||||
irix5* | irix6* | nonstopux*)
|
||||
hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
|
||||
hardcode_libdir_separator=:
|
||||
;;
|
||||
netbsd*)
|
||||
hardcode_libdir_flag_spec='-R$libdir'
|
||||
hardcode_direct=yes
|
||||
;;
|
||||
newsos6)
|
||||
hardcode_direct=yes
|
||||
hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
|
||||
hardcode_libdir_separator=:
|
||||
;;
|
||||
openbsd*)
|
||||
if test -f /usr/libexec/ld.so; then
|
||||
hardcode_direct=yes
|
||||
if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
|
||||
hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
|
||||
else
|
||||
case "$host_os" in
|
||||
openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
|
||||
hardcode_libdir_flag_spec='-R$libdir'
|
||||
;;
|
||||
*)
|
||||
hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
else
|
||||
ld_shlibs=no
|
||||
fi
|
||||
;;
|
||||
os2*)
|
||||
hardcode_libdir_flag_spec='-L$libdir'
|
||||
hardcode_minus_L=yes
|
||||
;;
|
||||
osf3*)
|
||||
hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
|
||||
hardcode_libdir_separator=:
|
||||
;;
|
||||
osf4* | osf5*)
|
||||
if test "$GCC" = yes; then
|
||||
hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
|
||||
else
|
||||
# Both cc and cxx compiler support -rpath directly
|
||||
hardcode_libdir_flag_spec='-rpath $libdir'
|
||||
fi
|
||||
hardcode_libdir_separator=:
|
||||
;;
|
||||
solaris*)
|
||||
hardcode_libdir_flag_spec='-R$libdir'
|
||||
;;
|
||||
sunos4*)
|
||||
hardcode_libdir_flag_spec='-L$libdir'
|
||||
hardcode_direct=yes
|
||||
hardcode_minus_L=yes
|
||||
;;
|
||||
sysv4)
|
||||
case $host_vendor in
|
||||
sni)
|
||||
hardcode_direct=yes # is this really true???
|
||||
;;
|
||||
siemens)
|
||||
hardcode_direct=no
|
||||
;;
|
||||
motorola)
|
||||
hardcode_direct=no #Motorola manual says yes, but my tests say they lie
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
sysv4.3*)
|
||||
;;
|
||||
sysv4*MP*)
|
||||
if test -d /usr/nec; then
|
||||
ld_shlibs=yes
|
||||
fi
|
||||
;;
|
||||
sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*)
|
||||
;;
|
||||
sysv5* | sco3.2v5* | sco5v6*)
|
||||
hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`'
|
||||
hardcode_libdir_separator=':'
|
||||
;;
|
||||
uts4*)
|
||||
hardcode_libdir_flag_spec='-L$libdir'
|
||||
;;
|
||||
*)
|
||||
ld_shlibs=no
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
|
||||
# Check dynamic linker characteristics
|
||||
# Code taken from libtool.m4's _LT_SYS_DYNAMIC_LINKER.
|
||||
# Unlike libtool.m4, here we don't care about _all_ names of the library, but
|
||||
# only about the one the linker finds when passed -lNAME. This is the last
|
||||
# element of library_names_spec in libtool.m4, or possibly two of them if the
|
||||
# linker has special search rules.
|
||||
library_names_spec= # the last element of library_names_spec in libtool.m4
|
||||
libname_spec='lib$name'
|
||||
case "$host_os" in
|
||||
aix3*)
|
||||
library_names_spec='$libname.a'
|
||||
;;
|
||||
aix[4-9]*)
|
||||
library_names_spec='$libname$shrext'
|
||||
;;
|
||||
amigaos*)
|
||||
library_names_spec='$libname.a'
|
||||
;;
|
||||
beos*)
|
||||
library_names_spec='$libname$shrext'
|
||||
;;
|
||||
bsdi[45]*)
|
||||
library_names_spec='$libname$shrext'
|
||||
;;
|
||||
cygwin* | mingw* | pw32* | cegcc*)
|
||||
shrext=.dll
|
||||
library_names_spec='$libname.dll.a $libname.lib'
|
||||
;;
|
||||
darwin* | rhapsody*)
|
||||
shrext=.dylib
|
||||
library_names_spec='$libname$shrext'
|
||||
;;
|
||||
dgux*)
|
||||
library_names_spec='$libname$shrext'
|
||||
;;
|
||||
freebsd1*)
|
||||
;;
|
||||
freebsd* | dragonfly*)
|
||||
case "$host_os" in
|
||||
freebsd[123]*)
|
||||
library_names_spec='$libname$shrext$versuffix' ;;
|
||||
*)
|
||||
library_names_spec='$libname$shrext' ;;
|
||||
esac
|
||||
;;
|
||||
gnu*)
|
||||
library_names_spec='$libname$shrext'
|
||||
;;
|
||||
hpux9* | hpux10* | hpux11*)
|
||||
case $host_cpu in
|
||||
ia64*)
|
||||
shrext=.so
|
||||
;;
|
||||
hppa*64*)
|
||||
shrext=.sl
|
||||
;;
|
||||
*)
|
||||
shrext=.sl
|
||||
;;
|
||||
esac
|
||||
library_names_spec='$libname$shrext'
|
||||
;;
|
||||
interix[3-9]*)
|
||||
library_names_spec='$libname$shrext'
|
||||
;;
|
||||
irix5* | irix6* | nonstopux*)
|
||||
library_names_spec='$libname$shrext'
|
||||
case "$host_os" in
|
||||
irix5* | nonstopux*)
|
||||
libsuff= shlibsuff=
|
||||
;;
|
||||
*)
|
||||
case $LD in
|
||||
*-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= ;;
|
||||
*-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 ;;
|
||||
*-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 ;;
|
||||
*) libsuff= shlibsuff= ;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
linux*oldld* | linux*aout* | linux*coff*)
|
||||
;;
|
||||
linux* | k*bsd*-gnu)
|
||||
library_names_spec='$libname$shrext'
|
||||
;;
|
||||
knetbsd*-gnu)
|
||||
library_names_spec='$libname$shrext'
|
||||
;;
|
||||
netbsd*)
|
||||
library_names_spec='$libname$shrext'
|
||||
;;
|
||||
newsos6)
|
||||
library_names_spec='$libname$shrext'
|
||||
;;
|
||||
nto-qnx*)
|
||||
library_names_spec='$libname$shrext'
|
||||
;;
|
||||
openbsd*)
|
||||
library_names_spec='$libname$shrext$versuffix'
|
||||
;;
|
||||
os2*)
|
||||
libname_spec='$name'
|
||||
shrext=.dll
|
||||
library_names_spec='$libname.a'
|
||||
;;
|
||||
osf3* | osf4* | osf5*)
|
||||
library_names_spec='$libname$shrext'
|
||||
;;
|
||||
rdos*)
|
||||
;;
|
||||
solaris*)
|
||||
library_names_spec='$libname$shrext'
|
||||
;;
|
||||
sunos4*)
|
||||
library_names_spec='$libname$shrext$versuffix'
|
||||
;;
|
||||
sysv4 | sysv4.3*)
|
||||
library_names_spec='$libname$shrext'
|
||||
;;
|
||||
sysv4*MP*)
|
||||
library_names_spec='$libname$shrext'
|
||||
;;
|
||||
sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
|
||||
library_names_spec='$libname$shrext'
|
||||
;;
|
||||
uts4*)
|
||||
library_names_spec='$libname$shrext'
|
||||
;;
|
||||
esac
|
||||
|
||||
sed_quote_subst='s/\(["`$\\]\)/\\\1/g'
|
||||
escaped_wl=`echo "X$wl" | sed -e 's/^X//' -e "$sed_quote_subst"`
|
||||
shlibext=`echo "$shrext" | sed -e 's,^\.,,'`
|
||||
escaped_libname_spec=`echo "X$libname_spec" | sed -e 's/^X//' -e "$sed_quote_subst"`
|
||||
escaped_library_names_spec=`echo "X$library_names_spec" | sed -e 's/^X//' -e "$sed_quote_subst"`
|
||||
escaped_hardcode_libdir_flag_spec=`echo "X$hardcode_libdir_flag_spec" | sed -e 's/^X//' -e "$sed_quote_subst"`
|
||||
|
||||
LC_ALL=C sed -e 's/^\([a-zA-Z0-9_]*\)=/acl_cv_\1=/' <<EOF
|
||||
|
||||
# How to pass a linker flag through the compiler.
|
||||
wl="$escaped_wl"
|
||||
|
||||
# Static library suffix (normally "a").
|
||||
libext="$libext"
|
||||
|
||||
# Shared library suffix (normally "so").
|
||||
shlibext="$shlibext"
|
||||
|
||||
# Format of library name prefix.
|
||||
libname_spec="$escaped_libname_spec"
|
||||
|
||||
# Library names that the linker finds when passed -lNAME.
|
||||
library_names_spec="$escaped_library_names_spec"
|
||||
|
||||
# Flag to hardcode \$libdir into a binary during linking.
|
||||
# This must work even if \$libdir does not exist.
|
||||
hardcode_libdir_flag_spec="$escaped_hardcode_libdir_flag_spec"
|
||||
|
||||
# Whether we need a single -rpath flag with a separated argument.
|
||||
hardcode_libdir_separator="$hardcode_libdir_separator"
|
||||
|
||||
# Set to yes if using DIR/libNAME.so during linking hardcodes DIR into the
|
||||
# resulting binary.
|
||||
hardcode_direct="$hardcode_direct"
|
||||
|
||||
# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
|
||||
# resulting binary.
|
||||
hardcode_minus_L="$hardcode_minus_L"
|
||||
|
||||
EOF
|
||||
@@ -0,0 +1,265 @@
|
||||
#
|
||||
# Copyright 2012 Xamarin Inc
|
||||
#
|
||||
AC_INIT(eglib, [0.3],
|
||||
[http://bugzilla.xamarin.com/enter_bug.cgi?classification=Mono])
|
||||
|
||||
AC_CONFIG_SRCDIR([README])
|
||||
AC_CONFIG_MACRO_DIR([m4])
|
||||
AC_CANONICAL_SYSTEM
|
||||
AC_CANONICAL_HOST
|
||||
|
||||
AM_INIT_AUTOMAKE([1.9 dist-bzip2 tar-ustar no-dist-gzip foreign])
|
||||
AC_CONFIG_HEADERS([config.h])
|
||||
AM_MAINTAINER_MODE
|
||||
|
||||
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
|
||||
|
||||
AC_PROG_CC
|
||||
AM_PROG_LIBTOOL
|
||||
# Use dolt (http://dolt.freedesktop.org/) instead of libtool for building.
|
||||
DOLT
|
||||
GNUC_PRETTY=
|
||||
GNUC_UNUSED=
|
||||
BREAKPOINT="G_STMT_START { raise (SIGTRAP); } G_STMT_END"
|
||||
if test x$GCC = xyes; then
|
||||
GNUC_UNUSED='__attribute__((__unused__))'
|
||||
GNUC_NORETURN='__attribute__((__noreturn__))'
|
||||
case $host_cpu in
|
||||
i*86|x86_64) BREAKPOINT="G_STMT_START { __asm__ (\"int \$03\"); } G_STMT_END" ;;
|
||||
esac
|
||||
fi
|
||||
AC_SUBST(GNUC_PRETTY)
|
||||
AC_SUBST(GNUC_UNUSED)
|
||||
AC_SUBST(GNUC_NORETURN)
|
||||
AC_SUBST(BREAKPOINT)
|
||||
|
||||
# We use a separate variable to pass down CPPFLAGS and CFLAGS from the main mono
|
||||
# configure, because of autoconf brokeness
|
||||
if test "x$CPPFLAGS_FOR_EGLIB" != "x"; then
|
||||
CPPFLAGS=$CPPFLAGS_FOR_EGLIB
|
||||
fi
|
||||
if test "x$CFLAGS_FOR_EGLIB" != "x"; then
|
||||
CFLAGS=$CFLAGS_FOR_EGLIB
|
||||
fi
|
||||
|
||||
CFLAGS="$CFLAGS -g -D_GNU_SOURCE"
|
||||
|
||||
AM_CONDITIONAL(CROSS_COMPILING, [test x$cross_compiling = xyes])
|
||||
AC_C_BIGENDIAN([ORDER=G_BIG_ENDIAN],[ORDER=G_LITTLE_ENDIAN])
|
||||
|
||||
platform_darwin=no
|
||||
platform_android=no
|
||||
|
||||
case $host in
|
||||
*-*-msdos* | *-*-go32* | *-*-mingw32* | *-*-cygwin* | *-*-windows*)
|
||||
PATHSEP='\\'
|
||||
SEARCHSEP=';'
|
||||
OS="WIN32"
|
||||
PIDTYPE='void *'
|
||||
;;
|
||||
*-*darwin*)
|
||||
platform_darwin=yes
|
||||
PATHSEP='/'
|
||||
SEARCHSEP=':'
|
||||
OS="UNIX"
|
||||
PIDTYPE='int'
|
||||
;;
|
||||
*-*-linux-android*)
|
||||
platform_android=yes
|
||||
AC_DEFINE(PLATFORM_ANDROID,1,[Targeting the Android platform])
|
||||
PATHSEP='/'
|
||||
SEARCHSEP=':'
|
||||
OS="UNIX"
|
||||
PIDTYPE='int'
|
||||
;;
|
||||
*)
|
||||
PATHSEP='/'
|
||||
SEARCHSEP=':'
|
||||
OS="UNIX"
|
||||
PIDTYPE='int'
|
||||
;;
|
||||
esac
|
||||
|
||||
case $host in
|
||||
*-*-solaris*)
|
||||
CFLAGS="$CFLAGS -D_POSIX_PTHREAD_SEMANTICS"
|
||||
;;
|
||||
esac
|
||||
|
||||
case $target in
|
||||
arm*-darwin*|aarch64*-*)
|
||||
CFLAGS="$CFLAGS -U_FORTIFY_SOURCE"
|
||||
;;
|
||||
i*86-*-darwin*)
|
||||
ORDER=G_LITTLE_ENDIAN
|
||||
;;
|
||||
*-*-openbsd*)
|
||||
CFLAGS="$CFLAGS -pthread"
|
||||
LDFLAGS="$LDFLAGS -pthread"
|
||||
;;
|
||||
esac
|
||||
|
||||
target_osx=no
|
||||
target_ios=no
|
||||
|
||||
if test "x$platform_darwin" = "xyes"; then
|
||||
AC_TRY_COMPILE([#include "TargetConditionals.h"],[
|
||||
#if TARGET_IPHONE_SIMULATOR == 1 || TARGET_OS_IPHONE == 1
|
||||
#error fail this for ios
|
||||
#endif
|
||||
return 0;
|
||||
], [
|
||||
AC_DEFINE(TARGET_OSX,1,[The JIT/AOT targets OSX])
|
||||
target_osx=yes
|
||||
], [
|
||||
AC_DEFINE(TARGET_IOS,1,[The JIT/AOT targets iOS])
|
||||
target_ios=yes
|
||||
])
|
||||
AC_DEFINE(TARGET_MACH,1,[The JIT/AOT targets Apple platforms])
|
||||
fi
|
||||
|
||||
AC_SUBST(ORDER)
|
||||
AC_SUBST(CFLAGS)
|
||||
AC_SUBST(PATHSEP)
|
||||
AC_SUBST(SEARCHSEP)
|
||||
AC_SUBST(OS)
|
||||
AC_SUBST(PIDTYPE)
|
||||
AM_CONDITIONAL(HOST_WIN32, test x$OS = xWIN32)
|
||||
AM_CONDITIONAL(TARGET_WIN32, test x$OS = xWIN32)
|
||||
AM_CONDITIONAL(PLATFORM_DARWIN, test x$platform_darwin = xyes)
|
||||
AM_CONDITIONAL(PLATFORM_ANDROID, test x$platform_android = xyes)
|
||||
|
||||
# Defined for all targets/platforms using classic Windows API support.
|
||||
AC_DEFINE(HAVE_CLASSIC_WINAPI_SUPPORT, 1, [Use classic Windows API support])
|
||||
AC_DEFINE(HAVE_UWP_WINAPI_SUPPORT, 0, [Don't use UWP Windows API support])
|
||||
|
||||
AC_CHECK_SIZEOF(int)
|
||||
AC_CHECK_SIZEOF(void *)
|
||||
AC_CHECK_SIZEOF(long)
|
||||
AC_CHECK_SIZEOF(long long)
|
||||
AC_CHECK_FUNCS(strlcpy stpcpy strtok_r rewinddir vasprintf)
|
||||
AC_CHECK_FUNCS(getrlimit)
|
||||
AC_CHECK_FUNCS(fork execv execve)
|
||||
|
||||
AC_ARG_WITH([overridable-allocators], [ --with-overridable-allocators allow g_*alloc/g_free to call custom allocators set via g_mem_set_vtable])
|
||||
|
||||
if test x$with_overridable_allocators = xyes; then
|
||||
AC_DEFINE(ENABLE_OVERRIDABLE_ALLOCATORS,1,[Overridable allocator support enabled])
|
||||
AC_MSG_NOTICE([Overridable allocator support enabled])
|
||||
else
|
||||
AC_MSG_NOTICE([Overridable allocator support disabled])
|
||||
fi
|
||||
|
||||
#
|
||||
# Mono currently supports 10.6, but strndup is not available prior to 10.7; avoiding
|
||||
# the detection of strndup on OS X so Mono built on 10.7+ still runs on 10.6. This can be
|
||||
# removed once support for 10.6 is dropped.
|
||||
#
|
||||
# iOS detection of strndup and getpwuid_r is faulty for some reason so let's simply avoid it
|
||||
#
|
||||
if test x$target_osx = xyes; then
|
||||
AC_CHECK_FUNCS(getpwuid_r)
|
||||
elif test x$target_ios = xno; then
|
||||
AC_CHECK_FUNCS(strndup getpwuid_r)
|
||||
fi
|
||||
|
||||
AM_CONDITIONAL(NEED_VASPRINTF, test x$ac_cv_func_vasprintf = xno || test x$with_overridable_allocators = xyes)
|
||||
AM_ICONV()
|
||||
AC_SEARCH_LIBS(sqrtf, m)
|
||||
|
||||
# nanosleep may not be part of libc, also search it in other libraries
|
||||
AC_SEARCH_LIBS(nanosleep, rt)
|
||||
|
||||
AC_SEARCH_LIBS(dlopen, dl)
|
||||
old_ldflags="${LDFLAGS}"
|
||||
LDFLAGS="${LDFLAGS} -Wl,-export-dynamic"
|
||||
AC_TRY_LINK(, [int i;], found_export_dynamic=yes, found_export_dynamic=no)
|
||||
if test $found_export_dynamic = no; then
|
||||
LDFLAGS="${old_ldflags}"
|
||||
fi
|
||||
|
||||
AC_MSG_CHECKING(for varargs macros)
|
||||
AC_TRY_COMPILE([],[
|
||||
int foo (int i, int j);
|
||||
#define bar(...) foo (1, __VA_ARGS__)
|
||||
void main () {
|
||||
bar (2);
|
||||
}
|
||||
],have_iso_varargs=yes,have_iso_varargs=no)
|
||||
AC_MSG_RESULT($have_iso_varargs)
|
||||
G_HAVE_ISO_VARARGS=0
|
||||
if test "x$have_iso_varargs" = "xyes"; then
|
||||
G_HAVE_ISO_VARARGS=1
|
||||
fi
|
||||
AC_SUBST(G_HAVE_ISO_VARARGS)
|
||||
|
||||
AC_CHECK_HEADERS(getopt.h sys/select.h sys/time.h sys/wait.h pwd.h iconv.h localcharset.h sys/types.h sys/resource.h)
|
||||
AC_CHECK_LIB([iconv], [locale_charset],[],[AC_CHECK_LIB([charset], [locale_charset],[LIBS+="-liconv -lcharset"])])
|
||||
AC_CHECK_HEADER(alloca.h, [HAVE_ALLOCA_H=1], [HAVE_ALLOCA_H=0])
|
||||
AC_SUBST(HAVE_ALLOCA_H)
|
||||
|
||||
if test $ac_cv_sizeof_void_p = $ac_cv_sizeof_int; then
|
||||
GPOINTER_TO_INT="((gint) (ptr))"
|
||||
GPOINTER_TO_UINT="((guint) (ptr))"
|
||||
GINT_TO_POINTER="((gpointer) (v))"
|
||||
GUINT_TO_POINTER="((gpointer) (v))"
|
||||
GSIZE="int"
|
||||
GSIZE_FORMAT='"u"'
|
||||
elif test $ac_cv_sizeof_void_p = $ac_cv_sizeof_long; then
|
||||
GPOINTER_TO_INT="((gint)(long) (ptr))"
|
||||
GPOINTER_TO_UINT="((guint)(long) (ptr))"
|
||||
GINT_TO_POINTER="((gpointer)(glong) (v))"
|
||||
GUINT_TO_POINTER="((gpointer)(gulong) (v))"
|
||||
GSIZE="long"
|
||||
GSIZE_FORMAT='"lu"'
|
||||
elif test $ac_cv_sizeof_void_p = $ac_cv_sizeof_long_long; then
|
||||
GPOINTER_TO_INT="((gint)(long long) (ptr))"
|
||||
GPOINTER_TO_UINT="((guint)(unsigned long long) (ptr))"
|
||||
GINT_TO_POINTER="((gpointer)(long long) (v))"
|
||||
GUINT_TO_POINTER="((gpointer)(unsigned long long) (v))"
|
||||
GSIZE="long long"
|
||||
GSIZE_FORMAT='"I64u"'
|
||||
else
|
||||
AC_MSG_ERROR([unsupported pointer size])
|
||||
fi
|
||||
|
||||
AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
|
||||
|
||||
pkg_config_path=
|
||||
AC_ARG_WITH(crosspkgdir, [ --with-crosspkgdir=/path/to/pkg-config/dir Change pkg-config dir to custom dir],
|
||||
if test x$with_crosspkgdir = "x"; then
|
||||
if test -s $PKG_CONFIG_PATH; then
|
||||
pkg_config_path=$PKG_CONFIG_PATH
|
||||
fi
|
||||
else
|
||||
pkg_config_path=$with_crosspkgdir
|
||||
PKG_CONFIG_PATH=$pkg_config_path
|
||||
export PKG_CONFIG_PATH
|
||||
fi
|
||||
)
|
||||
|
||||
AC_ARG_ENABLE(werror, [ --enable-werror Pass -Werror to the C compiler], werror_flag=$enableval, werror_flag=no)
|
||||
if test x$werror_flag = xyes; then
|
||||
WERROR_CFLAGS="-Werror"
|
||||
fi
|
||||
AC_SUBST([WERROR_CFLAGS])
|
||||
|
||||
AC_SUBST(GPOINTER_TO_INT)
|
||||
AC_SUBST(GPOINTER_TO_UINT)
|
||||
AC_SUBST(GINT_TO_POINTER)
|
||||
AC_SUBST(GUINT_TO_POINTER)
|
||||
AC_SUBST(GSIZE)
|
||||
AC_SUBST(GSIZE_FORMAT)
|
||||
AC_SUBST(G_GUINT64_FORMAT)
|
||||
AC_SUBST(G_GINT64_FORMAT)
|
||||
AC_SUBST(G_GUINT32_FORMAT)
|
||||
AC_SUBST(G_GINT32_FORMAT)
|
||||
|
||||
AC_OUTPUT([
|
||||
Makefile
|
||||
m4/Makefile
|
||||
src/Makefile
|
||||
src/eglib-config.h
|
||||
test/Makefile
|
||||
])
|
||||
@@ -0,0 +1,7 @@
|
||||
Makefile
|
||||
Makefile.in
|
||||
libtool.m4
|
||||
ltoptions.m4
|
||||
ltsugar.m4
|
||||
ltversion.m4
|
||||
lt~obsolete.m4
|
||||
@@ -0,0 +1 @@
|
||||
EXTRA_DIST = $(wildcard *.m4)
|
||||
@@ -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
|
||||
])
|
||||
@@ -0,0 +1,110 @@
|
||||
# lib-ld.m4 serial 4 (gettext-0.18)
|
||||
dnl Copyright (C) 1996-2003, 2009-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 Subroutines of libtool.m4,
|
||||
dnl with replacements s/AC_/AC_LIB/ and s/lt_cv/acl_cv/ to avoid collision
|
||||
dnl with libtool.m4.
|
||||
|
||||
dnl From libtool-1.4. Sets the variable with_gnu_ld to yes or no.
|
||||
AC_DEFUN([AC_LIB_PROG_LD_GNU],
|
||||
[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], [acl_cv_prog_gnu_ld],
|
||||
[# I'd rather use --version here, but apparently some GNU ld's only accept -v.
|
||||
case `$LD -v 2>&1 </dev/null` in
|
||||
*GNU* | *'with BFD'*)
|
||||
acl_cv_prog_gnu_ld=yes ;;
|
||||
*)
|
||||
acl_cv_prog_gnu_ld=no ;;
|
||||
esac])
|
||||
with_gnu_ld=$acl_cv_prog_gnu_ld
|
||||
])
|
||||
|
||||
dnl From libtool-1.4. Sets the variable LD.
|
||||
AC_DEFUN([AC_LIB_PROG_LD],
|
||||
[AC_ARG_WITH([gnu-ld],
|
||||
[ --with-gnu-ld assume the C compiler uses GNU ld [default=no]],
|
||||
test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
|
||||
AC_REQUIRE([AC_PROG_CC])dnl
|
||||
AC_REQUIRE([AC_CANONICAL_HOST])dnl
|
||||
# Prepare PATH_SEPARATOR.
|
||||
# The user is always right.
|
||||
if test "${PATH_SEPARATOR+set}" != set; then
|
||||
echo "#! /bin/sh" >conf$$.sh
|
||||
echo "exit 0" >>conf$$.sh
|
||||
chmod +x conf$$.sh
|
||||
if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
|
||||
PATH_SEPARATOR=';'
|
||||
else
|
||||
PATH_SEPARATOR=:
|
||||
fi
|
||||
rm -f conf$$.sh
|
||||
fi
|
||||
ac_prog=ld
|
||||
if test "$GCC" = yes; then
|
||||
# Check if gcc -print-prog-name=ld gives a path.
|
||||
AC_MSG_CHECKING([for ld used by GCC])
|
||||
case $host in
|
||||
*-*-mingw*)
|
||||
# gcc leaves a trailing carriage return which upsets mingw
|
||||
ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
|
||||
*)
|
||||
ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
|
||||
esac
|
||||
case $ac_prog in
|
||||
# Accept absolute paths.
|
||||
[[\\/]* | [A-Za-z]:[\\/]*)]
|
||||
[re_direlt='/[^/][^/]*/\.\./']
|
||||
# Canonicalize the path of ld
|
||||
ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
|
||||
while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
|
||||
ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
|
||||
done
|
||||
test -z "$LD" && LD="$ac_prog"
|
||||
;;
|
||||
"")
|
||||
# If it fails, then pretend we aren't using GCC.
|
||||
ac_prog=ld
|
||||
;;
|
||||
*)
|
||||
# If it is relative, then search for the first ld in PATH.
|
||||
with_gnu_ld=unknown
|
||||
;;
|
||||
esac
|
||||
elif test "$with_gnu_ld" = yes; then
|
||||
AC_MSG_CHECKING([for GNU ld])
|
||||
else
|
||||
AC_MSG_CHECKING([for non-GNU ld])
|
||||
fi
|
||||
AC_CACHE_VAL([acl_cv_path_LD],
|
||||
[if test -z "$LD"; then
|
||||
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
|
||||
for ac_dir in $PATH; do
|
||||
test -z "$ac_dir" && ac_dir=.
|
||||
if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
|
||||
acl_cv_path_LD="$ac_dir/$ac_prog"
|
||||
# Check to see if the program is GNU ld. I'd rather use --version,
|
||||
# but apparently some GNU ld's only accept -v.
|
||||
# Break only if it was the GNU/non-GNU ld that we prefer.
|
||||
case `"$acl_cv_path_LD" -v 2>&1 < /dev/null` in
|
||||
*GNU* | *'with BFD'*)
|
||||
test "$with_gnu_ld" != no && break ;;
|
||||
*)
|
||||
test "$with_gnu_ld" != yes && break ;;
|
||||
esac
|
||||
fi
|
||||
done
|
||||
IFS="$ac_save_ifs"
|
||||
else
|
||||
acl_cv_path_LD="$LD" # Let the user override the test with a path.
|
||||
fi])
|
||||
LD="$acl_cv_path_LD"
|
||||
if test -n "$LD"; then
|
||||
AC_MSG_RESULT([$LD])
|
||||
else
|
||||
AC_MSG_RESULT([no])
|
||||
fi
|
||||
test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
|
||||
AC_LIB_PROG_LD_GNU
|
||||
])
|
||||
@@ -0,0 +1,774 @@
|
||||
# lib-link.m4 serial 21 (gettext-0.18)
|
||||
dnl Copyright (C) 2001-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_PREREQ([2.54])
|
||||
|
||||
dnl AC_LIB_LINKFLAGS(name [, dependencies]) searches for libname and
|
||||
dnl the libraries corresponding to explicit and implicit dependencies.
|
||||
dnl Sets and AC_SUBSTs the LIB${NAME} and LTLIB${NAME} variables and
|
||||
dnl augments the CPPFLAGS variable.
|
||||
dnl Sets and AC_SUBSTs the LIB${NAME}_PREFIX variable to nonempty if libname
|
||||
dnl was found in ${LIB${NAME}_PREFIX}/$acl_libdirstem.
|
||||
AC_DEFUN([AC_LIB_LINKFLAGS],
|
||||
[
|
||||
AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
|
||||
AC_REQUIRE([AC_LIB_RPATH])
|
||||
pushdef([Name],[translit([$1],[./-], [___])])
|
||||
pushdef([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
|
||||
[ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
|
||||
AC_CACHE_CHECK([how to link with lib[]$1], [ac_cv_lib[]Name[]_libs], [
|
||||
AC_LIB_LINKFLAGS_BODY([$1], [$2])
|
||||
ac_cv_lib[]Name[]_libs="$LIB[]NAME"
|
||||
ac_cv_lib[]Name[]_ltlibs="$LTLIB[]NAME"
|
||||
ac_cv_lib[]Name[]_cppflags="$INC[]NAME"
|
||||
ac_cv_lib[]Name[]_prefix="$LIB[]NAME[]_PREFIX"
|
||||
])
|
||||
LIB[]NAME="$ac_cv_lib[]Name[]_libs"
|
||||
LTLIB[]NAME="$ac_cv_lib[]Name[]_ltlibs"
|
||||
INC[]NAME="$ac_cv_lib[]Name[]_cppflags"
|
||||
LIB[]NAME[]_PREFIX="$ac_cv_lib[]Name[]_prefix"
|
||||
AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
|
||||
AC_SUBST([LIB]NAME)
|
||||
AC_SUBST([LTLIB]NAME)
|
||||
AC_SUBST([LIB]NAME[_PREFIX])
|
||||
dnl Also set HAVE_LIB[]NAME so that AC_LIB_HAVE_LINKFLAGS can reuse the
|
||||
dnl results of this search when this library appears as a dependency.
|
||||
HAVE_LIB[]NAME=yes
|
||||
popdef([NAME])
|
||||
popdef([Name])
|
||||
])
|
||||
|
||||
dnl AC_LIB_HAVE_LINKFLAGS(name, dependencies, includes, testcode, [missing-message])
|
||||
dnl searches for libname and the libraries corresponding to explicit and
|
||||
dnl implicit dependencies, together with the specified include files and
|
||||
dnl the ability to compile and link the specified testcode. The missing-message
|
||||
dnl defaults to 'no' and may contain additional hints for the user.
|
||||
dnl If found, it sets and AC_SUBSTs HAVE_LIB${NAME}=yes and the LIB${NAME}
|
||||
dnl and LTLIB${NAME} variables and augments the CPPFLAGS variable, and
|
||||
dnl #defines HAVE_LIB${NAME} to 1. Otherwise, it sets and AC_SUBSTs
|
||||
dnl HAVE_LIB${NAME}=no and LIB${NAME} and LTLIB${NAME} to empty.
|
||||
dnl Sets and AC_SUBSTs the LIB${NAME}_PREFIX variable to nonempty if libname
|
||||
dnl was found in ${LIB${NAME}_PREFIX}/$acl_libdirstem.
|
||||
AC_DEFUN([AC_LIB_HAVE_LINKFLAGS],
|
||||
[
|
||||
AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
|
||||
AC_REQUIRE([AC_LIB_RPATH])
|
||||
pushdef([Name],[translit([$1],[./-], [___])])
|
||||
pushdef([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
|
||||
[ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
|
||||
|
||||
dnl Search for lib[]Name and define LIB[]NAME, LTLIB[]NAME and INC[]NAME
|
||||
dnl accordingly.
|
||||
AC_LIB_LINKFLAGS_BODY([$1], [$2])
|
||||
|
||||
dnl Add $INC[]NAME to CPPFLAGS before performing the following checks,
|
||||
dnl because if the user has installed lib[]Name and not disabled its use
|
||||
dnl via --without-lib[]Name-prefix, he wants to use it.
|
||||
ac_save_CPPFLAGS="$CPPFLAGS"
|
||||
AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
|
||||
|
||||
AC_CACHE_CHECK([for lib[]$1], [ac_cv_lib[]Name], [
|
||||
ac_save_LIBS="$LIBS"
|
||||
dnl If $LIB[]NAME contains some -l options, add it to the end of LIBS,
|
||||
dnl because these -l options might require -L options that are present in
|
||||
dnl LIBS. -l options benefit only from the -L options listed before it.
|
||||
dnl Otherwise, add it to the front of LIBS, because it may be a static
|
||||
dnl library that depends on another static library that is present in LIBS.
|
||||
dnl Static libraries benefit only from the static libraries listed after
|
||||
dnl it.
|
||||
case " $LIB[]NAME" in
|
||||
*" -l"*) LIBS="$LIBS $LIB[]NAME" ;;
|
||||
*) LIBS="$LIB[]NAME $LIBS" ;;
|
||||
esac
|
||||
AC_TRY_LINK([$3], [$4],
|
||||
[ac_cv_lib[]Name=yes],
|
||||
[ac_cv_lib[]Name='m4_if([$5], [], [no], [[$5]])'])
|
||||
LIBS="$ac_save_LIBS"
|
||||
])
|
||||
if test "$ac_cv_lib[]Name" = yes; then
|
||||
HAVE_LIB[]NAME=yes
|
||||
AC_DEFINE([HAVE_LIB]NAME, 1, [Define if you have the lib][$1 library.])
|
||||
AC_MSG_CHECKING([how to link with lib[]$1])
|
||||
AC_MSG_RESULT([$LIB[]NAME])
|
||||
else
|
||||
HAVE_LIB[]NAME=no
|
||||
dnl If $LIB[]NAME didn't lead to a usable library, we don't need
|
||||
dnl $INC[]NAME either.
|
||||
CPPFLAGS="$ac_save_CPPFLAGS"
|
||||
LIB[]NAME=
|
||||
LTLIB[]NAME=
|
||||
LIB[]NAME[]_PREFIX=
|
||||
fi
|
||||
AC_SUBST([HAVE_LIB]NAME)
|
||||
AC_SUBST([LIB]NAME)
|
||||
AC_SUBST([LTLIB]NAME)
|
||||
AC_SUBST([LIB]NAME[_PREFIX])
|
||||
popdef([NAME])
|
||||
popdef([Name])
|
||||
])
|
||||
|
||||
dnl Determine the platform dependent parameters needed to use rpath:
|
||||
dnl acl_libext,
|
||||
dnl acl_shlibext,
|
||||
dnl acl_hardcode_libdir_flag_spec,
|
||||
dnl acl_hardcode_libdir_separator,
|
||||
dnl acl_hardcode_direct,
|
||||
dnl acl_hardcode_minus_L.
|
||||
AC_DEFUN([AC_LIB_RPATH],
|
||||
[
|
||||
dnl Tell automake >= 1.10 to complain if config.rpath is missing.
|
||||
m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([config.rpath])])
|
||||
AC_REQUIRE([AC_PROG_CC]) dnl we use $CC, $GCC, $LDFLAGS
|
||||
AC_REQUIRE([AC_LIB_PROG_LD]) dnl we use $LD, $with_gnu_ld
|
||||
AC_REQUIRE([AC_CANONICAL_HOST]) dnl we use $host
|
||||
AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT]) dnl we use $ac_aux_dir
|
||||
AC_CACHE_CHECK([for shared library run path origin], [acl_cv_rpath], [
|
||||
CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \
|
||||
${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh
|
||||
. ./conftest.sh
|
||||
rm -f ./conftest.sh
|
||||
acl_cv_rpath=done
|
||||
])
|
||||
wl="$acl_cv_wl"
|
||||
acl_libext="$acl_cv_libext"
|
||||
acl_shlibext="$acl_cv_shlibext"
|
||||
acl_libname_spec="$acl_cv_libname_spec"
|
||||
acl_library_names_spec="$acl_cv_library_names_spec"
|
||||
acl_hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec"
|
||||
acl_hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator"
|
||||
acl_hardcode_direct="$acl_cv_hardcode_direct"
|
||||
acl_hardcode_minus_L="$acl_cv_hardcode_minus_L"
|
||||
dnl Determine whether the user wants rpath handling at all.
|
||||
AC_ARG_ENABLE([rpath],
|
||||
[ --disable-rpath do not hardcode runtime library paths],
|
||||
:, enable_rpath=yes)
|
||||
])
|
||||
|
||||
dnl AC_LIB_FROMPACKAGE(name, package)
|
||||
dnl declares that libname comes from the given package. The configure file
|
||||
dnl will then not have a --with-libname-prefix option but a
|
||||
dnl --with-package-prefix option. Several libraries can come from the same
|
||||
dnl package. This declaration must occur before an AC_LIB_LINKFLAGS or similar
|
||||
dnl macro call that searches for libname.
|
||||
AC_DEFUN([AC_LIB_FROMPACKAGE],
|
||||
[
|
||||
pushdef([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
|
||||
[ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
|
||||
define([acl_frompackage_]NAME, [$2])
|
||||
popdef([NAME])
|
||||
pushdef([PACK],[$2])
|
||||
pushdef([PACKUP],[translit(PACK,[abcdefghijklmnopqrstuvwxyz./-],
|
||||
[ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
|
||||
define([acl_libsinpackage_]PACKUP,
|
||||
m4_ifdef([acl_libsinpackage_]PACKUP, [acl_libsinpackage_]PACKUP[[, ]],)[lib$1])
|
||||
popdef([PACKUP])
|
||||
popdef([PACK])
|
||||
])
|
||||
|
||||
dnl AC_LIB_LINKFLAGS_BODY(name [, dependencies]) searches for libname and
|
||||
dnl the libraries corresponding to explicit and implicit dependencies.
|
||||
dnl Sets the LIB${NAME}, LTLIB${NAME} and INC${NAME} variables.
|
||||
dnl Also, sets the LIB${NAME}_PREFIX variable to nonempty if libname was found
|
||||
dnl in ${LIB${NAME}_PREFIX}/$acl_libdirstem.
|
||||
AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
|
||||
[
|
||||
AC_REQUIRE([AC_LIB_PREPARE_MULTILIB])
|
||||
pushdef([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
|
||||
[ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
|
||||
pushdef([PACK],[m4_ifdef([acl_frompackage_]NAME, [acl_frompackage_]NAME, lib[$1])])
|
||||
pushdef([PACKUP],[translit(PACK,[abcdefghijklmnopqrstuvwxyz./-],
|
||||
[ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
|
||||
pushdef([PACKLIBS],[m4_ifdef([acl_frompackage_]NAME, [acl_libsinpackage_]PACKUP, lib[$1])])
|
||||
dnl Autoconf >= 2.61 supports dots in --with options.
|
||||
pushdef([P_A_C_K],[m4_if(m4_version_compare(m4_defn([m4_PACKAGE_VERSION]),[2.61]),[-1],[translit(PACK,[.],[_])],PACK)])
|
||||
dnl By default, look in $includedir and $libdir.
|
||||
use_additional=yes
|
||||
AC_LIB_WITH_FINAL_PREFIX([
|
||||
eval additional_includedir=\"$includedir\"
|
||||
eval additional_libdir=\"$libdir\"
|
||||
])
|
||||
AC_ARG_WITH(P_A_C_K[-prefix],
|
||||
[[ --with-]]P_A_C_K[[-prefix[=DIR] search for ]PACKLIBS[ in DIR/include and DIR/lib
|
||||
--without-]]P_A_C_K[[-prefix don't search for ]PACKLIBS[ in includedir and libdir]],
|
||||
[
|
||||
if test "X$withval" = "Xno"; then
|
||||
use_additional=no
|
||||
else
|
||||
if test "X$withval" = "X"; then
|
||||
AC_LIB_WITH_FINAL_PREFIX([
|
||||
eval additional_includedir=\"$includedir\"
|
||||
eval additional_libdir=\"$libdir\"
|
||||
])
|
||||
else
|
||||
additional_includedir="$withval/include"
|
||||
additional_libdir="$withval/$acl_libdirstem"
|
||||
if test "$acl_libdirstem2" != "$acl_libdirstem" \
|
||||
&& ! test -d "$withval/$acl_libdirstem"; then
|
||||
additional_libdir="$withval/$acl_libdirstem2"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
])
|
||||
dnl Search the library and its dependencies in $additional_libdir and
|
||||
dnl $LDFLAGS. Using breadth-first-seach.
|
||||
LIB[]NAME=
|
||||
LTLIB[]NAME=
|
||||
INC[]NAME=
|
||||
LIB[]NAME[]_PREFIX=
|
||||
dnl HAVE_LIB${NAME} is an indicator that LIB${NAME}, LTLIB${NAME} have been
|
||||
dnl computed. So it has to be reset here.
|
||||
HAVE_LIB[]NAME=
|
||||
rpathdirs=
|
||||
ltrpathdirs=
|
||||
names_already_handled=
|
||||
names_next_round='$1 $2'
|
||||
while test -n "$names_next_round"; do
|
||||
names_this_round="$names_next_round"
|
||||
names_next_round=
|
||||
for name in $names_this_round; do
|
||||
already_handled=
|
||||
for n in $names_already_handled; do
|
||||
if test "$n" = "$name"; then
|
||||
already_handled=yes
|
||||
break
|
||||
fi
|
||||
done
|
||||
if test -z "$already_handled"; then
|
||||
names_already_handled="$names_already_handled $name"
|
||||
dnl See if it was already located by an earlier AC_LIB_LINKFLAGS
|
||||
dnl or AC_LIB_HAVE_LINKFLAGS call.
|
||||
uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'`
|
||||
eval value=\"\$HAVE_LIB$uppername\"
|
||||
if test -n "$value"; then
|
||||
if test "$value" = yes; then
|
||||
eval value=\"\$LIB$uppername\"
|
||||
test -z "$value" || LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$value"
|
||||
eval value=\"\$LTLIB$uppername\"
|
||||
test -z "$value" || LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$value"
|
||||
else
|
||||
dnl An earlier call to AC_LIB_HAVE_LINKFLAGS has determined
|
||||
dnl that this library doesn't exist. So just drop it.
|
||||
:
|
||||
fi
|
||||
else
|
||||
dnl Search the library lib$name in $additional_libdir and $LDFLAGS
|
||||
dnl and the already constructed $LIBNAME/$LTLIBNAME.
|
||||
found_dir=
|
||||
found_la=
|
||||
found_so=
|
||||
found_a=
|
||||
eval libname=\"$acl_libname_spec\" # typically: libname=lib$name
|
||||
if test -n "$acl_shlibext"; then
|
||||
shrext=".$acl_shlibext" # typically: shrext=.so
|
||||
else
|
||||
shrext=
|
||||
fi
|
||||
if test $use_additional = yes; then
|
||||
dir="$additional_libdir"
|
||||
dnl The same code as in the loop below:
|
||||
dnl First look for a shared library.
|
||||
if test -n "$acl_shlibext"; then
|
||||
if test -f "$dir/$libname$shrext"; then
|
||||
found_dir="$dir"
|
||||
found_so="$dir/$libname$shrext"
|
||||
else
|
||||
if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then
|
||||
ver=`(cd "$dir" && \
|
||||
for f in "$libname$shrext".*; do echo "$f"; done \
|
||||
| sed -e "s,^$libname$shrext\\\\.,," \
|
||||
| sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \
|
||||
| sed 1q ) 2>/dev/null`
|
||||
if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then
|
||||
found_dir="$dir"
|
||||
found_so="$dir/$libname$shrext.$ver"
|
||||
fi
|
||||
else
|
||||
eval library_names=\"$acl_library_names_spec\"
|
||||
for f in $library_names; do
|
||||
if test -f "$dir/$f"; then
|
||||
found_dir="$dir"
|
||||
found_so="$dir/$f"
|
||||
break
|
||||
fi
|
||||
done
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
dnl Then look for a static library.
|
||||
if test "X$found_dir" = "X"; then
|
||||
if test -f "$dir/$libname.$acl_libext"; then
|
||||
found_dir="$dir"
|
||||
found_a="$dir/$libname.$acl_libext"
|
||||
fi
|
||||
fi
|
||||
if test "X$found_dir" != "X"; then
|
||||
if test -f "$dir/$libname.la"; then
|
||||
found_la="$dir/$libname.la"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
if test "X$found_dir" = "X"; then
|
||||
for x in $LDFLAGS $LTLIB[]NAME; do
|
||||
AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
|
||||
case "$x" in
|
||||
-L*)
|
||||
dir=`echo "X$x" | sed -e 's/^X-L//'`
|
||||
dnl First look for a shared library.
|
||||
if test -n "$acl_shlibext"; then
|
||||
if test -f "$dir/$libname$shrext"; then
|
||||
found_dir="$dir"
|
||||
found_so="$dir/$libname$shrext"
|
||||
else
|
||||
if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then
|
||||
ver=`(cd "$dir" && \
|
||||
for f in "$libname$shrext".*; do echo "$f"; done \
|
||||
| sed -e "s,^$libname$shrext\\\\.,," \
|
||||
| sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \
|
||||
| sed 1q ) 2>/dev/null`
|
||||
if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then
|
||||
found_dir="$dir"
|
||||
found_so="$dir/$libname$shrext.$ver"
|
||||
fi
|
||||
else
|
||||
eval library_names=\"$acl_library_names_spec\"
|
||||
for f in $library_names; do
|
||||
if test -f "$dir/$f"; then
|
||||
found_dir="$dir"
|
||||
found_so="$dir/$f"
|
||||
break
|
||||
fi
|
||||
done
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
dnl Then look for a static library.
|
||||
if test "X$found_dir" = "X"; then
|
||||
if test -f "$dir/$libname.$acl_libext"; then
|
||||
found_dir="$dir"
|
||||
found_a="$dir/$libname.$acl_libext"
|
||||
fi
|
||||
fi
|
||||
if test "X$found_dir" != "X"; then
|
||||
if test -f "$dir/$libname.la"; then
|
||||
found_la="$dir/$libname.la"
|
||||
fi
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
if test "X$found_dir" != "X"; then
|
||||
break
|
||||
fi
|
||||
done
|
||||
fi
|
||||
if test "X$found_dir" != "X"; then
|
||||
dnl Found the library.
|
||||
LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$found_dir -l$name"
|
||||
if test "X$found_so" != "X"; then
|
||||
dnl Linking with a shared library. We attempt to hardcode its
|
||||
dnl directory into the executable's runpath, unless it's the
|
||||
dnl standard /usr/lib.
|
||||
if test "$enable_rpath" = no \
|
||||
|| test "X$found_dir" = "X/usr/$acl_libdirstem" \
|
||||
|| test "X$found_dir" = "X/usr/$acl_libdirstem2"; then
|
||||
dnl No hardcoding is needed.
|
||||
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
|
||||
else
|
||||
dnl Use an explicit option to hardcode DIR into the resulting
|
||||
dnl binary.
|
||||
dnl Potentially add DIR to ltrpathdirs.
|
||||
dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
|
||||
haveit=
|
||||
for x in $ltrpathdirs; do
|
||||
if test "X$x" = "X$found_dir"; then
|
||||
haveit=yes
|
||||
break
|
||||
fi
|
||||
done
|
||||
if test -z "$haveit"; then
|
||||
ltrpathdirs="$ltrpathdirs $found_dir"
|
||||
fi
|
||||
dnl The hardcoding into $LIBNAME is system dependent.
|
||||
if test "$acl_hardcode_direct" = yes; then
|
||||
dnl Using DIR/libNAME.so during linking hardcodes DIR into the
|
||||
dnl resulting binary.
|
||||
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
|
||||
else
|
||||
if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then
|
||||
dnl Use an explicit option to hardcode DIR into the resulting
|
||||
dnl binary.
|
||||
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
|
||||
dnl Potentially add DIR to rpathdirs.
|
||||
dnl The rpathdirs will be appended to $LIBNAME at the end.
|
||||
haveit=
|
||||
for x in $rpathdirs; do
|
||||
if test "X$x" = "X$found_dir"; then
|
||||
haveit=yes
|
||||
break
|
||||
fi
|
||||
done
|
||||
if test -z "$haveit"; then
|
||||
rpathdirs="$rpathdirs $found_dir"
|
||||
fi
|
||||
else
|
||||
dnl Rely on "-L$found_dir".
|
||||
dnl But don't add it if it's already contained in the LDFLAGS
|
||||
dnl or the already constructed $LIBNAME
|
||||
haveit=
|
||||
for x in $LDFLAGS $LIB[]NAME; do
|
||||
AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
|
||||
if test "X$x" = "X-L$found_dir"; then
|
||||
haveit=yes
|
||||
break
|
||||
fi
|
||||
done
|
||||
if test -z "$haveit"; then
|
||||
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir"
|
||||
fi
|
||||
if test "$acl_hardcode_minus_L" != no; then
|
||||
dnl FIXME: Not sure whether we should use
|
||||
dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
|
||||
dnl here.
|
||||
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
|
||||
else
|
||||
dnl We cannot use $acl_hardcode_runpath_var and LD_RUN_PATH
|
||||
dnl here, because this doesn't fit in flags passed to the
|
||||
dnl compiler. So give up. No hardcoding. This affects only
|
||||
dnl very old systems.
|
||||
dnl FIXME: Not sure whether we should use
|
||||
dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
|
||||
dnl here.
|
||||
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
else
|
||||
if test "X$found_a" != "X"; then
|
||||
dnl Linking with a static library.
|
||||
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_a"
|
||||
else
|
||||
dnl We shouldn't come here, but anyway it's good to have a
|
||||
dnl fallback.
|
||||
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir -l$name"
|
||||
fi
|
||||
fi
|
||||
dnl Assume the include files are nearby.
|
||||
additional_includedir=
|
||||
case "$found_dir" in
|
||||
*/$acl_libdirstem | */$acl_libdirstem/)
|
||||
basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem/"'*$,,'`
|
||||
if test "$name" = '$1'; then
|
||||
LIB[]NAME[]_PREFIX="$basedir"
|
||||
fi
|
||||
additional_includedir="$basedir/include"
|
||||
;;
|
||||
*/$acl_libdirstem2 | */$acl_libdirstem2/)
|
||||
basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem2/"'*$,,'`
|
||||
if test "$name" = '$1'; then
|
||||
LIB[]NAME[]_PREFIX="$basedir"
|
||||
fi
|
||||
additional_includedir="$basedir/include"
|
||||
;;
|
||||
esac
|
||||
if test "X$additional_includedir" != "X"; then
|
||||
dnl Potentially add $additional_includedir to $INCNAME.
|
||||
dnl But don't add it
|
||||
dnl 1. if it's the standard /usr/include,
|
||||
dnl 2. if it's /usr/local/include and we are using GCC on Linux,
|
||||
dnl 3. if it's already present in $CPPFLAGS or the already
|
||||
dnl constructed $INCNAME,
|
||||
dnl 4. if it doesn't exist as a directory.
|
||||
if test "X$additional_includedir" != "X/usr/include"; then
|
||||
haveit=
|
||||
if test "X$additional_includedir" = "X/usr/local/include"; then
|
||||
if test -n "$GCC"; then
|
||||
case $host_os in
|
||||
linux* | gnu* | k*bsd*-gnu) haveit=yes;;
|
||||
esac
|
||||
fi
|
||||
fi
|
||||
if test -z "$haveit"; then
|
||||
for x in $CPPFLAGS $INC[]NAME; do
|
||||
AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
|
||||
if test "X$x" = "X-I$additional_includedir"; then
|
||||
haveit=yes
|
||||
break
|
||||
fi
|
||||
done
|
||||
if test -z "$haveit"; then
|
||||
if test -d "$additional_includedir"; then
|
||||
dnl Really add $additional_includedir to $INCNAME.
|
||||
INC[]NAME="${INC[]NAME}${INC[]NAME:+ }-I$additional_includedir"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
dnl Look for dependencies.
|
||||
if test -n "$found_la"; then
|
||||
dnl Read the .la file. It defines the variables
|
||||
dnl dlname, library_names, old_library, dependency_libs, current,
|
||||
dnl age, revision, installed, dlopen, dlpreopen, libdir.
|
||||
save_libdir="$libdir"
|
||||
case "$found_la" in
|
||||
*/* | *\\*) . "$found_la" ;;
|
||||
*) . "./$found_la" ;;
|
||||
esac
|
||||
libdir="$save_libdir"
|
||||
dnl We use only dependency_libs.
|
||||
for dep in $dependency_libs; do
|
||||
case "$dep" in
|
||||
-L*)
|
||||
additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'`
|
||||
dnl Potentially add $additional_libdir to $LIBNAME and $LTLIBNAME.
|
||||
dnl But don't add it
|
||||
dnl 1. if it's the standard /usr/lib,
|
||||
dnl 2. if it's /usr/local/lib and we are using GCC on Linux,
|
||||
dnl 3. if it's already present in $LDFLAGS or the already
|
||||
dnl constructed $LIBNAME,
|
||||
dnl 4. if it doesn't exist as a directory.
|
||||
if test "X$additional_libdir" != "X/usr/$acl_libdirstem" \
|
||||
&& test "X$additional_libdir" != "X/usr/$acl_libdirstem2"; then
|
||||
haveit=
|
||||
if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem" \
|
||||
|| test "X$additional_libdir" = "X/usr/local/$acl_libdirstem2"; then
|
||||
if test -n "$GCC"; then
|
||||
case $host_os in
|
||||
linux* | gnu* | k*bsd*-gnu) haveit=yes;;
|
||||
esac
|
||||
fi
|
||||
fi
|
||||
if test -z "$haveit"; then
|
||||
haveit=
|
||||
for x in $LDFLAGS $LIB[]NAME; do
|
||||
AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
|
||||
if test "X$x" = "X-L$additional_libdir"; then
|
||||
haveit=yes
|
||||
break
|
||||
fi
|
||||
done
|
||||
if test -z "$haveit"; then
|
||||
if test -d "$additional_libdir"; then
|
||||
dnl Really add $additional_libdir to $LIBNAME.
|
||||
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$additional_libdir"
|
||||
fi
|
||||
fi
|
||||
haveit=
|
||||
for x in $LDFLAGS $LTLIB[]NAME; do
|
||||
AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
|
||||
if test "X$x" = "X-L$additional_libdir"; then
|
||||
haveit=yes
|
||||
break
|
||||
fi
|
||||
done
|
||||
if test -z "$haveit"; then
|
||||
if test -d "$additional_libdir"; then
|
||||
dnl Really add $additional_libdir to $LTLIBNAME.
|
||||
LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$additional_libdir"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
;;
|
||||
-R*)
|
||||
dir=`echo "X$dep" | sed -e 's/^X-R//'`
|
||||
if test "$enable_rpath" != no; then
|
||||
dnl Potentially add DIR to rpathdirs.
|
||||
dnl The rpathdirs will be appended to $LIBNAME at the end.
|
||||
haveit=
|
||||
for x in $rpathdirs; do
|
||||
if test "X$x" = "X$dir"; then
|
||||
haveit=yes
|
||||
break
|
||||
fi
|
||||
done
|
||||
if test -z "$haveit"; then
|
||||
rpathdirs="$rpathdirs $dir"
|
||||
fi
|
||||
dnl Potentially add DIR to ltrpathdirs.
|
||||
dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
|
||||
haveit=
|
||||
for x in $ltrpathdirs; do
|
||||
if test "X$x" = "X$dir"; then
|
||||
haveit=yes
|
||||
break
|
||||
fi
|
||||
done
|
||||
if test -z "$haveit"; then
|
||||
ltrpathdirs="$ltrpathdirs $dir"
|
||||
fi
|
||||
fi
|
||||
;;
|
||||
-l*)
|
||||
dnl Handle this in the next round.
|
||||
names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'`
|
||||
;;
|
||||
*.la)
|
||||
dnl Handle this in the next round. Throw away the .la's
|
||||
dnl directory; it is already contained in a preceding -L
|
||||
dnl option.
|
||||
names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'`
|
||||
;;
|
||||
*)
|
||||
dnl Most likely an immediate library name.
|
||||
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$dep"
|
||||
LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$dep"
|
||||
;;
|
||||
esac
|
||||
done
|
||||
fi
|
||||
else
|
||||
dnl Didn't find the library; assume it is in the system directories
|
||||
dnl known to the linker and runtime loader. (All the system
|
||||
dnl directories known to the linker should also be known to the
|
||||
dnl runtime loader, otherwise the system is severely misconfigured.)
|
||||
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"
|
||||
LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-l$name"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
done
|
||||
done
|
||||
if test "X$rpathdirs" != "X"; then
|
||||
if test -n "$acl_hardcode_libdir_separator"; then
|
||||
dnl Weird platform: only the last -rpath option counts, the user must
|
||||
dnl pass all path elements in one option. We can arrange that for a
|
||||
dnl single library, but not when more than one $LIBNAMEs are used.
|
||||
alldirs=
|
||||
for found_dir in $rpathdirs; do
|
||||
alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$found_dir"
|
||||
done
|
||||
dnl Note: acl_hardcode_libdir_flag_spec uses $libdir and $wl.
|
||||
acl_save_libdir="$libdir"
|
||||
libdir="$alldirs"
|
||||
eval flag=\"$acl_hardcode_libdir_flag_spec\"
|
||||
libdir="$acl_save_libdir"
|
||||
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
|
||||
else
|
||||
dnl The -rpath options are cumulative.
|
||||
for found_dir in $rpathdirs; do
|
||||
acl_save_libdir="$libdir"
|
||||
libdir="$found_dir"
|
||||
eval flag=\"$acl_hardcode_libdir_flag_spec\"
|
||||
libdir="$acl_save_libdir"
|
||||
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
|
||||
done
|
||||
fi
|
||||
fi
|
||||
if test "X$ltrpathdirs" != "X"; then
|
||||
dnl When using libtool, the option that works for both libraries and
|
||||
dnl executables is -R. The -R options are cumulative.
|
||||
for found_dir in $ltrpathdirs; do
|
||||
LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-R$found_dir"
|
||||
done
|
||||
fi
|
||||
popdef([P_A_C_K])
|
||||
popdef([PACKLIBS])
|
||||
popdef([PACKUP])
|
||||
popdef([PACK])
|
||||
popdef([NAME])
|
||||
])
|
||||
|
||||
dnl AC_LIB_APPENDTOVAR(VAR, CONTENTS) appends the elements of CONTENTS to VAR,
|
||||
dnl unless already present in VAR.
|
||||
dnl Works only for CPPFLAGS, not for LIB* variables because that sometimes
|
||||
dnl contains two or three consecutive elements that belong together.
|
||||
AC_DEFUN([AC_LIB_APPENDTOVAR],
|
||||
[
|
||||
for element in [$2]; do
|
||||
haveit=
|
||||
for x in $[$1]; do
|
||||
AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
|
||||
if test "X$x" = "X$element"; then
|
||||
haveit=yes
|
||||
break
|
||||
fi
|
||||
done
|
||||
if test -z "$haveit"; then
|
||||
[$1]="${[$1]}${[$1]:+ }$element"
|
||||
fi
|
||||
done
|
||||
])
|
||||
|
||||
dnl For those cases where a variable contains several -L and -l options
|
||||
dnl referring to unknown libraries and directories, this macro determines the
|
||||
dnl necessary additional linker options for the runtime path.
|
||||
dnl AC_LIB_LINKFLAGS_FROM_LIBS([LDADDVAR], [LIBSVALUE], [USE-LIBTOOL])
|
||||
dnl sets LDADDVAR to linker options needed together with LIBSVALUE.
|
||||
dnl If USE-LIBTOOL evaluates to non-empty, linking with libtool is assumed,
|
||||
dnl otherwise linking without libtool is assumed.
|
||||
AC_DEFUN([AC_LIB_LINKFLAGS_FROM_LIBS],
|
||||
[
|
||||
AC_REQUIRE([AC_LIB_RPATH])
|
||||
AC_REQUIRE([AC_LIB_PREPARE_MULTILIB])
|
||||
$1=
|
||||
if test "$enable_rpath" != no; then
|
||||
if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then
|
||||
dnl Use an explicit option to hardcode directories into the resulting
|
||||
dnl binary.
|
||||
rpathdirs=
|
||||
next=
|
||||
for opt in $2; do
|
||||
if test -n "$next"; then
|
||||
dir="$next"
|
||||
dnl No need to hardcode the standard /usr/lib.
|
||||
if test "X$dir" != "X/usr/$acl_libdirstem" \
|
||||
&& test "X$dir" != "X/usr/$acl_libdirstem2"; then
|
||||
rpathdirs="$rpathdirs $dir"
|
||||
fi
|
||||
next=
|
||||
else
|
||||
case $opt in
|
||||
-L) next=yes ;;
|
||||
-L*) dir=`echo "X$opt" | sed -e 's,^X-L,,'`
|
||||
dnl No need to hardcode the standard /usr/lib.
|
||||
if test "X$dir" != "X/usr/$acl_libdirstem" \
|
||||
&& test "X$dir" != "X/usr/$acl_libdirstem2"; then
|
||||
rpathdirs="$rpathdirs $dir"
|
||||
fi
|
||||
next= ;;
|
||||
*) next= ;;
|
||||
esac
|
||||
fi
|
||||
done
|
||||
if test "X$rpathdirs" != "X"; then
|
||||
if test -n ""$3""; then
|
||||
dnl libtool is used for linking. Use -R options.
|
||||
for dir in $rpathdirs; do
|
||||
$1="${$1}${$1:+ }-R$dir"
|
||||
done
|
||||
else
|
||||
dnl The linker is used for linking directly.
|
||||
if test -n "$acl_hardcode_libdir_separator"; then
|
||||
dnl Weird platform: only the last -rpath option counts, the user
|
||||
dnl must pass all path elements in one option.
|
||||
alldirs=
|
||||
for dir in $rpathdirs; do
|
||||
alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$dir"
|
||||
done
|
||||
acl_save_libdir="$libdir"
|
||||
libdir="$alldirs"
|
||||
eval flag=\"$acl_hardcode_libdir_flag_spec\"
|
||||
libdir="$acl_save_libdir"
|
||||
$1="$flag"
|
||||
else
|
||||
dnl The -rpath options are cumulative.
|
||||
for dir in $rpathdirs; do
|
||||
acl_save_libdir="$libdir"
|
||||
libdir="$dir"
|
||||
eval flag=\"$acl_hardcode_libdir_flag_spec\"
|
||||
libdir="$acl_save_libdir"
|
||||
$1="${$1}${$1:+ }$flag"
|
||||
done
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
AC_SUBST([$1])
|
||||
])
|
||||
@@ -0,0 +1,224 @@
|
||||
# lib-prefix.m4 serial 7 (gettext-0.18)
|
||||
dnl Copyright (C) 2001-2005, 2008-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.
|
||||
|
||||
dnl AC_LIB_ARG_WITH is synonymous to AC_ARG_WITH in autoconf-2.13, and
|
||||
dnl similar to AC_ARG_WITH in autoconf 2.52...2.57 except that is doesn't
|
||||
dnl require excessive bracketing.
|
||||
ifdef([AC_HELP_STRING],
|
||||
[AC_DEFUN([AC_LIB_ARG_WITH], [AC_ARG_WITH([$1],[[$2]],[$3],[$4])])],
|
||||
[AC_DEFUN([AC_][LIB_ARG_WITH], [AC_ARG_WITH([$1],[$2],[$3],[$4])])])
|
||||
|
||||
dnl AC_LIB_PREFIX adds to the CPPFLAGS and LDFLAGS the flags that are needed
|
||||
dnl to access previously installed libraries. The basic assumption is that
|
||||
dnl a user will want packages to use other packages he previously installed
|
||||
dnl with the same --prefix option.
|
||||
dnl This macro is not needed if only AC_LIB_LINKFLAGS is used to locate
|
||||
dnl libraries, but is otherwise very convenient.
|
||||
AC_DEFUN([AC_LIB_PREFIX],
|
||||
[
|
||||
AC_BEFORE([$0], [AC_LIB_LINKFLAGS])
|
||||
AC_REQUIRE([AC_PROG_CC])
|
||||
AC_REQUIRE([AC_CANONICAL_HOST])
|
||||
AC_REQUIRE([AC_LIB_PREPARE_MULTILIB])
|
||||
AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
|
||||
dnl By default, look in $includedir and $libdir.
|
||||
use_additional=yes
|
||||
AC_LIB_WITH_FINAL_PREFIX([
|
||||
eval additional_includedir=\"$includedir\"
|
||||
eval additional_libdir=\"$libdir\"
|
||||
])
|
||||
AC_LIB_ARG_WITH([lib-prefix],
|
||||
[ --with-lib-prefix[=DIR] search for libraries in DIR/include and DIR/lib
|
||||
--without-lib-prefix don't search for libraries in includedir and libdir],
|
||||
[
|
||||
if test "X$withval" = "Xno"; then
|
||||
use_additional=no
|
||||
else
|
||||
if test "X$withval" = "X"; then
|
||||
AC_LIB_WITH_FINAL_PREFIX([
|
||||
eval additional_includedir=\"$includedir\"
|
||||
eval additional_libdir=\"$libdir\"
|
||||
])
|
||||
else
|
||||
additional_includedir="$withval/include"
|
||||
additional_libdir="$withval/$acl_libdirstem"
|
||||
fi
|
||||
fi
|
||||
])
|
||||
if test $use_additional = yes; then
|
||||
dnl Potentially add $additional_includedir to $CPPFLAGS.
|
||||
dnl But don't add it
|
||||
dnl 1. if it's the standard /usr/include,
|
||||
dnl 2. if it's already present in $CPPFLAGS,
|
||||
dnl 3. if it's /usr/local/include and we are using GCC on Linux,
|
||||
dnl 4. if it doesn't exist as a directory.
|
||||
if test "X$additional_includedir" != "X/usr/include"; then
|
||||
haveit=
|
||||
for x in $CPPFLAGS; do
|
||||
AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
|
||||
if test "X$x" = "X-I$additional_includedir"; then
|
||||
haveit=yes
|
||||
break
|
||||
fi
|
||||
done
|
||||
if test -z "$haveit"; then
|
||||
if test "X$additional_includedir" = "X/usr/local/include"; then
|
||||
if test -n "$GCC"; then
|
||||
case $host_os in
|
||||
linux* | gnu* | k*bsd*-gnu) haveit=yes;;
|
||||
esac
|
||||
fi
|
||||
fi
|
||||
if test -z "$haveit"; then
|
||||
if test -d "$additional_includedir"; then
|
||||
dnl Really add $additional_includedir to $CPPFLAGS.
|
||||
CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }-I$additional_includedir"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
dnl Potentially add $additional_libdir to $LDFLAGS.
|
||||
dnl But don't add it
|
||||
dnl 1. if it's the standard /usr/lib,
|
||||
dnl 2. if it's already present in $LDFLAGS,
|
||||
dnl 3. if it's /usr/local/lib and we are using GCC on Linux,
|
||||
dnl 4. if it doesn't exist as a directory.
|
||||
if test "X$additional_libdir" != "X/usr/$acl_libdirstem"; then
|
||||
haveit=
|
||||
for x in $LDFLAGS; do
|
||||
AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
|
||||
if test "X$x" = "X-L$additional_libdir"; then
|
||||
haveit=yes
|
||||
break
|
||||
fi
|
||||
done
|
||||
if test -z "$haveit"; then
|
||||
if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem"; then
|
||||
if test -n "$GCC"; then
|
||||
case $host_os in
|
||||
linux*) haveit=yes;;
|
||||
esac
|
||||
fi
|
||||
fi
|
||||
if test -z "$haveit"; then
|
||||
if test -d "$additional_libdir"; then
|
||||
dnl Really add $additional_libdir to $LDFLAGS.
|
||||
LDFLAGS="${LDFLAGS}${LDFLAGS:+ }-L$additional_libdir"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
])
|
||||
|
||||
dnl AC_LIB_PREPARE_PREFIX creates variables acl_final_prefix,
|
||||
dnl acl_final_exec_prefix, containing the values to which $prefix and
|
||||
dnl $exec_prefix will expand at the end of the configure script.
|
||||
AC_DEFUN([AC_LIB_PREPARE_PREFIX],
|
||||
[
|
||||
dnl Unfortunately, prefix and exec_prefix get only finally determined
|
||||
dnl at the end of configure.
|
||||
if test "X$prefix" = "XNONE"; then
|
||||
acl_final_prefix="$ac_default_prefix"
|
||||
else
|
||||
acl_final_prefix="$prefix"
|
||||
fi
|
||||
if test "X$exec_prefix" = "XNONE"; then
|
||||
acl_final_exec_prefix='${prefix}'
|
||||
else
|
||||
acl_final_exec_prefix="$exec_prefix"
|
||||
fi
|
||||
acl_save_prefix="$prefix"
|
||||
prefix="$acl_final_prefix"
|
||||
eval acl_final_exec_prefix=\"$acl_final_exec_prefix\"
|
||||
prefix="$acl_save_prefix"
|
||||
])
|
||||
|
||||
dnl AC_LIB_WITH_FINAL_PREFIX([statement]) evaluates statement, with the
|
||||
dnl variables prefix and exec_prefix bound to the values they will have
|
||||
dnl at the end of the configure script.
|
||||
AC_DEFUN([AC_LIB_WITH_FINAL_PREFIX],
|
||||
[
|
||||
acl_save_prefix="$prefix"
|
||||
prefix="$acl_final_prefix"
|
||||
acl_save_exec_prefix="$exec_prefix"
|
||||
exec_prefix="$acl_final_exec_prefix"
|
||||
$1
|
||||
exec_prefix="$acl_save_exec_prefix"
|
||||
prefix="$acl_save_prefix"
|
||||
])
|
||||
|
||||
dnl AC_LIB_PREPARE_MULTILIB creates
|
||||
dnl - a variable acl_libdirstem, containing the basename of the libdir, either
|
||||
dnl "lib" or "lib64" or "lib/64",
|
||||
dnl - a variable acl_libdirstem2, as a secondary possible value for
|
||||
dnl acl_libdirstem, either the same as acl_libdirstem or "lib/sparcv9" or
|
||||
dnl "lib/amd64".
|
||||
AC_DEFUN([AC_LIB_PREPARE_MULTILIB],
|
||||
[
|
||||
dnl There is no formal standard regarding lib and lib64.
|
||||
dnl On glibc systems, the current practice is that on a system supporting
|
||||
dnl 32-bit and 64-bit instruction sets or ABIs, 64-bit libraries go under
|
||||
dnl $prefix/lib64 and 32-bit libraries go under $prefix/lib. We determine
|
||||
dnl the compiler's default mode by looking at the compiler's library search
|
||||
dnl path. If at least one of its elements ends in /lib64 or points to a
|
||||
dnl directory whose absolute pathname ends in /lib64, we assume a 64-bit ABI.
|
||||
dnl Otherwise we use the default, namely "lib".
|
||||
dnl On Solaris systems, the current practice is that on a system supporting
|
||||
dnl 32-bit and 64-bit instruction sets or ABIs, 64-bit libraries go under
|
||||
dnl $prefix/lib/64 (which is a symlink to either $prefix/lib/sparcv9 or
|
||||
dnl $prefix/lib/amd64) and 32-bit libraries go under $prefix/lib.
|
||||
AC_REQUIRE([AC_CANONICAL_HOST])
|
||||
acl_libdirstem=lib
|
||||
acl_libdirstem2=
|
||||
case "$host_os" in
|
||||
solaris*)
|
||||
dnl See Solaris 10 Software Developer Collection > Solaris 64-bit Developer's Guide > The Development Environment
|
||||
dnl <http://docs.sun.com/app/docs/doc/816-5138/dev-env?l=en&a=view>.
|
||||
dnl "Portable Makefiles should refer to any library directories using the 64 symbolic link."
|
||||
dnl But we want to recognize the sparcv9 or amd64 subdirectory also if the
|
||||
dnl symlink is missing, so we set acl_libdirstem2 too.
|
||||
AC_CACHE_CHECK([for 64-bit host], [gl_cv_solaris_64bit],
|
||||
[AC_EGREP_CPP([sixtyfour bits], [
|
||||
#ifdef _LP64
|
||||
sixtyfour bits
|
||||
#endif
|
||||
], [gl_cv_solaris_64bit=yes], [gl_cv_solaris_64bit=no])
|
||||
])
|
||||
if test $gl_cv_solaris_64bit = yes; then
|
||||
acl_libdirstem=lib/64
|
||||
case "$host_cpu" in
|
||||
sparc*) acl_libdirstem2=lib/sparcv9 ;;
|
||||
i*86 | x86_64) acl_libdirstem2=lib/amd64 ;;
|
||||
esac
|
||||
fi
|
||||
;;
|
||||
*)
|
||||
searchpath=`(LC_ALL=C $CC -print-search-dirs) 2>/dev/null | sed -n -e 's,^libraries: ,,p' | sed -e 's,^=,,'`
|
||||
if test -n "$searchpath"; then
|
||||
acl_save_IFS="${IFS= }"; IFS=":"
|
||||
for searchdir in $searchpath; do
|
||||
if test -d "$searchdir"; then
|
||||
case "$searchdir" in
|
||||
*/lib64/ | */lib64 ) acl_libdirstem=lib64 ;;
|
||||
*/../ | */.. )
|
||||
# Better ignore directories of this form. They are misleading.
|
||||
;;
|
||||
*) searchdir=`cd "$searchdir" && pwd`
|
||||
case "$searchdir" in
|
||||
*/lib64 ) acl_libdirstem=lib64 ;;
|
||||
esac ;;
|
||||
esac
|
||||
fi
|
||||
done
|
||||
IFS="$acl_save_IFS"
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
test -n "$acl_libdirstem2" || acl_libdirstem2="$acl_libdirstem"
|
||||
])
|
||||
File renamed without changes.
@@ -0,0 +1,65 @@
|
||||
noinst_LTLIBRARIES = libeglib.la
|
||||
|
||||
AM_CFLAGS = $(WERROR_CFLAGS)
|
||||
|
||||
win_files = \
|
||||
eglib-config.hw \
|
||||
gdate-win32.c gdir-win32.c gfile-win32.c gmisc-win32.c \
|
||||
gmodule-win32.c gtimer-win32.c gunicode-win32.c
|
||||
|
||||
unix_files = \
|
||||
gdate-unix.c gdir-unix.c gfile-unix.c gmisc-unix.c \
|
||||
gmodule-unix.c gtimer-unix.c
|
||||
|
||||
if HOST_WIN32
|
||||
os_files = $(win_files)
|
||||
else
|
||||
os_files = $(unix_files)
|
||||
endif
|
||||
|
||||
libeglib_la_SOURCES = \
|
||||
eglib-remap.h \
|
||||
sort.frag.h \
|
||||
glib.h \
|
||||
garray.c \
|
||||
gbytearray.c \
|
||||
gerror.c \
|
||||
ghashtable.c \
|
||||
giconv.c \
|
||||
gmem.c \
|
||||
gmodule.h \
|
||||
goutput.c \
|
||||
gqsort.c \
|
||||
gstr.c \
|
||||
gslist.c \
|
||||
gstring.c \
|
||||
gptrarray.c \
|
||||
glist.c \
|
||||
gqueue.c \
|
||||
gpath.c \
|
||||
gshell.c \
|
||||
gspawn.c \
|
||||
gfile.c \
|
||||
gfile-posix.c \
|
||||
gpattern.c \
|
||||
gmarkup.c \
|
||||
gutf8.c \
|
||||
gunicode.c \
|
||||
unicode-data.h \
|
||||
$(os_files)
|
||||
|
||||
libeglib_la_CFLAGS = -g -Wall -D_FORTIFY_SOURCE=2
|
||||
|
||||
AM_CPPFLAGS = -I$(srcdir)
|
||||
|
||||
if HOST_WIN32
|
||||
libeglib_la_LIBADD = -lm $(LIBICONV) -lpsapi
|
||||
else
|
||||
if PLATFORM_ANDROID
|
||||
libeglib_la_LIBADD = -llog
|
||||
endif
|
||||
endif
|
||||
|
||||
MAINTAINERCLEANFILES = Makefile.in
|
||||
|
||||
EXTRA_DIST = eglib-config.h.in $(win_files) $(unix_files)
|
||||
@@ -0,0 +1,42 @@
|
||||
#ifndef __EGLIB_CONFIG_H
|
||||
#define __EGLIB_CONFIG_H
|
||||
|
||||
/*
|
||||
* System-dependent settings
|
||||
*/
|
||||
#define G_GNUC_PRETTY_FUNCTION @GNUC_PRETTY@
|
||||
#define G_GNUC_UNUSED @GNUC_UNUSED@
|
||||
#define G_BYTE_ORDER @ORDER@
|
||||
#define G_GNUC_NORETURN @GNUC_NORETURN@
|
||||
#define G_SEARCHPATH_SEPARATOR_S "@SEARCHSEP@"
|
||||
#define G_SEARCHPATH_SEPARATOR '@SEARCHSEP@'
|
||||
#define G_DIR_SEPARATOR '@PATHSEP@'
|
||||
#define G_DIR_SEPARATOR_S "@PATHSEP@"
|
||||
#define G_BREAKPOINT() @BREAKPOINT@
|
||||
#define G_OS_@OS@
|
||||
#define GPOINTER_TO_INT(ptr) @GPOINTER_TO_INT@
|
||||
#define GPOINTER_TO_UINT(ptr) @GPOINTER_TO_UINT@
|
||||
#define GINT_TO_POINTER(v) @GINT_TO_POINTER@
|
||||
#define GUINT_TO_POINTER(v) @GUINT_TO_POINTER@
|
||||
|
||||
#if @HAVE_ALLOCA_H@ == 1
|
||||
#define G_HAVE_ALLOCA_H
|
||||
#endif
|
||||
|
||||
typedef unsigned @GSIZE@ gsize;
|
||||
typedef signed @GSIZE@ gssize;
|
||||
|
||||
#define G_GSIZE_FORMAT @GSIZE_FORMAT@
|
||||
|
||||
#if @G_HAVE_ISO_VARARGS@ == 1
|
||||
#define G_HAVE_ISO_VARARGS
|
||||
#endif
|
||||
|
||||
#if defined (__native_client__) || defined (HOST_WATCHOS)
|
||||
#undef G_BREAKPOINT
|
||||
#define G_BREAKPOINT()
|
||||
#endif
|
||||
|
||||
typedef @PIDTYPE@ GPid;
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,63 @@
|
||||
#ifndef __EGLIB_CONFIG_H
|
||||
#define __EGLIB_CONFIG_H
|
||||
|
||||
/*
|
||||
* System-dependent settings
|
||||
*/
|
||||
#define G_OS_WIN32 1
|
||||
|
||||
#ifdef _MSC_VER
|
||||
|
||||
#include <io.h>
|
||||
|
||||
#define G_GNUC_PRETTY_FUNCTION __FUNCTION__
|
||||
#define G_GNUC_UNUSED
|
||||
#define G_BYTE_ORDER 1234
|
||||
#define G_GNUC_NORETURN
|
||||
#define G_BREAKPOINT() __debugbreak()
|
||||
#define MAXPATHLEN 242
|
||||
|
||||
typedef uintptr_t gsize;
|
||||
typedef intptr_t gssize;
|
||||
typedef int pid_t;
|
||||
|
||||
#define G_DIR_SEPARATOR '\\'
|
||||
#define G_DIR_SEPARATOR_S "\\"
|
||||
#define G_SEARCHPATH_SEPARATOR_S ";"
|
||||
#define G_SEARCHPATH_SEPARATOR ';'
|
||||
#define G_GSIZE_FORMAT "d"
|
||||
#define GPOINTER_TO_INT(ptr) ((gint)(intptr_t) (ptr))
|
||||
#define GPOINTER_TO_UINT(ptr) ((guint)(intptr_t) (ptr))
|
||||
#define GINT_TO_POINTER(v) ((gpointer)(intptr_t) (v))
|
||||
#define GUINT_TO_POINTER(v) ((gpointer)(intptr_t) (v))
|
||||
|
||||
#define STDOUT_FILENO (int)(intptr_t)stdout
|
||||
#define STDERR_FILENO (int)(intptr_t)stderr
|
||||
|
||||
/* FIXME: what should this be ?*/
|
||||
#define X_OK 4 /* This is really read */
|
||||
#define WNOHANG 1
|
||||
#define F_SETFD 1
|
||||
#define FD_CLOEXEC 1
|
||||
|
||||
#undef inline
|
||||
#define inline __inline
|
||||
|
||||
#define strtok_r strtok_s
|
||||
|
||||
#undef G_HAVE_UNISTD_H
|
||||
#undef G_HAVE_SYS_TIME_H
|
||||
#undef G_HAVE_SYS_WAIT_H
|
||||
#undef G_HAVE_PWD_H
|
||||
#undef G_HAVE_STRNDUP
|
||||
#define G_HAVE_GETOPT_H 1
|
||||
|
||||
/* disable the following warnings
|
||||
* C4100: The formal parameter is not referenced in the body of the function. The unreferenced parameter is ignored.
|
||||
* C4127: conditional expression is constant
|
||||
*/
|
||||
#pragma warning(disable:4100 4127)
|
||||
#endif
|
||||
|
||||
typedef void * GPid;
|
||||
#endif
|
||||
@@ -1,11 +1,3 @@
|
||||
#undef g_malloc
|
||||
#undef g_realloc
|
||||
#undef g_malloc0
|
||||
#undef g_calloc
|
||||
#undef g_try_malloc
|
||||
#undef g_try_realloc
|
||||
#undef g_memdup
|
||||
|
||||
#define g_array_append monoeg_g_array_append
|
||||
#define g_array_append_vals monoeg_g_array_append_vals
|
||||
#define g_array_free monoeg_g_array_free
|
||||
@@ -16,7 +8,6 @@
|
||||
#define g_array_set_size monoeg_g_array_set_size
|
||||
#define g_array_sized_new monoeg_g_array_sized_new
|
||||
#define g_ascii_strdown monoeg_g_ascii_strdown
|
||||
#define g_ascii_strdown_no_alloc monoeg_g_ascii_strdown_no_alloc
|
||||
#define g_ascii_strncasecmp monoeg_g_ascii_strncasecmp
|
||||
#define g_ascii_tolower monoeg_g_ascii_tolower
|
||||
#define g_ascii_xdigit_value monoeg_g_ascii_xdigit_value
|
||||
@@ -24,8 +15,6 @@
|
||||
#define g_byte_array_append monoeg_g_byte_array_append
|
||||
#define g_byte_array_free monoeg_g_byte_array_free
|
||||
#define g_byte_array_new monoeg_g_byte_array_new
|
||||
#define g_byte_array_set_size monoeg_g_byte_array_set_size
|
||||
#define g_calloc monoeg_g_calloc
|
||||
#define g_clear_error monoeg_g_clear_error
|
||||
#define g_convert monoeg_g_convert
|
||||
#define g_convert_error_quark monoeg_g_convert_error_quark
|
||||
@@ -36,7 +25,6 @@
|
||||
#define g_mkdir_with_parents monoeg_g_mkdir_with_parents
|
||||
#define g_direct_equal monoeg_g_direct_equal
|
||||
#define g_direct_hash monoeg_g_direct_hash
|
||||
#define g_ensure_directory_exists monoeg_g_ensure_directory_exists
|
||||
#define g_error_free monoeg_g_error_free
|
||||
#define g_error_new monoeg_g_error_new
|
||||
#define g_error_vnew monoeg_g_error_vnew
|
||||
@@ -60,7 +48,6 @@
|
||||
#define g_get_tmp_dir monoeg_g_get_tmp_dir
|
||||
#define g_get_user_name monoeg_g_get_user_name
|
||||
#define g_getenv monoeg_g_getenv
|
||||
#define g_hasenv monoeg_g_hasenv
|
||||
#define g_hash_table_destroy monoeg_g_hash_table_destroy
|
||||
#define g_hash_table_find monoeg_g_hash_table_find
|
||||
#define g_hash_table_foreach monoeg_g_hash_table_foreach
|
||||
@@ -68,7 +55,6 @@
|
||||
#define g_hash_table_foreach_steal monoeg_g_hash_table_foreach_steal
|
||||
#define g_hash_table_get_keys monoeg_g_hash_table_get_keys
|
||||
#define g_hash_table_get_values monoeg_g_hash_table_get_values
|
||||
#define g_hash_table_contains monoeg_g_hash_table_contains
|
||||
#define g_hash_table_insert_replace monoeg_g_hash_table_insert_replace
|
||||
#define g_hash_table_lookup monoeg_g_hash_table_lookup
|
||||
#define g_hash_table_lookup_extended monoeg_g_hash_table_lookup_extended
|
||||
@@ -121,9 +107,6 @@
|
||||
#define g_markup_parse_context_new monoeg_g_markup_parse_context_new
|
||||
#define g_markup_parse_context_parse monoeg_g_markup_parse_context_parse
|
||||
#define g_memdup monoeg_g_memdup
|
||||
#define g_mem_set_vtable monoeg_g_mem_set_vtable
|
||||
#define g_mem_get_vtable monoeg_g_mem_get_vtable
|
||||
#define g_mkdtemp monoeg_g_mkdtemp
|
||||
#define g_module_build_path monoeg_g_module_build_path
|
||||
#define g_module_close monoeg_g_module_close
|
||||
#define g_module_error monoeg_g_module_error
|
||||
@@ -135,18 +118,11 @@
|
||||
#define g_pattern_match_string monoeg_g_pattern_match_string
|
||||
#define g_pattern_spec_free monoeg_g_pattern_spec_free
|
||||
#define g_pattern_spec_new monoeg_g_pattern_spec_new
|
||||
#define g_async_safe_fgets monoeg_g_async_safe_fgets
|
||||
#define g_async_safe_fprintf monoeg_g_async_safe_fprintf
|
||||
#define g_async_safe_vfprintf monoeg_g_async_safe_vfprintf
|
||||
#define g_async_safe_printf monoeg_g_async_safe_printf
|
||||
#define g_async_safe_vprintf monoeg_g_async_safe_vprintf
|
||||
#define g_print monoeg_g_print
|
||||
#define g_printf monoeg_g_printf
|
||||
#define g_printv monoeg_g_printv
|
||||
#define g_printerr monoeg_g_printerr
|
||||
#define g_propagate_error monoeg_g_propagate_error
|
||||
#define g_ptr_array_add monoeg_g_ptr_array_add
|
||||
#define g_ptr_array_capacity monoeg_g_ptr_array_capacity
|
||||
#define g_ptr_array_foreach monoeg_g_ptr_array_foreach
|
||||
#define g_ptr_array_free monoeg_g_ptr_array_free
|
||||
#define g_ptr_array_new monoeg_g_ptr_array_new
|
||||
@@ -222,9 +198,12 @@
|
||||
#define g_string_append_unichar monoeg_g_string_append_unichar
|
||||
#define g_string_append_printf monoeg_g_string_append_printf
|
||||
#define g_string_append_vprintf monoeg_g_string_append_vprintf
|
||||
#define g_string_erase monoeg_g_string_erase
|
||||
#define g_string_free monoeg_g_string_free
|
||||
#define g_string_insert monoeg_g_string_insert
|
||||
#define g_string_new monoeg_g_string_new
|
||||
#define g_string_new_len monoeg_g_string_new_len
|
||||
#define g_string_prepend monoeg_g_string_prepend
|
||||
#define g_string_printf monoeg_g_string_printf
|
||||
#define g_string_set_size monoeg_g_string_set_size
|
||||
#define g_string_sized_new monoeg_g_string_sized_new
|
||||
@@ -234,7 +213,6 @@
|
||||
#define g_strlcpy monoeg_g_strlcpy
|
||||
#define g_strndup monoeg_g_strndup
|
||||
#define g_strnfill monoeg_g_strnfill
|
||||
#define g_strnlen monoeg_g_strnlen
|
||||
#define g_strreverse monoeg_g_strreverse
|
||||
#define g_strsplit monoeg_g_strsplit
|
||||
#define g_strsplit_set monoeg_g_strsplit_set
|
||||
@@ -258,9 +236,6 @@
|
||||
#define g_usleep monoeg_g_usleep
|
||||
#define g_utf16_to_ucs4 monoeg_g_utf16_to_ucs4
|
||||
#define g_utf16_to_utf8 monoeg_g_utf16_to_utf8
|
||||
#define g_utf16_ascii_equal monoeg_g_utf16_ascii_equal
|
||||
#define g_utf16_asciiz_equal monoeg_g_utf16_asciiz_equal
|
||||
#define g_utf8_jump_table monoeg_g_utf8_jump_table
|
||||
#define g_utf8_get_char monoeg_g_utf8_get_char
|
||||
#define g_utf8_offset_to_pointer monoeg_g_utf8_offset_to_pointer
|
||||
#define g_utf8_pointer_to_offset monoeg_g_utf8_pointer_to_offset
|
||||
@@ -276,12 +251,8 @@
|
||||
#define g_utf8_offset_to_pointer monoeg_g_utf8_offset_to_pointer
|
||||
#define g_utf8_pointer_to_offset monoeg_g_utf8_pointer_to_offset
|
||||
#define g_utf8_to_ucs4_fast monoeg_g_utf8_to_ucs4_fast
|
||||
#define g_vasprintf monoeg_g_vasprintf
|
||||
#define g_win32_getlocale monoeg_g_win32_getlocale
|
||||
#define g_assertion_disable_global monoeg_assertion_disable_global
|
||||
#define g_assert_abort monoeg_assert_abort
|
||||
#define g_assertion_message monoeg_assertion_message
|
||||
#define g_get_assertion_message monoeg_get_assertion_message
|
||||
#define g_malloc monoeg_malloc
|
||||
#define g_malloc0 monoeg_malloc0
|
||||
#define g_ptr_array_grow monoeg_ptr_array_grow
|
||||
@@ -291,7 +262,6 @@
|
||||
#define g_strdup monoeg_strdup
|
||||
#define g_ucs4_to_utf16_len monoeg_ucs4_to_utf16_len
|
||||
#define g_utf16_to_ucs4_len monoeg_utf16_to_ucs4_len
|
||||
#define g_utf16_len monoeg_utf16_len
|
||||
|
||||
#define g_ascii_strcasecmp monoeg_ascii_strcasecmp
|
||||
#define g_ascii_strup monoeg_ascii_strup
|
||||
@@ -299,7 +269,9 @@
|
||||
#define g_unichar_break_type monoeg_unichar_break_type
|
||||
#define g_unichar_isspace monoeg_unichar_isspace
|
||||
#define g_unichar_to_utf16 monoeg_unichar_to_utf16
|
||||
#define g_utf8_find_prev_char monoeg_utf8_find_prev_char
|
||||
#define g_utf8_get_char_validated monoeg_utf8_get_char_validated
|
||||
#define g_utf8_prev_char monoeg_utf8_prev_char
|
||||
#define g_utf8_to_ucs4 monoeg_utf8_to_ucs4
|
||||
|
||||
|
||||
@@ -307,5 +279,3 @@
|
||||
#define g_log_set_default_handler monoeg_log_set_default_handler
|
||||
#define g_set_print_handler monoeg_set_print_handler
|
||||
#define g_set_printerr_handler monoeg_set_printerr_handler
|
||||
|
||||
#define g_size_to_int monoeg_size_to_int
|
||||
@@ -25,7 +25,7 @@
|
||||
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
#include "config.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <glib.h>
|
||||
|
||||
@@ -25,12 +25,12 @@
|
||||
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
#include "config.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <glib.h>
|
||||
|
||||
GByteArray *
|
||||
g_byte_array_new (void)
|
||||
g_byte_array_new ()
|
||||
{
|
||||
return (GByteArray *) g_array_new (FALSE, TRUE, 1);
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
/*
|
||||
* gdate-unix.c: Date and time utility functions.
|
||||
*
|
||||
* Author:
|
||||
* Gonzalo Paniagua Javier ([email protected]
|
||||
*
|
||||
* (C) 2006 Novell, Inc.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining
|
||||
* a copy of this software and associated documentation files (the
|
||||
* "Software"), to deal in the Software without restriction, including
|
||||
* without limitation the rights to use, copy, modify, merge, publish,
|
||||
* distribute, sublicense, and/or sell copies of the Software, and to
|
||||
* permit persons to whom the Software is furnished to do so, subject to
|
||||
* the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be
|
||||
* included in all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
#include <stdio.h>
|
||||
#include <glib.h>
|
||||
#include <time.h>
|
||||
#include <errno.h>
|
||||
#include <sys/time.h>
|
||||
|
||||
void
|
||||
g_get_current_time (GTimeVal *result)
|
||||
{
|
||||
struct timeval tv;
|
||||
|
||||
g_return_if_fail (result != NULL);
|
||||
gettimeofday (&tv, NULL);
|
||||
result->tv_sec = tv.tv_sec;
|
||||
result->tv_usec = tv.tv_usec;
|
||||
}
|
||||
|
||||
void
|
||||
g_usleep (gulong microseconds)
|
||||
{
|
||||
struct timespec req, rem;
|
||||
|
||||
req.tv_sec = microseconds / 1000000;
|
||||
req.tv_nsec = (microseconds % 1000000) * 1000;
|
||||
|
||||
while (nanosleep (&req, &rem) == -1 && errno == EINTR)
|
||||
req = rem;
|
||||
}
|
||||
@@ -25,7 +25,6 @@
|
||||
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
#include "config.h"
|
||||
#include <stdio.h>
|
||||
#include <glib.h>
|
||||
|
||||
@@ -25,12 +25,10 @@
|
||||
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
#include "config.h"
|
||||
#include <glib.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <errno.h>
|
||||
#include "../utils/mono-errno.h"
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <unistd.h>
|
||||
@@ -44,20 +42,20 @@ struct _GDir {
|
||||
};
|
||||
|
||||
GDir *
|
||||
g_dir_open (const gchar *path, guint flags, GError **gerror)
|
||||
g_dir_open (const gchar *path, guint flags, GError **error)
|
||||
{
|
||||
GDir *dir;
|
||||
|
||||
g_return_val_if_fail (path != NULL, NULL);
|
||||
g_return_val_if_fail (gerror == NULL || *gerror == NULL, NULL);
|
||||
g_return_val_if_fail (error == NULL || *error == NULL, NULL);
|
||||
|
||||
(void) flags; /* this is not used */
|
||||
dir = g_new (GDir, 1);
|
||||
dir->dir = opendir (path);
|
||||
if (dir->dir == NULL) {
|
||||
if (gerror) {
|
||||
if (error) {
|
||||
gint err = errno;
|
||||
*gerror = g_error_new (G_LOG_DOMAIN, g_file_error_from_errno (err), strerror (err));
|
||||
*error = g_error_new (G_LOG_DOMAIN, g_file_error_from_errno (err), strerror (err));
|
||||
}
|
||||
g_free (dir);
|
||||
return NULL;
|
||||
@@ -114,7 +112,7 @@ g_mkdir_with_parents (const gchar *pathname, int mode)
|
||||
int rv;
|
||||
|
||||
if (!pathname || *pathname == '\0') {
|
||||
mono_set_errno (EINVAL);
|
||||
errno = EINVAL;
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -25,7 +25,6 @@
|
||||
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
#include "config.h"
|
||||
#include <glib.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
@@ -43,7 +42,7 @@ struct _GDir {
|
||||
};
|
||||
|
||||
GDir *
|
||||
g_dir_open (const gchar *path, guint flags, GError **gerror)
|
||||
g_dir_open (const gchar *path, guint flags, GError **error)
|
||||
{
|
||||
GDir *dir;
|
||||
gunichar2* path_utf16;
|
||||
@@ -51,19 +50,19 @@ g_dir_open (const gchar *path, guint flags, GError **gerror)
|
||||
WIN32_FIND_DATAW find_data;
|
||||
|
||||
g_return_val_if_fail (path != NULL, NULL);
|
||||
g_return_val_if_fail (gerror == NULL || *gerror == NULL, NULL);
|
||||
g_return_val_if_fail (error == NULL || *error == NULL, NULL);
|
||||
|
||||
dir = g_new0 (GDir, 1);
|
||||
path_utf16 = u8to16 (path);
|
||||
path_utf16_search = g_malloc ((wcslen(path_utf16) + 3)*sizeof(gunichar2));
|
||||
path_utf16_search = g_malloc ((wcslen((wchar_t *) path_utf16) + 3)*sizeof(gunichar2));
|
||||
wcscpy (path_utf16_search, path_utf16);
|
||||
wcscat (path_utf16_search, L"\\*");
|
||||
|
||||
dir->handle = FindFirstFileW (path_utf16_search, &find_data);
|
||||
if (dir->handle == INVALID_HANDLE_VALUE) {
|
||||
if (gerror) {
|
||||
if (error) {
|
||||
gint err = errno;
|
||||
*gerror = g_error_new (G_LOG_DOMAIN, g_file_error_from_errno (err), strerror (err));
|
||||
*error = g_error_new (G_LOG_DOMAIN, g_file_error_from_errno (err), strerror (err));
|
||||
}
|
||||
g_free (path_utf16_search);
|
||||
g_free (path_utf16);
|
||||
@@ -73,11 +72,11 @@ g_dir_open (const gchar *path, guint flags, GError **gerror)
|
||||
g_free (path_utf16_search);
|
||||
g_free (path_utf16);
|
||||
|
||||
while ((wcscmp (find_data.cFileName, L".") == 0) || (wcscmp (find_data.cFileName, L"..") == 0)) {
|
||||
while ((wcscmp ((wchar_t *) find_data.cFileName, L".") == 0) || (wcscmp ((wchar_t *) find_data.cFileName, L"..") == 0)) {
|
||||
if (!FindNextFileW (dir->handle, &find_data)) {
|
||||
if (gerror) {
|
||||
if (error) {
|
||||
gint err = errno;
|
||||
*gerror = g_error_new (G_LOG_DOMAIN, g_file_error_from_errno (err), strerror (err));
|
||||
*error = g_error_new (G_LOG_DOMAIN, g_file_error_from_errno (err), strerror (err));
|
||||
}
|
||||
g_free (dir);
|
||||
return NULL;
|
||||
@@ -112,7 +111,7 @@ g_dir_read_name (GDir *dir)
|
||||
dir->next = NULL;
|
||||
return dir->current;
|
||||
}
|
||||
} while ((wcscmp (find_data.cFileName, L".") == 0) || (wcscmp (find_data.cFileName, L"..") == 0));
|
||||
} while ((wcscmp ((wchar_t *) find_data.cFileName, L".") == 0) || (wcscmp ((wchar_t *) find_data.cFileName, L"..") == 0));
|
||||
|
||||
dir->next = u16to8 (find_data.cFileName);
|
||||
return dir->current;
|
||||
@@ -62,22 +62,21 @@ g_error_vnew (gpointer domain, gint code, const char *format, va_list ap)
|
||||
}
|
||||
|
||||
void
|
||||
g_clear_error (GError **gerror)
|
||||
g_clear_error (GError **error)
|
||||
{
|
||||
if (gerror && *gerror) {
|
||||
g_error_free (*gerror);
|
||||
*gerror = NULL;
|
||||
if (error && *error) {
|
||||
g_error_free (*error);
|
||||
*error = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
g_error_free (GError *gerror)
|
||||
g_error_free (GError *error)
|
||||
{
|
||||
if (!gerror)
|
||||
return;
|
||||
g_return_if_fail (error != NULL);
|
||||
|
||||
g_free (gerror->message);
|
||||
g_free (gerror);
|
||||
g_free (error->message);
|
||||
g_free (error);
|
||||
}
|
||||
|
||||
void
|
||||
@@ -50,7 +50,7 @@ int mkstemp (char *tmp_template);
|
||||
#define OPEN_FLAGS (O_RDONLY | O_LARGEFILE)
|
||||
#endif
|
||||
gboolean
|
||||
g_file_get_contents (const gchar *filename, gchar **contents, gsize *length, GError **gerror)
|
||||
g_file_get_contents (const gchar *filename, gchar **contents, gsize *length, GError **error)
|
||||
{
|
||||
gchar *str;
|
||||
int fd;
|
||||
@@ -60,7 +60,7 @@ g_file_get_contents (const gchar *filename, gchar **contents, gsize *length, GEr
|
||||
|
||||
g_return_val_if_fail (filename != NULL, FALSE);
|
||||
g_return_val_if_fail (contents != NULL, FALSE);
|
||||
g_return_val_if_fail (gerror == NULL || *gerror == NULL, FALSE);
|
||||
g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
|
||||
|
||||
*contents = NULL;
|
||||
if (length)
|
||||
@@ -68,17 +68,17 @@ g_file_get_contents (const gchar *filename, gchar **contents, gsize *length, GEr
|
||||
|
||||
fd = open (filename, OPEN_FLAGS);
|
||||
if (fd == -1) {
|
||||
if (gerror != NULL) {
|
||||
if (error != NULL) {
|
||||
int err = errno;
|
||||
*gerror = g_error_new (G_LOG_DOMAIN, g_file_error_from_errno (err), "Error opening file");
|
||||
*error = g_error_new (G_LOG_DOMAIN, g_file_error_from_errno (err), "Error opening file");
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (fstat (fd, &st) != 0) {
|
||||
if (gerror != NULL) {
|
||||
if (error != NULL) {
|
||||
int err = errno;
|
||||
*gerror = g_error_new (G_LOG_DOMAIN, g_file_error_from_errno (err), "Error in fstat()");
|
||||
*error = g_error_new (G_LOG_DOMAIN, g_file_error_from_errno (err), "Error in fstat()");
|
||||
}
|
||||
close (fd);
|
||||
return FALSE;
|
||||
@@ -94,61 +94,50 @@ g_file_get_contents (const gchar *filename, gchar **contents, gsize *length, GEr
|
||||
} while ((nread > 0 && offset < st.st_size) || (nread == -1 && errno == EINTR));
|
||||
|
||||
close (fd);
|
||||
|
||||
#ifdef G_OS_WIN32
|
||||
// Windows defaults to O_TEXT for opened files, meaning that st_size can be larger than
|
||||
// what's actually read into str due to new line conversion.
|
||||
g_assert (offset <= st.st_size);
|
||||
str [offset] = '\0';
|
||||
if (length)
|
||||
*length = offset;
|
||||
#else
|
||||
str [st.st_size] = '\0';
|
||||
if (length) {
|
||||
*length = st.st_size;
|
||||
}
|
||||
#endif
|
||||
|
||||
*contents = str;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
gint
|
||||
g_file_open_tmp (const gchar *tmpl, gchar **name_used, GError **gerror)
|
||||
g_file_open_tmp (const gchar *tmpl, gchar **name_used, GError **error)
|
||||
{
|
||||
const static gchar *default_tmpl = ".XXXXXX";
|
||||
gchar *t;
|
||||
gint fd;
|
||||
size_t len;
|
||||
|
||||
g_return_val_if_fail (gerror == NULL || *gerror == NULL, -1);
|
||||
g_return_val_if_fail (error == NULL || *error == NULL, -1);
|
||||
|
||||
if (tmpl == NULL)
|
||||
tmpl = default_tmpl;
|
||||
|
||||
if (strchr (tmpl, G_DIR_SEPARATOR) != NULL) {
|
||||
if (gerror) {
|
||||
*gerror = g_error_new (G_LOG_DOMAIN, 24, "Template should not have any " G_DIR_SEPARATOR_S);
|
||||
if (error) {
|
||||
*error = g_error_new (G_LOG_DOMAIN, 24, "Template should not have any " G_DIR_SEPARATOR_S);
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
len = strlen (tmpl);
|
||||
if (len < 6 || strcmp (tmpl + len - 6, "XXXXXX")) {
|
||||
if (gerror) {
|
||||
*gerror = g_error_new (G_LOG_DOMAIN, 24, "Template should end with XXXXXX");
|
||||
if (error) {
|
||||
*error = g_error_new (G_LOG_DOMAIN, 24, "Template should end with XXXXXX");
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
t = g_build_filename (g_get_tmp_dir (), tmpl, (const char*)NULL);
|
||||
t = g_build_filename (g_get_tmp_dir (), tmpl, NULL);
|
||||
|
||||
fd = mkstemp (t);
|
||||
|
||||
if (fd == -1) {
|
||||
if (gerror) {
|
||||
if (error) {
|
||||
int err = errno;
|
||||
*gerror = g_error_new (G_LOG_DOMAIN, g_file_error_from_errno (err), "Error in mkstemp()");
|
||||
*error = g_error_new (G_LOG_DOMAIN, g_file_error_from_errno (err), "Error in mkstemp()");
|
||||
}
|
||||
g_free (t);
|
||||
return -1;
|
||||
@@ -165,6 +154,15 @@ g_file_open_tmp (const gchar *tmpl, gchar **name_used, GError **gerror)
|
||||
gchar *
|
||||
g_get_current_dir (void)
|
||||
{
|
||||
#ifdef __native_client__
|
||||
char *buffer;
|
||||
if ((buffer = g_getenv("NACL_PWD"))) {
|
||||
buffer = g_strdup(buffer);
|
||||
} else {
|
||||
buffer = g_strdup(".");
|
||||
}
|
||||
return buffer;
|
||||
#else
|
||||
int s = 32;
|
||||
char *buffer = NULL, *r;
|
||||
gboolean fail;
|
||||
@@ -183,4 +181,5 @@ g_get_current_dir (void)
|
||||
* so we return the buffer here since it has a pointer to the valid string
|
||||
*/
|
||||
return buffer;
|
||||
#endif
|
||||
}
|
||||
@@ -0,0 +1,88 @@
|
||||
/*
|
||||
* File utility functions.
|
||||
*
|
||||
* Author:
|
||||
* Gonzalo Paniagua Javier ([email protected])
|
||||
*
|
||||
* (C) 2006 Novell, Inc.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining
|
||||
* a copy of this software and associated documentation files (the
|
||||
* "Software"), to deal in the Software without restriction, including
|
||||
* without limitation the rights to use, copy, modify, merge, publish,
|
||||
* distribute, sublicense, and/or sell copies of the Software, and to
|
||||
* permit persons to whom the Software is furnished to do so, subject to
|
||||
* the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be
|
||||
* included in all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
#include <config.h>
|
||||
#include <glib.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <errno.h>
|
||||
#include <fcntl.h>
|
||||
|
||||
#ifdef HAVE_UNISTD_H
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
gboolean
|
||||
g_file_test (const gchar *filename, GFileTest test)
|
||||
{
|
||||
struct stat st;
|
||||
gboolean have_stat;
|
||||
|
||||
if (filename == NULL || test == 0)
|
||||
return FALSE;
|
||||
|
||||
have_stat = FALSE;
|
||||
|
||||
if ((test & G_FILE_TEST_EXISTS) != 0) {
|
||||
if (access (filename, F_OK) == 0)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
if ((test & G_FILE_TEST_IS_EXECUTABLE) != 0) {
|
||||
if (access (filename, X_OK) == 0)
|
||||
return TRUE;
|
||||
}
|
||||
if ((test & G_FILE_TEST_IS_SYMLINK) != 0) {
|
||||
have_stat = (lstat (filename, &st) == 0);
|
||||
if (have_stat && S_ISLNK (st.st_mode))
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
if ((test & G_FILE_TEST_IS_REGULAR) != 0) {
|
||||
if (!have_stat)
|
||||
have_stat = (stat (filename, &st) == 0);
|
||||
if (have_stat && S_ISREG (st.st_mode))
|
||||
return TRUE;
|
||||
}
|
||||
if ((test & G_FILE_TEST_IS_DIR) != 0) {
|
||||
if (!have_stat)
|
||||
have_stat = (stat (filename, &st) == 0);
|
||||
if (have_stat && S_ISDIR (st.st_mode))
|
||||
return TRUE;
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
gchar *
|
||||
g_mkdtemp (char *tmp_template)
|
||||
{
|
||||
char *template_copy = g_strdup (tmp_template);
|
||||
|
||||
return mkdtemp (template_copy);
|
||||
}
|
||||
@@ -114,8 +114,11 @@ g_file_test (const gchar *filename, GFileTest test)
|
||||
}
|
||||
|
||||
if ((test & G_FILE_TEST_IS_EXECUTABLE) != 0) {
|
||||
/* Testing executable permission on Windows is hard, and this is unused, treat as EXISTS for now. */
|
||||
return TRUE;
|
||||
size_t len = strlen (filename);
|
||||
if (len > 4 && strcmp (filename + len-3, "exe"))
|
||||
return TRUE;
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if ((test & G_FILE_TEST_IS_REGULAR) != 0) {
|
||||
@@ -36,7 +36,7 @@
|
||||
#endif
|
||||
#include <errno.h>
|
||||
|
||||
static gpointer error_quark = (gpointer)"FileError";
|
||||
static gpointer error_quark = "FileError";
|
||||
|
||||
gpointer
|
||||
g_file_error_quark (void)
|
||||
@@ -123,7 +123,7 @@ g_file_set_contents (const gchar *filename, const gchar *contents, gssize length
|
||||
else
|
||||
name++;
|
||||
|
||||
path = g_strdup_printf (TMP_FILE_FORMAT, (int)(name - filename), filename, name);
|
||||
path = g_strdup_printf (TMP_FILE_FORMAT, name - filename, filename, name);
|
||||
if (!(fp = fopen (path, "wb"))) {
|
||||
g_set_error (err, G_FILE_ERROR, g_file_error_from_errno (errno), "%s", g_strerror (errno));
|
||||
g_free (path);
|
||||
@@ -25,11 +25,9 @@
|
||||
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
#include "config.h"
|
||||
#include <stdio.h>
|
||||
#include <math.h>
|
||||
#include <glib.h>
|
||||
#include <eglib-remap.h> // Remove the cast macros and restore the rename macros.
|
||||
|
||||
typedef struct _Slot Slot;
|
||||
|
||||
@@ -305,14 +303,6 @@ g_hash_table_size (GHashTable *hash)
|
||||
return hash->in_use;
|
||||
}
|
||||
|
||||
gboolean
|
||||
g_hash_table_contains (GHashTable *hash, gconstpointer key)
|
||||
{
|
||||
g_return_val_if_fail (key != NULL, FALSE);
|
||||
|
||||
return g_hash_table_lookup_extended (hash, key, NULL, NULL);
|
||||
}
|
||||
|
||||
gpointer
|
||||
g_hash_table_lookup (GHashTable *hash, gconstpointer key)
|
||||
{
|
||||
@@ -555,9 +545,8 @@ void
|
||||
g_hash_table_destroy (GHashTable *hash)
|
||||
{
|
||||
int i;
|
||||
|
||||
if (!hash)
|
||||
return;
|
||||
|
||||
g_return_if_fail (hash != NULL);
|
||||
|
||||
for (i = 0; i < hash->table_size; i++){
|
||||
Slot *s, *next;
|
||||
@@ -666,7 +655,7 @@ g_int_hash (gconstpointer v1)
|
||||
gboolean
|
||||
g_str_equal (gconstpointer v1, gconstpointer v2)
|
||||
{
|
||||
return v1 == v2 || strcmp ((const char*)v1, (const char*)v2) == 0;
|
||||
return strcmp (v1, v2) == 0;
|
||||
}
|
||||
|
||||
guint
|
||||
@@ -22,14 +22,17 @@
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#endif
|
||||
|
||||
#include <glib.h>
|
||||
#include <string.h>
|
||||
#ifdef HAVE_ICONV_H
|
||||
#include <iconv.h>
|
||||
#endif
|
||||
#include <errno.h>
|
||||
#include "../utils/mono-errno.h"
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#define FORCE_INLINE(RET_TYPE) __forceinline RET_TYPE
|
||||
@@ -48,7 +51,7 @@ struct _GIConv {
|
||||
Decoder decode;
|
||||
Encoder encode;
|
||||
gunichar c;
|
||||
#ifdef HAVE_LIBICONV
|
||||
#ifdef HAVE_ICONV
|
||||
iconv_t cd;
|
||||
#endif
|
||||
};
|
||||
@@ -109,7 +112,7 @@ static struct {
|
||||
GIConv
|
||||
g_iconv_open (const char *to_charset, const char *from_charset)
|
||||
{
|
||||
#ifdef HAVE_LIBICONV
|
||||
#ifdef HAVE_ICONV
|
||||
iconv_t icd = (iconv_t) -1;
|
||||
#endif
|
||||
Decoder decoder = NULL;
|
||||
@@ -118,7 +121,7 @@ g_iconv_open (const char *to_charset, const char *from_charset)
|
||||
guint i;
|
||||
|
||||
if (!to_charset || !from_charset || !to_charset[0] || !from_charset[0]) {
|
||||
mono_set_errno (EINVAL);
|
||||
errno = EINVAL;
|
||||
|
||||
return (GIConv) -1;
|
||||
}
|
||||
@@ -132,11 +135,11 @@ g_iconv_open (const char *to_charset, const char *from_charset)
|
||||
}
|
||||
|
||||
if (!encoder || !decoder) {
|
||||
#ifdef HAVE_LIBICONV
|
||||
#ifdef HAVE_ICONV
|
||||
if ((icd = iconv_open (to_charset, from_charset)) == (iconv_t) -1)
|
||||
return (GIConv) -1;
|
||||
#else
|
||||
mono_set_errno (EINVAL);
|
||||
errno = EINVAL;
|
||||
|
||||
return (GIConv) -1;
|
||||
#endif
|
||||
@@ -147,7 +150,7 @@ g_iconv_open (const char *to_charset, const char *from_charset)
|
||||
cd->encode = encoder;
|
||||
cd->c = -1;
|
||||
|
||||
#ifdef HAVE_LIBICONV
|
||||
#ifdef HAVE_ICONV
|
||||
cd->cd = icd;
|
||||
#endif
|
||||
|
||||
@@ -157,7 +160,7 @@ g_iconv_open (const char *to_charset, const char *from_charset)
|
||||
int
|
||||
g_iconv_close (GIConv cd)
|
||||
{
|
||||
#ifdef HAVE_LIBICONV
|
||||
#ifdef HAVE_ICONV
|
||||
if (cd->cd != (iconv_t) -1)
|
||||
iconv_close (cd->cd);
|
||||
#endif
|
||||
@@ -176,7 +179,7 @@ g_iconv (GIConv cd, gchar **inbytes, gsize *inbytesleft,
|
||||
gunichar c;
|
||||
int rc = 0;
|
||||
|
||||
#ifdef HAVE_LIBICONV
|
||||
#ifdef HAVE_ICONV
|
||||
if (cd->cd != (iconv_t) -1) {
|
||||
/* Note: gsize may have a different size than size_t, so we need to
|
||||
remap inbytesleft and outbytesleft to size_t's. */
|
||||
@@ -251,32 +254,24 @@ g_iconv (GIConv cd, gchar **inbytes, gsize *inbytesleft,
|
||||
* Unicode encoders and decoders
|
||||
*/
|
||||
|
||||
static FORCE_INLINE (uint32_t)
|
||||
read_uint32_endian (unsigned char *inptr, unsigned endian)
|
||||
{
|
||||
if (endian == G_LITTLE_ENDIAN)
|
||||
return (inptr[3] << 24) | (inptr[2] << 16) | (inptr[1] << 8) | inptr[0];
|
||||
return (inptr[0] << 24) | (inptr[1] << 16) | (inptr[2] << 8) | inptr[3];
|
||||
}
|
||||
|
||||
static int
|
||||
decode_utf32_endian (char *inbuf, size_t inleft, gunichar *outchar, unsigned endian)
|
||||
decode_utf32be (char *inbuf, size_t inleft, gunichar *outchar)
|
||||
{
|
||||
unsigned char *inptr = (unsigned char *) inbuf;
|
||||
gunichar c;
|
||||
|
||||
if (inleft < 4) {
|
||||
mono_set_errno (EINVAL);
|
||||
errno = EINVAL;
|
||||
return -1;
|
||||
}
|
||||
|
||||
c = read_uint32_endian (inptr, endian);
|
||||
c = (inptr[0] << 24) | (inptr[1] << 16) | (inptr[2] << 8) | inptr[3];
|
||||
|
||||
if (c >= 0xd800 && c < 0xe000) {
|
||||
mono_set_errno (EILSEQ);
|
||||
errno = EILSEQ;
|
||||
return -1;
|
||||
} else if (c >= 0x110000) {
|
||||
mono_set_errno (EILSEQ);
|
||||
errno = EILSEQ;
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -285,16 +280,30 @@ decode_utf32_endian (char *inbuf, size_t inleft, gunichar *outchar, unsigned end
|
||||
return 4;
|
||||
}
|
||||
|
||||
static int
|
||||
decode_utf32be (char *inbuf, size_t inleft, gunichar *outchar)
|
||||
{
|
||||
return decode_utf32_endian (inbuf, inleft, outchar, G_BIG_ENDIAN);
|
||||
}
|
||||
|
||||
static int
|
||||
decode_utf32le (char *inbuf, size_t inleft, gunichar *outchar)
|
||||
{
|
||||
return decode_utf32_endian (inbuf, inleft, outchar, G_LITTLE_ENDIAN);
|
||||
unsigned char *inptr = (unsigned char *) inbuf;
|
||||
gunichar c;
|
||||
|
||||
if (inleft < 4) {
|
||||
errno = EINVAL;
|
||||
return -1;
|
||||
}
|
||||
|
||||
c = (inptr[3] << 24) | (inptr[2] << 16) | (inptr[1] << 8) | inptr[0];
|
||||
|
||||
if (c >= 0xd800 && c < 0xe000) {
|
||||
errno = EILSEQ;
|
||||
return -1;
|
||||
} else if (c >= 0x110000) {
|
||||
errno = EILSEQ;
|
||||
return -1;
|
||||
}
|
||||
|
||||
*outchar = c;
|
||||
|
||||
return 4;
|
||||
}
|
||||
|
||||
static int
|
||||
@@ -303,7 +312,7 @@ encode_utf32be (gunichar c, char *outbuf, size_t outleft)
|
||||
unsigned char *outptr = (unsigned char *) outbuf;
|
||||
|
||||
if (outleft < 4) {
|
||||
mono_set_errno (E2BIG);
|
||||
errno = E2BIG;
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -321,7 +330,7 @@ encode_utf32le (gunichar c, char *outbuf, size_t outleft)
|
||||
unsigned char *outptr = (unsigned char *) outbuf;
|
||||
|
||||
if (outleft < 4) {
|
||||
mono_set_errno (E2BIG);
|
||||
errno = E2BIG;
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -333,27 +342,19 @@ encode_utf32le (gunichar c, char *outbuf, size_t outleft)
|
||||
return 4;
|
||||
}
|
||||
|
||||
static FORCE_INLINE (uint16_t)
|
||||
read_uint16_endian (unsigned char *inptr, unsigned endian)
|
||||
{
|
||||
if (endian == G_LITTLE_ENDIAN)
|
||||
return (inptr[1] << 8) | inptr[0];
|
||||
return (inptr[0] << 8) | inptr[1];
|
||||
}
|
||||
|
||||
static FORCE_INLINE (int)
|
||||
decode_utf16_endian (char *inbuf, size_t inleft, gunichar *outchar, unsigned endian)
|
||||
static int
|
||||
decode_utf16be (char *inbuf, size_t inleft, gunichar *outchar)
|
||||
{
|
||||
unsigned char *inptr = (unsigned char *) inbuf;
|
||||
gunichar2 c;
|
||||
gunichar u;
|
||||
|
||||
if (inleft < 2) {
|
||||
mono_set_errno (E2BIG);
|
||||
errno = EINVAL;
|
||||
return -1;
|
||||
}
|
||||
|
||||
u = read_uint16_endian (inptr, endian);
|
||||
u = (inptr[0] << 8) | inptr[1];
|
||||
|
||||
if (u < 0xd800) {
|
||||
/* 0x0000 -> 0xd7ff */
|
||||
@@ -362,14 +363,14 @@ decode_utf16_endian (char *inbuf, size_t inleft, gunichar *outchar, unsigned end
|
||||
} else if (u < 0xdc00) {
|
||||
/* 0xd800 -> 0xdbff */
|
||||
if (inleft < 4) {
|
||||
mono_set_errno (EINVAL);
|
||||
errno = EINVAL;
|
||||
return -2;
|
||||
}
|
||||
|
||||
c = read_uint16_endian (inptr + 2, endian);
|
||||
c = (inptr[2] << 8) | inptr[3];
|
||||
|
||||
if (c < 0xdc00 || c > 0xdfff) {
|
||||
mono_set_errno (EILSEQ);
|
||||
errno = EILSEQ;
|
||||
return -2;
|
||||
}
|
||||
|
||||
@@ -379,7 +380,7 @@ decode_utf16_endian (char *inbuf, size_t inleft, gunichar *outchar, unsigned end
|
||||
return 4;
|
||||
} else if (u < 0xe000) {
|
||||
/* 0xdc00 -> 0xdfff */
|
||||
mono_set_errno (EILSEQ);
|
||||
errno = EILSEQ;
|
||||
return -1;
|
||||
} else {
|
||||
/* 0xe000 -> 0xffff */
|
||||
@@ -389,31 +390,54 @@ decode_utf16_endian (char *inbuf, size_t inleft, gunichar *outchar, unsigned end
|
||||
}
|
||||
|
||||
static int
|
||||
decode_utf16be (char *inbuf, size_t inleft, gunichar *outchar)
|
||||
decode_utf16le (char *inbuf, size_t inleft, gunichar *outchar)
|
||||
{
|
||||
return decode_utf16_endian (inbuf, inleft, outchar, G_BIG_ENDIAN);
|
||||
unsigned char *inptr = (unsigned char *) inbuf;
|
||||
gunichar2 c;
|
||||
gunichar u;
|
||||
|
||||
if (inleft < 2) {
|
||||
errno = EINVAL;
|
||||
return -1;
|
||||
}
|
||||
|
||||
u = (inptr[1] << 8) | inptr[0];
|
||||
|
||||
if (u < 0xd800) {
|
||||
/* 0x0000 -> 0xd7ff */
|
||||
*outchar = u;
|
||||
return 2;
|
||||
} else if (u < 0xdc00) {
|
||||
/* 0xd800 -> 0xdbff */
|
||||
if (inleft < 4) {
|
||||
errno = EINVAL;
|
||||
return -2;
|
||||
}
|
||||
|
||||
c = (inptr[3] << 8) | inptr[2];
|
||||
|
||||
if (c < 0xdc00 || c > 0xdfff) {
|
||||
errno = EILSEQ;
|
||||
return -2;
|
||||
}
|
||||
|
||||
u = ((u - 0xd800) << 10) + (c - 0xdc00) + 0x0010000UL;
|
||||
*outchar = u;
|
||||
|
||||
return 4;
|
||||
} else if (u < 0xe000) {
|
||||
/* 0xdc00 -> 0xdfff */
|
||||
errno = EILSEQ;
|
||||
return -1;
|
||||
} else {
|
||||
/* 0xe000 -> 0xffff */
|
||||
*outchar = u;
|
||||
return 2;
|
||||
}
|
||||
}
|
||||
|
||||
static int
|
||||
decode_utf16le (char *inbuf, size_t inleft, gunichar *outchar)
|
||||
{
|
||||
return decode_utf16_endian (inbuf, inleft, outchar, G_LITTLE_ENDIAN);
|
||||
}
|
||||
|
||||
static FORCE_INLINE (void)
|
||||
write_uint16_endian (unsigned char *outptr, uint16_t c, unsigned endian)
|
||||
{
|
||||
if (endian == G_LITTLE_ENDIAN) {
|
||||
outptr[0] = c & 0xff;
|
||||
outptr[1] = (c >> 8) & 0xff;
|
||||
return;
|
||||
}
|
||||
outptr[0] = (c >> 8) & 0xff;
|
||||
outptr[1] = c & 0xff;
|
||||
}
|
||||
|
||||
static FORCE_INLINE (int)
|
||||
encode_utf16_endian (gunichar c, char *outbuf, size_t outleft, unsigned endian)
|
||||
encode_utf16be (gunichar c, char *outbuf, size_t outleft)
|
||||
{
|
||||
unsigned char *outptr = (unsigned char *) outbuf;
|
||||
gunichar2 ch;
|
||||
@@ -421,39 +445,69 @@ encode_utf16_endian (gunichar c, char *outbuf, size_t outleft, unsigned endian)
|
||||
|
||||
if (c < 0x10000) {
|
||||
if (outleft < 2) {
|
||||
mono_set_errno (E2BIG);
|
||||
errno = E2BIG;
|
||||
return -1;
|
||||
}
|
||||
|
||||
write_uint16_endian (outptr, c, endian);
|
||||
outptr[0] = (c >> 8) & 0xff;
|
||||
outptr[1] = c & 0xff;
|
||||
|
||||
return 2;
|
||||
} else {
|
||||
if (outleft < 4) {
|
||||
mono_set_errno (E2BIG);
|
||||
errno = E2BIG;
|
||||
return -1;
|
||||
}
|
||||
|
||||
c2 = c - 0x10000;
|
||||
|
||||
ch = (gunichar2) ((c2 >> 10) + 0xd800);
|
||||
write_uint16_endian (outptr, ch, endian);
|
||||
|
||||
outptr[0] = (ch >> 8) & 0xff;
|
||||
outptr[1] = ch & 0xff;
|
||||
|
||||
ch = (gunichar2) ((c2 & 0x3ff) + 0xdc00);
|
||||
write_uint16_endian (outptr + 2, ch, endian);
|
||||
outptr[2] = (ch >> 8) & 0xff;
|
||||
outptr[3] = ch & 0xff;
|
||||
|
||||
return 4;
|
||||
}
|
||||
}
|
||||
|
||||
static int
|
||||
encode_utf16be (gunichar c, char *outbuf, size_t outleft)
|
||||
{
|
||||
return encode_utf16_endian (c, outbuf, outleft, G_BIG_ENDIAN);
|
||||
}
|
||||
|
||||
static int
|
||||
encode_utf16le (gunichar c, char *outbuf, size_t outleft)
|
||||
{
|
||||
return encode_utf16_endian (c, outbuf, outleft, G_LITTLE_ENDIAN);
|
||||
unsigned char *outptr = (unsigned char *) outbuf;
|
||||
gunichar2 ch;
|
||||
gunichar c2;
|
||||
|
||||
if (c < 0x10000) {
|
||||
if (outleft < 2) {
|
||||
errno = E2BIG;
|
||||
return -1;
|
||||
}
|
||||
|
||||
outptr[0] = c & 0xff;
|
||||
outptr[1] = (c >> 8) & 0xff;
|
||||
|
||||
return 2;
|
||||
} else {
|
||||
if (outleft < 4) {
|
||||
errno = E2BIG;
|
||||
return -1;
|
||||
}
|
||||
|
||||
c2 = c - 0x10000;
|
||||
|
||||
ch = (gunichar2) ((c2 >> 10) + 0xd800);
|
||||
outptr[0] = ch & 0xff;
|
||||
outptr[1] = (ch >> 8) & 0xff;
|
||||
|
||||
ch = (gunichar2) ((c2 & 0x3ff) + 0xdc00);
|
||||
outptr[2] = ch & 0xff;
|
||||
outptr[3] = (ch >> 8) & 0xff;
|
||||
|
||||
return 4;
|
||||
}
|
||||
}
|
||||
|
||||
static FORCE_INLINE (int)
|
||||
@@ -470,7 +524,7 @@ decode_utf8 (char *inbuf, size_t inleft, gunichar *outchar)
|
||||
*outchar = u;
|
||||
return 1;
|
||||
} else if (u < 0xc2) {
|
||||
mono_set_errno (EILSEQ);
|
||||
errno = EILSEQ;
|
||||
return -1;
|
||||
} else if (u < 0xe0) {
|
||||
u &= 0x1f;
|
||||
@@ -488,12 +542,12 @@ decode_utf8 (char *inbuf, size_t inleft, gunichar *outchar)
|
||||
u &= 0x01;
|
||||
n = 6;
|
||||
} else {
|
||||
mono_set_errno (EILSEQ);
|
||||
errno = EILSEQ;
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (n > inleft) {
|
||||
mono_set_errno (EINVAL);
|
||||
errno = EINVAL;
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -542,7 +596,7 @@ encode_utf8 (gunichar c, char *outbuf, size_t outleft)
|
||||
}
|
||||
|
||||
if (outleft < n) {
|
||||
mono_set_errno (E2BIG);
|
||||
errno = E2BIG;
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -578,12 +632,12 @@ static int
|
||||
encode_latin1 (gunichar c, char *outbuf, size_t outleft)
|
||||
{
|
||||
if (outleft < 1) {
|
||||
mono_set_errno (E2BIG);
|
||||
errno = E2BIG;
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (c > 0xff) {
|
||||
mono_set_errno (EILSEQ);
|
||||
errno = EILSEQ;
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -597,7 +651,7 @@ encode_latin1 (gunichar c, char *outbuf, size_t outleft)
|
||||
* Simple conversion API
|
||||
*/
|
||||
|
||||
static gpointer error_quark = (gpointer)"ConvertError";
|
||||
static gpointer error_quark = "ConvertError";
|
||||
|
||||
gpointer
|
||||
g_convert_error_quark (void)
|
||||
@@ -830,7 +884,7 @@ g_utf8_to_ucs4_fast (const gchar *str, glong len, glong *items_written)
|
||||
}
|
||||
|
||||
static gunichar2 *
|
||||
eg_utf8_to_utf16_general (const gchar *str, glong len, glong *items_read, glong *items_written, gboolean include_nuls, gboolean replace_invalid_codepoints, GError **err)
|
||||
eg_utf8_to_utf16_general (const gchar *str, glong len, glong *items_read, glong *items_written, gboolean include_nuls, GError **err)
|
||||
{
|
||||
gunichar2 *outbuf, *outptr;
|
||||
size_t outlen = 0;
|
||||
@@ -861,12 +915,8 @@ eg_utf8_to_utf16_general (const gchar *str, glong len, glong *items_read, glong
|
||||
break;
|
||||
|
||||
if ((u = g_unichar_to_utf16 (c, NULL)) < 0) {
|
||||
if (replace_invalid_codepoints) {
|
||||
u = 2;
|
||||
} else {
|
||||
mono_set_errno (EILSEQ);
|
||||
goto error;
|
||||
}
|
||||
errno = EILSEQ;
|
||||
goto error;
|
||||
}
|
||||
|
||||
outlen += u;
|
||||
@@ -891,14 +941,7 @@ eg_utf8_to_utf16_general (const gchar *str, glong len, glong *items_read, glong
|
||||
if (c == 0 && !include_nuls)
|
||||
break;
|
||||
|
||||
u = g_unichar_to_utf16 (c, outptr);
|
||||
if ((u < 0) && replace_invalid_codepoints) {
|
||||
outptr[0] = 0xFFFD;
|
||||
outptr[1] = 0xFFFD;
|
||||
u = 2;
|
||||
}
|
||||
|
||||
outptr += u;
|
||||
outptr += g_unichar_to_utf16 (c, outptr);
|
||||
inleft -= n;
|
||||
inptr += n;
|
||||
}
|
||||
@@ -930,19 +973,13 @@ eg_utf8_to_utf16_general (const gchar *str, glong len, glong *items_read, glong
|
||||
gunichar2 *
|
||||
g_utf8_to_utf16 (const gchar *str, glong len, glong *items_read, glong *items_written, GError **err)
|
||||
{
|
||||
return eg_utf8_to_utf16_general (str, len, items_read, items_written, FALSE, FALSE, err);
|
||||
return eg_utf8_to_utf16_general (str, len, items_read, items_written, FALSE, err);
|
||||
}
|
||||
|
||||
gunichar2 *
|
||||
eg_utf8_to_utf16_with_nuls (const gchar *str, glong len, glong *items_read, glong *items_written, GError **err)
|
||||
{
|
||||
return eg_utf8_to_utf16_general (str, len, items_read, items_written, TRUE, FALSE, err);
|
||||
}
|
||||
|
||||
gunichar2 *
|
||||
eg_wtf8_to_utf16 (const gchar *str, glong len, glong *items_read, glong *items_written, GError **err)
|
||||
{
|
||||
return eg_utf8_to_utf16_general (str, len, items_read, items_written, TRUE, TRUE, err);
|
||||
return eg_utf8_to_utf16_general (str, len, items_read, items_written, TRUE, err);
|
||||
}
|
||||
|
||||
gunichar *
|
||||
+1078
File diff suppressed because it is too large.
Load diff
@@ -26,17 +26,16 @@
|
||||
*
|
||||
* (C) 2006 Novell, Inc.
|
||||
*/
|
||||
#include "config.h"
|
||||
#include <stdio.h>
|
||||
#include <glib.h>
|
||||
|
||||
GList*
|
||||
g_list_alloc (void)
|
||||
g_list_alloc ()
|
||||
{
|
||||
return g_new0 (GList, 1);
|
||||
}
|
||||
|
||||
static GList*
|
||||
static inline GList*
|
||||
new_node (GList *prev, gpointer data, GList *next)
|
||||
{
|
||||
GList *node = g_list_alloc ();
|
||||
@@ -50,7 +49,7 @@ new_node (GList *prev, gpointer data, GList *next)
|
||||
return node;
|
||||
}
|
||||
|
||||
static GList*
|
||||
static inline GList*
|
||||
disconnect_node (GList *node)
|
||||
{
|
||||
if (node->next)
|
||||
@@ -39,12 +39,11 @@
|
||||
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
#include "config.h"
|
||||
#include <stdio.h>
|
||||
#include <ctype.h>
|
||||
#include <glib.h>
|
||||
|
||||
#define set_error(msg, ...) do { if (gerror != NULL) *gerror = g_error_new (GINT_TO_POINTER (1), 1, msg, __VA_ARGS__); } while (0);
|
||||
#define set_error(msg, ...) do { if (error != NULL) *error = g_error_new (GINT_TO_POINTER (1), 1, msg, __VA_ARGS__); } while (0);
|
||||
|
||||
typedef enum {
|
||||
START,
|
||||
@@ -54,13 +53,13 @@ typedef enum {
|
||||
CLOSING_ELEMENT,
|
||||
COMMENT,
|
||||
SKIP_XML_DECLARATION
|
||||
} MonoGMarkupParseState;
|
||||
} ParseState;
|
||||
|
||||
struct _GMarkupParseContext {
|
||||
GMarkupParser parser;
|
||||
gpointer user_data;
|
||||
GDestroyNotify user_data_dnotify;
|
||||
MonoGMarkupParseState state;
|
||||
ParseState state;
|
||||
|
||||
/* Stores the name of the current element, so we can issue the end_element */
|
||||
GSList *level;
|
||||
@@ -128,24 +127,6 @@ my_isalpha (char c)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
my_isnamestartchar (char c)
|
||||
{
|
||||
/* NameStartChar from https://www.w3.org/TR/xml/#sec-common-syn excluding non-ASCII and ':' */
|
||||
if (my_isalpha (c) || c == '_')
|
||||
return TRUE;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
my_isnamechar (char c)
|
||||
{
|
||||
/* NameChar from https://www.w3.org/TR/xml/#sec-common-syn excluding non-ASCII and ':' */
|
||||
if (my_isalnum (c) || c == '_' || c == '-' || c == '.')
|
||||
return TRUE;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static const char *
|
||||
skip_space (const char *p, const char *end)
|
||||
{
|
||||
@@ -155,7 +136,7 @@ skip_space (const char *p, const char *end)
|
||||
}
|
||||
|
||||
static const char *
|
||||
parse_value (const char *p, const char *end, char **value, GError **gerror)
|
||||
parse_value (const char *p, const char *end, char **value, GError **error)
|
||||
{
|
||||
const char *start;
|
||||
int l;
|
||||
@@ -185,9 +166,8 @@ parse_name (const char *p, const char *end, char **value)
|
||||
const char *start = p;
|
||||
int l;
|
||||
|
||||
if (p < end && my_isnamestartchar (*p))
|
||||
for (; p < end && my_isnamechar (*p); p++)
|
||||
;
|
||||
for (; p < end && my_isalnum (*p); p++)
|
||||
;
|
||||
if (p == end)
|
||||
return end;
|
||||
|
||||
@@ -201,7 +181,7 @@ parse_name (const char *p, const char *end, char **value)
|
||||
}
|
||||
|
||||
static const char *
|
||||
parse_attributes (const char *p, const char *end, char ***names, char ***values, GError **gerror, int *full_stop, int state)
|
||||
parse_attributes (const char *p, const char *end, char ***names, char ***values, GError **error, int *full_stop, int state)
|
||||
{
|
||||
int nnames = 0;
|
||||
|
||||
@@ -246,7 +226,7 @@ parse_attributes (const char *p, const char *end, char ***names, char ***values,
|
||||
return end;
|
||||
}
|
||||
|
||||
p = parse_value (p, end, &value, gerror);
|
||||
p = parse_value (p, end, &value, error);
|
||||
if (p == end){
|
||||
g_free (name);
|
||||
return p;
|
||||
@@ -281,7 +261,7 @@ destroy_parse_state (GMarkupParseContext *context)
|
||||
gboolean
|
||||
g_markup_parse_context_parse (GMarkupParseContext *context,
|
||||
const gchar *text, gssize text_len,
|
||||
GError **gerror)
|
||||
GError **error)
|
||||
{
|
||||
const char *p, *end;
|
||||
|
||||
@@ -329,12 +309,12 @@ g_markup_parse_context_parse (GMarkupParseContext *context,
|
||||
break;
|
||||
}
|
||||
|
||||
if (!my_isnamestartchar (*p)){
|
||||
if (!my_isalpha (*p)){
|
||||
set_error ("%s", "Expected an element name");
|
||||
goto fail;
|
||||
}
|
||||
|
||||
for (++p; p < end && my_isnamechar (*p); p++)
|
||||
for (++p; p < end && (my_isalnum (*p) || (*p == '.')); p++)
|
||||
;
|
||||
if (p == end){
|
||||
set_error ("%s", "Expected an element");
|
||||
@@ -348,14 +328,14 @@ g_markup_parse_context_parse (GMarkupParseContext *context,
|
||||
set_error ("%s", "Unfinished element");
|
||||
goto fail;
|
||||
}
|
||||
p = parse_attributes (p, end, &names, &values, gerror, &full_stop, context->state);
|
||||
p = parse_attributes (p, end, &names, &values, error, &full_stop, context->state);
|
||||
if (p == end){
|
||||
if (names != NULL) {
|
||||
g_strfreev (names);
|
||||
g_strfreev (values);
|
||||
}
|
||||
/* Only set the error if parse_attributes did not */
|
||||
if (gerror != NULL && *gerror == NULL)
|
||||
if (error != NULL && *error == NULL)
|
||||
set_error ("%s", "Unfinished sequence");
|
||||
goto fail;
|
||||
}
|
||||
@@ -371,22 +351,22 @@ g_markup_parse_context_parse (GMarkupParseContext *context,
|
||||
context->parser.start_element (context, ename,
|
||||
(const gchar **) names,
|
||||
(const gchar **) values,
|
||||
context->user_data, gerror);
|
||||
context->user_data, error);
|
||||
|
||||
if (names != NULL){
|
||||
g_strfreev (names);
|
||||
g_strfreev (values);
|
||||
}
|
||||
|
||||
if (gerror != NULL && *gerror != NULL){
|
||||
if (error != NULL && *error != NULL){
|
||||
g_free (ename);
|
||||
goto fail;
|
||||
}
|
||||
|
||||
if (full_stop){
|
||||
if (context->parser.end_element != NULL && context->state == START_ELEMENT){
|
||||
context->parser.end_element (context, ename, context->user_data, gerror);
|
||||
if (gerror != NULL && *gerror != NULL){
|
||||
context->parser.end_element (context, ename, context->user_data, error);
|
||||
if (error != NULL && *error != NULL){
|
||||
g_free (ename);
|
||||
goto fail;
|
||||
}
|
||||
@@ -426,8 +406,8 @@ g_markup_parse_context_parse (GMarkupParseContext *context,
|
||||
case FLUSH_TEXT:
|
||||
if (context->parser.text != NULL && context->text != NULL){
|
||||
context->parser.text (context, context->text->str, context->text->len,
|
||||
context->user_data, gerror);
|
||||
if (gerror != NULL && *gerror != NULL)
|
||||
context->user_data, error);
|
||||
if (error != NULL && *error != NULL)
|
||||
goto fail;
|
||||
}
|
||||
|
||||
@@ -448,10 +428,10 @@ g_markup_parse_context_parse (GMarkupParseContext *context,
|
||||
goto fail;
|
||||
}
|
||||
|
||||
text = (char*)current->data;
|
||||
text = current->data;
|
||||
if (context->parser.end_element != NULL){
|
||||
context->parser.end_element (context, text, context->user_data, gerror);
|
||||
if (gerror != NULL && *gerror != NULL){
|
||||
context->parser.end_element (context, text, context->user_data, error);
|
||||
if (error != NULL && *error != NULL){
|
||||
g_free (text);
|
||||
goto fail;
|
||||
}
|
||||
@@ -473,15 +453,15 @@ g_markup_parse_context_parse (GMarkupParseContext *context,
|
||||
|
||||
return TRUE;
|
||||
fail:
|
||||
if (context->parser.error && gerror != NULL && *gerror)
|
||||
context->parser.error (context, *gerror, context->user_data);
|
||||
if (context->parser.error && error != NULL && *error)
|
||||
context->parser.error (context, *error, context->user_data);
|
||||
|
||||
destroy_parse_state (context);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
gboolean
|
||||
g_markup_parse_context_end_parse (GMarkupParseContext *context, GError **gerror)
|
||||
g_markup_parse_context_end_parse (GMarkupParseContext *context, GError **error)
|
||||
{
|
||||
g_return_val_if_fail (context != NULL, FALSE);
|
||||
|
||||
@@ -29,11 +29,6 @@
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <glib.h>
|
||||
#include <eglib-remap.h> // Remove the cast macros and restore the rename macros.
|
||||
#undef malloc
|
||||
#undef realloc
|
||||
#undef free
|
||||
#undef calloc
|
||||
|
||||
#if defined (ENABLE_OVERRIDABLE_ALLOCATORS)
|
||||
|
||||
@@ -48,24 +43,12 @@ g_mem_set_vtable (GMemVTable* vtable)
|
||||
sGMemVTable.free = vtable->free ? vtable->free : free;
|
||||
}
|
||||
|
||||
void
|
||||
g_mem_get_vtable (GMemVTable* vtable)
|
||||
{
|
||||
*vtable = sGMemVTable;
|
||||
}
|
||||
|
||||
#define G_FREE_INTERNAL sGMemVTable.free
|
||||
#define G_REALLOC_INTERNAL sGMemVTable.realloc
|
||||
#define G_CALLOC_INTERNAL sGMemVTable.calloc
|
||||
#define G_MALLOC_INTERNAL sGMemVTable.malloc
|
||||
#else
|
||||
|
||||
void
|
||||
g_mem_get_vtable (GMemVTable* vtable)
|
||||
{
|
||||
memset (vtable, 0, sizeof (*vtable));
|
||||
}
|
||||
|
||||
void
|
||||
g_mem_set_vtable (GMemVTable* vtable)
|
||||
{
|
||||
@@ -128,7 +111,7 @@ gpointer g_calloc (gsize n, gsize x)
|
||||
gpointer ptr;
|
||||
if (!x || !n)
|
||||
return 0;
|
||||
ptr = G_CALLOC_INTERNAL (n, x);
|
||||
ptr = G_CALLOC_INTERNAL (n, x);
|
||||
if (ptr)
|
||||
return ptr;
|
||||
g_error ("Could not allocate %i (%i * %i) bytes", x*n, n, x);
|
||||
@@ -127,7 +127,7 @@ get_pw_data (void)
|
||||
{
|
||||
#ifdef HAVE_GETPWUID_R
|
||||
struct passwd pw;
|
||||
struct passwd *result = NULL;
|
||||
struct passwd *result;
|
||||
char buf [4096];
|
||||
#endif
|
||||
|
||||
@@ -145,7 +145,7 @@ get_pw_data (void)
|
||||
|
||||
#ifdef HAVE_GETPWUID_R
|
||||
if (home_dir == NULL || user_name == NULL) {
|
||||
if (getpwuid_r (getuid (), &pw, buf, 4096, &result) == 0 && result) {
|
||||
if (getpwuid_r (getuid (), &pw, buf, 4096, &result) == 0) {
|
||||
if (home_dir == NULL)
|
||||
home_dir = g_strdup (pw.pw_dir);
|
||||
if (user_name == NULL)
|
||||
@@ -169,7 +169,7 @@ g_get_home_dir (void)
|
||||
return home_dir;
|
||||
}
|
||||
|
||||
const gchar *
|
||||
const char *
|
||||
g_get_user_name (void)
|
||||
{
|
||||
get_pw_data ();
|
||||
File renamed without changes.
@@ -53,8 +53,7 @@ g_getenv(const gchar *variable)
|
||||
gint32 buffer_size = 1024;
|
||||
gint32 retval;
|
||||
var = u8to16(variable);
|
||||
// FIXME This should loop in case another thread is growing the data.
|
||||
buffer = g_new (gunichar2, buffer_size);
|
||||
buffer = g_malloc(buffer_size*sizeof(gunichar2));
|
||||
retval = GetEnvironmentVariableW (var, buffer, buffer_size);
|
||||
if (retval != 0) {
|
||||
if (retval > buffer_size) {
|
||||
@@ -134,12 +133,7 @@ g_get_known_folder_path (void)
|
||||
{
|
||||
gchar *folder_path = NULL;
|
||||
PWSTR profile_path = NULL;
|
||||
#ifdef __cplusplus
|
||||
REFGUID folderid = FOLDERID_Profile;
|
||||
#else
|
||||
REFGUID folderid = &FOLDERID_Profile;
|
||||
#endif
|
||||
HRESULT hr = SHGetKnownFolderPath (folderid, KF_FLAG_DEFAULT, NULL, &profile_path);
|
||||
HRESULT hr = SHGetKnownFolderPath (&FOLDERID_Profile, KF_FLAG_DEFAULT, NULL, &profile_path);
|
||||
if (SUCCEEDED(hr)) {
|
||||
folder_path = u16to8 (profile_path);
|
||||
CoTaskMemFree (profile_path);
|
||||
@@ -150,7 +144,7 @@ g_get_known_folder_path (void)
|
||||
|
||||
#else
|
||||
|
||||
static gchar *
|
||||
static inline gchar *
|
||||
g_get_known_folder_path (void)
|
||||
{
|
||||
return NULL;
|
||||
@@ -176,14 +170,14 @@ g_get_home_dir (void)
|
||||
sprintf (home_dir, "%s%s", drive, path);
|
||||
}
|
||||
}
|
||||
g_free ((void*)drive);
|
||||
g_free ((void*)path);
|
||||
g_free (drive);
|
||||
g_free (path);
|
||||
}
|
||||
|
||||
return home_dir;
|
||||
}
|
||||
|
||||
const gchar *
|
||||
const char *
|
||||
g_get_user_name (void)
|
||||
{
|
||||
const char * retName = g_getenv ("USER");
|
||||
@@ -80,45 +80,6 @@ g_module_symbol (GModule *module, const gchar *symbol_name, gpointer *symbol)
|
||||
return (*symbol != NULL);
|
||||
}
|
||||
|
||||
#if defined(HAVE_DLADDR)
|
||||
gboolean
|
||||
g_module_address (void *addr, char *file_name, size_t file_name_len,
|
||||
void **file_base, char *sym_name, size_t sym_name_len,
|
||||
void **sym_addr)
|
||||
{
|
||||
Dl_info dli;
|
||||
int ret = dladdr(addr, &dli);
|
||||
/* This zero-on-failure is unlike other Unix APIs. */
|
||||
if (ret == 0)
|
||||
return FALSE;
|
||||
/*
|
||||
* AIX/Win32 return non-const, so we use caller-allocated bufs instead
|
||||
*/
|
||||
if (file_name != NULL && file_name_len >= 1)
|
||||
g_strlcpy(file_name, dli.dli_fname, file_name_len);
|
||||
if (file_base != NULL)
|
||||
*file_base = dli.dli_fbase;
|
||||
if (sym_name != NULL && sym_name_len >= 1) {
|
||||
if (dli.dli_sname)
|
||||
g_strlcpy (sym_name, dli.dli_sname, sym_name_len);
|
||||
else
|
||||
sym_name [0] = '\0';
|
||||
}
|
||||
if (sym_addr != NULL)
|
||||
*sym_addr = dli.dli_saddr;
|
||||
return TRUE;
|
||||
}
|
||||
#elif !defined(_AIX)
|
||||
/* AIX has its own implementation that is long enough to be its own file. */
|
||||
gboolean
|
||||
g_module_address (void *addr, char *file_name, size_t file_name_len,
|
||||
void **file_base, char *sym_name, size_t sym_name_len,
|
||||
void **sym_addr)
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
#endif
|
||||
|
||||
const gchar *
|
||||
g_module_error (void)
|
||||
{
|
||||
@@ -139,9 +100,6 @@ g_module_close (GModule *module)
|
||||
}
|
||||
|
||||
#elif defined (G_OS_WIN32)
|
||||
#ifndef PSAPI_VERSION
|
||||
#define PSAPI_VERSION 2 // Use the Windows 7 or newer version more directly.
|
||||
#endif
|
||||
#include <windows.h>
|
||||
#include <psapi.h>
|
||||
|
||||
@@ -315,7 +273,7 @@ g_module_close (GModule *module)
|
||||
gchar *
|
||||
g_module_build_path (const gchar *directory, const gchar *module_name)
|
||||
{
|
||||
const char *lib_prefix = "";
|
||||
char *lib_prefix = "";
|
||||
|
||||
if (module_name == NULL)
|
||||
return NULL;
|
||||
@@ -323,8 +281,10 @@ g_module_build_path (const gchar *directory, const gchar *module_name)
|
||||
if (strncmp (module_name, "lib", 3) != 0)
|
||||
lib_prefix = LIBPREFIX;
|
||||
|
||||
if (directory && *directory)
|
||||
if (directory && *directory){
|
||||
|
||||
return g_strdup_printf ("%s/%s%s" LIBSUFFIX, directory, lib_prefix, module_name);
|
||||
}
|
||||
return g_strdup_printf ("%s%s" LIBSUFFIX, lib_prefix, module_name);
|
||||
}
|
||||
|
||||
File renamed without changes.
File renamed without changes.
Loaded 100 of 15094 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user