Anonymous avatar Anonymous committed 956825c

Add the ability to use the gmcs command if present.

Comments (0)

Files changed (1)

 # -*- mode:python; coding:utf-8; -*-
 
-# Copyright (c) 2009 The SCons Foundation
+# Copyright (c) 2009-10 The SCons Foundation
 #
 # Permission is hereby granted, free of charge, to any person obtaining
 # a copy of this software and associated documentation files (the
 #  This C# Tool taken from http://www.scons.org/wiki/CsharpBuilder and amended
 #  by the patch from Issue 1912 at http://scons.tigris.org/issues/show_bug.cgi?id=1912
 
+#  Amended and extended by Russel Winder <russel.winder@concertant.com>
+
+#  On the SCons wiki page there are two distinct tools, one for the Microsoft C# system and one for Mono.
+#  This is an attempt to meld to two based initially on the Microsoft C# tool with amendmnets from the Mono
+#  tool.
+
 import os.path
 import SCons.Builder
 import SCons.Node.FS
     env['BUILDERS']['CLIRes'] = MsCliResBuilder
     env['BUILDERS']['CLITypeLib'] = MsCliTypeLibBuilder
     
-    env['CSC']          = 'csc'
+    env['CSC']          = env.WhereIs('gmcs') or 'csc'
     env['_CSCLIBS']     = "${_stripixes('-r:', CILLIBS, '', '-r', '', __env__)}"
     env['_CSCLIBPATH']  = "${_stripixes('-lib:', CILLIBPATH, '', '-r', '', __env__)}"
     env['CSCFLAGS']     = SCons.Util.CLVar('-nologo -noconfig')
     SConsEnvironment.PublisherPolicy = PublisherPolicy
     
 def exists(env):
-    return env.Detect('csc')
+    return env.Detect('csc') or env.Detect('gmcs')
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.