[Mono-list] System.Data Linux Compilation Error
Jonathan Pryor
jonpryor@vt.edu
21 Nov 2002 22:17:26 -0500
--=-lO8QMZu2/EG7sWRwSEeH
Content-Type: text/plain
Content-Transfer-Encoding: 7bit
I came across this odd error compiling the mcs module tonight (fresh cvs
update). Maybe it's just me...
When compiling System.Data, I got an error that it couldn't find the
Mono.Data.Tds assembly. This was from the mcs/class/System.Data
directory, running the command:
MONO_PATH=../../class/lib: mono ../../mcs/mcs.exe --target
library --noconfig -L ../../class/lib: -o
../../class/lib/System.Data.dll -r corlib -r System
-r System.Xml -r System.EnterpriseServices -r Mono.Data.Tds
@.response
Further examination allowed me to compile System.Data if I added the
following parameter to the mcs command:
-lib:../../class/lib
So, I figured I'd try to fix up the `library.make' file to insert the
`-lib' parameter to mcs.
Trying my fix resulted in the same compiler error -- it couldn't find
the assembly Mono.Data.Tds. Further inspection showed that the command
my changes made to `library.make' had an extra `:' appended to the -lib
parameter, e.g.:
-lib:../../class/lib:
The extra `:' prevents mcs from finding the assembly. I find this to be
an mcs bug. (I haven't looked into this any further.)
Thus, my final patch inserts an appropriate -lib parameter if
$(MONO_PATH_PREFIX)$(MONO_PATH) is non-null, and strips off the final
`:' if present.
After applying my patch I'm able to compile System.Data; however, I get
a System.InvalidCastException while compiling Mono.Data.MySql.dll.
However, I get the same exception without my change, so they are not
related.
Suggestions?
Thanks,
- Jon
--=-lO8QMZu2/EG7sWRwSEeH
Content-Disposition: attachment; filename=library.make.diff
Content-Type: text/x-patch; name=library.make.diff; charset=UTF-8
Content-Transfer-Encoding: 7bit
Index: class/library.make
===================================================================
RCS file: /cvs/public/mcs/class/library.make,v
retrieving revision 1.16
diff -u -r1.16 library.make
--- class/library.make 19 Nov 2002 16:11:06 -0000 1.16
+++ class/library.make 22 Nov 2002 03:20:08 -0000
@@ -1,7 +1,9 @@
#USE_SOURCE_RULES=1
RUNTIME = mono
MCS = $(RUNTIME) $(topdir)/mcs/mcs.exe
-MCS_FLAGS = --target library --noconfig
+MCS_LIB_ARG_1_ = $(if $(MONO_PATH_PREFIX)$(MONO_PATH), -lib:$(MONO_PATH_PREFIX)$(MONO_PATH),)
+MCS_LIB_ARG_ = $(patsubst %:,%,$(MCS_LIB_ARG_1_))
+MCS_FLAGS = $(MCS_LIB_ARG_) --target library --noconfig
INSTALL = /usr/bin/install
prefix = /usr
--=-lO8QMZu2/EG7sWRwSEeH--