Skip to content

Commit 0d71d06

Browse files
committed
Add generated document for configurations and the docgen script.
1 parent 5aff148 commit 0d71d06

File tree

3 files changed

+835
-0
lines changed

3 files changed

+835
-0
lines changed

Documentation/README.md

+1
Original file line numberDiff line numberDiff line change
@@ -57,5 +57,6 @@ Decoder Rings
5757
Other Information
5858
=================
5959

60+
- [CLR Configuration Knobs](clr-configuration-knobs.md)
6061
- [MSDN Entry for the CLR](http://msdn.microsoft.com/library/8bs2ecf4.aspx)
6162
- [Wikipedia Entry for the CLR](http://en.wikipedia.org/wiki/Common_Language_Runtime)
+48
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
#!/usr/bin/env bash
2+
3+
# Requires git, GNU bash and GNU m4 to run.
4+
5+
DATE=`date +%D`;
6+
COMMIT=`git rev-parse --short HEAD`
7+
8+
if [ ! -r "$1" -o -z "$2" ]; then
9+
echo "usage: $0 <path to clrconfigvalues.h> <output file>"
10+
exit 1;
11+
fi
12+
13+
read -r -d '' M4SCRIPT << "EOF"
14+
changequote(`"', `"')
15+
define("CONFIG_DWORD_INFO", "`$2` | $4 | DWORD | patsubst("$1", "_.*", "") | $3 | ")dnl
16+
define("RETAIL_CONFIG_DWORD_INFO", "`$2` | $4 | DWORD | patsubst("$1", "_.*", "") | $3 | ")dnl
17+
define("CONFIG_DWORD_INFO_DIRECT_ACCESS", "`$2` | $3 | DWORD | patsubst("$1", "_.*", "") | | ")dnl
18+
define("RETAIL_CONFIG_DWORD_INFO_DIRECT_ACCESS", "`$2` | $3 | DWORD | patsubst("$1", "_.*", "") | | ")dnl
19+
define("CONFIG_STRING_INFO", "`$2` | $3 | STRING | patsubst("$1", "_.*", "") | | ")dnl
20+
define("RETAIL_CONFIG_STRING_INFO", "`$2` | $3 | STRING | patsubst("$1", "_.*", "") | | ")dnl
21+
define("CONFIG_STRING_INFO_DIRECT_ACCESS", "`$2` | $3 | STRING | patsubst("$1", "_.*", "") | | ")dnl
22+
define("RETAIL_CONFIG_STRING_INFO_DIRECT_ACCESS", "`$2` | $3 | STRING | patsubst("$1", "_.*", "") | | ")dnl
23+
define("CONFIG_DWORD_INFO_EX", "`$2` | $4 | DWORD | patsubst("$1", "_.*", "") | $3 | patsubst(patsubst("$5", "CLRConfig::", ""), "|", "/")")dnl
24+
define("RETAIL_CONFIG_DWORD_INFO_EX", "`$2` | $4 | DWORD | patsubst("$1", "_.*", "") | $3 | patsubst(patsubst("$5", "CLRConfig::", ""), "|", "/")")dnl
25+
define("CONFIG_STRING_INFO_EX", "`$2` | $3 | STRING | patsubst("$1", "_.*", "") | | patsubst(patsubst("$4", "CLRConfig::", ""), "|", "/")")dnl
26+
define("RETAIL_CONFIG_STRING_INFO_EX", "`$2` | $3 | STRING | patsubst("$1", "_.*", "") | | patsubst(patsubst("$4", "CLRConfig::", ""), "|", "/")")dnl
27+
define("W", "$1")dnl
28+
dnl
29+
#CLR Configuration Knobs
30+
31+
EOF
32+
33+
INFO="This Document is machine-generated from commit $COMMIT on ${DATE}. It might be out of date."
34+
35+
read -r -d '' HEADER << "EOF"
36+
When using these configurations from environment variables, the variable need to have `ComPlus_` prefix in its name. e.g. To set DumpJittedMethods to 1, add `ComPlus_DumpJittedMethods=1` to envvars.
37+
38+
See also [CLR Configurations](clr-configurations.md) for instructions.
39+
40+
Name | Description | Type | Class | Default Value | Flags
41+
-----|-------------|------|-------|---------------|-------
42+
EOF
43+
44+
45+
cat <(echo "$M4SCRIPT") <(echo) \
46+
<(echo "$INFO") <(echo) \
47+
<(echo "$HEADER") <(cat "$1" | sed "/^\/\//d" | sed "/^#/d" | sed "s/\\\\\"/'/g" | sed "/^$/d" ) \
48+
| m4 | sed "s/;$//" > "$2";

0 commit comments

Comments
 (0)