[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
darwin / OS X support - revisited
From: |
David Bélanger |
Subject: |
darwin / OS X support - revisited |
Date: |
Sat, 24 Jan 2004 03:33:52 -0500 |
User-agent: |
Mutt/1.3.28i |
Hi,
Chris Hoffmann from the JikesRVM team sent a patch some time ago for
Mac OS X support.
(see: http://mail.gnu.org/archive/html/classpath/2003-10/msg00032.html)
I adapted his work to suit more the target native framework.
Basically, what I did is:
1) Copy the Linux target directory to a Darwin directory. (Darwin is
the name of the Unix system under Mac OS X).
2) Modified configure.ac/Makefile to use it.
Note: The diff between Darwin and Linux are quite small, basically 2
lines but I still added a arch.
Note: I am not a Darwin/OS X expert by the way.
>From the original patch:
+#if (defined( __BIG_ENDIAN__) && defined( __APPLE__ ))
+#define __IEEE_BIG_ENDIAN
+#endif
+
+
I did not use that. I simply set CPPFLAGS as -D__PPC__ -D_BIG_ENDIAN
when compiling and leave that file untouched. It may be tempting to add
a __APPLE__ beside the __AIX__, but __PPC__ is not defined by gcc and
we still need the CPPFLAGS anyway. Unless we do a completely separte #ifdef
__APPLE__... not under the #ifdef __PPC__.
- INIT_FIELD ("in", 0);
- INIT_FIELD ("out", 1);
- INIT_FIELD ("err", 2);
+ INIT_FIELD ("in", ((long long)0));
+ INIT_FIELD ("out", ((long long)1));
+ INIT_FIELD ("err", ((long long)2));
I did not do that part either. Seem to work fine.
+#ifndef O_SYNC
+#undef TARGET_NATIVE_FILE_FILEFLAG_SYNC
+#define TARGET_NATIVE_FILE_FILEFLAG_SYNC O_FSYNC
+#endif
Here the problem is that O_FSYNC is be defined in fcntl.h.
However, fcntl.h is not included for the constant in the generic file.
On Linux works fine,
OS X don't like it. So either the Linux fcntl.h gets included
by some other include etc. Would need investigation.
What I did, is to add a #include in the Darwin specific target file.
Finally, for:
+#ifdef __MACH__
+typedef int socklen_t;
+#endif
I simply added it (without the #ifdef) to the network target specific
file.
David
SableVM developer
---
David Bélanger
Graduate Student
School of Computer Science
McGill University
Office: MC226
Web page: http://www.cs.mcgill.ca/~dbelan2/
Public key: http://www.cs.mcgill.ca/~dbelan2/public_key.txt
classpath.darwin.diff
Description: Text document
- darwin / OS X support - revisited,
David Bélanger <=