Index: config_office/configure.in
===================================================================
--- config_office/configure.in.orig	2006-01-08 20:48:38.000000000 +0100
+++ config_office/configure.in	2006-01-08 20:48:45.000000000 +0100
@@ -33,6 +33,9 @@ AC_ARG_WITH(gpc,
 [  --without-gpc           Use the internal polygon clipping code instead of
                           the external GPC polygon clipping library.
 ],,if test ! -e ../external/gpc/gpc.c && test ! -e ../external/gpc/gpc.h; then without_gpc=yes; fi)
+AC_ARG_ENABLE(mono,
+[  --enable-mono          Enables the compilation of the Mono bindings
+],,)
 AC_ARG_ENABLE(ldap,
 [  --disable-ldap       Disables the use of LDAP backend via Netscape/Mozilla or
                           OpenLDAP LDAP SDK
@@ -1357,6 +1360,8 @@ if test "$COMEX" = "8" -o "$COMEX" = "10
 	CSC_PATH=`cygpath -d "$CSC_PATH"`
 	CSC_PATH=`cygpath -u "$CSC_PATH"`
 	AC_PATH_PROG(CSC_PATH, csc.exe)
+	CSC="$CSC_PATH/csc.exe"
+	AL="$CSC_PATH/al.exe"
 
     dnl Check nmake.exe for MS VC Toolkit
     if test -n "$ENABLE_VCTK"; then
@@ -1407,10 +1412,61 @@ if test "$COMEX" = "8" -o "$COMEX" = "10
 	FRAME_HOME=`cygpath -u "$FRAME_HOME"`
 fi
 AC_SUBST(MIDL_PATH)
-AC_SUBST(CSC_PATH)
 AC_SUBST(NMAKE_PATH)
 AC_SUBST(FRAME_HOME)
 
+if test "$_os" = "Linux"; then
+	AC_MSG_CHECKING([whether to enable Mono bindings])
+	CSC_PATH=
+	CSC=
+	ENABLE_MONO=NO
+	if test "$enable_mono" != "no" ; then
+		if test "z$with_csc_path" != "z"; then
+	        	if test -x "$with_csc_path/mcs"; then
+	                	CSC_PATH="$with_csc_path"
+		       	fi
+	        	if test -x "$with_csc_path/bin/mcs"; then
+	                	CSC_PATH="$with_csc_path/bin"
+	        	fi
+		fi
+        	if test "z$CSC_PATH" = "z"; then
+			MCS=`which mcs 2>/dev/null`
+			test -z "$MCS" || CSC_PATH=`dirname $MCS`
+        	fi
+                AL="$CSC_PATH/al"
+		MCS="$CSC_PATH/mcs"
+		if test -x "$MCS" -a -x "$AL"; then
+			MCS_VERSION=`$MCS --version | cut -d" " -f5`
+			if test "`echo $MCS_VERSION | cut -d"." -f1`" -gt "1" || \
+			   test "`echo $MCS_VERSION | cut -d"." -f1`" = "1" -a \
+		    		"`echo $MCS_VERSION | cut -d"." -f2`" -ge "2" || \
+			   test "`echo $MCS_VERSION | cut -d"." -f1`" = "1" -a \
+			        "`echo $MCS_VERSION | cut -d"." -f2`" = "1" -a \
+		                "`echo $MCS_VERSION | cut -d"." -f3`" -ge "8"; then
+				ENABLE_MONO=YES
+				CSC=$MCS
+				AC_MSG_RESULT([yes])
+			else
+				if test -n "$enable_mono" ; then
+					AC_MSG_ERROR([no, mcs >= 1.1.8 is needed.])
+				fi
+				AC_MSG_RESULT([no])
+			fi
+		else
+			if test -n "$enable_mono"; then
+				AC_MSG_ERROR([mcs or al not found. Make sure they're in the path or use --with-csc-path])
+			fi
+			AC_MSG_RESULT([no])
+        	fi
+	else
+		AC_MSG_RESULT([no])
+	fi
+fi
+AC_SUBST(CSC_PATH)
+AC_SUBST(CSC)
+AC_SUBST(AL)
+AC_SUBST(ENABLE_MONO)
+
 dnl ===================================================================
 dnl Check if stdc headers are available excluding windows.
 dnl ===================================================================
Index: cli_ure/util/target.pmk
===================================================================
--- cli_ure/util/target.pmk.orig	2006-01-08 20:48:38.000000000 +0100
+++ cli_ure/util/target.pmk	2006-01-08 20:48:40.000000000 +0100
@@ -42,7 +42,7 @@ CSCFLAGS = -warnaserror+ -incremental- -
 .IF "$(product)" == ""
 CSCFLAGS += -checked+ -define:DEBUG -define:TRACE
 .ELSE
-CSCFLAGS += -o
+CSCFLAGS += -optimize
 .ENDIF
 
 .ELSE # debug
Index: cli_ure/util/makefile.pmk
===================================================================
--- cli_ure/util/makefile.pmk.orig	2006-01-08 20:48:38.000000000 +0100
+++ cli_ure/util/makefile.pmk	2006-01-08 20:48:40.000000000 +0100
@@ -35,7 +35,7 @@
 
 # no translation here anyway
 .IF "$(L10N_framework)"==""
-.IF "$(COM)$(COMEX)" == "MSC8" || "$(COM)$(COMEX)"== "MSC10"
+.IF "$(COM)$(COMEX)" == "MSC8" || "$(COM)$(COMEX)"== "MSC10" || "$(ENABLE_MONO)" == "YES"
 BUILD_FOR_CLI = "true"
 .ENDIF
 .ENDIF			# "L10N_framework"==""
Index: config_office/set_soenv.in
===================================================================
--- config_office/set_soenv.in.orig	2006-01-08 20:48:38.000000000 +0100
+++ config_office/set_soenv.in	2006-01-08 20:48:53.000000000 +0100
@@ -1600,6 +1600,10 @@ ToFile( "MKDEPENDSOLVER",    "TRUE",    
 # (c = comment, e = environment variable, a = alias )
 ToFile( "Platform dependent constant values.", $empty, "c" );
 ToFile( "SOLAR_JAVA",        $SOLAR_JAVA,        "e" );
+ToFile( "ENABLE_MONO",       "@ENABLE_MONO@",    "e" );
+ToFile( "CSC",               "@CSC@",            "e" );
+ToFile( "AL",                "@AL@",             "e" );
+ToFile( "CSC_PATH",          "@CSC_PATH@",       "e" );
 ToFile( "BIG_SVX",           $BIG_SVX,           "e" );
 ToFile( "COM",               $COM,               "e" );
 ToFile( "COMPATH",           $COMPATH,           "e" );
Index: cli_ure/prj/build.lst
===================================================================
--- cli_ure/prj/build.lst	2006-03-09 11:49:51.000000000 +0100
+++ cli_ure/prj/build.lst	2006-03-20 19:16:44.000000000 +0100
@@ -1,10 +1,11 @@
 ure	cli_ure	:	cppuhelper cppu sal codemaker offapi stoc NULL
 ure	cli_ure						usr1	-	all	ure_mkout NULL
 ure	cli_ure\version					nmake   -       all   ure_source_version NULL
-ure	cli_ure\source					nmake   -       w,vc7   ure_source_source NULL
-ure	cli_ure\source\basetypes			nmake	-	w,vc7	ure_source_basetypes ure_source_version ure_source_source.w NULL
+ure	cli_ure\source					nmake   -       all	ure_source_source NULL
+ure	cli_ure\source\basetypes			nmake	-	all	ure_source_basetypes ure_source_version ure_source_source.w NULL
+ure	cli_ure\source\bootstrap			nmake	-	u	ure_source_bootstrap ure_source_source ure_source_basetypes NULL
 ure	cli_ure\source\climaker				nmake	-	w,vc7	ure_source_climaker ure_source_basetypes.w NULL
-ure	cli_ure\unotypes				nmake	-	w,vc7	ure_unotypes ure_source_version ure_source_source.w ure_source_climaker.w NULL
-ure	cli_ure\source\ure				nmake	-	w,vc7	ure_source_ure ure_source_version ure_source_source.w ure_unotypes.w NULL
+ure	cli_ure\unotypes				nmake	-	w,vc7	ure_unotypes ure_source_version ure_source_source.w ure_source_climaker.w ure_source_basetypes.w NULL
+ure	cli_ure\source\ure				nmake	-	all	ure_source_ure ure_source_version ure_source_source.w ure_unotypes.w ure_source_basetypes.w ure_source_bootstrap.u NULL
 ure	cli_ure\source\native				nmake	-	w,vc7	ure_source_native ure_source_version ure_source_source.w ure_source_ure.w ure_unotypes.w NULL
-#ure	cli_ure\util					nmake	-	w,vc7	ure_util ure_source_ure.w ure_source_native.w NULL
+#ure	cli_ure\util					nmake	-	all	ure_util ure_source_ure.w ure_source_native.w NULL
Index: cli_ure/prj/d.lst
===================================================================
--- cli_ure/prj/d.lst.orig	2006-01-08 20:48:38.000000000 +0100
+++ cli_ure/prj/d.lst	2006-01-08 20:48:40.000000000 +0100
@@ -3,6 +3,7 @@
 ..\%__SRC%\bin\climaker.exe.config %_DEST%\bin%_EXT%\climaker.exe.config
 
 ..\%__SRC%\bin\cli_*.dll %_DEST%\bin%_EXT%\cli_*.dll
+..\%__SRC%\lib\libcli*.so %_DEST%\lib%_EXT%\libcli*.so
 ..\%__SRC%\bin\cli_*.pdb %_DEST%\bin%_EXT%\cli_*.pdb
 ..\%__SRC%\bin\cli_*.config %_DEST%\bin%_EXT%\cli_*.config
 ..\%__SRC%\bin\policy*.dll %_DEST%\bin%_EXT%\policy*.dll
Index: cli_ure/source/ure/makefile.mk
===================================================================
--- cli_ure/source/ure/makefile.mk.orig	2006-01-08 20:42:24.000000000 +0100
+++ cli_ure/source/ure/makefile.mk	2006-01-08 20:51:15.000000000 +0100
@@ -50,6 +50,7 @@ ECHOQUOTE='
 .ELSE
 ECHOQUOTE=
 .ENDIF
+# ' emacs is a fool
 
 .IF "$(BUILD_FOR_CLI)" != ""
 
@@ -93,7 +94,7 @@ $(BIN)$/cli_ure.dll : $(CSFILES) $(BIN)$
 
 #do not forget to deliver cli_ure.config. It is NOT embedded in the policy file.
 $(POLICY_ASSEMBLY_FILE) : $(BIN)$/cli_ure.config
-	+$(WRAPCMD) AL.exe -out:$@ \
+	+$(WRAPCMD) $(AL) -out:$@ \
 			-version:$(CLI_URE_POLICY_VERSION) \
 			-keyfile:$(BIN)$/cliuno.snk \
 			-link:$(BIN)$/cli_ure.config
--- cli_ure/source/basetypes/makefile.mk	2006-03-09 11:51:45.000000000 +0100
+++ cli_ure/source/basetypes/makefile.mk	2006-03-21 17:21:48.000000000 +0100
@@ -92,7 +92,7 @@ $(BIN)$/cli_basetypes.dll : $(CSFILES) $
 
 #do not forget to deliver cli_types.config. It is NOT embedded in the policy file.
 $(POLICY_ASSEMBLY_FILE) : $(BIN)$/cli_basetypes.config
-	+$(WRAPCMD) AL.exe -out:$@ \
+	+$(WRAPCMD) $(AL) -out:$@ \
 			-version:$(CLI_BASETYPES_POLICY_VERSION) \
 			-keyfile:$(BIN)$/cliuno.snk \
 			-link:$(BIN)$/cli_basetypes.config
--- cli_ure/source/native/makefile.mk	2006-03-09 11:53:11.000000000 +0100
+++ cli_ure/source/native/makefile.mk	2006-03-21 17:22:15.000000000 +0100
@@ -125,7 +125,7 @@ DEF1NAME = $(SHL1TARGET)
 
 #do not forget to deliver cli_cppuhelper.config. It is NOT embedded in the policy file.
 $(POLICY_ASSEMBLY_FILE) : $(BIN)$/cli_cppuhelper.config
-	+$(WRAPCMD) AL.exe -out:$@ \
+	+$(WRAPCMD) $(AL) -out:$@ \
 			-version:$(CLI_CPPUHELPER_POLICY_VERSION) \
 			-keyfile:$(BIN)$/cliuno.snk \
 			-link:$(BIN)$/cli_cppuhelper.config
