dotgnu-general
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [DotGNU]C# compiler command line parsing


From: Rhys Weatherley
Subject: Re: [DotGNU]C# compiler command line parsing
Date: Thu, 28 Mar 2002 19:31:42 +1000

Fergus Henderson wrote:

> One way to do this would be to just add support for Microsoft's
> command-line interface to the .NET and Mono C# compilers.  Another way
> to do it would be to define a Unix-like command-line syntax, and write
> a wrapper for Microsoft's csc that would convert the Unix-like syntax
> into Microsoft's syntax and then invoke csc.  Software written in C#
> could ship with this wrapper program included.

Portable.NET's C# compiler already uses the gcc syntax.
Attached is a script I wrote to wrap up "csc" and give it
the same gcc-like syntax, so as to improve interoperability.

Microsoft's syntax does not fit into a Unix environment very
well, because it uses '/' as a switch character.  I don't see
why we should dumb down our compilers, when a shell script
can be used to smarten up Microsoft's.

The only drawback with the script is that it only works in
Cygwin and Unix environments.  It doesn't work at the
raw Windows command prompt.  That could be easily fixed
by re-implementing the script in C or C#.

As another option, Portable.NET's "csant" tool, which is
a C-only variant of NAnt, supports csc, mcs, and cscc
syntax transparently.  The XML file describes what needs
to be compiled, and "csant" converts it into the correct
conventions depending upon which compiler has been
configured.  Environment variables or command-line
options are used to specify which compiler to use.

Cheers,

Rhys.

Attachment: mscsc.sh
Description: Bourne shell script


reply via email to

[Prev in Thread] Current Thread [Next in Thread]