[hyena] build: better guess for the C# compiler available



commit d421ec920b4a401731d0422d6c6d0a208c9c2e2a
Author: Dmitrii Petukhov <dimart sp gmail com>
Date:   Fri Jul 25 23:07:35 2014 +0400

    build: better guess for the C# compiler available
    
    There are some distributions that bundle only a limited set of class
    libraries to be able to meet size requirements better. Such is the case
    of Ubuntu, which normally ships with only the subset compiled for the
    4.0 version of the runtime.
    
    In this case, the user may install the default Mono SDK packages when
    asked by the configure script, which only includes the 4.0 compiler by
    default (dmcs). At that point, banshee can already be compiled, but
    the configure script would insist in requiring a 2.0 compiler. If the
    user installs it, compiles Banshee and launches the "run" target, she
    may get a runtime exception because of a runtime version mismatch, like
    in bgo#675113.
    
    This problem is commonly known, and there is a clear workaround for it:
    http://orangesquash.org.uk/~laney/blog/posts/2011/10/mono-gotcha/
    However it poses a small barrier of entry for new developers that try
    to compile and run banshee from sources for the first time.
    
    Now the configure script is smarter and tries to guess harder if there
    is a C# compiler, even one that targets a higher version of the runtime
    than the one that is required to compile banshee.
    
    This possibility is only enabled in case the Mono version found is 2.8
    or higher, because Mono 2.6.1 included the 4.0 profile only as a
    "preview" [1] and might not be stable enough.
    
    [1] http://www.mono-project.com/Release_Notes_Mono_2.6.4#C.23_Language
    
    (commit taken from Banshee 3d3f7899465ee46e634b53c236401f612dac1492)
    
    Signed-off-by: Andrés G. Aragoneses <knocte gmail com>

 build/m4/shamrock/mono.m4 |   14 ++++++++++++++
 configure.ac              |    2 +-
 2 files changed, 15 insertions(+), 1 deletions(-)
---
diff --git a/build/m4/shamrock/mono.m4 b/build/m4/shamrock/mono.m4
index 0087197..10c7eb3 100644
--- a/build/m4/shamrock/mono.m4
+++ b/build/m4/shamrock/mono.m4
@@ -8,6 +8,20 @@ AC_DEFUN([SHAMROCK_FIND_MONO_2_0_COMPILER],
        SHAMROCK_FIND_PROGRAM_OR_BAIL(MCS, gmcs)
 ])
 
+AC_DEFUN([SHAMROCK_FIND_MONO_2_0_COMPILER_OR_HIGHER],
+[
+    if pkg-config --atleast-version=2.8 mono; then
+        SHAMROCK_FIND_PROGRAM(MCS, dmcs)
+    fi
+    if test "x$MCS" = "x" ; then
+        SHAMROCK_FIND_PROGRAM(MCS, gmcs)
+    fi
+
+    if test "x$MCS" = "x" ; then
+        AC_MSG_ERROR([You need to install 'dmcs' or 'gmcs'])
+    fi
+])
+
 AC_DEFUN([SHAMROCK_FIND_MONO_4_0_COMPILER],
 [
        SHAMROCK_FIND_PROGRAM_OR_BAIL(MCS, dmcs)
diff --git a/configure.ac b/configure.ac
index 3282c7c..70b48f7 100644
--- a/configure.ac
+++ b/configure.ac
@@ -49,7 +49,7 @@ fi
 
 dnl Mono and gmcs
 SHAMROCK_CHECK_MONO_MODULE(2.8.2)
-SHAMROCK_FIND_MONO_2_0_COMPILER
+SHAMROCK_FIND_MONO_2_0_COMPILER_OR_HIGHER
 SHAMROCK_FIND_MONO_RUNTIME
 
 


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