Various mono related changes to facilitate GAC support.
[platform/upstream/dbus.git] / configure.in
index 887ef1c..2fe7d18 100644 (file)
@@ -185,32 +185,64 @@ AM_CONDITIONAL(DBUS_USE_GCJ, test x$enable_gcj = xyes)
 AM_PROG_LIBTOOL
 
 #### Look for mono
-AC_CHECK_TOOL(MCS, mcs)
-if test -z "$MCS" ; then
-     have_mcs=no
+MONO_REQUIRED_VERSION=0.91
+AC_SUBST(MONO_REQUIRED_VERSION)
+PKG_CHECK_MODULES(MONO_DEPENDENCY, mono >= $MONO_REQUIRED_VERSION, have_mono=true, have_mono=false)
+
+if test "x$have_mono" = "xtrue"; then
+if test `uname -s` = "Darwin"; then
+       AC_PATH_PROG(RUNTIME, mint, no)
+       AC_PATH_PROG(CSC, mcs, no)
+       LIB_PREFIX=
+    LIB_SUFFIX=.dylib
 else
-     have_mcs=yes
-     if test "x${MCSFLAGS-unset}" = xunset; then
-        MCSFLAGS="" ### put default MCSFLAGS here
-     fi
-     AC_SUBST(MCSFLAGS)
+       AC_PATH_PROG(RUNTIME, mono, no)
+       AC_PATH_PROG(CSC, mcs, no)
+       LIB_PREFIX=.so
+    LIB_SUFFIX=
 fi
-
-if test x$enable_mono = xauto ; then
-    if test x$have_mcs = xno ; then
-        enable_mono=no
-    else
-        enable_mono=yes
-    fi
+else
+AC_PATH_PROG(CSC, csc.exe, no)
+RUNTIME=
+LIB_PREFIX=
+LIB_SUFFIX=.dylib
 fi
 
 if test x$enable_mono = xyes; then
     if test x$have_mcs = xno ; then
        AC_MSG_ERROR([Building Mono bindings explicitly required, but mcs compiler not found])
     fi
+
+    ### Test for GACUTIL
+    AC_PATH_PROG(GACUTIL, gacutil, no)
+    if test "x$GACUTIL" = "xno" ; then
+        AC_MSG_ERROR([No gacutil tool found])
+    fi
+
+    AC_SUBST(GACUTIL)
 fi
 
-AM_CONDITIONAL(DBUS_USE_MCS, test x$enable_mono = xyes)
+if test x$enable_mono = xauto ; then
+    if test x$CSC = xno ; then
+        enable_mono=no
+    else
+       ### Test for GACUTIL
+       AC_PATH_PROG(GACUTIL, gacutil, no)
+       if test "x$GACUTIL" = "xno" ; then
+          enable_mono=no
+       else
+          enable_mono=yes
+       fi
+    fi
+fi
+
+AC_SUBST(RUNTIME)
+AC_SUBST(CSC)
+AC_SUBST(GACUTIL)
+AC_SUBST(LIB_PREFIX)
+AC_SUBST(LIB_SUFFIX)
+
+AM_CONDITIONAL(DBUS_USE_CSC, test x$enable_mono = xyes)
 
 #### Look for monodoc
 MONODOC_REQUIRED_VERSION=0.15
@@ -1059,6 +1091,8 @@ gcj/org/Makefile
 gcj/org/freedesktop/Makefile
 gcj/org/freedesktop/dbus/Makefile
 mono/Makefile
+mono/AssemblyInfo.cs
+mono/dbus-sharp.dll.config
 mono/example/Makefile
 mono/doc/Makefile
 bus/Makefile
@@ -1111,12 +1145,11 @@ fi
 
 if test x$enable_mono = xyes ; then
 echo \
-"        mcs:                    ${MCS}
-       mcsflags:                 ${MCSFLAGS}
+"        csc:                    ${CSC}
 "
 else
 echo \
-"        mcs:                      (not enabled)
+"        csc:                      (not enabled)
 "
 fi