You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Context: #13
Context: https://bugzilla.xamarin.com/show_bug.cgi?id=28141
The current "GC bridge" implementation is bunk. Not only is it bunk,
it's *horribly broken* bunk (see commit eb69a47). (Well, it was just
for bootstrapping anyway...)
A "proper" fix is to copy Xamarin.Android's Mono GC bridge
implementation, which has been thoroughly debugged by now.
This in turn requires that Java.Interop now provide a native library
to contain the Mono GC bridge glue code...which raises a new set of
conundrums, related to: the build system.
The problem is that most of our projects which build native code use
make(1) and/or GNU Auto* (autoconf, automake, etc.), which this
project isn't currently using, and I don't *want* to use it.
(I'm attempting to use the IDE as much as possible, which in turn
*usually* means using `xbuild`.)
Fortunately, Xamarin Studio supports C projects, which use an
MSBuild-compatible project format. (Yay!)
Unfortunately, Xamarin Studio is "faking" this support, because it's
not a *real* MSBuild project, in that it can't be built with xbuild:
$ xbuild src/java-interop/java-interop.cproj
error : Target named 'Build' not found in the project.
Doh!
(Additionally, the contents of the .cproj file bear ~no resemblance to
a VS2012-generated .vcproj file, so there's ~no compatibility with
Visual Studio here. Windows build support is "when needed.")
Furthermore, due to Bug #28141, the shared library that Xamarin Studio
generates has the *wrong file name suffix*: it's using `.so` on OS X
when it should really be using `.dylib`.
There are thus four options for providing a native lib with
Java.Interop:
1. Don't. :-) (i.e. build the native lib code in other repo's.)
2. Start using auto*
3. Actually rely on make(1), instead of just having Makefile delegate
to xbuild for everything.
4. Hack things until they work.
Option (4) is clearly the winner (?), at least for now, so what does
*that* look like?
First, src/java-interop is the source code for the new native library,
currently named libjava-interop.dylib.
Secondly, "fix" src/java-interop/java-interop.cproj so that:
1. It has a (manually provided) Build target, thus allowing `xbuild`
to build it
2. It has a Xamarin Studio post-build step which renames the output
so it creates libjava-interop.dylib instead of libjava-interop.so.
3. xbuild and XS-related sections are updated so that Mono.framework
is referenced and mono's headers are available.
This allows the project to be built with both xbuild (continuous
integration case) and Xamarin Studio ("normal" development case),
without introducing the complexities of Auto*.
This commit does NOT currently add the GC bridge implementation. This
commit is solely about adding build system support for the native lib.
0 commit comments