[Mono-list] Patch: MONO_ROOT environment variable in mono_set_rootdir()

Tim Haynes thaynes@openlinksw.com (Tim Haynes)
Tue, 22 Oct 2002 14:43:43 +0100


--=-=-=

Hi,

Another small patch is attached - this one adds use of the MONO_ROOT
environment variable in mono_set_rootdir().

Cheers,

~Tim
-- 
Product Development Consultant
OpenLink Software
Tel: +44 (0) 20 8681 7701
Web: <http://www.openlinksw.com>
Universal Data Access & Data Integration Technology Providers



--=-=-=
Content-Disposition: attachment; filename=mono_root.diff

Index: mono/os/unix/Makefile.am
===================================================================
RCS file: /mono/mono/mono/os/unix/Makefile.am,v
retrieving revision 1.4
diff -u -r1.4 Makefile.am
--- mono/os/unix/Makefile.am	19 Jul 2002 17:08:25 -0000	1.4
+++ mono/os/unix/Makefile.am	18 Oct 2002 09:17:05 -0000
@@ -1,5 +1,7 @@
-
-INCLUDES = -I$(top_srcdir)
+INCLUDES = 				\
+	-I$(top_srcdir)			\
+	$(GMODULE_CFLAGS)		\
+	$(GLIB_CFLAGS)
 
 noinst_LTLIBRARIES = libmonoos.la
 
Index: mono/os/unix/util.c
===================================================================
RCS file: /mono/mono/mono/os/unix/util.c,v
retrieving revision 1.2
diff -u -r1.2 util.c
--- mono/os/unix/util.c	28 Aug 2002 14:14:24 -0000	1.2
+++ mono/os/unix/util.c	18 Oct 2002 09:17:05 -0000
@@ -7,7 +7,9 @@
  * (C) 2002 Ximian, Inc. (http://www.ximian.com)
  */
 #include <config.h>
+#include <stdlib.h>
 #include <mono/os/util.h>
+#include <mono/metadata/metadata.h>
 
 /*
  * mono_set_rootdir:
@@ -18,8 +20,10 @@
 void
 mono_set_rootdir (void)
 {
-	/* nothing on Unix */
+  char *path = getenv ("MONO_ROOT");
+  if (path)
+    mono_assembly_setrootdir (path);
 }
 
- 
+
 

--=-=-=--