2003/09/10 03:14:19
[org.ibex.core.git] / upstream / darwin-linker / patches / cctools.patch
1 diff -rub ./include/architecture/i386/frame.h ./include/architecture/i386/frame.h
2 --- ./include/architecture/i386/frame.h Thu May  6 19:24:33 1999
3 +++ ./include/architecture/i386/frame.h Mon Aug 25 12:56:22 2003
4 @@ -63,7 +63,7 @@
5      } pgfault;
6  } err_code_t;
7  
8 -#import <architecture/i386/sel.h>
9 +#include <architecture/i386/sel.h>
10  
11  /*
12   * The actual hardware exception frame
13 diff -rub ./include/architecture/m88k/fp_regs.h ./include/architecture/m88k/fp_regs.h
14 --- ./include/architecture/m88k/fp_regs.h       Wed Oct  9 18:47:37 2002
15 +++ ./include/architecture/m88k/fp_regs.h       Mon Aug 25 12:56:22 2003
16 @@ -37,7 +37,7 @@
17  #ifndef        _ARCH_M88K_FP_REGS_H_
18  #define        _ARCH_M88K_FP_REGS_H_
19  
20 -#import <architecture/m88k/reg_help.h>
21 +#include <architecture/m88k/reg_help.h>
22  
23  /*
24   * m88k_xrf_t -- data types that MAY be in extended register file
25 diff -rub ./include/architecture/m88k/reg_help.h ./include/architecture/m88k/reg_help.h
26 --- ./include/architecture/m88k/reg_help.h      Wed Oct  9 18:47:39 2002
27 +++ ./include/architecture/m88k/reg_help.h      Mon Aug 25 12:56:22 2003
28 @@ -37,7 +37,7 @@
29  #ifndef _ARCH_M88K_REG_HELP_H_
30  #define _ARCH_M88K_REG_HELP_H_
31  
32 -#import <architecture/nrw/reg_help.h>
33 +#include <architecture/nrw/reg_help.h>
34  
35  /* Stack pointer must always be a multiple of 16 */
36  #define        STACK_INCR      16
37 diff -rub ./include/mach/m88k/thread_status.h ./include/mach/m88k/thread_status.h
38 --- ./include/mach/m88k/thread_status.h Wed Oct  9 18:48:16 2002
39 +++ ./include/mach/m88k/thread_status.h Mon Aug 25 12:56:22 2003
40 @@ -45,8 +45,8 @@
41  #ifndef        _MACH_M88K_THREAD_STATE_
42  #define        _MACH_M88K_THREAD_STATE_
43  
44 -#import <architecture/m88k/fp_regs.h>
45 -#import <architecture/m88k/reg_help.h>
46 +#include <architecture/m88k/fp_regs.h>
47 +#include <architecture/m88k/reg_help.h>
48  
49  /**************************************************************************
50   * Data Typedefs used by thread_getstatus() and thread_setstatus()        *
51 diff -rub ./include/mach/machine.h ./include/mach/machine.h
52 --- ./include/mach/machine.h    Mon Feb 10 19:52:25 2003
53 +++ ./include/mach/machine.h    Mon Aug 25 12:56:22 2003
54 @@ -81,8 +81,8 @@
55  #ifndef        _MACH_MACHINE_H_
56  #define _MACH_MACHINE_H_
57  
58 -#import <mach/machine/vm_types.h>
59 -#import <mach/boolean.h>
60 +#include <mach/machine/vm_types.h>
61 +#include <mach/boolean.h>
62  
63  /*
64   *     For each host, there is a maximum possible number of
65 diff -rub ./include/mach-o/hppa/swap.h ./include/mach-o/hppa/swap.h
66 --- ./include/mach-o/hppa/swap.h        Thu May  6 19:25:11 1999
67 +++ ./include/mach-o/hppa/swap.h        Mon Aug 25 12:56:22 2003
68 @@ -21,8 +21,8 @@
69   * 
70   * @APPLE_LICENSE_HEADER_END@
71   */
72 -#import <architecture/byte_order.h>
73 -#import <mach/hppa/thread_status.h>
74 +#include <architecture/byte_order.h>
75 +#include <mach/hppa/thread_status.h>
76  
77  extern void swap_hppa_integer_thread_state(
78      struct hp_pa_integer_thread_state *regs,
79 diff -rub ./include/mach-o/i860/swap.h ./include/mach-o/i860/swap.h
80 --- ./include/mach-o/i860/swap.h        Thu May  6 19:25:19 1999
81 +++ ./include/mach-o/i860/swap.h        Mon Aug 25 12:56:22 2003
82 @@ -21,8 +21,8 @@
83   * 
84   * @APPLE_LICENSE_HEADER_END@
85   */
86 -#import <architecture/byte_order.h>
87 -#import <mach/i860/thread_status.h>
88 +#include <architecture/byte_order.h>
89 +#include <mach/i860/thread_status.h>
90  
91  extern void swap_i860_thread_state_regs(
92      struct i860_thread_state_regs *cpu,
93 diff -rub ./include/mach-o/m68k/swap.h ./include/mach-o/m68k/swap.h
94 --- ./include/mach-o/m68k/swap.h        Thu May  6 19:25:26 1999
95 +++ ./include/mach-o/m68k/swap.h        Mon Aug 25 12:56:22 2003
96 @@ -21,8 +21,8 @@
97   * 
98   * @APPLE_LICENSE_HEADER_END@
99   */
100 -#import <architecture/byte_order.h>
101 -#import <mach/m68k/thread_status.h>
102 +#include <architecture/byte_order.h>
103 +#include <mach/m68k/thread_status.h>
104  
105  extern void swap_m68k_thread_state_regs(
106      struct m68k_thread_state_regs *cpu,
107 diff -rub ./include/mach-o/m88k/swap.h ./include/mach-o/m88k/swap.h
108 --- ./include/mach-o/m88k/swap.h        Thu May  6 19:25:31 1999
109 +++ ./include/mach-o/m88k/swap.h        Mon Aug 25 12:56:22 2003
110 @@ -21,8 +21,8 @@
111   * 
112   * @APPLE_LICENSE_HEADER_END@
113   */
114 -#import <architecture/byte_order.h>
115 -#import <mach/m88k/thread_status.h>
116 +#include <architecture/byte_order.h>
117 +#include <mach/m88k/thread_status.h>
118  
119  extern void swap_m88k_thread_state_grf_t(
120      m88k_thread_state_grf_t *cpu,
121 diff -rub ./include/mach-o/rld.h ./include/mach-o/rld.h
122 --- ./include/mach-o/rld.h      Tue Oct  2 15:19:03 2001
123 +++ ./include/mach-o/rld.h      Mon Aug 25 12:56:22 2003
124 @@ -28,7 +28,7 @@
125  #ifndef _MACHO_RLD_H_
126  #define _MACHO_RLD_H_
127  
128 -#include <streams/streams.h>
129 +//~ #include <streams/streams.h>
130  #include <mach-o/loader.h>
131  
132  extern long rld_load(
133 diff -rub ./include/mach-o/sparc/swap.h ./include/mach-o/sparc/swap.h
134 --- ./include/mach-o/sparc/swap.h       Thu May  6 19:25:56 1999
135 +++ ./include/mach-o/sparc/swap.h       Mon Aug 25 12:56:22 2003
136 @@ -21,8 +21,8 @@
137   * 
138   * @APPLE_LICENSE_HEADER_END@
139   */
140 -#import <architecture/byte_order.h>
141 -#import <mach/sparc/thread_status.h>
142 +#include <architecture/byte_order.h>
143 +#include <mach/sparc/thread_status.h>
144  
145  void swap_sparc_thread_state_regs(
146      struct sparc_thread_state_regs *cpu,
147 diff -rub ./include/standalone/libsa.h ./include/standalone/libsa.h
148 --- ./include/standalone/libsa.h        Mon Sep 11 15:03:00 2000
149 +++ ./include/standalone/libsa.h        Mon Aug 25 12:56:22 2003
150 @@ -23,13 +23,13 @@
151   */
152  /* Exported API for standalone library */
153  #if !(defined(KLD) && defined(__STATIC__))
154 -#import <mach/mach.h>
155 +#include <mach/mach.h>
156  #else /* defined(KLD) && defined(__STATIC__) */
157  #include <mach/kern_return.h>
158  #endif /* !(defined(KLD) && defined(__STATIC__)) */
159 -#import <mach-o/loader.h>
160 -#import <stdarg.h>
161 -#import <stddef.h>
162 +#include <mach-o/loader.h>
163 +#include <stdarg.h>
164 +#include <stddef.h>
165  
166  #ifndef bcopy
167  #ifdef __OPENSTEP__
168 diff -rub ./include/stuff/allocate.h ./include/stuff/allocate.h
169 --- ./include/stuff/allocate.h  Thu May  6 19:26:24 1999
170 +++ ./include/stuff/allocate.h  Mon Aug 25 13:08:44 2003
171 @@ -21,8 +21,10 @@
172   * 
173   * @APPLE_LICENSE_HEADER_END@
174   */
175 -#if defined(__MWERKS__) && !defined(__private_extern__)
176 +#if ( defined(__MWERKS__) && !defined(__private_extern__) )
177  #define __private_extern__ __declspec(private_extern)
178 +#elif ( defined(__linux__) && !defined(__private_extern__) )
179 +#define __private_extern__ extern
180  #endif
181  
182  /* defined in allocate.c */
183 diff -rub ./include/stuff/arch.h ./include/stuff/arch.h
184 --- ./include/stuff/arch.h      Mon Nov 19 12:09:40 2001
185 +++ ./include/stuff/arch.h      Mon Aug 25 13:10:15 2003
186 @@ -24,15 +24,17 @@
187  #ifndef _STUFF_ARCH_H_
188  #define _STUFF_ARCH_H_
189  
190 -#if defined(__MWERKS__) && !defined(__private_extern__)
191 +#if ( defined(__MWERKS__) && !defined(__private_extern__) )
192  #define __private_extern__ __declspec(private_extern)
193 +#elif ( defined(__linux__) && !defined(__private_extern__) )
194 +#define __private_extern__ extern
195  #endif
196  /*
197   * This file contains the current known set of flags and constants for the
198   * known architectures.
199   */
200 -#import <mach/machine.h>
201 -#import <stuff/bytesex.h>
202 +#include <mach/machine.h>
203 +#include <stuff/bytesex.h>
204  
205  /*
206   * The structure describing an architecture flag with the string of the flag
207 diff -rub ./include/stuff/best_arch.h ./include/stuff/best_arch.h
208 --- ./include/stuff/best_arch.h Thu May  6 19:26:29 1999
209 +++ ./include/stuff/best_arch.h Mon Aug 25 13:10:13 2003
210 @@ -21,8 +21,10 @@
211   * 
212   * @APPLE_LICENSE_HEADER_END@
213   */
214 -#if defined(__MWERKS__) && !defined(__private_extern__)
215 +#if ( defined(__MWERKS__) && !defined(__private_extern__) )
216  #define __private_extern__ __declspec(private_extern)
217 +#elif ( defined(__linux__) && !defined(__private_extern__) )
218 +#define __private_extern__ extern
219  #endif
220  
221  #include <mach/machine.h>
222 diff -rub ./include/stuff/breakout.h ./include/stuff/breakout.h
223 --- ./include/stuff/breakout.h  Mon May  6 14:03:46 2002
224 +++ ./include/stuff/breakout.h  Mon Aug 25 13:10:12 2003
225 @@ -21,11 +21,13 @@
226   * 
227   * @APPLE_LICENSE_HEADER_END@
228   */
229 -#if defined(__MWERKS__) && !defined(__private_extern__)
230 +#if ( defined(__MWERKS__) && !defined(__private_extern__) )
231  #define __private_extern__ __declspec(private_extern)
232 +#elif ( defined(__linux__) && !defined(__private_extern__) )
233 +#define __private_extern__ extern
234  #endif
235  
236 -#import "stuff/ofile.h"
237 +#include "stuff/ofile.h"
238  
239  /*
240   * The input files are broken out in to their object files and then placed in
241 diff -rub ./include/stuff/bytesex.h ./include/stuff/bytesex.h
242 --- ./include/stuff/bytesex.h   Mon Nov 19 12:09:42 2001
243 +++ ./include/stuff/bytesex.h   Mon Aug 25 13:10:10 2003
244 @@ -25,23 +25,25 @@
245  #ifndef _STUFF_BYTESEX_H_
246  #define _STUFF_BYTESEX_H_
247  
248 -#if defined(__MWERKS__) && !defined(__private_extern__)
249 +#if ( defined(__MWERKS__) && !defined(__private_extern__) )
250  #define __private_extern__ __declspec(private_extern)
251 +#elif ( defined(__linux__) && !defined(__private_extern__) )
252 +#define __private_extern__ extern
253  #endif
254  
255 -#import <mach-o/fat.h>
256 -#import <mach-o/loader.h>
257 -#import <mach/m68k/thread_status.h>
258 -#import <mach/ppc/thread_status.h>
259 -#import <mach/m88k/thread_status.h>
260 -#import <mach/i860/thread_status.h>
261 -#import <mach/i386/thread_status.h>
262 -#import <mach/hppa/thread_status.h>
263 -#import <mach/sparc/thread_status.h>
264 -#import <mach-o/nlist.h>
265 -#import <mach-o/reloc.h>
266 -#import <mach-o/ranlib.h>
267 -#import "stuff/bool.h"
268 +#include <mach-o/fat.h>
269 +#include <mach-o/loader.h>
270 +#include <mach/m68k/thread_status.h>
271 +#include <mach/ppc/thread_status.h>
272 +#include <mach/m88k/thread_status.h>
273 +#include <mach/i860/thread_status.h>
274 +#include <mach/i386/thread_status.h>
275 +#include <mach/hppa/thread_status.h>
276 +#include <mach/sparc/thread_status.h>
277 +#include <mach-o/nlist.h>
278 +#include <mach-o/reloc.h>
279 +#include <mach-o/ranlib.h>
280 +#include "stuff/bool.h"
281  
282  enum byte_sex {
283      UNKNOWN_BYTE_SEX,
284 diff -rub ./include/stuff/errors.h ./include/stuff/errors.h
285 --- ./include/stuff/errors.h    Thu May  6 19:26:40 1999
286 +++ ./include/stuff/errors.h    Mon Aug 25 13:09:00 2003
287 @@ -21,11 +21,13 @@
288   * 
289   * @APPLE_LICENSE_HEADER_END@
290   */
291 -#if defined(__MWERKS__) && !defined(__private_extern__)
292 +#if ( defined(__MWERKS__) && !defined(__private_extern__) )
293  #define __private_extern__ __declspec(private_extern)
294 +#elif ( defined(__linux__) && !defined(__private_extern__) )
295 +#define __private_extern__ extern
296  #endif
297  
298 -#import "mach/mach.h"
299 +#include "mach/mach.h"
300  
301  /* user defined (imported) */
302  __private_extern__ char *progname;
303 diff -rub ./include/stuff/execute.h ./include/stuff/execute.h
304 --- ./include/stuff/execute.h   Thu May  6 19:26:42 1999
305 +++ ./include/stuff/execute.h   Mon Aug 25 13:10:04 2003
306 @@ -21,8 +21,10 @@
307   * 
308   * @APPLE_LICENSE_HEADER_END@
309   */
310 -#if defined(__MWERKS__) && !defined(__private_extern__)
311 +#if ( defined(__MWERKS__) && !defined(__private_extern__) )
312  #define __private_extern__ __declspec(private_extern)
313 +#elif ( defined(__linux__) && !defined(__private_extern__) )
314 +#define __private_extern__ extern
315  #endif
316  
317  /*
318 diff -rub ./include/stuff/hash_string.h ./include/stuff/hash_string.h
319 --- ./include/stuff/hash_string.h       Thu May  6 19:26:45 1999
320 +++ ./include/stuff/hash_string.h       Mon Aug 25 13:10:32 2003
321 @@ -21,8 +21,10 @@
322   * 
323   * @APPLE_LICENSE_HEADER_END@
324   */
325 -#if defined(__MWERKS__) && !defined(__private_extern__)
326 +#if ( defined(__MWERKS__) && !defined(__private_extern__) )
327  #define __private_extern__ __declspec(private_extern)
328 +#elif ( defined(__linux__) && !defined(__private_extern__) )
329 +#define __private_extern__ extern
330  #endif
331  
332  __private_extern__ long hash_string(
333 diff -rub ./include/stuff/hppa.h ./include/stuff/hppa.h
334 --- ./include/stuff/hppa.h      Thu May  6 19:26:47 1999
335 +++ ./include/stuff/hppa.h      Mon Aug 25 13:10:40 2003
336 @@ -21,8 +21,10 @@
337   * 
338   * @APPLE_LICENSE_HEADER_END@
339   */
340 -#if defined(__MWERKS__) && !defined(__private_extern__)
341 +#if ( defined(__MWERKS__) && !defined(__private_extern__) )
342  #define __private_extern__ __declspec(private_extern)
343 +#elif ( defined(__linux__) && !defined(__private_extern__) )
344 +#define __private_extern__ extern
345  #endif
346  
347  __private_extern__ void calc_hppa_HILO(
348 diff -rub ./include/stuff/ofile.h ./include/stuff/ofile.h
349 --- ./include/stuff/ofile.h     Mon Feb 10 19:52:33 2003
350 +++ ./include/stuff/ofile.h     Mon Aug 25 13:10:51 2003
351 @@ -25,21 +25,23 @@
352  #ifndef _STUFF_OFILE_H_
353  #define _STUFF_OFILE_H_
354  
355 -#if defined(__MWERKS__) && !defined(__private_extern__)
356 +#if ( defined(__MWERKS__) && !defined(__private_extern__) )
357  #define __private_extern__ __declspec(private_extern)
358 +#elif ( defined(__linux__) && !defined(__private_extern__) )
359 +#define __private_extern__ extern
360  #endif
361  
362 -#import <ar.h>
363 +#include <ar.h>
364  #ifndef AR_EFMT1
365  #define        AR_EFMT1        "#1/"           /* extended format #1 */
366  #endif
367 -#import <mach-o/loader.h>
368 +#include <mach-o/loader.h>
369  #ifdef OFI
370 -#import <mach-o/dyld.h>
371 +#include <mach-o/dyld.h>
372  #endif
373 -#import "stuff/bytesex.h"
374 -#import "stuff/bool.h"
375 -#import "stuff/arch.h"
376 +#include "stuff/bytesex.h"
377 +#include "stuff/bool.h"
378 +#include "stuff/arch.h"
379  
380  enum ofile_type {
381      OFILE_UNKNOWN,
382 diff -rub ./include/stuff/print.h ./include/stuff/print.h
383 --- ./include/stuff/print.h     Thu May  6 19:26:55 1999
384 +++ ./include/stuff/print.h     Mon Aug 25 13:10:58 2003
385 @@ -21,11 +21,13 @@
386   * 
387   * @APPLE_LICENSE_HEADER_END@
388   */
389 -#if defined(__MWERKS__) && !defined(__private_extern__)
390 +#if ( defined(__MWERKS__) && !defined(__private_extern__) )
391  #define __private_extern__ __declspec(private_extern)
392 +#elif ( defined(__linux__) && !defined(__private_extern__) )
393 +#define __private_extern__ extern
394  #endif
395  
396 -#import <stdarg.h>
397 +#include <stdarg.h>
398  
399  __private_extern__ void print(
400      const char *format, ...)
401 diff -rub ./include/stuff/reloc.h ./include/stuff/reloc.h
402 --- ./include/stuff/reloc.h     Thu May  6 19:26:57 1999
403 +++ ./include/stuff/reloc.h     Mon Aug 25 13:11:02 2003
404 @@ -21,12 +21,14 @@
405   * 
406   * @APPLE_LICENSE_HEADER_END@
407   */
408 -#if defined(__MWERKS__) && !defined(__private_extern__)
409 +#if ( defined(__MWERKS__) && !defined(__private_extern__) )
410  #define __private_extern__ __declspec(private_extern)
411 +#elif ( defined(__linux__) && !defined(__private_extern__) )
412 +#define __private_extern__ extern
413  #endif
414  
415 -#import <mach/machine.h>
416 -#import "stuff/bool.h"
417 +#include <mach/machine.h>
418 +#include "stuff/bool.h"
419  
420  __private_extern__ unsigned long reloc_pair_r_type(
421      cpu_type_t cputype);
422 diff -rub ./include/stuff/round.h ./include/stuff/round.h
423 --- ./include/stuff/round.h     Fri Mar 14 18:18:29 2003
424 +++ ./include/stuff/round.h     Mon Aug 25 13:11:06 2003
425 @@ -21,8 +21,10 @@
426   * 
427   * @APPLE_LICENSE_HEADER_END@
428   */
429 -#if defined(__MWERKS__) && !defined(__private_extern__)
430 +#if ( defined(__MWERKS__) && !defined(__private_extern__) )
431  #define __private_extern__ __declspec(private_extern)
432 +#elif ( defined(__linux__) && !defined(__private_extern__) )
433 +#define __private_extern__ extern
434  #endif
435  
436  /*
437 diff -rub ./include/stuff/symbol_list.h ./include/stuff/symbol_list.h
438 --- ./include/stuff/symbol_list.h       Thu Oct 24 17:04:30 2002
439 +++ ./include/stuff/symbol_list.h       Mon Aug 25 13:19:46 2003
440 @@ -1,6 +1,12 @@
441  #include <mach-o/nlist.h>
442  #include <stuff/bool.h>
443  
444 +#if ( defined(__MWERKS__) && !defined(__private_extern__) )
445 +#define __private_extern__ __declspec(private_extern)
446 +#elif ( defined(__linux__) && !defined(__private_extern__) )
447 +#define __private_extern__ extern
448 +#endif
449 +
450  /*
451   * Data structures to perform selective stripping of symbol table entries.
452   */
453 diff -rub ./include/stuff/vm_flush_cache.h ./include/stuff/vm_flush_cache.h
454 --- ./include/stuff/vm_flush_cache.h    Thu May  6 19:27:05 1999
455 +++ ./include/stuff/vm_flush_cache.h    Mon Aug 25 13:11:15 2003
456 @@ -21,11 +21,13 @@
457   * 
458   * @APPLE_LICENSE_HEADER_END@
459   */
460 -#if defined(__MWERKS__) && !defined(__private_extern__)
461 +#if ( defined(__MWERKS__) && !defined(__private_extern__) )
462  #define __private_extern__ __declspec(private_extern)
463 +#elif ( defined(__linux__) && !defined(__private_extern__) )
464 +#define __private_extern__ extern
465  #endif
466  
467 -#import <mach/mach.h>
468 +#include <mach/mach.h>
469  __private_extern__ kern_return_t vm_flush_cache(
470      mach_port_t target_task,
471      vm_address_t address,
472 diff -rub ./ld/Makefile ./ld/Makefile
473 --- ./ld/Makefile       Fri Mar 14 18:18:29 2003
474 +++ ./ld/Makefile       Sat Sep  6 20:17:46 2003
475 @@ -9,10 +9,10 @@
476         -DKERNEL -DKERNEL_PRIVATE -DAPPLE -DNeXT -DLIBSA_PRIVATE
477  
478  
479 -MIG = $(NEXT_ROOT)/usr/bin/mig
480 +MIG = mig
481  
482  ifeq "macos" "$(RC_OS)"
483 -  X_CFLAGS := $(shell if [ "$(RC_RELEASE)" != "Beaker" ] &&    \
484 +  X_CFLAGS := $(shell if [ `uname` != "Linux" ] && [ "$(RC_RELEASE)" != "Beaker" ] &&    \
485                          [ "$(RC_RELEASE)" != "Bunsen" ] &&    \
486                          [ "$(RC_RELEASE)" != "Gonzo"  ] &&    \
487                          [ "$(RC_RELEASE)" != "Kodiak" ]; then \
488 @@ -21,10 +21,19 @@
489  endif
490  
491  ifneq "mwccppc" "$(notdir $(CC))"
492 +  ifeq "Linux" "$(shell uname)"
493 +    GCC_FLAGS = -Wall $(X_CFLAGS) -D__LITTLE_ENDIAN__ -U__BIG_ENDIAN__  -D__ppc__ -I/usr/include -I../../../macosx-include
494 +  else
495    GCC_FLAGS = -Wall $(X_CFLAGS)
496 +  endif
497  endif
498  
499 -USE_DEPENDENCY_FILE := $(shell if [ "$(notdir $(CC))" != "mwccppc" ]; then \
500 +# Hack: Add ../misc to the path because it contains seg_hack and ver_string
501 +ifneq ($(findstring ../misc,$(PATH)),../misc)
502 +  PATH:=../misc:../../misc:$(PATH)
503 +endif
504 +
505 +USE_DEPENDENCY_FILE := $(shell if [ `uname` != "Linux" ] && [ "$(notdir $(CC))" != "mwccppc" ]; then \
506              echo YES ; else echo NO ; \
507              fi; )
508  
509 @@ -78,7 +87,7 @@
510          fvmlibs.c layout.c specs.c pass2.c generic_reloc.c rld.c sets.c \
511          4byte_literals.c 8byte_literals.c literal_pointers.c dylibs.c \
512          indirect_sections.c mod_sections.c i860_reloc.c ppc_reloc.c \
513 -        m88k_reloc.c hppa_reloc.c sparc_reloc.c coalesced_sections.c
514 +        m88k_reloc.c hppa_reloc.c sparc_reloc.c coalesced_sections.c fake-mach.c
515  OBJS = $(CFILES:.c=.o)
516  INSTALL_FILES = $(CFILES) $(HFILES) Makefile notes \
517                 make.defs make_defs.h librld.ofileList
518 @@ -341,8 +350,9 @@
519  makeUser.c ld.c: make.h
520  
521  make.h makeUser.c: make.defs
522 -       $(MIG) $(MIG_FLAGS) $(SRCROOT)/make.defs
523 -       rm -f makeServer.c
524 +       #~ $(MIG) $(MIG_FLAGS) $(SRCROOT)/make.defs
525 +       #~ rm -f makeServer.c
526 +       cp $(SRCROOT)/makeUser.c .
527  
528  ld_vers.o: ld_vers.c
529  ifeq "mwccppc" "$(notdir $(CC))"
530 diff -rub ./ld/layout.c ./ld/layout.c
531 --- ./ld/layout.c       Wed May 28 18:29:27 2003
532 +++ ./ld/layout.c       Mon Aug 25 23:22:05 2003
533 @@ -42,18 +42,22 @@
534  #include "stuff/openstep_mach.h"
535  #include <mach-o/fat.h> 
536  #include <mach-o/loader.h> 
537 -#import <mach/m68k/thread_status.h>
538 -#import <mach/ppc/thread_status.h>
539 -#import <mach/m88k/thread_status.h>
540 -#import <mach/i860/thread_status.h>
541 -#import <mach/i386/thread_status.h>
542 -#import <mach/hppa/thread_status.h>
543 -#import <mach/sparc/thread_status.h>
544 +#include <mach/m68k/thread_status.h>
545 +#include <mach/ppc/thread_status.h>
546 +#include <mach/m88k/thread_status.h>
547 +#include <mach/i860/thread_status.h>
548 +#include <mach/i386/thread_status.h>
549 +#include <mach/hppa/thread_status.h>
550 +#include <mach/sparc/thread_status.h>
551  #include <mach-o/nlist.h>
552  #include <mach-o/reloc.h>
553 +
554 +#include <mach/kern_return.h>
555 +
556  #if defined(RLD) && !defined(SA_RLD) && !(defined(KLD) && defined(__STATIC__))
557 +typedef void NXStream;
558  #include <mach-o/rld.h>
559 -#include <streams/streams.h>
560 +//~ #include <streams/streams.h>
561  #endif /* defined(RLD) && !defined(SA_RLD) &&
562           !(defined(KLD) && defined(__STATIC__)) */
563  #include "stuff/arch.h"
564 @@ -72,6 +76,15 @@
565  #include "sets.h"
566  #include "mach-o/sarld.h"
567  #include "indirect_sections.h"
568 +
569 +#if ( defined(__MWERKS__) && !defined(__private_extern__) )
570 +#define __private_extern__ __declspec(private_extern)
571 +#elif ( defined(__linux__) && !defined(__private_extern__) )
572 +#define __private_extern__ extern
573 +#endif
574 +
575 +/** gcc on Linux defines powerpc, if we are compiling on a powerpc. */
576 +#undef powerpc
577  
578  #ifdef RLD
579  __private_extern__ long RLD_DEBUG_OUTPUT_FILENAME_flag;
580 diff -rub ./ld/rld.c ./ld/rld.c
581 --- ./ld/rld.c  Wed May 28 18:29:32 2003
582 +++ ./ld/rld.c  Mon Aug 25 22:11:47 2003
583 @@ -56,11 +56,13 @@
584  #include "stuff/openstep_mach.h"
585  #include <mach-o/fat.h>
586  #include <mach-o/nlist.h>
587 -#ifdef KLD
588 +//~ #ifdef KLD
589  #include <mach-o/kld.h>
590 -#else /* !defined(KLD) */
591 +#ifndef KLD
592 +//~ #else /* !defined(KLD) */
593 +typedef void NXStream;
594  #include <mach-o/rld.h>
595 -#include <streams/streams.h>
596 +//~ #include <streams/streams.h>
597  #include <objc/zone.h>
598  #endif /* KLD */
599  #include <mach-o/rld_state.h>
600 diff -rub ./libstuff/Makefile ./libstuff/Makefile
601 --- ./libstuff/Makefile Fri Mar 14 18:18:30 2003
602 +++ ./libstuff/Makefile Sat Sep  6 20:12:21 2003
603 @@ -1,7 +1,7 @@
604  RC_OS = macos
605  OFLAG = -O
606  ifeq "macos" "$(RC_OS)"
607 -  X_CFLAGS := $(shell if [ "$(RC_RELEASE)" != "Beaker" ] &&    \
608 +  X_CFLAGS := $(shell if [ `uname` != "Linux" ] && [ "$(RC_RELEASE)" != "Beaker" ] &&    \
609                          [ "$(RC_RELEASE)" != "Bunsen" ] &&    \
610                          [ "$(RC_RELEASE)" != "Gonzo"  ] &&    \
611                          [ "$(RC_RELEASE)" != "Kodiak" ]; then \
612 @@ -10,14 +10,18 @@
613  endif
614  
615  
616 -USE_DEPENDENCY_FILE := $(shell if [ "$(notdir $(CC))" != "mwccppc" ]; then \
617 +USE_DEPENDENCY_FILE := $(shell if [ `uname` != "Linux" ] && [ "$(notdir $(CC))" != "mwccppc" ]; then \
618              echo YES ; else echo NO ; \
619              fi; )
620         
621  ifeq "mwccppc" "$(notdir $(CC))"
622    CFLAGS = $(OFLAG) -g -gccinc -I$(SRCROOT)/../include
623  else
624 +  ifeq "Linux" "$(shell uname)"
625 +    CFLAGS = $(OFLAG) -g -I$(SRCROOT)/../include -Wall $(X_CFLAGS) -D__LITTLE_ENDIAN__ -U__BIG_ENDIAN__ -D__ppc__ -I/usr/include -I../../../macosx-include
626 +  else
627    CFLAGS = $(OFLAG) -g -I$(SRCROOT)/../include -Wall $(X_CFLAGS)
628 +  endif
629  endif
630  
631  ifneq "" "$(wildcard /bin/mkdirs)"
632 @@ -41,7 +45,7 @@
633           breakout.c writeout.c checkout.c fatal_arch.c ofile_get_word.c \
634           vm_flush_cache.c hash_string.c dylib_roots.c guess_short_name.c \
635           SymLoc.c get_arch_from_host.c crc32.c macosx_deployment_target.c \
636 -         symbol_list.c
637 +         symbol_list.c fake-mach.c
638  OBJS = $(CFILES:.c=.o)
639  INSTALL_FILES = $(CFILES) Makefile notes
640  
641 @@ -91,7 +95,7 @@
642                 OFILE_DIR=.                                             \
643                 SRCROOT=..                                              \
644                 SYMROOT=..                                              \
645 -               COPTS="-dynamic"                                        \
646 +               COPTS=""                                        \
647                 OFLAG="$(OFLAG)"                                        \
648                 CFILES="$(CFILES)"                                      \
649                 RC_CFLAGS="$(RC_CFLAGS)"                                \
650 @@ -104,7 +108,7 @@
651                 OFILE_DIR=$(OBJROOT)/dynamic_obj                        \
652                 SRCROOT=$(SRCROOT)                                      \
653                 SYMROOT=$(SYMROOT)                                      \
654 -               COPTS="-dynamic"                                        \
655 +               COPTS=""                                        \
656                 OFLAG="$(OFLAG)"                                        \
657                 CFILES="$(CFILES)"                                      \
658                 RC_CFLAGS="$(RC_CFLAGS)"                                \
659 @@ -121,7 +125,7 @@
660                 OFILE_DIR=.                                             \
661                 SRCROOT=..                                              \
662                 SYMROOT=..                                              \
663 -               COPTS="-dynamic -pg"                                    \
664 +               COPTS="-pg"                                     \
665                 OFLAG="$(OFLAG)"                                        \
666                 RC_CFLAGS="$(RC_CFLAGS)"                                \
667                 RC_ARCHS="$(RC_ARCHS)";                                 \
668 @@ -133,7 +137,7 @@
669                 OFILE_DIR=$(OBJROOT)/profile_obj                        \
670                 SRCROOT=$(SRCROOT)                                      \
671                 SYMROOT=$(SYMROOT)                                      \
672 -               COPTS="-dynamic -pg"                                    \
673 +               COPTS="-pg"                                     \
674                 OFLAG="$(OFLAG)"                                        \
675                 RC_CFLAGS="$(RC_CFLAGS)"                                \
676                 RC_ARCHS="$(RC_ARCHS)";                                 \
677 @@ -168,7 +172,8 @@
678         fi
679  
680  $(PRODUCT):    $(OFILE_DIR) $(SYMROOT) $(OBJS)
681 -       libtool -static -o $(SYMROOT)/$(PRODUCT) $(OBJS)
682 +       ar r $(SYMROOT)/$(PRODUCT) $(OBJS)
683 +       ranlib $(SYMROOT)/$(PRODUCT)
684  
685  ifeq "NO" "$(USE_DEPENDENCY_FILE)"
686  .c.o:
687 diff -rub ./libstuff/SymLoc.c ./libstuff/SymLoc.c
688 --- ./libstuff/SymLoc.c Thu Oct 24 17:04:50 2002
689 +++ ./libstuff/SymLoc.c Mon Aug 25 13:17:40 2003
690 @@ -1,15 +1,15 @@
691 -#import <libc.h>
692 -#import <ctype.h>
693 -#import <sys/types.h>
694 +#include <libc.h>
695 +#include <ctype.h>
696 +#include <sys/types.h>
697  #ifdef __OPENSTEP__
698  #define _POSIX_SOURCE
699  #endif
700 -#import <dirent.h>
701 -#import <pwd.h>
702 -#import "stuff/bool.h"
703 -#import "stuff/errors.h"
704 -#import "stuff/allocate.h"
705 -#import "stuff/SymLoc.h"
706 +#include <dirent.h>
707 +#include <pwd.h>
708 +#include "stuff/bool.h"
709 +#include "stuff/errors.h"
710 +#include "stuff/allocate.h"
711 +#include "stuff/SymLoc.h"
712  
713  const char *
714  symLocForDylib(const char *installName, const char *releaseName,
715 diff -rub ./libstuff/bytesex.c ./libstuff/bytesex.c
716 --- ./libstuff/bytesex.c        Mon Nov 19 12:10:07 2001
717 +++ ./libstuff/bytesex.c        Mon Aug 25 13:17:40 2003
718 @@ -25,13 +25,13 @@
719  #include <string.h>
720  #include <mach-o/fat.h>
721  #include <mach-o/loader.h>
722 -#import <mach/m68k/thread_status.h>
723 -#import <mach/ppc/thread_status.h>
724 -#import <mach/m88k/thread_status.h>
725 -#import <mach/i860/thread_status.h>
726 -#import <mach/i386/thread_status.h>
727 -#import <mach/hppa/thread_status.h>
728 -#import <mach/sparc/thread_status.h>
729 +#include <mach/m68k/thread_status.h>
730 +#include <mach/ppc/thread_status.h>
731 +#include <mach/m88k/thread_status.h>
732 +#include <mach/i860/thread_status.h>
733 +#include <mach/i386/thread_status.h>
734 +#include <mach/hppa/thread_status.h>
735 +#include <mach/sparc/thread_status.h>
736  #include <mach-o/nlist.h>
737  #include <mach-o/reloc.h>
738  #include <mach-o/ranlib.h>
739 diff -rub ./libstuff/crc32.c ./libstuff/crc32.c
740 --- ./libstuff/crc32.c  Wed Feb 13 17:53:36 2002
741 +++ ./libstuff/crc32.c  Mon Aug 25 13:19:21 2003
742 @@ -35,6 +35,12 @@
743   */
744  #include <sys/types.h>
745  
746 +#if ( defined(__MWERKS__) && !defined(__private_extern__) )
747 +#define __private_extern__ __declspec(private_extern)
748 +#elif ( defined(__linux__) && !defined(__private_extern__) )
749 +#define __private_extern__ extern
750 +#endif
751 +
752  static const u_int32_t crctab[] = {
753         0x0,
754         0x04c11db7, 0x09823b6e, 0x0d4326d9, 0x130476dc, 0x17c56b6b,
755 diff -rub ./libstuff/ofile.c ./libstuff/ofile.c
756 --- ./libstuff/ofile.c  Wed Apr 16 16:15:01 2003
757 +++ ./libstuff/ofile.c  Tue Sep  2 20:15:34 2003
758 @@ -21,6 +21,7 @@
759   * 
760   * @APPLE_LICENSE_HEADER_END@
761   */
762 +#include "machine/endian.h"
763  #ifdef SHLIB
764  #include "shlib.h"
765  #endif
766 @@ -36,12 +37,12 @@
767  #include <sys/file.h>
768  #include <mach-o/fat.h>
769  #include <mach-o/loader.h>
770 -#import <mach/m68k/thread_status.h>
771 -#import <mach/ppc/thread_status.h>
772 -#import <mach/m88k/thread_status.h>
773 -#import <mach/i860/thread_status.h>
774 -#import <mach/i386/thread_status.h>
775 -#import <mach/sparc/thread_status.h>
776 +#include <mach/m68k/thread_status.h>
777 +#include <mach/ppc/thread_status.h>
778 +#include <mach/m88k/thread_status.h>
779 +#include <mach/i860/thread_status.h>
780 +#include <mach/i386/thread_status.h>
781 +#include <mach/sparc/thread_status.h>
782  #include <mach-o/nlist.h>
783  #include <mach-o/reloc.h>
784  #include "stuff/bool.h"
785 @@ -677,7 +678,7 @@
786         memset(ofile, '\0', sizeof(struct ofile));
787  
788         /* Open the file and map it in */
789 -       if((fd = open(file_name, O_RDONLY)) == -1){
790 +       if((fd = open(file_name, O_RDWR)) == -1){
791  #ifdef OFI
792             return(NSObjectFileImageAccess);
793  #else
794 @@ -975,7 +976,7 @@
795                 }
796             }
797         }
798 -       /* see if this file is Mach-O file */
799 +
800         else if(size >= sizeof(struct mach_header) &&
801                 (magic == MH_MAGIC || magic == SWAP_LONG(MH_MAGIC))){
802             ofile->file_type = OFILE_Mach_O;
803 diff -rub ./libstuff/print.c ./libstuff/print.c
804 --- ./libstuff/print.c  Thu May  6 19:30:58 1999
805 +++ ./libstuff/print.c  Mon Aug 25 13:17:40 2003
806 @@ -21,8 +21,8 @@
807   * 
808   * @APPLE_LICENSE_HEADER_END@
809   */
810 -#import <stdio.h>
811 -#import "stuff/print.h"
812 +#include <stdio.h>
813 +#include "stuff/print.h"
814  
815  /*
816   * All printing of all messages for ofile functions goes through this function.
817 diff -rub ./libstuff/swap_headers.c ./libstuff/swap_headers.c
818 --- ./libstuff/swap_headers.c   Fri Oct  4 17:54:48 2002
819 +++ ./libstuff/swap_headers.c   Mon Aug 25 13:17:40 2003
820 @@ -22,13 +22,13 @@
821   * @APPLE_LICENSE_HEADER_END@
822   */
823  #include <mach-o/loader.h>
824 -#import <mach/m68k/thread_status.h>
825 -#import <mach/ppc/thread_status.h>
826 -#import <mach/m88k/thread_status.h>
827 -#import <mach/i860/thread_status.h>
828 -#import <mach/i386/thread_status.h>
829 -#import <mach/hppa/thread_status.h>
830 -#import <mach/sparc/thread_status.h>
831 +#include <mach/m68k/thread_status.h>
832 +#include <mach/ppc/thread_status.h>
833 +#include <mach/m88k/thread_status.h>
834 +#include <mach/i860/thread_status.h>
835 +#include <mach/i386/thread_status.h>
836 +#include <mach/hppa/thread_status.h>
837 +#include <mach/sparc/thread_status.h>
838  #include "stuff/bool.h"
839  #include "stuff/bytesex.h"
840  #include "stuff/errors.h"
841 diff -rub ./misc/Makefile ./misc/Makefile
842 --- ./misc/Makefile     Fri Mar 14 18:18:30 2003
843 +++ ./misc/Makefile     Sat Sep  6 20:17:36 2003
844 @@ -2,11 +2,11 @@
845  OFLAG = -O
846  RC_OS = macos
847  ifeq "macos" "$(RC_OS)"
848 -  X_CFLAGS := $(shell if [ "$(RC_RELEASE)" != "Beaker" ] &&    \
849 +  X_CFLAGS := $(shell if [ `uname` != "Linux" ] && [ "$(RC_RELEASE)" != "Beaker" ] &&    \
850                          [ "$(RC_RELEASE)" != "Bunsen" ] &&    \
851                          [ "$(RC_RELEASE)" != "Gonzo"  ] &&    \
852                          [ "$(RC_RELEASE)" != "Kodiak" ]; then \
853 -            echo -Wno-long-double -no-cpp-precomp; \
854 +            echo -Wno-long-double -no-cpp-precomp ; \
855              fi; )
856  endif
857  
858 @@ -14,11 +14,16 @@
859    CFLAGS = $(OFLAG) -g \
860          -I$(SRCROOT) -I$(SRCROOT)/../include -I$(OFILE_DIR)
861  else
862 +  ifeq "Linux" "$(shell uname)"
863 +    CFLAGS = $(OFLAG) -g -Wall $(X_CFLAGS) \
864 +      -I$(SRCROOT) -I$(SRCROOT)/../include -I$(OFILE_DIR) -D__LITTLE_ENDIAN__ -U__BIG_ENDIAN__ -D__ppc__ -I/usr/include -I../../macosx-include
865 +  else
866    CFLAGS = $(OFLAG) -g -Wall $(X_CFLAGS) \
867          -I$(SRCROOT) -I$(SRCROOT)/../include -I$(OFILE_DIR)
868 +  endif
869  endif
870  
871 -USE_DEPENDENCY_FILE := $(shell if [ "$(notdir $(CC))" != "mwccppc" ]; then \
872 +USE_DEPENDENCY_FILE := $(shell if [ `uname` != "Linux" ] && [ "$(notdir $(CC))" != "mwccppc" ]; then \
873              echo YES ; else echo NO ; \
874              fi; )
875  
876 @@ -44,10 +49,7 @@
877  LOCLIBDIR = /usr/local/lib
878  
879  CFILES1 = libtool.c
880 -CFILES2 = main.c lipo.c size.c strings.c nm.c checksyms.c inout.c \
881 -        indr.c strip.c atom.c segedit.c kern_tool.c cmpdylib.c \
882 -        dylib_pcsampler.c pagestuff.c redo_prebinding.c seg_addr_table.c \
883 -        check_dylib.c seg_hack.c check_hints.c install_name_tool.c
884 +CFILES2 = seg_hack.c strip.c
885  ifeq "nextstep" "$(RC_OS)"
886    CFILES3 = file.c ar.c
887  endif
888 @@ -56,11 +58,7 @@
889                 notes
890  
891  
892 -PROGS = lipo.NEW size.NEW strings.NEW nm.NEW \
893 -       libtool.NEW checksyms.NEW indr.NEW strip.NEW nmedit.NEW \
894 -       segedit.NEW kern_tool.NEW cmpdylib.NEW \
895 -       dylib_pcsampler.NEW pagestuff.NEW redo_prebinding.NEW \
896 -       seg_addr_table.NEW check_dylib.NEW seg_hack.NEW install_name_tool.NEW
897 +PROGS = seg_hack.NEW strip.NEW
898  
899  teflon_all macos_all: $(PROGS)
900  
901 @@ -71,7 +69,7 @@
902  lib_ofiles: $(OFILE_DIR) $(SYMROOT) libredo_prebinding.a
903  
904  vers.c:
905 -       vers_string -c $(VERS_STRING_FLAGS) cctools_misc > $(OFILE_DIR)/$@
906 +       ./vers_string -c $(VERS_STRING_FLAGS) cctools_misc > $(OFILE_DIR)/$@
907  
908  ifeq "NO" "$(USE_DEPENDENCY_FILE)"
909  .c.o:
910 @@ -222,6 +220,7 @@
911                 $(OFILE_DIR)/seg_hack.o $(OFILE_DIR)/vers.o $(LIBSTUFF)
912         $(CC) $(CFLAGS) $(RC_CFLAGS) -o $(SYMROOT)/seg_hack.NEW \
913                 $(OFILE_DIR)/seg_hack.private.o
914 +       cp $(SYMROOT)/seg_hack.NEW $(SYMROOT)/seg_hack
915  
916  install_name_tool.NEW: install_name_tool.o vers.o
917         $(CC) $(CFLAGS) $(RC_CFLAGS) -nostdlib -r \
918 @@ -331,7 +330,8 @@
919         $(SYMROOT)/redo_prebinding.NEW \
920         $(SYMROOT)/libredo_prebinding.a \
921         $(SYMROOT)/kern_tool.NEW \
922 -       $(SYMROOT)/cmpdylib.NEW
923 +       $(SYMROOT)/cmpdylib.NEW \
924 +       $(SYMROOT)/seg_hack
925  
926  shlib_clean:
927         -rm -f \
928 --- ld/makeUser.c       Sat Sep  6 21:52:24 2003
929 +++ ld/makeUser.c       Mon Aug 25 22:54:46 2003
930 @@ -0,0 +1,305 @@
931 +/*
932 + * IDENTIFICATION:
933 + * stub generated Mon Aug 25 15:06:30 2003
934 + * with a MiG generated Tue Nov 5 01:17:50 PST 2002 by root@brixen
935 + * OPTIONS: 
936 + */
937 +#include "make.h"
938 +
939 +
940 +#ifndef        mig_internal
941 +#define        mig_internal    static
942 +#endif /* mig_internal */
943 +
944 +#ifndef        mig_external
945 +#define mig_external
946 +#endif /* mig_external */
947 +
948 +#ifndef        TypeCheck
949 +#define        TypeCheck 0
950 +#endif /* TypeCheck */
951 +
952 +#ifndef        LimitCheck
953 +#define        LimitCheck 0
954 +#endif /* LimitCheck */
955 +
956 +#ifndef        min
957 +#define        min(a,b)  ( ((a) < (b))? (a): (b) )
958 +#endif /* min */
959 +
960 +#ifndef        UseStaticTemplates
961 +#define        UseStaticTemplates      0
962 +#endif /* UseStaticTemplates */
963 +
964 +#define _WALIGN_(x) (((x) + 3) & ~3)
965 +#define _WALIGNSZ_(x) _WALIGN_(sizeof(x))
966 +#ifndef        __MachMsgErrorWithTimeout
967 +#define        __MachMsgErrorWithTimeout(_R_) { \
968 +       switch (_R_) { \
969 +       case MACH_SEND_INVALID_REPLY: \
970 +       case MACH_RCV_INVALID_NAME: \
971 +       case MACH_RCV_PORT_DIED: \
972 +       case MACH_RCV_PORT_CHANGED: \
973 +       case MACH_RCV_TIMED_OUT: \
974 +               mig_dealloc_reply_port(InP->Head.msgh_reply_port); \
975 +               break; \
976 +       default: \
977 +               mig_put_reply_port(InP->Head.msgh_reply_port); \
978 +       } \
979 +}
980 +#endif /* __MachMsgErrorWithTimeout */
981 +
982 +#ifndef        __MachMsgErrorWithoutTimeout
983 +#define        __MachMsgErrorWithoutTimeout(_R_) { \
984 +       switch (_R_) { \
985 +       case MACH_SEND_INVALID_REPLY: \
986 +       case MACH_RCV_INVALID_NAME: \
987 +       case MACH_RCV_PORT_DIED: \
988 +       case MACH_RCV_PORT_CHANGED: \
989 +               mig_dealloc_reply_port(InP->Head.msgh_reply_port); \
990 +               break; \
991 +       default: \
992 +               mig_put_reply_port(InP->Head.msgh_reply_port); \
993 +       } \
994 +}
995 +#endif /* __MachMsgErrorWithoutTimeout */
996 +
997 +#ifndef        __DeclareSendRpc
998 +#define        __DeclareSendRpc(_NUM_, _NAME_)
999 +#endif /* __DeclareSendRpc */
1000 +
1001 +#ifndef        __BeforeSendRpc
1002 +#define        __BeforeSendRpc(_NUM_, _NAME_)
1003 +#endif /* __BeforeSendRpc */
1004 +
1005 +#ifndef        __AfterSendRpc
1006 +#define        __AfterSendRpc(_NUM_, _NAME_)
1007 +#endif /* __AfterSendRpc */
1008 +
1009 +#ifndef        __DeclareSendSimple
1010 +#define        __DeclareSendSimple(_NUM_, _NAME_)
1011 +#endif /* __DeclareSendSimple */
1012 +
1013 +#ifndef        __BeforeSendSimple
1014 +#define        __BeforeSendSimple(_NUM_, _NAME_)
1015 +#endif /* __BeforeSendSimple */
1016 +
1017 +#ifndef        __AfterSendSimple
1018 +#define        __AfterSendSimple(_NUM_, _NAME_)
1019 +#endif /* __AfterSendSimple */
1020 +
1021 +#define msgh_request_port      msgh_remote_port
1022 +#define msgh_reply_port                msgh_local_port
1023 +
1024 +
1025 +
1026 +/* SimpleRoutine alert_old */
1027 +mig_external kern_return_t make_alert_old
1028 +(
1029 +       mach_port_t makePort,
1030 +       int eventType,
1031 +       make_string_t functionName,
1032 +       mach_msg_type_number_t functionNameCnt,
1033 +       make_string_t fileName,
1034 +       mach_msg_type_number_t fileNameCnt,
1035 +       int line,
1036 +       make_string_t message,
1037 +       mach_msg_type_number_t messageCnt
1038 +)
1039 +{
1040 +    {
1041 +       typedef struct {
1042 +               mach_msg_header_t Head;
1043 +               NDR_record_t NDR;
1044 +               int eventType;
1045 +               mach_msg_type_number_t functionNameCnt;
1046 +               char functionName[1024];
1047 +               mach_msg_type_number_t fileNameCnt;
1048 +               char fileName[1024];
1049 +               int line;
1050 +               mach_msg_type_number_t messageCnt;
1051 +               char message[1024];
1052 +       } Request;
1053 +
1054 +       /*
1055 +        * typedef struct {
1056 +        *      mach_msg_header_t Head;
1057 +        *      NDR_record_t NDR;
1058 +        *      kern_return_t RetCode;
1059 +        * } mig_reply_error_t;
1060 +        */
1061 +
1062 +       union {
1063 +               Request In;
1064 +       } Mess;
1065 +
1066 +       register Request *InP = &Mess.In;
1067 +
1068 +       mach_msg_return_t msg_result;
1069 +       unsigned int msgh_size;
1070 +       unsigned int msgh_size_delta;
1071 +       __DeclareSendSimple(100, "alert_old")
1072 +
1073 +       InP->NDR = NDR_record;
1074 +
1075 +       InP->eventType = eventType;
1076 +
1077 +       if (functionNameCnt > 1024) {
1078 +               { return MIG_ARRAY_TOO_LARGE; }
1079 +       }
1080 +       (void)memcpy((char *) InP->functionName, (const char *) functionName, functionNameCnt);
1081 +
1082 +       InP->functionNameCnt = functionNameCnt;
1083 +
1084 +       msgh_size_delta = _WALIGN_(functionNameCnt);
1085 +       msgh_size = (sizeof(Request) - 3072) + msgh_size_delta;
1086 +       InP = (Request *) ((pointer_t) InP + msgh_size_delta - 1024);
1087 +
1088 +       if (fileNameCnt > 1024) {
1089 +               { return MIG_ARRAY_TOO_LARGE; }
1090 +       }
1091 +       (void)memcpy((char *) InP->fileName, (const char *) fileName, fileNameCnt);
1092 +
1093 +       InP->fileNameCnt = fileNameCnt;
1094 +
1095 +       msgh_size_delta = _WALIGN_(fileNameCnt);
1096 +       msgh_size += msgh_size_delta;
1097 +       InP = (Request *) ((pointer_t) InP + msgh_size_delta - 1024);
1098 +
1099 +       InP->line = line;
1100 +
1101 +       if (messageCnt > 1024) {
1102 +               { return MIG_ARRAY_TOO_LARGE; }
1103 +       }
1104 +       (void)memcpy((char *) InP->message, (const char *) message, messageCnt);
1105 +
1106 +       InP->messageCnt = messageCnt;
1107 +
1108 +       msgh_size += _WALIGN_(messageCnt);
1109 +       InP = &Mess.In;
1110 +       InP->Head.msgh_bits =
1111 +               MACH_MSGH_BITS(19, 0);
1112 +       /* msgh_size passed as argument */
1113 +       InP->Head.msgh_request_port = makePort;
1114 +       InP->Head.msgh_reply_port = MACH_PORT_NULL;
1115 +       InP->Head.msgh_id = 100;
1116 +
1117 +       __BeforeSendSimple(100, "alert_old")
1118 +       msg_result = mach_msg(&InP->Head, MACH_SEND_MSG|MACH_MSG_OPTION_NONE, msgh_size, 0, MACH_PORT_NULL, MACH_MSG_TIMEOUT_NONE, MACH_PORT_NULL);
1119 +       __AfterSendSimple(100, "alert_old")
1120 +               return msg_result;
1121 +    }
1122 +}
1123 +
1124 +/* SimpleRoutine alert */
1125 +mig_external kern_return_t make_alert
1126 +(
1127 +       mach_port_t makePort,
1128 +       int eventType,
1129 +       make_string_t functionName,
1130 +       mach_msg_type_number_t functionNameCnt,
1131 +       make_string_t fileName,
1132 +       mach_msg_type_number_t fileNameCnt,
1133 +       make_string_t directory,
1134 +       mach_msg_type_number_t directoryCnt,
1135 +       int line,
1136 +       make_string_t message,
1137 +       mach_msg_type_number_t messageCnt
1138 +)
1139 +{
1140 +    {
1141 +       typedef struct {
1142 +               mach_msg_header_t Head;
1143 +               NDR_record_t NDR;
1144 +               int eventType;
1145 +               mach_msg_type_number_t functionNameCnt;
1146 +               char functionName[1024];
1147 +               mach_msg_type_number_t fileNameCnt;
1148 +               char fileName[1024];
1149 +               mach_msg_type_number_t directoryCnt;
1150 +               char directory[1024];
1151 +               int line;
1152 +               mach_msg_type_number_t messageCnt;
1153 +               char message[1024];
1154 +       } Request;
1155 +
1156 +       /*
1157 +        * typedef struct {
1158 +        *      mach_msg_header_t Head;
1159 +        *      NDR_record_t NDR;
1160 +        *      kern_return_t RetCode;
1161 +        * } mig_reply_error_t;
1162 +        */
1163 +
1164 +       union {
1165 +               Request In;
1166 +       } Mess;
1167 +
1168 +       register Request *InP = &Mess.In;
1169 +
1170 +       mach_msg_return_t msg_result;
1171 +       unsigned int msgh_size;
1172 +       unsigned int msgh_size_delta;
1173 +       __DeclareSendSimple(101, "alert")
1174 +
1175 +       InP->NDR = NDR_record;
1176 +
1177 +       InP->eventType = eventType;
1178 +
1179 +       if (functionNameCnt > 1024) {
1180 +               { return MIG_ARRAY_TOO_LARGE; }
1181 +       }
1182 +       (void)memcpy((char *) InP->functionName, (const char *) functionName, functionNameCnt);
1183 +
1184 +       InP->functionNameCnt = functionNameCnt;
1185 +
1186 +       msgh_size_delta = _WALIGN_(functionNameCnt);
1187 +       msgh_size = (sizeof(Request) - 4096) + msgh_size_delta;
1188 +       InP = (Request *) ((pointer_t) InP + msgh_size_delta - 1024);
1189 +
1190 +       if (fileNameCnt > 1024) {
1191 +               { return MIG_ARRAY_TOO_LARGE; }
1192 +       }
1193 +       (void)memcpy((char *) InP->fileName, (const char *) fileName, fileNameCnt);
1194 +
1195 +       InP->fileNameCnt = fileNameCnt;
1196 +
1197 +       msgh_size_delta = _WALIGN_(fileNameCnt);
1198 +       msgh_size += msgh_size_delta;
1199 +       InP = (Request *) ((pointer_t) InP + msgh_size_delta - 1024);
1200 +
1201 +       if (directoryCnt > 1024) {
1202 +               { return MIG_ARRAY_TOO_LARGE; }
1203 +       }
1204 +       (void)memcpy((char *) InP->directory, (const char *) directory, directoryCnt);
1205 +
1206 +       InP->directoryCnt = directoryCnt;
1207 +
1208 +       msgh_size_delta = _WALIGN_(directoryCnt);
1209 +       msgh_size += msgh_size_delta;
1210 +       InP = (Request *) ((pointer_t) InP + msgh_size_delta - 1024);
1211 +
1212 +       InP->line = line;
1213 +
1214 +       if (messageCnt > 1024) {
1215 +               { return MIG_ARRAY_TOO_LARGE; }
1216 +       }
1217 +       (void)memcpy((char *) InP->message, (const char *) message, messageCnt);
1218 +
1219 +       InP->messageCnt = messageCnt;
1220 +
1221 +       msgh_size += _WALIGN_(messageCnt);
1222 +       InP = &Mess.In;
1223 +       InP->Head.msgh_bits =
1224 +               MACH_MSGH_BITS(19, 0);
1225 +       /* msgh_size passed as argument */
1226 +       InP->Head.msgh_request_port = makePort;
1227 +       InP->Head.msgh_reply_port = MACH_PORT_NULL;
1228 +       InP->Head.msgh_id = 101;
1229 +
1230 +       __BeforeSendSimple(101, "alert")
1231 +       msg_result = mach_msg(&InP->Head, MACH_SEND_MSG|MACH_MSG_OPTION_NONE, msgh_size, 0, MACH_PORT_NULL, MACH_MSG_TIMEOUT_NONE, MACH_PORT_NULL);
1232 +       __AfterSendSimple(101, "alert")
1233 +               return msg_result;
1234 +    }
1235 +}
1236 diff -bur ./Makefile /home/megacz/xwt/upstream/darwin-linker/src/cctools/as/Makefile
1237 --- as/Makefile Fri Sep  6 18:27:10 2002
1238 +++ as/Makefile Sat Sep  6 23:52:22 2003
1239 @@ -2,7 +2,7 @@
1240  export USE_APPLE_PB_SUPPORT = all
1241  OFLAG = -O
1242  ifeq "macos" "$(RC_OS)"
1243 -  X_CFLAGS := $(shell if [ "$(RC_RELEASE)" != "Beaker" ] &&    \
1244 +  X_CFLAGS := $(shell if [ `uname` != "Linux" ] && [ "$(RC_RELEASE)" != "Beaker" ] &&    \
1245                          [ "$(RC_RELEASE)" != "Bunsen" ] &&    \
1246                          [ "$(RC_RELEASE)" != "Gonzo"  ] &&    \
1247                          [ "$(RC_RELEASE)" != "Kodiak" ]; then \
1248 @@ -11,10 +11,14 @@
1249  endif
1250  
1251  ifneq "mwccppc" "$(notdir $(CC))"
1252 +  ifeq "Linux" "$(shell uname)"
1253 +    GCC_FLAGS = -Wall $(X_CFLAGS) -D__LITTLE_ENDIAN__ -U__BIG_ENDIAN__  -D__ppc__ -I/usr/include -I../../../macosx-include
1254 +  else
1255    GCC_FLAGS = -Wall -Wno-precomp $(X_CFLAGS)
1256 +  endif
1257  endif
1258  
1259 -USE_DEPENDENCY_FILE := $(shell if [ "$(notdir $(CC))" != "mwccppc" ]; then \
1260 +USE_DEPENDENCY_FILE := $(shell if [ `uname` != "Linux" ] && [ "$(notdir $(CC))" != "mwccppc" ]; then \
1261              echo YES ; else echo NO ; \
1262              fi; )
1263  
1264 diff -bur ./app.h /home/megacz/xwt/upstream/darwin-linker/src/cctools/as/app.h
1265 --- as/app.h    Tue Apr 30 00:37:17 2002
1266 +++ as/app.h    Sat Sep  6 23:49:28 2003
1267 @@ -1,4 +1,4 @@
1268 -#import <stdio.h>
1269 +#include <stdio.h>
1270  
1271  extern FILE *scrub_file;
1272  extern char *scrub_string;
1273 diff -bur ./as.h /home/megacz/xwt/upstream/darwin-linker/src/cctools/as/as.h
1274 --- as/as.h     Tue Apr 30 00:37:17 2002
1275 +++ as/as.h     Sat Sep  6 23:49:28 2003
1276 @@ -43,10 +43,10 @@
1277   */
1278  #undef SUSPECT
1279  
1280 -/* These #imports are for type definitions etc. */
1281 -#import <stdio.h>
1282 -#import <assert.h>
1283 -#import <mach/machine.h>
1284 +/* These #includes are for type definitions etc. */
1285 +#include <stdio.h>
1286 +#include <assert.h>
1287 +#include <mach/machine.h>
1288  
1289  /* These defines are potentially useful */
1290  #undef FALSE
1291 Only in /home/megacz/xwt/upstream/darwin-linker/src/cctools/as: asparc_dir
1292 diff -bur ./atof-ieee.h /home/megacz/xwt/upstream/darwin-linker/src/cctools/as/atof-ieee.h
1293 --- as/atof-ieee.h      Tue Apr 30 00:37:17 2002
1294 +++ as/atof-ieee.h      Sat Sep  6 23:49:28 2003
1295 @@ -1,4 +1,4 @@
1296 -#import "flonum.h"
1297 +#include "flonum.h"
1298  
1299  extern char *atof_ieee(
1300      char *str,
1301 diff -bur ./bignum.h /home/megacz/xwt/upstream/darwin-linker/src/cctools/as/bignum.h
1302 --- as/bignum.h Tue Apr 30 00:37:17 2002
1303 +++ as/bignum.h Sat Sep  6 23:53:27 2003
1304 @@ -28,6 +28,8 @@
1305  *      Bignums are >= 0.                                               *
1306  *                                                                      *
1307  \***********************************************************************/
1308 +#ifndef __BIGNUM_H__
1309 +#define __BIGNUM_H__
1310  
1311  #define        LITTLENUM_NUMBER_OF_BITS        (16)
1312  #define        LITTLENUM_RADIX                 (1 << LITTLENUM_NUMBER_OF_BITS)
1313 @@ -44,3 +46,4 @@
1314  /* JF truncated this to get around a problem with GCC */
1315  #define        LOG_TO_BASE_2_OF_10     (3.3219280948873623478703194294893901758651)
1316  /* WARNING: I haven't checked that the trailing digits are correct! */
1317 +#endif
1318 diff -bur ./expr.h /home/megacz/xwt/upstream/darwin-linker/src/cctools/as/expr.h
1319 --- as/expr.h   Fri Sep  6 18:27:10 2002
1320 +++ as/expr.h   Sat Sep  6 23:49:28 2003
1321 @@ -19,9 +19,9 @@
1322  along with GAS; see the file COPYING.  If not, write to
1323  the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  */
1324  
1325 -#import "struc-symbol.h"
1326 -#import "bignum.h"
1327 -#import "flonum.h"
1328 +#include "struc-symbol.h"
1329 +#include "bignum.h"
1330 +#include "flonum.h"
1331  
1332  /*
1333   * This table describes the use of segments as EXPRESSION types.
1334 diff -bur ./flonum.h /home/megacz/xwt/upstream/darwin-linker/src/cctools/as/flonum.h
1335 --- as/flonum.h Fri Sep  6 18:27:10 2002
1336 +++ as/flonum.h Sat Sep  6 23:49:28 2003
1337 @@ -32,7 +32,7 @@
1338  *                                                                      *
1339  \***********************************************************************/
1340  
1341 -#import "bignum.h"
1342 +#include "bignum.h"
1343  
1344  /***********************************************************************\
1345  *                                                                      *
1346 diff -bur ./frags.h /home/megacz/xwt/upstream/darwin-linker/src/cctools/as/frags.h
1347 --- as/frags.h  Tue Jan 14 23:35:18 2003
1348 +++ as/frags.h  Sat Sep  6 23:49:28 2003
1349 @@ -19,8 +19,8 @@
1350  along with GAS; see the file COPYING.  If not, write to
1351  the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  */
1352  
1353 -#import "relax.h"
1354 -#import "struc-symbol.h"
1355 +#include "relax.h"
1356 +#include "struc-symbol.h"
1357  
1358  /*
1359   * A code fragment (frag) is some known number of chars, followed by some
1360 diff -bur ./md.h /home/megacz/xwt/upstream/darwin-linker/src/cctools/as/md.h
1361 --- as/md.h     Tue Apr 30 00:37:17 2002
1362 +++ as/md.h     Sat Sep  6 23:49:29 2003
1363 @@ -19,13 +19,13 @@
1364  in a file named COPYING.  Among other things, the copyright
1365  notice and this notice must be preserved on all copies.  */
1366  
1367 -#import <mach/machine.h>
1368 -#import "stuff/bytesex.h"
1369 -#import "frags.h"
1370 -#import "relax.h"
1371 -#import "struc-symbol.h"
1372 -#import "fixes.h"
1373 -#import "read.h"
1374 +#include <mach/machine.h>
1375 +#include "stuff/bytesex.h"
1376 +#include "frags.h"
1377 +#include "relax.h"
1378 +#include "struc-symbol.h"
1379 +#include "fixes.h"
1380 +#include "read.h"
1381  
1382  /* These are the default cputype and cpusubtype for this target MACHINE */
1383  extern const cpu_type_t md_cputype;
1384 diff -bur ./read.h /home/megacz/xwt/upstream/darwin-linker/src/cctools/as/read.h
1385 --- as/read.h   Fri Sep  6 18:27:13 2002
1386 +++ as/read.h   Sat Sep  6 23:49:29 2003
1387 @@ -19,7 +19,7 @@
1388  along with GAS; see the file COPYING.  If not, write to
1389  the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  */
1390  
1391 -#import "expr.h"
1392 +#include "expr.h"
1393  
1394  #define PERMIT_WHITESPACE      /* Define to make whitespace be allowed in */
1395                                 /* many syntactically unnecessary places. */
1396 diff -bur ./relax.h /home/megacz/xwt/upstream/darwin-linker/src/cctools/as/relax.h
1397 --- as/relax.h  Tue Apr 30 00:37:17 2002
1398 +++ as/relax.h  Sat Sep  6 23:53:35 2003
1399 @@ -1,3 +1,5 @@
1400 +#ifndef __RELAX_H__
1401 +#define __RELAX_H__
1402  /* The type used for a target address */
1403  typedef unsigned long relax_addressT;
1404  
1405 @@ -42,3 +44,4 @@
1406      relax_substateT rlx_more;    /* Next longer relax-state. */
1407                                   /* 0 means there is no 'next' relax-state. */
1408  } relax_typeS;
1409 +#endif
1410 diff -bur ./sections.h /home/megacz/xwt/upstream/darwin-linker/src/cctools/as/sections.h
1411 --- as/sections.h       Tue Apr 30 00:37:17 2002
1412 +++ as/sections.h       Sat Sep  6 23:49:29 2003
1413 @@ -17,8 +17,8 @@
1414  along with GAS; see the file COPYING.  If not, write to
1415  the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  */
1416  
1417 -#import <mach-o/loader.h>
1418 -#import "struc-symbol.h"
1419 +#include <mach-o/loader.h>
1420 +#include "struc-symbol.h"
1421  
1422  /*
1423   * For every section the user mentions in the assembley program, we make one
1424 diff -bur ./struc-symbol.h /home/megacz/xwt/upstream/darwin-linker/src/cctools/as/struc-symbol.h
1425 --- as/struc-symbol.h   Fri Sep  6 18:27:14 2002
1426 +++ as/struc-symbol.h   Sat Sep  6 23:49:29 2003
1427 @@ -20,7 +20,7 @@
1428  the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  */
1429  
1430  #ifdef NeXT_MOD
1431 -#import <mach-o/nlist.h>
1432 +#include <mach-o/nlist.h>
1433  #else /* !defined(NeXT_MOD) */
1434  #ifndef                VMS
1435  #include "a.out.h"             /* Needed to define struct nlist. Sigh. */
1436 diff -bur ./symbols.h /home/megacz/xwt/upstream/darwin-linker/src/cctools/as/symbols.h
1437 --- as/symbols.h        Tue Apr 30 00:37:17 2002
1438 +++ as/symbols.h        Sat Sep  6 23:49:29 2003
1439 @@ -17,8 +17,8 @@
1440  along with GAS; see the file COPYING.  If not, write to
1441  the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  */
1442  
1443 -#import "struc-symbol.h"
1444 -#import "hash.h"
1445 +#include "struc-symbol.h"
1446 +#include "hash.h"
1447  
1448  extern struct hash_control *sy_hash;
1449  extern struct obstack notes;
1450 --- as/make.h   Sun Sep  7 00:01:26 2003
1451 +++ as/make.h   Sat Sep  6 23:55:11 2003
1452 @@ -0,0 +1,161 @@
1453 +#ifndef        _make_user_
1454 +#define        _make_user_
1455 +
1456 +/* Module make */
1457 +
1458 +#include <string.h>
1459 +#include <mach/ndr.h>
1460 +#include <mach/boolean.h>
1461 +#include <mach/kern_return.h>
1462 +#include <mach/notify.h>
1463 +#include <mach/mach_types.h>
1464 +#include <mach/message.h>
1465 +#include <mach/mig_errors.h>
1466 +#include <mach/port.h>
1467 +
1468 +#ifdef AUTOTEST
1469 +#ifndef FUNCTION_PTR_T
1470 +#define FUNCTION_PTR_T
1471 +typedef void (*function_ptr_t)(mach_port_t, char *, mach_msg_type_number_t);
1472 +typedef struct {
1473 +        char            *name;
1474 +        function_ptr_t  function;
1475 +} function_table_entry;
1476 +typedef function_table_entry   *function_table_t;
1477 +#endif /* FUNCTION_PTR_T */
1478 +#endif /* AUTOTEST */
1479 +
1480 +#ifndef        make_MSG_COUNT
1481 +#define        make_MSG_COUNT  2
1482 +#endif /* make_MSG_COUNT */
1483 +
1484 +#include <mach/std_types.h>
1485 +#include <mach/mig.h>
1486 +#include "make_defs.h"
1487 +
1488 +#ifdef __BeforeMigUserHeader
1489 +__BeforeMigUserHeader
1490 +#endif /* __BeforeMigUserHeader */
1491 +
1492 +
1493 +/* SimpleRoutine alert_old */
1494 +#ifdef mig_external
1495 +mig_external
1496 +#else
1497 +extern
1498 +#endif /* mig_external */
1499 +kern_return_t make_alert_old
1500 +(
1501 +       mach_port_t makePort,
1502 +       int eventType,
1503 +       make_string_t functionName,
1504 +       mach_msg_type_number_t functionNameCnt,
1505 +       make_string_t fileName,
1506 +       mach_msg_type_number_t fileNameCnt,
1507 +       int line,
1508 +       make_string_t message,
1509 +       mach_msg_type_number_t messageCnt
1510 +);
1511 +
1512 +/* SimpleRoutine alert */
1513 +#ifdef mig_external
1514 +mig_external
1515 +#else
1516 +extern
1517 +#endif /* mig_external */
1518 +kern_return_t make_alert
1519 +(
1520 +       mach_port_t makePort,
1521 +       int eventType,
1522 +       make_string_t functionName,
1523 +       mach_msg_type_number_t functionNameCnt,
1524 +       make_string_t fileName,
1525 +       mach_msg_type_number_t fileNameCnt,
1526 +       make_string_t directory,
1527 +       mach_msg_type_number_t directoryCnt,
1528 +       int line,
1529 +       make_string_t message,
1530 +       mach_msg_type_number_t messageCnt
1531 +);
1532 +/* typedefs for all requests */
1533 +
1534 +#ifndef __Request__make_subsystem__defined
1535 +#define __Request__make_subsystem__defined
1536 +       typedef struct {
1537 +               mach_msg_header_t Head;
1538 +               NDR_record_t NDR;
1539 +               int eventType;
1540 +               mach_msg_type_number_t functionNameCnt;
1541 +               char functionName[1024];
1542 +               mach_msg_type_number_t fileNameCnt;
1543 +               char fileName[1024];
1544 +               int line;
1545 +               mach_msg_type_number_t messageCnt;
1546 +               char message[1024];
1547 +       } __Request__alert_old_t;
1548 +
1549 +       typedef struct {
1550 +               mach_msg_header_t Head;
1551 +               NDR_record_t NDR;
1552 +               int eventType;
1553 +               mach_msg_type_number_t functionNameCnt;
1554 +               char functionName[1024];
1555 +               mach_msg_type_number_t fileNameCnt;
1556 +               char fileName[1024];
1557 +               mach_msg_type_number_t directoryCnt;
1558 +               char directory[1024];
1559 +               int line;
1560 +               mach_msg_type_number_t messageCnt;
1561 +               char message[1024];
1562 +       } __Request__alert_t;
1563 +
1564 +#endif /* !__Request__make_subsystem__defined */
1565 +
1566 +/* union of all requests */
1567 +
1568 +#ifndef __RequestUnion__make_make_subsystem__defined
1569 +#define __RequestUnion__make_make_subsystem__defined
1570 +union __RequestUnion__make_make_subsystem {
1571 +       __Request__alert_old_t Request_make_alert_old;
1572 +       __Request__alert_t Request_make_alert;
1573 +};
1574 +#endif /* !__RequestUnion__make_make_subsystem__defined */
1575 +/* typedefs for all replies */
1576 +
1577 +#ifndef __Reply__make_subsystem__defined
1578 +#define __Reply__make_subsystem__defined
1579 +       typedef struct {
1580 +               mach_msg_header_t Head;
1581 +               NDR_record_t NDR;
1582 +               kern_return_t RetCode;
1583 +       } __Reply__alert_old_t;
1584 +
1585 +       typedef struct {
1586 +               mach_msg_header_t Head;
1587 +               NDR_record_t NDR;
1588 +               kern_return_t RetCode;
1589 +       } __Reply__alert_t;
1590 +
1591 +#endif /* !__Reply__make_subsystem__defined */
1592 +
1593 +/* union of all replies */
1594 +
1595 +#ifndef __ReplyUnion__make_make_subsystem__defined
1596 +#define __ReplyUnion__make_make_subsystem__defined
1597 +union __ReplyUnion__make_make_subsystem {
1598 +       __Reply__alert_old_t Reply_make_alert_old;
1599 +       __Reply__alert_t Reply_make_alert;
1600 +};
1601 +#endif /* !__RequestUnion__make_make_subsystem__defined */
1602 +
1603 +#ifndef subsystem_to_name_map_make
1604 +#define subsystem_to_name_map_make \
1605 +    { "alert_old", 100 },\
1606 +    { "alert", 101 }
1607 +#endif
1608 +
1609 +#ifdef __AfterMigUserHeader
1610 +__AfterMigUserHeader
1611 +#endif /* __AfterMigUserHeader */
1612 +
1613 +#endif  /* _make_user_ */
1614 --- as/makeUser.c       Sun Sep  7 00:01:26 2003
1615 +++ as/makeUser.c       Sat Sep  6 23:55:11 2003
1616 @@ -0,0 +1,305 @@
1617 +/*
1618 + * IDENTIFICATION:
1619 + * stub generated Sat Sep  6 23:50:34 2003
1620 + * with a MiG generated Tue Nov 5 01:17:50 PST 2002 by root@brixen
1621 + * OPTIONS: 
1622 + */
1623 +#include "make.h"
1624 +
1625 +
1626 +#ifndef        mig_internal
1627 +#define        mig_internal    static
1628 +#endif /* mig_internal */
1629 +
1630 +#ifndef        mig_external
1631 +#define mig_external
1632 +#endif /* mig_external */
1633 +
1634 +#ifndef        TypeCheck
1635 +#define        TypeCheck 0
1636 +#endif /* TypeCheck */
1637 +
1638 +#ifndef        LimitCheck
1639 +#define        LimitCheck 0
1640 +#endif /* LimitCheck */
1641 +
1642 +#ifndef        min
1643 +#define        min(a,b)  ( ((a) < (b))? (a): (b) )
1644 +#endif /* min */
1645 +
1646 +#ifndef        UseStaticTemplates
1647 +#define        UseStaticTemplates      0
1648 +#endif /* UseStaticTemplates */
1649 +
1650 +#define _WALIGN_(x) (((x) + 3) & ~3)
1651 +#define _WALIGNSZ_(x) _WALIGN_(sizeof(x))
1652 +#ifndef        __MachMsgErrorWithTimeout
1653 +#define        __MachMsgErrorWithTimeout(_R_) { \
1654 +       switch (_R_) { \
1655 +       case MACH_SEND_INVALID_REPLY: \
1656 +       case MACH_RCV_INVALID_NAME: \
1657 +       case MACH_RCV_PORT_DIED: \
1658 +       case MACH_RCV_PORT_CHANGED: \
1659 +       case MACH_RCV_TIMED_OUT: \
1660 +               mig_dealloc_reply_port(InP->Head.msgh_reply_port); \
1661 +               break; \
1662 +       default: \
1663 +               mig_put_reply_port(InP->Head.msgh_reply_port); \
1664 +       } \
1665 +}
1666 +#endif /* __MachMsgErrorWithTimeout */
1667 +
1668 +#ifndef        __MachMsgErrorWithoutTimeout
1669 +#define        __MachMsgErrorWithoutTimeout(_R_) { \
1670 +       switch (_R_) { \
1671 +       case MACH_SEND_INVALID_REPLY: \
1672 +       case MACH_RCV_INVALID_NAME: \
1673 +       case MACH_RCV_PORT_DIED: \
1674 +       case MACH_RCV_PORT_CHANGED: \
1675 +               mig_dealloc_reply_port(InP->Head.msgh_reply_port); \
1676 +               break; \
1677 +       default: \
1678 +               mig_put_reply_port(InP->Head.msgh_reply_port); \
1679 +       } \
1680 +}
1681 +#endif /* __MachMsgErrorWithoutTimeout */
1682 +
1683 +#ifndef        __DeclareSendRpc
1684 +#define        __DeclareSendRpc(_NUM_, _NAME_)
1685 +#endif /* __DeclareSendRpc */
1686 +
1687 +#ifndef        __BeforeSendRpc
1688 +#define        __BeforeSendRpc(_NUM_, _NAME_)
1689 +#endif /* __BeforeSendRpc */
1690 +
1691 +#ifndef        __AfterSendRpc
1692 +#define        __AfterSendRpc(_NUM_, _NAME_)
1693 +#endif /* __AfterSendRpc */
1694 +
1695 +#ifndef        __DeclareSendSimple
1696 +#define        __DeclareSendSimple(_NUM_, _NAME_)
1697 +#endif /* __DeclareSendSimple */
1698 +
1699 +#ifndef        __BeforeSendSimple
1700 +#define        __BeforeSendSimple(_NUM_, _NAME_)
1701 +#endif /* __BeforeSendSimple */
1702 +
1703 +#ifndef        __AfterSendSimple
1704 +#define        __AfterSendSimple(_NUM_, _NAME_)
1705 +#endif /* __AfterSendSimple */
1706 +
1707 +#define msgh_request_port      msgh_remote_port
1708 +#define msgh_reply_port                msgh_local_port
1709 +
1710 +
1711 +
1712 +/* SimpleRoutine alert_old */
1713 +mig_external kern_return_t make_alert_old
1714 +(
1715 +       mach_port_t makePort,
1716 +       int eventType,
1717 +       make_string_t functionName,
1718 +       mach_msg_type_number_t functionNameCnt,
1719 +       make_string_t fileName,
1720 +       mach_msg_type_number_t fileNameCnt,
1721 +       int line,
1722 +       make_string_t message,
1723 +       mach_msg_type_number_t messageCnt
1724 +)
1725 +{
1726 +    {
1727 +       typedef struct {
1728 +               mach_msg_header_t Head;
1729 +               NDR_record_t NDR;
1730 +               int eventType;
1731 +               mach_msg_type_number_t functionNameCnt;
1732 +               char functionName[1024];
1733 +               mach_msg_type_number_t fileNameCnt;
1734 +               char fileName[1024];
1735 +               int line;
1736 +               mach_msg_type_number_t messageCnt;
1737 +               char message[1024];
1738 +       } Request;
1739 +
1740 +       /*
1741 +        * typedef struct {
1742 +        *      mach_msg_header_t Head;
1743 +        *      NDR_record_t NDR;
1744 +        *      kern_return_t RetCode;
1745 +        * } mig_reply_error_t;
1746 +        */
1747 +
1748 +       union {
1749 +               Request In;
1750 +       } Mess;
1751 +
1752 +       register Request *InP = &Mess.In;
1753 +
1754 +       mach_msg_return_t msg_result;
1755 +       unsigned int msgh_size;
1756 +       unsigned int msgh_size_delta;
1757 +       __DeclareSendSimple(100, "alert_old")
1758 +
1759 +       InP->NDR = NDR_record;
1760 +
1761 +       InP->eventType = eventType;
1762 +
1763 +       if (functionNameCnt > 1024) {
1764 +               { return MIG_ARRAY_TOO_LARGE; }
1765 +       }
1766 +       (void)memcpy((char *) InP->functionName, (const char *) functionName, functionNameCnt);
1767 +
1768 +       InP->functionNameCnt = functionNameCnt;
1769 +
1770 +       msgh_size_delta = _WALIGN_(functionNameCnt);
1771 +       msgh_size = (sizeof(Request) - 3072) + msgh_size_delta;
1772 +       InP = (Request *) ((pointer_t) InP + msgh_size_delta - 1024);
1773 +
1774 +       if (fileNameCnt > 1024) {
1775 +               { return MIG_ARRAY_TOO_LARGE; }
1776 +       }
1777 +       (void)memcpy((char *) InP->fileName, (const char *) fileName, fileNameCnt);
1778 +
1779 +       InP->fileNameCnt = fileNameCnt;
1780 +
1781 +       msgh_size_delta = _WALIGN_(fileNameCnt);
1782 +       msgh_size += msgh_size_delta;
1783 +       InP = (Request *) ((pointer_t) InP + msgh_size_delta - 1024);
1784 +
1785 +       InP->line = line;
1786 +
1787 +       if (messageCnt > 1024) {
1788 +               { return MIG_ARRAY_TOO_LARGE; }
1789 +       }
1790 +       (void)memcpy((char *) InP->message, (const char *) message, messageCnt);
1791 +
1792 +       InP->messageCnt = messageCnt;
1793 +
1794 +       msgh_size += _WALIGN_(messageCnt);
1795 +       InP = &Mess.In;
1796 +       InP->Head.msgh_bits =
1797 +               MACH_MSGH_BITS(19, 0);
1798 +       /* msgh_size passed as argument */
1799 +       InP->Head.msgh_request_port = makePort;
1800 +       InP->Head.msgh_reply_port = MACH_PORT_NULL;
1801 +       InP->Head.msgh_id = 100;
1802 +
1803 +       __BeforeSendSimple(100, "alert_old")
1804 +       msg_result = mach_msg(&InP->Head, MACH_SEND_MSG|MACH_MSG_OPTION_NONE, msgh_size, 0, MACH_PORT_NULL, MACH_MSG_TIMEOUT_NONE, MACH_PORT_NULL);
1805 +       __AfterSendSimple(100, "alert_old")
1806 +               return msg_result;
1807 +    }
1808 +}
1809 +
1810 +/* SimpleRoutine alert */
1811 +mig_external kern_return_t make_alert
1812 +(
1813 +       mach_port_t makePort,
1814 +       int eventType,
1815 +       make_string_t functionName,
1816 +       mach_msg_type_number_t functionNameCnt,
1817 +       make_string_t fileName,
1818 +       mach_msg_type_number_t fileNameCnt,
1819 +       make_string_t directory,
1820 +       mach_msg_type_number_t directoryCnt,
1821 +       int line,
1822 +       make_string_t message,
1823 +       mach_msg_type_number_t messageCnt
1824 +)
1825 +{
1826 +    {
1827 +       typedef struct {
1828 +               mach_msg_header_t Head;
1829 +               NDR_record_t NDR;
1830 +               int eventType;
1831 +               mach_msg_type_number_t functionNameCnt;
1832 +               char functionName[1024];
1833 +               mach_msg_type_number_t fileNameCnt;
1834 +               char fileName[1024];
1835 +               mach_msg_type_number_t directoryCnt;
1836 +               char directory[1024];
1837 +               int line;
1838 +               mach_msg_type_number_t messageCnt;
1839 +               char message[1024];
1840 +       } Request;
1841 +
1842 +       /*
1843 +        * typedef struct {
1844 +        *      mach_msg_header_t Head;
1845 +        *      NDR_record_t NDR;
1846 +        *      kern_return_t RetCode;
1847 +        * } mig_reply_error_t;
1848 +        */
1849 +
1850 +       union {
1851 +               Request In;
1852 +       } Mess;
1853 +
1854 +       register Request *InP = &Mess.In;
1855 +
1856 +       mach_msg_return_t msg_result;
1857 +       unsigned int msgh_size;
1858 +       unsigned int msgh_size_delta;
1859 +       __DeclareSendSimple(101, "alert")
1860 +
1861 +       InP->NDR = NDR_record;
1862 +
1863 +       InP->eventType = eventType;
1864 +
1865 +       if (functionNameCnt > 1024) {
1866 +               { return MIG_ARRAY_TOO_LARGE; }
1867 +       }
1868 +       (void)memcpy((char *) InP->functionName, (const char *) functionName, functionNameCnt);
1869 +
1870 +       InP->functionNameCnt = functionNameCnt;
1871 +
1872 +       msgh_size_delta = _WALIGN_(functionNameCnt);
1873 +       msgh_size = (sizeof(Request) - 4096) + msgh_size_delta;
1874 +       InP = (Request *) ((pointer_t) InP + msgh_size_delta - 1024);
1875 +
1876 +       if (fileNameCnt > 1024) {
1877 +               { return MIG_ARRAY_TOO_LARGE; }
1878 +       }
1879 +       (void)memcpy((char *) InP->fileName, (const char *) fileName, fileNameCnt);
1880 +
1881 +       InP->fileNameCnt = fileNameCnt;
1882 +
1883 +       msgh_size_delta = _WALIGN_(fileNameCnt);
1884 +       msgh_size += msgh_size_delta;
1885 +       InP = (Request *) ((pointer_t) InP + msgh_size_delta - 1024);
1886 +
1887 +       if (directoryCnt > 1024) {
1888 +               { return MIG_ARRAY_TOO_LARGE; }
1889 +       }
1890 +       (void)memcpy((char *) InP->directory, (const char *) directory, directoryCnt);
1891 +
1892 +       InP->directoryCnt = directoryCnt;
1893 +
1894 +       msgh_size_delta = _WALIGN_(directoryCnt);
1895 +       msgh_size += msgh_size_delta;
1896 +       InP = (Request *) ((pointer_t) InP + msgh_size_delta - 1024);
1897 +
1898 +       InP->line = line;
1899 +
1900 +       if (messageCnt > 1024) {
1901 +               { return MIG_ARRAY_TOO_LARGE; }
1902 +       }
1903 +       (void)memcpy((char *) InP->message, (const char *) message, messageCnt);
1904 +
1905 +       InP->messageCnt = messageCnt;
1906 +
1907 +       msgh_size += _WALIGN_(messageCnt);
1908 +       InP = &Mess.In;
1909 +       InP->Head.msgh_bits =
1910 +               MACH_MSGH_BITS(19, 0);
1911 +       /* msgh_size passed as argument */
1912 +       InP->Head.msgh_request_port = makePort;
1913 +       InP->Head.msgh_reply_port = MACH_PORT_NULL;
1914 +       InP->Head.msgh_id = 101;
1915 +
1916 +       __BeforeSendSimple(101, "alert")
1917 +       msg_result = mach_msg(&InP->Head, MACH_SEND_MSG|MACH_MSG_OPTION_NONE, msgh_size, 0, MACH_PORT_NULL, MACH_MSG_TIMEOUT_NONE, MACH_PORT_NULL);
1918 +       __AfterSendSimple(101, "alert")
1919 +               return msg_result;
1920 +    }
1921 +}
1922 --- ar/contents.c       30 Apr 2002 07:37:17 -0000      1.1.1.1
1923 +++ ar/contents.c       7 Sep 2003 08:55:11 -0000
1924 @@ -76,7 +76,6 @@
1925  #include <fcntl.h>
1926  #include <stdio.h>
1927  #include <string.h>
1928 -#include <tzfile.h>
1929  #include <unistd.h>
1930  
1931  #include "archive.h"
1932 @@ -103,12 +102,14 @@
1933                 else if (!(file = files(argv)))
1934                         goto next;
1935                 if (options & AR_V) {
1936 +/*
1937                         (void)strmode(chdr.mode, buf);
1938                         (void)printf("%s %6d/%-6d %8qd ",
1939                             buf + 1, chdr.uid, chdr.gid, chdr.size);
1940                         tp = localtime(&chdr.date);
1941                         (void)strftime(buf, sizeof(buf), "%b %e %H:%M %Y", tp);
1942                         (void)printf("%s %s\n", buf, file);
1943 +*/
1944                 } else
1945                         (void)printf("%s\n", file);
1946                 if (!all && !*argv)
1947 --- ar/misc.c   30 Apr 2002 07:37:17 -0000      1.1.1.1
1948 +++ ar/misc.c   7 Sep 2003 08:55:11 -0000
1949 @@ -68,6 +68,7 @@
1950  #endif /* not lint */
1951  
1952  #include <sys/param.h>
1953 +#define EFTYPE          79              /* Inappropriate file type or format */
1954  
1955  #include <dirent.h>
1956  #include <err.h>
1957 --- ar/vers_string      Sun Sep  7 01:55:10 2003
1958 +++ ar/vers_string      Sun Sep  7 01:53:23 2003
1959 @@ -0,0 +1,125 @@
1960 +#!/bin/sh
1961 +##
1962 +# Copyright (c) 1999 Apple Computer, Inc. All rights reserved.
1963 +#
1964 +# @APPLE_LICENSE_HEADER_START@
1965 +# 
1966 +# "Portions Copyright (c) 1999 Apple Computer, Inc.  All Rights
1967 +# Reserved.  This file contains Original Code and/or Modifications of
1968 +# Original Code as defined in and that are subject to the Apple Public
1969 +# Source License Version 1.0 (the 'License').  You may not use this file
1970 +# except in compliance with the License.  Please obtain a copy of the
1971 +# License at http://www.apple.com/publicsource and read it before using
1972 +# this file.
1973 +# 
1974 +# The Original Code and all software distributed under the License are
1975 +# distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
1976 +# EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
1977 +# INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
1978 +# FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT.  Please see the
1979 +# License for the specific language governing rights and limitations
1980 +# under the License."
1981 +# 
1982 +# @APPLE_LICENSE_HEADER_END@
1983 +##
1984 +#
1985 +# vers_string PROGRAM [STAMPED_NAME]
1986 +#
1987 +# Output a string suitable for use as a version identifier
1988 +#
1989 +
1990 +##
1991 +# Usage
1992 +##
1993 +
1994 +program=$(basename $0);
1995 +
1996 +usage ()
1997 +{
1998 +    echo "Usage: ${program} [<options>] <program> [<stamped_name>]";
1999 +    echo "     <program>: ???";
2000 +    echo "     <stamped_name>: ???";
2001 +    echo "Options: ???";
2002 +}
2003 +
2004 +##
2005 +# Handle command line
2006 +##
2007 +
2008 +  Date=$(date);
2009 +Format=''\''PROGRAM:'\''"${Program}"'\''  PROJECT:'\''"${Version}"'\''  DEVELOPER:'\''"${USER}"'\''  BUILT:'\''"${Date}"'\'''\''';
2010 +
2011 +if ! args=$(getopt cflBn $*); then usage; fi;
2012 +set -- ${args};
2013 +for option; do
2014 +    case "${option}" in
2015 +      -c)
2016 +        Format=''\''#include <sys/cdefs.h>
2017 +#ifndef __IDSTRING
2018 +#define __IDSTRING(name,string) \
2019 +     static const char name[] __attribute__((__unused__)) = string
2020 +#endif
2021 +__IDSTRING(SGS_VERS,"@(#)PROGRAM:'\''"${Program}"'\''  PROJECT:'\''"${Version}"'\''  DEVELOPER:'\''"${USER}"'\''  BUILT:'\''"${Date}"'\''\n");
2022 +__IDSTRING(VERS_NUM,"'\''${Revision}'\''");'\''';
2023 +       shift;
2024 +       ;;
2025 +      -f)
2026 +        Format='"${Program}"'\''-'\''"${Revision}"';
2027 +       shift;
2028 +       ;;
2029 +      -l)
2030 +        Format=''\''#include <sys/cdefs.h>
2031 +#ifndef __IDSTRING
2032 +#define __IDSTRING(name,string) \
2033 +       const char name[] __attribute__((__unused__)) = string
2034 +#endif
2035 +__IDSTRING(SGS_VERS,"@(#)LIBRARY:'\''"${Program}"'\''  PROJECT:'\''"${Version}"'\''  DEVELOPER:'\''"${USER}"'\''  BUILT:'\''"${Date}"'\''\n");'\''';
2036 +       shift;
2037 +       ;;
2038 +      -B)
2039 +        date="NO DATE SET (-B used)";
2040 +       shift;
2041 +       ;;
2042 +      -n)
2043 +        Format='"${Revision}"';
2044 +       shift;
2045 +       ;;
2046 +      --)
2047 +       shift;
2048 +       break;
2049 +       ;;
2050 +    esac;
2051 +done;
2052 +
2053 +Program=$1; if [ $# != 0 ]; then shift; fi;
2054 +Version=$1; if [ $# != 0 ]; then shift; fi;
2055 +
2056 +if [ $# != 0 ]; then usage; fi;
2057 +
2058 +if [ -z "${Program}" ]; then Program="Unknown"; fi;
2059 +
2060 +if [ -n "${Version}" ]; then
2061 +    if ! Revision=$(expr "${Version}" : '.*-\(.*\)'); then
2062 +       echo "${program}: No hyphen in project root ${Version}" >&2
2063 +       exit 1;
2064 +    fi;
2065 +else
2066 +    CurrentDir=$(/bin/pwd);
2067 +       Version=$(basename "${CurrentDir}");
2068 +    while [ "${Version}" != "${CurrentDir}" ]; do
2069 +       if Revision=$(expr "${Version}" : '.*-\(.*\)'); then break; fi;
2070 +       CurrentDir=$(dirname  "${CurrentDir}");
2071 +          Version=$(basename "${CurrentDir}");
2072 +    done;
2073 +    if [ "${Version}" = "${CurrentDir}" ]; then
2074 +       CurrentDir=$(/bin/pwd);
2075 +       echo "${program}: No hyphen in project root ${CurrentDir}" >&2
2076 +       echo "${program}: Could not determine version" >&2
2077 +        Version="Unknown";
2078 +       Revision="";
2079 +    fi;
2080 +fi;
2081 +
2082 +if [ -z "${USER}" ]; then USER=$(whoami); fi;
2083 +
2084 +echo "$(eval echo "${Format}")";
2085 --- ar/Makefile 7 Sep 2002 01:27:09 -0000       1.1.1.2
2086 +++ ar/Makefile 7 Sep 2003 09:03:52 -0000
2087 @@ -2,12 +2,16 @@
2088  ifeq "mwccppc" "$(notdir $(CC))"
2089    CFLAGS = -g $(OFLAG) -I$(SRCROOT)/../include
2090  else
2091 -  CFLAGS = -g $(OFLAG) -Wall -Wno-precomp -I$(SRCROOT)/../include
2092 +  ifeq "Linux" "$(shell uname)"
2093 +    CFLAGS = -Wall $(X_CFLAGS) -D__LITTLE_ENDIAN__ -U__BIG_ENDIAN__  -D__ppc__ -I/usr/include -I../../macosx-include -I../include
2094 +  else
2095 +    CFLAGS = -g $(OFLAG) -Wall -Wno-precomp -I$(SRCROOT)/../include
2096 +  endif
2097  endif
2098  
2099  LIBSTUFF = -L$(SYMROOT)/../libstuff -lstuff
2100  
2101 -USE_DEPENDENCY_FILE := $(shell if [ "$(notdir $(CC))" != "mwccppc" ]; then \
2102 +USE_DEPENDENCY_FILE := $(shell if [ `uname` != "Linux" ] && [ "$(notdir $(CC))" != "mwccppc" ]; then \
2103              echo YES ; else echo NO ; \
2104              fi; )
2105  
2106 @@ -43,7 +47,8 @@
2107         $(CC) $(CFLAGS) $(RC_CFLAGS) -o $(SYMROOT)/$@ $(OBJS) $(LIBSTUFF)
2108  
2109  vers.c:
2110 -       vers_string -c $(VERS_STRING_FLAGS) $(PRODUCT) > $(OFILE_DIR)/$@
2111 +       chmod +x vers_string
2112 +       ./vers_string -c $(VERS_STRING_FLAGS) $(PRODUCT) > $(OFILE_DIR)/$@
2113  
2114  ifeq "NO" "$(USE_DEPENDENCY_FILE)"
2115  .c.o:
2116 --- ld/fake-mach.c      Sun Sep  7 14:13:57 2003
2117 +++ ld/fake-mach.c      Sun Sep  7 14:13:50 2003
2118 @@ -0,0 +1,163 @@
2119 +/** fake-mach.c - A half baked implementation of mach kernel functions using the POSIX UNIX API.
2120 +*
2121 +* This was used to port Apple's Darwin linker (ld) to Linux. This allows Mac OS X applications to
2122 +* be cross complied on Linux. */
2123 +
2124 +#include <stdlib.h>
2125 +#include <assert.h>
2126 +#include <sys/types.h>
2127 +#include <sys/uio.h>
2128 +#include <unistd.h>
2129 +
2130 +#include <errno.h>
2131 +
2132 +#include <sys/mman.h>
2133 +
2134 +// Mach include files for typedefs, return values, etc
2135 +//~ #include <mach/mach.h>
2136 +#include <mach/kern_return.h>
2137 +#include <mach/vm_types.h>
2138 +#include <mach/mach_types.h>
2139 +#include <mach/message.h>
2140 +#include <servers/bootstrap_defs.h>
2141 +
2142 +/** The port for the current task. Ignored in this implementation. */
2143 +mach_port_t mach_task_self_ = 0;
2144 +
2145 +/** The bootstrap port. Ignored in this implementation. */
2146 +mach_port_t bootstrap_port = 0;
2147 +
2148 +#include <mach/ppc/ndr_def.h>
2149 +
2150 +/** Maps the file descriptor into memory. Free the memory using  vm_deallocate. Ignores findspace and offset. */
2151 +kern_return_t map_fd( int fd, vm_offset_t offset, vm_offset_t *va, boolean_t findspace, vm_size_t size)
2152 +{
2153 +       void* space = NULL;
2154 +       int bytes = 0;
2155 +
2156 +       assert( fd > 0 );
2157 +       assert( offset == 0 );
2158 +       //~ assert( *va == 0 );
2159 +       assert( findspace == TRUE );
2160 +       
2161 +       // Allocate memory
2162 +       space = malloc( size );
2163 +       assert( space != NULL );
2164 +       
2165 +       // Read file into space
2166 +       while(bytes < size) bytes += read( fd, ((char*)space) + bytes, size - bytes);
2167 +       assert( bytes == size );
2168 +
2169 +       /*
2170 +       space = mmap( (void*) offset, size, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0 );
2171 +       // No permission: try to make it read only
2172 +       if ( space == (void*) -1 && errno == EACCES )
2173 +       {
2174 +               space = mmap( (void*) offset, size, PROT_READ, MAP_SHARED, fd, 0 );
2175 +       }
2176 +       assert( space != NULL && space != (void*) -1 );
2177 +       */
2178 +
2179 +       // Copy back the pointer
2180 +       *va = (vm_offset_t) space;
2181 +       
2182 +       // Return success
2183 +       return KERN_SUCCESS;
2184 +}
2185 +
2186 +/** Returns a string appropriate to the error argument given. */
2187 +char* mach_error_string( int error_value )
2188 +{
2189 +       char *errorString = "Some fake mach error string.";
2190 +       
2191 +       return errorString;
2192 +}
2193 +
2194 +/** Returns the mach port for the current host. We fake it by returning zero. */
2195 +mach_port_t mach_host_self( void )
2196 +{
2197 +       return 0;
2198 +}
2199 +
2200 +/** Returns the mach port for the current task. We fake it by returning zero. */
2201 +//~ mach_port_t mach_task_self( void )
2202 +//~ {
2203 +       //~ return 0;
2204 +//~ }
2205 +
2206 +/**The function vm_allocate allocates a region of virtual memory, placing it in the specified task's address space. Anywhere must be true, as the memory will be allocated anywhere. */
2207 +extern kern_return_t vm_allocate( mach_port_t target_task, vm_address_t *address, vm_size_t size, boolean_t anywhere )
2208 +{
2209 +       assert( anywhere == TRUE );
2210 +       
2211 +       // Anonymous memory map
2212 +       *address = (vm_address_t) mmap( NULL, size, PROT_READ | PROT_WRITE, MAP_PRIVATE|MAP_ANON, 0, 0 );
2213 +       //~ *address = (vm_address_t) malloc( size );
2214 +       assert( address != (vm_address_t) NULL );
2215 +       
2216 +       return KERN_SUCCESS;
2217 +}
2218 +
2219 +/**vm_deallocate relinquishes access to a region of a task's address space, causing further access to that memory to fail. This memory must have been allocated with vm_allocate. size is ignored. */
2220 +kern_return_t vm_deallocate( mach_port_t target_task, vm_address_t address, vm_size_t size ) 
2221 +{
2222 +       int ret = 0;
2223 +       
2224 +       assert( address != (vm_address_t) NULL );
2225 +       
2226 +       // Free the memory
2227 +       ret = munmap( (void*) address, size );
2228 +       assert( ret == 0 );
2229 +       
2230 +       //~ free( (void*) address );
2231 +       
2232 +       return KERN_SUCCESS;
2233 +}
2234 +
2235 +/** The function mach_port_allocate_name creates a new right in the specified task, with a specified name for the new right. In this implementation it does nothing. */
2236 +kern_return_t mach_port_allocate_name (mach_port_t task, mach_port_right_t right, mach_port_t name)
2237 +{
2238 +       return KERN_SUCCESS;
2239 +}
2240 +
2241 +/** The function mach_port_deallocate releases a user reference for a right in task's IPC name space. In this implementation it does nothing. */
2242 +kern_return_t mach_port_deallocate (mach_port_t task, mach_port_t name)
2243 +{
2244 +       return KERN_SUCCESS;
2245 +}
2246 +
2247 +/** host_info returns information about the host. It is not implemented in this implementation. */
2248 +kern_return_t host_info( host_t host, host_flavor_t flavor, host_info_t host_info_out, mach_msg_type_number_t *host_info_outCnt )
2249 +{
2250 +       assert( 0 );
2251 +       return KERN_FAILURE;
2252 +}
2253 +
2254 +/** vm_msync unimplemented: It does nothing. */
2255 +kern_return_t vm_msync ( vm_map_t target_task, vm_address_t address, vm_size_t size, vm_sync_t sync_flags )
2256 +{
2257 +       //~ assert( address != (vm_address_t) NULL );
2258 +       //~ int ret = 0;
2259 +       //~ ret = msync( (void*) address, size, int flags);
2260 +       //~ assert( 0 );
2261 +       return KERN_SUCCESS;
2262 +}
2263 +
2264 +/** bootstrap_look_up unimplemented. */
2265 +kern_return_t bootstrap_look_up( mach_port_t bootstrap_port, name_t service_name, mach_port_t *service_port )
2266 +{
2267 +       assert( 0 );
2268 +       return KERN_FAILURE;
2269 +}
2270 +
2271 +/** mach_msg unimplemented. Send and/or receive a message.  If the message operation
2272 + *             is interrupted, and the user did not request an indication
2273 + *             of that fact, then restart the appropriate parts of the
2274 + *             operation silently (trap version does not restart).
2275 + */
2276 +mach_msg_return_t mach_msg( mach_msg_header_t *msg, mach_msg_option_t option, mach_msg_size_t send_size,
2277 +       mach_msg_size_t rcv_size, mach_port_name_t rcv_name, mach_msg_timeout_t timeout, mach_port_name_t notify)
2278 +{
2279 +       //~ assert( 0 );
2280 +       return KERN_SUCCESS;
2281 +}
2282 --- ar/archive.c        30 Apr 2002 07:37:17 -0000      1.1.1.1
2283 +++ ar/archive.c        8 Sep 2003 01:51:24 -0000
2284 @@ -69,6 +69,7 @@
2285  
2286  #include <sys/param.h>
2287  #include <sys/stat.h>
2288 +#include <stuff/ofile.h>
2289  
2290  #include <ar.h>
2291  #include <dirent.h>
2292 @@ -86,7 +87,7 @@
2293  #include "extern.h"
2294  
2295  typedef struct ar_hdr HDR;
2296 -static char hb[sizeof(HDR) + 1];       /* real header */
2297 +static char hb[61];    /* real header */
2298  
2299  int
2300  open_archive(mode)
2301 @@ -262,30 +263,40 @@
2302                  */
2303                 lname = strlen(name);
2304                 if (options & AR_TR) {
2305 +                 char buf[16];
2306 +                 int i;
2307 +                 for(i=0; i<15; i++) buf[i] = ' ';
2308 +                 buf[15] = '\0';
2309                         if (lname > OLDARMAXNAME) {
2310                                 (void)fflush(stdout);
2311                                 warnx("warning: %s truncated to %.*s",
2312                                     name, OLDARMAXNAME, name);
2313                                 (void)fflush(stderr);
2314                         }
2315 -                       (void)sprintf(hb, HDR3, name, (long int)sb->st_mtimespec.tv_sec,
2316 +                       strncpy(buf, name, 15);
2317 +                       (void)sprintf(hb, HDR3, buf, (long int)sb->st_mtime,
2318                             (unsigned int)(u_short)sb->st_uid,
2319                             (unsigned int)(u_short)sb->st_gid,
2320 -                           sb->st_mode, sb->st_size, ARFMAG);
2321 +                           sb->st_mode, (long long)sb->st_size, ARFMAG);
2322                         lname = 0;
2323 -               } else if (lname > sizeof(hdr->ar_name) || strchr(name, ' '))
2324 +               } else if (lname > sizeof(hdr->ar_name) || strchr(name, ' ')) {
2325                         (void)sprintf(hb, HDR1, AR_EFMT1, (lname + 3) & ~3,
2326 -                           (long int)sb->st_mtimespec.tv_sec,
2327 +                           (long int)sb->st_mtime,
2328                             (unsigned int)(u_short)sb->st_uid,
2329                             (unsigned int)(u_short)sb->st_gid,
2330 -                           sb->st_mode, sb->st_size + ((lname + 3) & ~3),
2331 +                           sb->st_mode, (long long)(sb->st_size + ((lname + 3) & ~3)),
2332                             ARFMAG);
2333 -               else {
2334 +}              else {
2335 +                 char buf[17];
2336 +                 int i;
2337 +                 for(i=0; i<16; i++) buf[i] = ' ';
2338 +                 buf[16] = '\0';
2339 +                 strncpy(buf, name, 16);
2340                         lname = 0;
2341 -                       (void)sprintf(hb, HDR2, name, (long int)sb->st_mtimespec.tv_sec,
2342 +                       (void)sprintf(hb, HDR2, buf, (long int)sb->st_mtime,
2343                             (unsigned int)(u_short)sb->st_uid,
2344                             (unsigned int)(u_short)sb->st_gid,
2345 -                           sb->st_mode, sb->st_size, ARFMAG);
2346 +                           sb->st_mode, (long long)sb->st_size, ARFMAG);
2347                 }
2348                 size = sb->st_size;
2349         } else {
2350 --- misc/libtool.c      Wed Apr 23 15:44:51 2003
2351 +++ misc/libtool.c      Sun Sep  7 18:58:16 2003
2352 @@ -2177,14 +2177,15 @@
2353      
2354         strcpy(message_buf, message);
2355         strcat(message_buf, arch_name);
2356 -
2357 +       /*
2358         make_alert(ProjectBuilder_port,
2359             -1,
2360 -           NULL, 0, /* functionName, not used by ProjectBuilder */
2361 +           NULL, 0,
2362             fileName, strlen(fileName)+1 > 1024 ? 1024 : strlen(fileName)+1,
2363             NULL, 0,
2364             0,
2365             message_buf, strlen(message_buf) + 1);
2366 +*/
2367  }
2368  
2369  /*