[Mono-list] Mono builds for Mac OS X

Ryan Wilhm ryan_wilhm@yahoo.com
Tue, 19 Feb 2002 07:37:53 -0600


Thanks, Jeff! I pulled down a snapshot of Mono last night from CVS and
managed to get it to build. Sort of. The major caveat is that, in addition
to not supporting Pthread recursive mutexes, it also doesn't support
read/write locks. I checked out Apple's developer site and found a bugfix
request that details the functionality missing from the Pthread OpenGroup
spec in OS X:

http://www.opensource.apple.com/bugs/X/Libraries/2686231.html

To get things to build in the interim, I just wrote stubs for the methods
that io-layer/events.c calls. (So in other words, don't have much confidence
that the build will work as expected... :) I'm going to be gone on vacation
for a week starting tomorrow, but I'd be happy to give an implementation a
shot when I get back next week.

Everything else was just build massaging... Off the top of my head:

- I set configure.in to target the ppc arch for powerpc-*-darwin*
- For any problematic header dependencies, I just used #if(n)def
__APPLE__/#endif to resolve
- I did end up removing EDOTDOT and ENOMEDIUM
- I ended up needing to manually compiling monoberg.c... I needed to add the
-no-cpp-precomp and a library include flag that wasn't carried forward
during Makefile generation
- I also added the empty read/write lock stub file into the io-layer
Makefile.am and Makefile.in files so I didn't have to hand crank the
Makefile every time might need to reconfigure...

That's about it...

Thanks again for the help!
Ryan


On 2/18/02 3:46 PM, "Jeffrey Stedfast" <fejj@ximian.com> wrote:

> My fixes were committed to CVS (along with some fixes to my original
> patches), so using the anoncvs server you should be able to get the
> updated code. I've also had to fix a few other things that may or may
> not have caused build problems on OSX that are also in CVS.
> 
> One thing that I still have to do on Solaris is to edit
> mono/mono/wrapper/genwrapper.pl and remove the line with EDOTDOT and
> ENOMEDIUM since Solaris doesn't have those. You may find that OSX lacks
> some of these errno's too.
> 
> Lemme know how it goes!
> 
> Jeff
> 
> On Mon, 2002-02-18 at 09:53, Ryan Wilhm wrote:
>> Cool. I started dinking with this over the weekend. I thought I'd share what
>> I've found so far:
>> 
>> For pkg-config, I just downloaded and installed Fink.
>> 
>> For glib, I didn't see anything but the 1.2 dist in Fink out there for OS X,
>> so I tried to compile the 1.3.13 source tarball. Here's what I did to make
>> that work:
>> 
>> - I had to replace config.guess (It couldn't guess the OS type, I just
>> copied the one in the mono-0.8 tarball over.)
>> 
>> - I set up CPPFLAGS with "-no-cpp-precomp" like you'd mentioned, and also
>> added "-I/sw/include" dir to look for headers in the fink distro. Also set
>> up LDFLAGS with "-L/sw/lib".
>> 
>> - In "glib/gdir.c", an additional include was needed for stdint.h.
>> 
>> - Libtool was generated to include "-undefined suppress" to suppress
>> errors/warnings, which bombs in 10.1 now. I removed that.
>> 
>> That seemed to build everything up to the "tests" target, which built but
>> didn't link due to some unresolved symbols in module (I think).
>> 
>> I didn't get much farther than that. I tried to kick off the mono build
>> (from the 0.8 source tarball). It got up to the point where it wanted to
>> find PTHREAD_MUTEX_RECURSIVE in pthread.h, which I've noticed that you'd
>> posted a workaround for in an earlier thread for non-glibc systems. I was
>> going to take a gander at that next. Was also going to go back and see if I
>> can get the tests to compile for glib, to make sure it regresses okay.
>> 
>> Thanks,
>> Ryan
>> 
>> 
>> On 2/15/02 12:38 PM, "Jeffrey Stedfast" <fejj@ximian.com> wrote:
>> 
>>> I've been working on making mono more portable in order to help me port
>>> to Sun/SPARC and I've now got it compiling. Also, Radek Doulik has
>>> already successfully ported mono to LinuxPPC. This means that pretty
>>> much all you should need to do is compile under OSX and it will probably
>>> Mostly Just Work (tm) as far as I know at least.
>>> 
>>> Note: You need to specify -no-cpp-precomp in CPPFLAGS when compiling
>>> just about anything UNIX-ish as opposed to Mac-ish. (Otherwise it uses
>>> the hacked-up Apple version of cpp, which claims to be gcc, but doesn't
>>> support all of the extensions.) -- Dan Winship
>>> 
>>> If you come accross any build problems, perhaps you can send a patch to
>>> the list or else let someone know where the build gets stuck.
>>> 
>>> I do know that OSX doesn't support some POSIX functions, like strtok_r
>>> and gethostbyname_r - but I don't think they are currently being used
>>> within mono.
>>> 
>>> I guess what I'm saying is: give it a go, if it fails then at least
>>> someone can report where it fails :-)
>>> 
>>> Jeff
>>> 
>>> On Fri, 2002-02-15 at 09:31, Ryan Wilhm wrote:
>>>> Okay, so I did a little searching around the net and found interviews where
>>>> Miguel says that a port to OS X is in the plan. I guess my question is: Is
>>>> it actively being developed? Or is Linux the priority right now, with an OS
>>>> X port forthcoming afterwards?
>>>> 
>>>> Thanks,
>>>> Ryan
>>>> 
>>>> 
>>>> On 2/14/02 12:15 PM, "Ryan Wilhm" <ryan_wilhm@yahoo.com> wrote:
>>>> 
>>>>> Out of curiosity, is there any effort underway to port to OS X? I know
>>>>> that
>>>>> MS is providing a port to FreeBSD, and it probably isn't much of a leap
>>>>> from
>>>>> there to port to OS X (assuming they want to), but it'd be nice to have an
>>>>> open source implementation available to keep MS honest.
>>>>> 
>>>>> 
>>>>> _______________________________________________
>>>>> Mono-list maillist  -  Mono-list@ximian.com
>>>>> http://lists.ximian.com/mailman/listinfo/mono-list
>>>> 
>>>> 
>>>> _______________________________________________
>>>> Mono-list maillist  -  Mono-list@ximian.com
>>>> http://lists.ximian.com/mailman/listinfo/mono-list
>> 
>> 
>> _______________________________________________
>> Mono-list maillist  -  Mono-list@ximian.com
>> http://lists.ximian.com/mailman/listinfo/mono-list