In ilasm/codegen:
[mono.git] / man / mcs.1
old mode 100755 (executable)
new mode 100644 (file)
index 9183aca..9fe42ad
--- a/man/mcs.1
+++ b/man/mcs.1
@@ -1,6 +1,6 @@
 .TH mcs 1 "6 January 2001"
 .SH NAME 
-mcs \- Mono Compiler Suite.
+mcs, gmcs \- Mono Compiler Suite.
 .SH SYNOPSIS
 .B mcs 
 [option] [source-files]
@@ -11,6 +11,14 @@ compiler, and a set of source files.  Extra options or arguments can
 be provided in a response file.  Response files are referenced by
 prepending the @ symbol to the response file name.
 .PP
+The 
+.I mcs
+compiler is used to compile against the 1.x profile and implements
+C# 1.0 and 2.0 with the exception of generics and nullable types.  The
+.I gmcs
+compiler is used to compile against the 2.x profile and implements
+the complete C# 2.0 specification.
+.PP
 The Mono C# compiler accepts the same options than the Microsoft C#
 compiler does.  Those options can start with a slash or a dash
 (/checked is the same as -checked).  Additionally to this, the
@@ -31,6 +39,13 @@ Language Infrastructure virtual machine such as the Microsoft .NET
 runtime engine on Windows or the Mono runtime engine on Unix systems.
 Executables are not bound to a specific CPU or operating system.
 .PP
+The Mono C# compiler by default only references three assemblies:
+mscorlib.dll, System.dll and System.Xml.dll.   If you want to
+reference extra libraries you must manually specify them using the
+-pkg: command line option or the -r: command line option.
+Alternatively if you want to get all of the System libraries, you can
+use the -pkg:dotnet command line option.
+.PP
 .SH OPTIONS
 .TP
 .I \-\-about
@@ -51,9 +66,13 @@ the math operations unchecked (this is the default).
 Specifies the code page used to process the input files from the
 point it is specified on.  By default files will be processed in the
 Latin-1 code page.  The compiler will also automatically detect
-Unicode files that have an embedded byte mark at the beginning.   The
-special ID "utf8" can be used to switch to utf8 and the ID "reset"
-restores the automatic handling of code pages.
+Unicode files that have an embedded byte mark at the beginning.   
+.TP
+Other popular encodings are 28591 (Latin1), 1252 (iso-8859-1) and 65001 (UTF-8).
+.TP 
+MCS supports a couple of shorthands: "utf8" can be used to specify utf-8 instead
+of using the cryptic 65001 and "reset" restores the automatic handling of
+code pages.  These shorthands are not available on the Microsoft compiler.
 .TP
 .I \-define:SYMLIST, -d:SYMLIST
 Defines the symbol listed by the semi-colon separeted list SYMLIST
@@ -85,6 +104,10 @@ Default. Strongname (sign) the assembly using the strong name key file
 AssemblyDelaySign (false)] in your source code. Compiler option takes
 precedence over the attributes.
 .TP
+.I \-doc:FILE
+Extracts the C#/XML documentation from the source code and stores in in
+the given FILE.
+.TP
 .I \-\-expect-error X L
 The compiler will expect the code to generate an error 
 named `X' in line `L'.  This is only used by the test suite.
@@ -108,6 +131,25 @@ key containers. The option is equivalent to including [assembly:
 AssemblyKeyName ("CONTAINER")] in your source code. Compiler option 
 takes precedence over the attributes.
 .TP
+.I \-langversion:TEXT
+The option specifies the version of the language to use. The feature
+set is different in each C# version. This switch can be used to force
+the compiler to allow only a subset of the features.
+The possible values are:
+.nf
+
+Default - Instruct compiler to use the latest version. Equivalent
+is to omit the switch.
+
+ISO-1   - Restrict compiler to use only ISO standardized features.
+The usage of features such as generics, static classes, anonymous
+methods will lead to error.
+.Sp
+Notice that this flag only controls the language features available to
+the programmer, it does not control the kind of assemblies produced.
+Programs compiled with mcs will reference the 1.1 APIs, Programs
+compiled with gmcs reference the 2.0 APIs.
+.TP
 .I -lib:PATHLIST
 Each path specified in the comma-separated list will direct the
 compiler to look for libraries in that specified path.
@@ -132,6 +174,11 @@ compiler by default has references to the system assemblies.
 Makes the compiler ignore warnings specified in the comma-separeted
 list WARNLIST>
 .TP
+.I -optimize, -optimize+, -optimize-
+Controls whether to perform optimizations on the code.   -optimize and
+-optimize+ will turn on optimizations, -optimize- will turn it off.
+The default in mcs is to optimize+.
+.TP
 .I -out:FNAME, -o FNAME
 Names the output file to be generated.
 .TP
@@ -148,6 +195,13 @@ This is typically used with third party components, like this:
                $ mcs -pkg:gtk-sharp demo.cs
 .fi
 .TP
+.TP
+.I \-pkg:dotnet
+This will instruct the compiler to reference the System.* libraries
+available on a typical dotnet framework installation, notice that this
+does not include all of the Mono libraies, only the System.* ones.  This
+is a convenient shortcut for those porting code.
+.TP
 .I -resource:RESOURCE[,ID]
 Embeds to the given resource file.  The optional ID can be used to
 give a different name to the resource.  If not specified, the resource