1 |
/* GCL config file for MacOS X v10.2 (aurelien.chanudetATm4xDOTorg) */ |
/* GCL config file for Mac OS X v10.2 (aurelienDOTchanudetATm4xDOTorg) */ |
2 |
|
|
3 |
|
/* ./configure --enable-debug --enable-machine=powerpc-macosx --enable-dlopen=no |
4 |
|
--enable-statsysbfd=no --enable-dynsysbfd=no --enable-custreloc=yes */ |
5 |
|
|
6 |
#include "bsd.h" |
#include "bsd.h" |
7 |
|
|
8 |
#define DARWIN |
#define DARWIN |
9 |
|
|
10 |
/* MacOS X has its own executable file format (Mach-O). */ |
/* Mac OS X has its own executable file format (Mach-O). */ |
11 |
#undef HAVE_AOUT |
#undef HAVE_AOUT |
12 |
#undef HAVE_ELF |
#undef HAVE_ELF |
13 |
|
|
14 |
#undef WANT_VALLOC |
/* #undef WANT_VALLOC */ |
15 |
#define DONT_NEED_MALLOC |
/* #define DONT_NEED_MALLOC */ |
16 |
|
/* #define GNU_MALLOC */ |
17 |
|
|
18 |
/* move this to configure */ |
/* move this to configure */ |
19 |
#define HAVE_UNISTD_H |
#define HAVE_UNISTD_H |
20 |
|
|
21 |
/* FIX-ME : check value is correct (differs for ppc and i386) */ |
/* correct value for ppc (we should detect this automatically) */ |
22 |
|
/* alternatively, we could use the global variable vm_page_size */ |
23 |
#define PAGEWIDTH 12 |
#define PAGEWIDTH 12 |
24 |
|
/* correct value for i386 */ |
25 |
|
/* #define PAGEWIDTH 13 */ |
26 |
|
|
27 |
/* The following value determines the running process size. */ |
/* The following value determines the running process size. */ |
28 |
/* I've no idea whatsoever if this value is appropriate. */ |
#define BIG_HEAP_SIZE 0x50000000 |
|
#define BIG_HEAP_SIZE 0x1000000 |
|
29 |
|
|
30 |
/* based on NeXT32-m68k.h */ |
/* based on NeXT32-m68k.h */ |
31 |
#undef SET_REAL_MAXPAGE |
#undef SET_REAL_MAXPAGE |
32 |
#define SET_REAL_MAXPAGE \ |
#define SET_REAL_MAXPAGE \ |
33 |
{ extern int mach_maplimit; sbrk(0); real_maxpage = mach_maplimit/PAGESIZE; } |
{ extern int mach_maplimit; my_sbrk(0); real_maxpage = mach_maplimit/PAGESIZE; } |
34 |
|
|
35 |
#define sbrk my_sbrk |
#define sbrk my_sbrk |
36 |
extern char * my_sbrk(int incr); |
extern char *my_sbrk(int incr); |
37 |
|
|
38 |
/* The code for unexec is based on Christian Swinehart's work for Emacs, |
/* The implementation of unexec for GCL is based on Andrew Choi's work |
39 |
which in turn is based on Apple's patches to work with the Mach-O format. */ |
for Emacs. Previous pioneering implementation of unexec for Mac OS X |
40 |
#define UNIXSAVE "unexdyld.c" |
by Steve Nygard. */ |
41 |
|
#define UNIXSAVE "unexmacosx.c" |
42 |
#undef SFASL |
|
43 |
|
/* sfaslbfd.c is included from sfasl.c */ |
44 |
#ifdef USE_DLOPEN |
#ifdef HAVE_LIBBFD |
45 |
/* #define SPECIAL_RSYM rsym_dyld.c */ |
#define SEPARATE_SFASL_FILE "sfaslbfd.c" |
|
/* #define UNIXFASL "fasldlsym.c" */ |
|
|
#define SPECIAL_RSYM |
|
|
#define UNIXFASL "fasldyld.c" |
|
46 |
#else |
#else |
47 |
#define UNIXFASL "fasldyld.c" |
/* #ifdef USE_DLOPEN */ |
48 |
|
#define SPECIAL_RSYM "rsym_macosx.c" |
49 |
|
/* #define SEPARATE_SFASL_FILE "fasldlsym.c" */ |
50 |
|
#define SEPARATE_SFASL_FILE "sfaslmacosx.c" |
51 |
#endif |
#endif |
52 |
|
|
53 |
/* MacOS X has sigaction (this is needed in o/usig.c), */ |
/* Mac OS X has sigaction (this is needed in o/usig.c), */ |
54 |
#define HAVE_SIGACTION |
#define HAVE_SIGACTION |
55 |
/* and we have sigvec too but this is defined in bsd.h. */ |
/* and we have sigvec too but this is defined in bsd.h. */ |
56 |
|
|
57 |
/* make this a noop */ |
/* make this a noop */ |
58 |
#define SETUP_SIG_STACK |
/* #define SETUP_SIG_STACK */ |
59 |
/* FIX-ME : configure doesnt detect SV_ONSTACK */ |
|
60 |
|
/* copied from {Net,Free,Open}BSD.h */ |
61 |
|
#define HAVE_SIGPROCMASK |
62 |
|
#define SIG_STACK_SIZE (SIGSTKSZ/sizeof(double)) |
63 |
|
#define SETUP_SIG_STACK \ |
64 |
|
{ \ |
65 |
|
static struct sigaltstack estack; \ |
66 |
|
if ((estack.ss_sp = malloc(SIGSTKSZ)) == NULL) \ |
67 |
|
perror("malloc"); \ |
68 |
|
estack.ss_size = SIGSTKSZ; \ |
69 |
|
estack.ss_flags = 0; \ |
70 |
|
if (sigaltstack(&estack, 0) < 0) \ |
71 |
|
perror("sigaltstack"); \ |
72 |
|
} |
73 |
|
|
74 |
|
#define INSTALL_SEGMENTATION_CATCHER \ |
75 |
|
(void) gcl_signal(SIGSEGV, segmentation_catcher); \ |
76 |
|
(void) gcl_signal(SIGBUS, segmentation_catcher) |
77 |
|
|
78 |
#define IEEEFLOAT |
#define IEEEFLOAT |
79 |
|
|
80 |
/* how to check for input */ |
/* how to check for input */ |
81 |
/* MacOS X does not have _fileno as in linux.h. Nor does it have _cnt as in bsd.h. */ |
/* Mac OS X does not have _fileno as in linux.h. Nor does it have _cnt as in bsd.h. */ |
82 |
/* Let us see what we can do with this declaration found in {Net,Open,Free}BSD.h. */ |
/* Let us see what we can do with this declaration found in {Net,Free,Open}BSD.h. */ |
83 |
#undef LISTEN_FOR_INPUT |
#undef LISTEN_FOR_INPUT |
84 |
#define LISTEN_FOR_INPUT(fp) \ |
#define LISTEN_FOR_INPUT(fp) \ |
85 |
do {int c=0;\ |
do {int c=0;\ |
90 |
/* (I hope) we dont need to worry about zeroing fp->_base */ |
/* (I hope) we dont need to worry about zeroing fp->_base */ |
91 |
#define FCLOSE_SETBUF_OK |
#define FCLOSE_SETBUF_OK |
92 |
|
|
|
/* #define or #undef this to your taste */ |
|
|
/* #define SGC */ |
|
|
#undef SGC |
|
93 |
|
|
94 |
/* This is based on powerpc-linux.h. */ |
/**** enable stratified garbage collection */ |
95 |
|
|
96 |
|
#define SGC |
97 |
|
#define SIGPROTV SIGBUS |
98 |
|
|
99 |
|
|
100 |
|
/**** cache synchronization code */ |
101 |
|
|
102 |
|
/* This is based on powerpc-linux.h. See equivalent code in dyld. */ |
103 |
|
|
104 |
#define CLEAR_CACHE_LINE_SIZE 32 |
#define CLEAR_CACHE_LINE_SIZE 32 |
105 |
#define CLEAR_CACHE \ |
#define CLEAR_CACHE \ |
106 |
do {\ |
do {\ |
113 |
|
|
114 |
#define SEEK_TO_END_OFILE(fp) seek_to_end_ofile(fp) |
#define SEEK_TO_END_OFILE(fp) seek_to_end_ofile(fp) |
115 |
/* extern int seek_to_end_ofile(FILE *fp); */ |
/* extern int seek_to_end_ofile(FILE *fp); */ |
116 |
|
|
117 |
|
#undef malloc |
118 |
|
#define malloc my_malloc |
119 |
|
|
120 |
|
#undef free |
121 |
|
#define free my_free |
122 |
|
|
123 |
|
#undef realloc |
124 |
|
#define realloc my_realloc |
125 |
|
|
126 |
|
#undef valloc |
127 |
|
#define valloc my_valloc |
128 |
|
|
129 |
|
#undef calloc |
130 |
|
#define calloc my_calloc |
131 |
|
|