From a71d06f5397f0e77e205cfb46df8e0752cfef190 Mon Sep 17 00:00:00 2001 From: William S Fulton Date: Thu, 27 Nov 2003 21:15:40 +0000 Subject: [PATCH] Check that mcs is the mono C# compiler. Avoids falsely detecting mcs as another Unix utility git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@5428 626c5289-ae23-0410-ae9c-e8d60b6d4f22 --- SWIG/configure.in | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/SWIG/configure.in b/SWIG/configure.in index 519ca6cd0..22a9f3c73 100644 --- a/SWIG/configure.in +++ b/SWIG/configure.in @@ -1296,6 +1296,17 @@ if test -z "$CSHARPBIN" ; then AC_CHECK_PROGS(CSHARPCILINTERPRETER, ilrun) else if test "mcs" = "$CSHARPCOMPILER"; then + # Check that mcs is the C# compiler and not the Unix mcs utility by examining the output of 'mcs --version' + # The Mono compiler should emit: Mono C# compiler version a.b.c.d + csharp_version_raw=`(mcs --version) 2>/dev/null` + csharp_version_searched=`(mcs --version | sed -n "/C#\|Mono/p") 2>/dev/null` + CSHARPCOMPILER=""; + if test -n "$csharp_version_raw" ; then + if test "$csharp_version_raw" = "$csharp_version_searched" ; then + CSHARPCOMPILER="mcs" + fi + fi + # mono interpreter (ver 0.26 doesn't seem to work on Windows platforms) case $host in *-*-cygwin* | *-*-mingw*)