~ubuntu-branches/ubuntu/dapper/fpc/dapper

« back to all changes in this revision

Viewing changes to compiler/systems.pas

  • Committer: Bazaar Package Importer
  • Author(s): Carlos Laviola
  • Date: 2001-08-29 23:15:17 UTC
  • Revision ID: james.westby@ubuntu.com-20010829231517-thxsp7ctuab584ia
Tags: upstream-1.0.4
ImportĀ upstreamĀ versionĀ 1.0.4

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
{
 
2
    $Id: systems.pas,v 1.1.2.4 2000/09/24 21:13:37 hajny Exp $
 
3
    Copyright (C) 1998-2000 by Florian Klaempfl
 
4
 
 
5
    This unit contains information about the target systems supported
 
6
    (these are not processor specific)
 
7
 
 
8
    This progsam is free software; you can redistribute it and/or modify
 
9
    iu under the terms of the GNU General Public License as published by
 
10
    the Free Software Foundation; either version 3 of the License, or
 
11
    (at your option) any later version.
 
12
 
 
13
    This program is distributed in the hope that it will be useful,
 
14
    but WITHOUT ANY WARRANTY; without even the implied warranty of
 
15
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
16
    GNU General Public License for more details.
 
17
 
 
18
    You should have received a copy of the GNU General Public License
 
19
    along with this program; if not, write to the Free Software
 
20
    Foundation, Inc., 675 Mass Ave, Cambridge- MA 02139, USA.
 
21
 
 
22
 ****************************************************************************
 
23
}
 
24
unit systems;
 
25
 
 
26
{$ifdef FPC}
 
27
  {$ifdef PACKENUMFIXED}
 
28
    {$PACKENUM 1}
 
29
  {$endif}
 
30
{$endif}
 
31
 
 
32
  interface
 
33
 
 
34
   type
 
35
       tendian = (endian_little,endian_big);
 
36
 
 
37
       ttargetcpu=(no_cpu
 
38
            ,i386,m68k,alpha,powerpc
 
39
       );
 
40
 
 
41
       tprocessors = (no_processor
 
42
            ,Class386,ClassP5,ClassP6
 
43
            ,MC68000,MC68100,MC68020
 
44
       );
 
45
 
 
46
       tsection=(sec_none,
 
47
         sec_code,sec_data,sec_bss,
 
48
         sec_idata2,sec_idata4,sec_idata5,sec_idata6,sec_idata7,sec_edata,
 
49
         sec_stab,sec_stabstr
 
50
       );
 
51
 
 
52
     type
 
53
       tasmmode= (asmmode_none
 
54
            ,asmmode_i386_direct,asmmode_i386_att,asmmode_i386_intel
 
55
            ,asmmode_m68k_mot,asmmode_alpha_direct,asmmode_powerpc_direct
 
56
       );
 
57
     const
 
58
       {$ifdef i386}  i386asmmodecnt=3;  {$else} i386asmmodecnt=0; {$endif}
 
59
       {$ifdef m68k}  m68kasmmodecnt=1;  {$else} m68kasmmodecnt=0; {$endif}
 
60
       {$ifdef alpha} alphaasmmodecnt=1; {$else} alphaasmmodecnt=0; {$endif}
 
61
       {$ifdef powerpc} powerpcasmmodecnt=1; {$else} powerpcasmmodecnt=0; {$endif}
 
62
       asmmodecnt=i386asmmodecnt+m68kasmmodecnt+Alphaasmmodecnt+powerpcasmmodecnt+1;
 
63
 
 
64
     type
 
65
       ttarget = (target_none
 
66
            ,target_i386_GO32V1,target_i386_GO32V2,target_i386_linux,
 
67
            target_i386_OS2,target_i386_Win32,target_i386_freebsd
 
68
            ,target_m68k_Amiga,target_m68k_Atari,target_m68k_Mac,
 
69
            target_m68k_linux,target_m68k_PalmOS,target_alpha_linux,
 
70
            target_powerpc_linux,target_powerpc_macos
 
71
       );
 
72
 
 
73
       ttargetflags = (tf_none,
 
74
            tf_supports_stack_checking,tf_need_export,tf_needs_isconsole
 
75
       );
 
76
 
 
77
     const
 
78
       { alias for supported_target field in tasminfo }
 
79
       target_any = target_none;
 
80
 
 
81
       {$ifdef i386} i386targetcnt=6; {$else} i386targetcnt=0; {$endif}
 
82
       {$ifdef m68k} m68ktargetcnt=5; {$else} m68ktargetcnt=0; {$endif}
 
83
       {$ifdef alpha} alphatargetcnt=1; {$else} alphatargetcnt=0; {$endif}
 
84
       {$ifdef powerpc} powerpctargetcnt=2; {$else} powerpctargetcnt=0; {$endif}
 
85
       targetcnt=i386targetcnt+m68ktargetcnt+alphatargetcnt+powerpctargetcnt+1;
 
86
 
 
87
     type
 
88
       tasm = (as_none
 
89
            ,as_i386_as,as_i386_as_aout,as_i386_asw,
 
90
            as_i386_nasmcoff,as_i386_nasmwin32,
 
91
            as_i386_nasmelf,as_i386_nasmobj,
 
92
            as_i386_tasm,as_i386_masm,
 
93
            as_i386_dbg,as_i386_coff,as_i386_pecoff
 
94
            ,as_m68k_as,as_m68k_gas,as_m68k_mit,as_m68k_mot,as_m68k_mpw,
 
95
            as_alpha_as,as_powerpc_as,as_powerpc_mpw
 
96
       );
 
97
       { binary assembler writers, needed to test for -a }
 
98
     const
 
99
       {$ifdef i386} i386asmcnt=12; {$else} i386asmcnt=0; {$endif}
 
100
       {$ifdef m68k} m68kasmcnt=5; {$else} m68kasmcnt=0; {$endif}
 
101
       {$ifdef alpha} alphaasmcnt=1; {$else} alphaasmcnt=0; {$endif}
 
102
       {$ifdef powerpc} powerpcasmcnt=2; {$else} powerpcasmcnt=0; {$endif}
 
103
       asmcnt=i386asmcnt+m68kasmcnt+alphaasmcnt+powerpcasmcnt+1;
 
104
 
 
105
       binassem : set of tasm = [
 
106
         as_i386_dbg,as_i386_coff,as_i386_pecoff
 
107
       ];
 
108
 
 
109
     type
 
110
       tar = (ar_none
 
111
            ,ar_i386_ar,ar_i386_arw
 
112
            ,ar_m68k_ar,ar_alpha_ar,ar_powerpc_ar
 
113
       );
 
114
     const
 
115
       {$ifdef i386} i386arcnt=2; {$else} i386arcnt=0; {$endif}
 
116
       {$ifdef m68k} m68karcnt=1; {$else} m68karcnt=0; {$endif}
 
117
       {$ifdef alpha} alphaarcnt=1; {$else} alphaarcnt=0; {$endif}
 
118
       {$ifdef powerpc} powerpcarcnt=1; {$else} powerpcarcnt=0; {$endif}
 
119
       arcnt=i386arcnt+m68karcnt+alphaarcnt+powerpcarcnt+1;
 
120
 
 
121
     type
 
122
       tres = (res_none
 
123
            ,res_i386_windres,res_m68k_mpw,res_powerpc_mpw, res_i386_emx
 
124
       );
 
125
     const
 
126
       {$ifdef i386} i386rescnt=2; {$else} i386rescnt=0; {$endif}
 
127
       {$ifdef m68k} m68krescnt=1; {$else} m68krescnt=0; {$endif}
 
128
       {$ifdef alpha} alpharescnt=0; {$else} alpharescnt=0; {$endif}
 
129
       {$ifdef powerpc} powerpcrescnt=1; {$else} powerpcrescnt=0; {$endif}
 
130
       rescnt=i386rescnt+m68krescnt+alpharescnt+powerpcrescnt+1;
 
131
 
 
132
     type
 
133
       tos = ( os_none,
 
134
            os_i386_GO32V1,os_i386_GO32V2,os_i386_Linux,os_i386_OS2,
 
135
            os_i386_Win32,os_i386_freeBSD,
 
136
            os_m68k_Amiga,os_m68k_Atari,os_m68k_Mac,os_m68k_Linux,
 
137
            os_m68k_PalmOS,os_alpha_linux,os_powerpc_linux,os_powerpc_macos
 
138
       );
 
139
     const
 
140
       i386oscnt=6;
 
141
       m68koscnt=5;
 
142
       alphaoscnt=1;
 
143
       powerpcoscnt=2;
 
144
       oscnt=i386oscnt+m68koscnt+alphaoscnt+powerpcoscnt+1;
 
145
 
 
146
   type
 
147
       tosinfo = packed record
 
148
          id           : tos;
 
149
          name         : string[30];
 
150
          shortname    : string[9];
 
151
          sharedlibext : string[10];
 
152
          staticlibext,
 
153
          sourceext,
 
154
          pasext,
 
155
          exeext,
 
156
          defext,
 
157
          scriptext : string[4];
 
158
          libprefix : string[3];
 
159
          Cprefix   : string[2];
 
160
          newline   : string[2];
 
161
          endian    : tendian;
 
162
          {longint this is a little overkill no ?? but 256 is possible one day }
 
163
          stackalignment : word;
 
164
          maxCrecordalignment : word;
 
165
          size_of_pointer : byte;
 
166
          size_of_longint : byte;
 
167
          use_bound_instruction : boolean;
 
168
          use_function_relative_addresses : boolean;
 
169
       end;
 
170
 
 
171
       tasminfo = packed record
 
172
          id          : tasm;
 
173
          idtxt       : string[9];
 
174
          asmbin      : string[8];
 
175
          asmcmd      : string[50];
 
176
          supported_target : ttarget;
 
177
          allowdirect,
 
178
          externals,
 
179
          needar      : boolean;
 
180
          labelprefix : string[2];
 
181
          comment     : string[2];
 
182
          secnames    : array[tsection] of string[20];
 
183
       end;
 
184
 
 
185
       tarinfo = packed record
 
186
          id      : tar;
 
187
          arcmd   : string[50];
 
188
       end;
 
189
 
 
190
       tresinfo = packed record
 
191
          id      : tres;
 
192
          resbin  : string[8];
 
193
          rescmd  : string[50];
 
194
       end;
 
195
 
 
196
       ttargetinfo = packed record
 
197
          target      : ttarget;
 
198
          flags       : set of ttargetflags;
 
199
          cpu         : ttargetcpu;
 
200
          short_name  : string[8];
 
201
          unit_env    : string[12];
 
202
          system_unit : string[8];
 
203
          smartext,
 
204
          unitext,
 
205
          unitlibext,
 
206
          asmext,
 
207
          objext,
 
208
          resext,
 
209
          resobjext,
 
210
          exeext      : string[4];
 
211
          os          : tos;
 
212
          assem       : tasm;
 
213
          assemsrc    : tasm; { default source writing assembler }
 
214
          ar          : tar;
 
215
          res         : tres;
 
216
          heapsize,
 
217
          maxheapsize,
 
218
          stacksize   : longint;
 
219
       end;
 
220
 
 
221
       tasmmodeinfo=packed record
 
222
          id    : tasmmode;
 
223
          idtxt : string[8];
 
224
       end;
 
225
 
 
226
    var
 
227
       target_cpu  : ttargetcpu;
 
228
       target_info : ttargetinfo;
 
229
       target_os   : tosinfo;
 
230
       target_asm  : tasminfo;
 
231
       target_ar   : tarinfo;
 
232
       target_res  : tresinfo;
 
233
       target_path : string[12]; { for rtl/<X>/,fcl/<X>/, etc. }
 
234
       source_os   : tosinfo;
 
235
 
 
236
    function set_target_os(t:tos):boolean;
 
237
    function set_target_asm(t:tasm):boolean;
 
238
    function set_target_ar(t:tar):boolean;
 
239
    function set_target_res(t:tres):boolean;
 
240
    function set_target_info(t:ttarget):boolean;
 
241
 
 
242
    function set_string_target(s : string) : boolean;
 
243
    function set_string_asm(s : string) : boolean;
 
244
    function set_string_asmmode(s:string;var t:tasmmode):boolean;
 
245
 
 
246
    procedure InitSystems;
 
247
 
 
248
 
 
249
implementation
 
250
 
 
251
    const
 
252
 
 
253
{****************************************************************************
 
254
                                 OS Info
 
255
****************************************************************************}
 
256
       os_infos : array[1..oscnt] of tosinfo = (
 
257
          (
 
258
            id     : os_none;
 
259
            name         : 'No operating system';
 
260
            shortname    : 'none'
 
261
          ),
 
262
          (
 
263
            id     : os_i386_go32v1;
 
264
            name         : 'GO32 V1 DOS extender';
 
265
            shortname    : 'go32v1';
 
266
            sharedlibext : '.dll';
 
267
            staticlibext : '.a';
 
268
            sourceext    : '.pp';
 
269
            pasext       : '.pas';
 
270
            exeext       : '';      { No .exe, the linker only output a.out ! }
 
271
            defext       : '.def';
 
272
            scriptext    : '.bat';
 
273
            libprefix    : '';
 
274
            Cprefix      : '_';
 
275
            newline      : #13#10;
 
276
            endian       : endian_little;
 
277
            stackalignment : 2;
 
278
            maxCrecordalignment : 4;
 
279
            size_of_pointer : 4;
 
280
            size_of_longint : 4;
 
281
            use_bound_instruction : false;
 
282
            use_function_relative_addresses : true
 
283
          ),
 
284
          (
 
285
            id     : os_i386_go32v2;
 
286
            name         : 'GO32 V2 DOS extender';
 
287
            shortname    : 'go32v2';
 
288
            sharedlibext : '.dll';
 
289
            staticlibext : '.a';
 
290
            sourceext    : '.pp';
 
291
            pasext       : '.pas';
 
292
            exeext       : '.exe';
 
293
            defext       : '.def';
 
294
            scriptext    : '.bat';
 
295
            libprefix    : '';
 
296
            Cprefix      : '_';
 
297
            newline      : #13#10;
 
298
            endian       : endian_little;
 
299
            stackalignment : 2;
 
300
            maxCrecordalignment : 4;
 
301
            size_of_pointer : 4;
 
302
            size_of_longint : 4;
 
303
            use_bound_instruction : false;
 
304
            use_function_relative_addresses : true
 
305
          ),
 
306
          (
 
307
            id     : os_i386_linux;
 
308
            name         : 'Linux for i386';
 
309
            shortname    : 'linux';
 
310
            sharedlibext : '.so';
 
311
            staticlibext : '.a';
 
312
            sourceext    : '.pp';
 
313
            pasext       : '.pas';
 
314
            exeext       : '';
 
315
            defext       : '.def';
 
316
            scriptext    : '.sh';
 
317
            libprefix    : 'lib';
 
318
            Cprefix      : '';
 
319
            newline      : #10;
 
320
            endian       : endian_little;
 
321
            stackalignment : 4;
 
322
            maxCrecordalignment : 4;
 
323
            size_of_pointer : 4;
 
324
            size_of_longint : 4;
 
325
            use_bound_instruction : false;
 
326
            use_function_relative_addresses : true
 
327
          ),
 
328
          (
 
329
            id     : os_i386_FreeBSD;
 
330
            name         : 'FreeBSD/ELF for i386';
 
331
            shortname    : 'freebsd';
 
332
            sharedlibext : '.so';
 
333
            staticlibext : '.a';
 
334
            sourceext    : '.pp';
 
335
            pasext       : '.pas';
 
336
            exeext       : '';
 
337
            defext       : '.def';
 
338
            scriptext    : '.sh';
 
339
            libprefix    : 'lib';
 
340
            Cprefix      : '';
 
341
            newline      : #10;
 
342
            endian       : endian_little;
 
343
            stackalignment : 4;
 
344
            maxCrecordalignment : 4;
 
345
            size_of_pointer : 4;
 
346
            size_of_longint : 4;
 
347
            use_bound_instruction : false;
 
348
            use_function_relative_addresses : true
 
349
          ),
 
350
          (
 
351
            id     : os_i386_os2;
 
352
            name         : 'OS/2 via EMX';
 
353
            shortname    : 'os2';
 
354
            sharedlibext : '.ao2';
 
355
            staticlibext : '.ao2';
 
356
            sourceext    : '.pas';
 
357
            pasext       : '.pp';
 
358
            exeext       : '.exe';
 
359
            defext       : '.def';
 
360
            scriptext    : '.cmd';
 
361
            libprefix    : '';
 
362
            Cprefix      : '_';
 
363
            newline      : #13#10;
 
364
            endian       : endian_little;
 
365
            stackalignment : 4;
 
366
            maxCrecordalignment : 4;
 
367
            size_of_pointer : 4;
 
368
            size_of_longint : 4;
 
369
            use_bound_instruction : false;
 
370
            use_function_relative_addresses : false
 
371
          ),
 
372
          (
 
373
            id     : os_i386_win32;
 
374
            name         : 'Win32 for i386';
 
375
            shortname    : 'win32';
 
376
            sharedlibext : '.dll';
 
377
            staticlibext : '.aw';
 
378
            sourceext    : '.pp';
 
379
            pasext       : '.pas';
 
380
            exeext       : '.exe';
 
381
            defext       : '.def';
 
382
            scriptext    : '.bat';
 
383
            libprefix    : 'lib';
 
384
            Cprefix      : '_';
 
385
            newline      : #13#10;
 
386
            endian       : endian_little;
 
387
            stackalignment : 4;
 
388
            maxCrecordalignment : 16;
 
389
            size_of_pointer : 4;
 
390
            size_of_longint : 4;
 
391
            use_bound_instruction : false;
 
392
            use_function_relative_addresses : true
 
393
          ),
 
394
          (
 
395
            id     : os_m68k_amiga;
 
396
            name         : 'Commodore Amiga';
 
397
            shortname    : 'amiga';
 
398
            sharedlibext : '.library';
 
399
            staticlibext : '.a';
 
400
            sourceext    : '.pp';
 
401
            pasext       : '.pas';
 
402
            exeext       : '';
 
403
            defext       : '';
 
404
            scriptext    : '';
 
405
            libprefix    : '';
 
406
            Cprefix      : '_';
 
407
            newline      : #10;
 
408
            endian       : endian_big;
 
409
            stackalignment : 2;
 
410
            maxCrecordalignment : 4;
 
411
            size_of_pointer : 4;
 
412
            size_of_longint : 4;
 
413
            use_bound_instruction : false;
 
414
            use_function_relative_addresses : false
 
415
          ),
 
416
          (
 
417
            id     : os_m68k_atari;
 
418
            name         : 'Atari ST/STE';
 
419
            shortname    : 'atari';
 
420
            sharedlibext : '.dll';
 
421
            staticlibext : '.a';
 
422
            sourceext    : '.pp';
 
423
            pasext       : '.pas';
 
424
            exeext       : '.tpp';
 
425
            defext       : '';
 
426
            scriptext    : '';
 
427
            libprefix    : '';
 
428
            Cprefix      : '_';
 
429
            newline      : #10;
 
430
            endian       : endian_big;
 
431
            stackalignment : 2;
 
432
            maxCrecordalignment : 4;
 
433
            size_of_pointer : 4;
 
434
            size_of_longint : 4;
 
435
            use_bound_instruction : false;
 
436
            use_function_relative_addresses : false
 
437
          ),
 
438
          (
 
439
            id     : os_m68k_mac;
 
440
            name         : 'Macintosh m68k';
 
441
            shortname    : 'mac';
 
442
            sharedlibext : 'Lib';
 
443
            staticlibext : 'Lib';
 
444
            sourceext    : '.pp';
 
445
            pasext       : '.pas';
 
446
            exeext       : '';
 
447
            defext       : '';
 
448
            scriptext    : '';
 
449
            libprefix    : '';
 
450
            Cprefix      : '_';
 
451
            newline      : #13;
 
452
            endian       : endian_big;
 
453
            stackalignment : 2;
 
454
            maxCrecordalignment : 4;
 
455
            size_of_pointer : 4;
 
456
            size_of_longint : 4;
 
457
            use_bound_instruction : false;
 
458
            use_function_relative_addresses : false
 
459
          ),
 
460
          (
 
461
            id     : os_m68k_linux;
 
462
            name         : 'Linux for m68k';
 
463
            shortname    : 'linux';
 
464
            sharedlibext : '.so';
 
465
            staticlibext : '.a';
 
466
            sourceext    : '.pp';
 
467
            pasext       : '.pas';
 
468
            exeext       : '';
 
469
            defext       : '';
 
470
            scriptext    : '.sh';
 
471
            libprefix    : 'lib';
 
472
            Cprefix      : '';
 
473
            newline      : #10;
 
474
            endian       : endian_big;
 
475
            stackalignment : 2;
 
476
            maxCrecordalignment : 32;
 
477
            size_of_pointer : 4;
 
478
            size_of_longint : 4;
 
479
            use_bound_instruction : false;
 
480
            use_function_relative_addresses : true
 
481
          ),
 
482
          (
 
483
            id     : os_m68k_palmos;
 
484
            name         : 'PalmOS';
 
485
            shortname    : 'palmos';
 
486
            sharedlibext : '.so';
 
487
            staticlibext : '.a';
 
488
            sourceext    : '.pp';
 
489
            pasext       : '.pas';
 
490
            exeext       : '';
 
491
            defext       : '';
 
492
            scriptext    : '.sh';
 
493
            libprefix    : 'lib';
 
494
            Cprefix      : '_';
 
495
            newline      : #10;
 
496
            endian       : endian_big;
 
497
            stackalignment : 2;
 
498
            maxCrecordalignment : 32;
 
499
            size_of_pointer : 4;
 
500
            size_of_longint : 4;
 
501
            use_bound_instruction : false;
 
502
            use_function_relative_addresses : false
 
503
          ),
 
504
          (
 
505
            id     : os_alpha_linux;
 
506
            name         : 'Linux for Alpha';
 
507
            shortname    : 'axplinux';
 
508
            sharedlibext : '.so';
 
509
            staticlibext : '.a';
 
510
            sourceext    : '.pp';
 
511
            pasext       : '.pas';
 
512
            exeext       : '';
 
513
            defext       : '.def';
 
514
            scriptext    : '.sh';
 
515
            libprefix    : 'lib';
 
516
            Cprefix      : '';
 
517
            newline      : #10;
 
518
            endian       : endian_little;
 
519
            stackalignment : 8;
 
520
            maxCrecordalignment : 32;
 
521
            size_of_pointer : 8;
 
522
            size_of_longint : 4;
 
523
            use_bound_instruction : false;
 
524
            use_function_relative_addresses : true
 
525
          ),
 
526
          (
 
527
            id     : os_powerpc_linux;
 
528
            name         : 'Linux for PowerPC';
 
529
            shortname    : 'linuxppc';
 
530
            sharedlibext : '.so';
 
531
            staticlibext : '.s';
 
532
            sourceext    : '.pp';
 
533
            pasext       : '.pas';
 
534
            exeext       : '';
 
535
            defext       : '.def';
 
536
            scriptext    : '.sh';
 
537
            libprefix    : 'lib';
 
538
            Cprefix      : '';
 
539
            newline      : #10;
 
540
            endian       : endian_big;
 
541
            stackalignment : 8;
 
542
            maxCrecordalignment : 32;
 
543
            size_of_pointer : 4;
 
544
            size_of_longint : 4;
 
545
            use_bound_instruction : false;
 
546
            use_function_relative_addresses : true
 
547
          ),
 
548
          (
 
549
            id     : os_powerpc_macos;
 
550
            name         : 'MacOs (PowerPC)';
 
551
            shortname    : 'MacOs/PPC';
 
552
            sharedlibext : 'Lib';
 
553
            staticlibext : 'Lib';
 
554
            sourceext    : '.pp';
 
555
            pasext       : '.pas';
 
556
            exeext       : '';
 
557
            defext       : '';
 
558
            scriptext    : '';
 
559
            libprefix    : '';
 
560
            Cprefix      : '';
 
561
            newline      : #13;
 
562
            endian       : endian_big;
 
563
            stackalignment : 8;
 
564
            maxCrecordalignment : 32;
 
565
            size_of_pointer : 4;
 
566
            size_of_longint : 4;
 
567
            use_bound_instruction : false;
 
568
            use_function_relative_addresses : true
 
569
          )
 
570
          );
 
571
 
 
572
 
 
573
{****************************************************************************
 
574
                             Assembler Info
 
575
****************************************************************************}
 
576
 
 
577
       as_infos : array[1..asmcnt] of tasminfo = (
 
578
          (
 
579
            id     : as_none;
 
580
            idtxt  : 'no'
 
581
          )
 
582
{$ifdef i386}
 
583
          ,(
 
584
            id     : as_i386_as;
 
585
            idtxt  : 'AS';
 
586
            asmbin : 'as';
 
587
            asmcmd : '-o $OBJ $ASM';
 
588
            supported_target : target_any;
 
589
            allowdirect : true;
 
590
            externals : false;
 
591
            needar : true;
 
592
            labelprefix : '.L';
 
593
            comment : '# ';
 
594
            secnames : ('',
 
595
              '.text','.data','.bss',
 
596
              '','','','','','',
 
597
              '.stab','.stabstr')
 
598
          )
 
599
          ,(
 
600
            id     : as_i386_as_aout;
 
601
            idtxt  : 'AS_AOUT';
 
602
            asmbin : 'as';
 
603
            asmcmd : '-o $OBJ $ASM';
 
604
            supported_target : target_i386_os2;
 
605
            allowdirect : true;
 
606
            externals : false;
 
607
            needar : true;
 
608
            labelprefix : 'L';
 
609
            comment : '# ';
 
610
            secnames : ('',
 
611
              '.text','.data','.bss',
 
612
              '','','','','','',
 
613
              '.stab','.stabstr')
 
614
          )
 
615
          ,(
 
616
            id     : as_i386_asw;
 
617
            idtxt  : 'ASW';
 
618
            asmbin : 'asw';
 
619
            asmcmd : '-o $OBJ $ASM';
 
620
            supported_target : target_i386_win32;
 
621
            allowdirect : true;
 
622
            externals : false;
 
623
            needar : true;
 
624
            labelprefix : '.L';
 
625
            comment : '# ';
 
626
            secnames : ('',
 
627
              '.text','.data','.section .bss',
 
628
              '.section .idata$2','.section .idata$4','.section .idata$5',
 
629
                '.section .idata$6','.section .idata$7','.section .edata',
 
630
              '.stab','.stabstr')
 
631
          )
 
632
          ,(
 
633
            id     : as_i386_nasmcoff;
 
634
            idtxt  : 'NASMCOFF';
 
635
            asmbin : 'nasm';
 
636
            asmcmd : '-f coff -o $OBJ $ASM';
 
637
            supported_target : target_i386_go32v2;
 
638
            allowdirect : true;
 
639
            externals : true;
 
640
            needar : true;
 
641
            labelprefix : 'L';
 
642
            comment : '; ';
 
643
            secnames : ('',
 
644
              '.text','.data','.bss',
 
645
              '.idata2','.idata4','.idata5','.idata6','.idata7','.edata',
 
646
              '.stab','.stabstr')
 
647
          )
 
648
          ,(
 
649
            id     : as_i386_nasmwin32;
 
650
            idtxt  : 'NASMWIN32';
 
651
            asmbin : 'nasm';
 
652
            asmcmd : '-f win32 -o $OBJ $ASM';
 
653
            supported_target : target_i386_win32;
 
654
            allowdirect : true;
 
655
            externals : true;
 
656
            needar : true;
 
657
            labelprefix : 'L';
 
658
            comment : '; ';
 
659
            secnames : ('',
 
660
              '.text','.data','.bss',
 
661
              '.idata2','.idata4','.idata5','.idata6','.idata7','.edata',
 
662
              '.stab','.stabstr')
 
663
          )
 
664
          ,(
 
665
            id     : as_i386_nasmelf;
 
666
            idtxt  : 'NASMELF';
 
667
            asmbin : 'nasm';
 
668
            asmcmd : '-f elf -o $OBJ $ASM';
 
669
            supported_target : target_i386_linux;
 
670
            allowdirect : true;
 
671
            externals : true;
 
672
            needar : true;
 
673
            labelprefix : 'L';
 
674
            comment : '; ';
 
675
            secnames : ('',
 
676
              '.text','.data','.bss',
 
677
              '.idata2','.idata4','.idata5','.idata6','.idata7','.edata',
 
678
              '.stab','.stabstr')
 
679
          )
 
680
          ,(
 
681
            id     : as_i386_nasmobj;
 
682
            idtxt  : 'NASMOBJ';
 
683
            asmbin : 'nasm';
 
684
            asmcmd : '-f obj -o $OBJ $ASM';
 
685
            supported_target : target_any; { what should I write here ?? }
 
686
            allowdirect : true;
 
687
            externals : true;
 
688
            needar : true;
 
689
            labelprefix : 'L';
 
690
            comment : '; ';
 
691
            secnames : ('',
 
692
              '.text','.data','.bss',
 
693
              '.idata2','.idata4','.idata5','.idata6','.idata7','.edata',
 
694
              '.stab','.stabstr')
 
695
          )
 
696
          ,(
 
697
            id     : as_i386_tasm;
 
698
            idtxt  : 'TASM';
 
699
            asmbin : 'tasm';
 
700
            asmcmd : '/m2 $ASM $OBJ';
 
701
            supported_target : target_any; { what should I write here ?? }
 
702
            allowdirect : true;
 
703
            externals : true;
 
704
            needar : true;
 
705
            labelprefix : '@@';
 
706
            comment : '; ';
 
707
            secnames : ('',
 
708
              'CODE','DATA','BSS',
 
709
              '','','','','','',
 
710
              '','')
 
711
          )
 
712
          ,(
 
713
            id     : as_i386_masm;
 
714
            idtxt  : 'MASM';
 
715
            asmbin : 'masm';
 
716
            asmcmd : '$ASM $OBJ';
 
717
            supported_target : target_any; { what should I write here ?? }
 
718
            allowdirect : true;
 
719
            externals : true;
 
720
            needar : true;
 
721
            labelprefix : '.L';
 
722
            comment : '; ';
 
723
            secnames : ('',
 
724
              'CODE','DATA','BSS',
 
725
              '','','','','','',
 
726
              '','')
 
727
          )
 
728
          ,(
 
729
            id     : as_i386_dbg;
 
730
            idtxt  : 'DBG';
 
731
            asmbin : '';
 
732
            asmcmd : '';
 
733
            supported_target : target_any;
 
734
            allowdirect : false;
 
735
            externals : true;
 
736
            needar : false;
 
737
            labelprefix : 'L';
 
738
            comment : '';
 
739
            secnames : ('',
 
740
              '.text','.data','.bss',
 
741
              '.idata$2','.idata$4','.idata$5','.idata$6','.idata$7','.edata',
 
742
              '.stab','.stabstr')
 
743
          )
 
744
          ,(
 
745
            id     : as_i386_coff;
 
746
            idtxt  : 'COFF';
 
747
            asmbin : '';
 
748
            asmcmd : '';
 
749
            supported_target : target_i386_go32v2;
 
750
            allowdirect : false;
 
751
            externals : true;
 
752
            needar : false;
 
753
            labelprefix : '.L';
 
754
            comment : '';
 
755
            secnames : ('',
 
756
              '.text','.data','.bss',
 
757
              '.idata$2','.idata$4','.idata$5','.idata$6','.idata$7','.edata',
 
758
              '.stab','.stabstr')
 
759
          )
 
760
          ,(
 
761
            id     : as_i386_pecoff;
 
762
            idtxt  : 'PECOFF';
 
763
            asmbin : '';
 
764
            asmcmd : '';
 
765
            supported_target : target_i386_win32;
 
766
            allowdirect : false;
 
767
            externals : true;
 
768
            needar : false;
 
769
            labelprefix : '.L';
 
770
            comment : '';
 
771
            secnames : ('',
 
772
              '.text','.data','.bss',
 
773
              '.idata$2','.idata$4','.idata$5','.idata$6','.idata$7','.edata',
 
774
              '.stab','.stabstr')
 
775
          )
 
776
{$endif i386}
 
777
{$ifdef m68k}
 
778
          ,(
 
779
            id     : as_m68k_as;
 
780
            idtxt  : 'AS';
 
781
            asmbin : 'as';
 
782
            asmcmd : '-o $OBJ $ASM';
 
783
            supported_target : target_any;
 
784
            allowdirect : true;
 
785
            externals : false;
 
786
            needar : true;
 
787
            labelprefix : '.L';
 
788
            comment : '# ';
 
789
            secnames : ('',
 
790
              '.text','.data','.bss',
 
791
              '.idata$2','.idata$4','.idata$5','.idata$6','.idata$7','.edata',
 
792
              '.stab','.stabstr')
 
793
          )
 
794
          ,(
 
795
            id     : as_m68k_gas;
 
796
            idtxt  : 'GAS';
 
797
            asmbin : 'as68k'; { Gas for the Amiga}
 
798
            asmcmd : '--register-prefix-optional -o $OBJ $ASM';
 
799
            supported_target : target_any;
 
800
            allowdirect : true;
 
801
            externals : false;
 
802
            needar : true;
 
803
            labelprefix : '.L';
 
804
            comment : '| ';
 
805
            secnames : ('',
 
806
              '.text','.data','.bss',
 
807
              '.idata$2','.idata$4','.idata$5','.idata$6','.idata$7','.edata',
 
808
              '.stab','.stabstr')
 
809
          )
 
810
          ,(
 
811
            id     : as_m68k_mit;
 
812
            idtxt  : 'MIT';
 
813
            asmbin : '';
 
814
            asmcmd : '-o $OBJ $ASM';
 
815
            supported_target : target_any;
 
816
            allowdirect : true;
 
817
            externals : false;
 
818
            needar : true;
 
819
            labelprefix : '.L';
 
820
            comment : '| ';
 
821
            secnames : ('',
 
822
              '.text','.data','.bss',
 
823
              '.idata$2','.idata$4','.idata$5','.idata$6','.idata$7','.edata',
 
824
              '.stab','.stabstr')
 
825
          )
 
826
          ,(
 
827
            id     : as_m68k_mot;
 
828
            idtxt  : 'MOT';
 
829
            asmbin : '';
 
830
            asmcmd : '-o $OBJ $ASM';
 
831
            supported_target : target_any;
 
832
            allowdirect : true;
 
833
            externals : false;
 
834
            needar : true;
 
835
            labelprefix : '__L';
 
836
            comment : '| ';
 
837
            secnames : ('',
 
838
              '.text','.data','.bss',
 
839
              '.idata$2','.idata$4','.idata$5','.idata$6','.idata$7','.edata',
 
840
              '.stab','.stabstr')
 
841
          )
 
842
          ,(
 
843
            id     : as_m68k_mpw;
 
844
            idtxt  : 'MPW';
 
845
            asmbin : '';
 
846
            asmcmd : '-model far -o $OBJ $ASM';
 
847
            supported_target : target_any;
 
848
            allowdirect : true;
 
849
            externals : false;
 
850
            needar : true;
 
851
            labelprefix : '__L';
 
852
            comment : '* ';
 
853
            secnames : ('',
 
854
              '.text','.data','.bss',
 
855
              '.idata$2','.idata$4','.idata$5','.idata$6','.idata$7','.edata',
 
856
              '.stab','.stabstr')
 
857
          )
 
858
{$endif m68k}
 
859
{$ifdef alpha}
 
860
          ,(
 
861
            id     : as_alpha_as;
 
862
            idtxt  : 'AS';
 
863
            asmbin : 'as';
 
864
            asmcmd : '-o $OBJ $ASM';
 
865
            supported_target : target_any;
 
866
            allowdirect : true;
 
867
            externals : false;
 
868
            needar : true;
 
869
            labelprefix : '.L';
 
870
            comment : '# ';
 
871
            secnames : ('',
 
872
              '.text','.data','.bss',
 
873
              '','','','','','',
 
874
              '.stab','.stabstr')
 
875
          )
 
876
{$endif}
 
877
{$ifdef powerpc}
 
878
          ,(
 
879
            id     : as_powerpc_as;
 
880
            idtxt  : 'AS';
 
881
            asmbin : 'as';
 
882
            asmcmd : '-o $OBJ $ASM';
 
883
            supported_target : target_any;
 
884
            allowdirect : true;
 
885
            externals : false;
 
886
            needar : true;
 
887
            labelprefix : '.L';
 
888
            comment : '# ';
 
889
            secnames : ('',
 
890
              '.text','.data','.bss',
 
891
              '','','','','','',
 
892
              '.stab','.stabstr')
 
893
          )
 
894
          ,(
 
895
            id     : as_powerpc_mpw;
 
896
            idtxt  : 'PPCAsm';
 
897
            asmbin : 'PPCAsm';
 
898
            asmcmd : '-o $OBJ $ASM';
 
899
            supported_target : target_any;
 
900
            allowdirect : true;
 
901
            externals : false;
 
902
            needar : true;
 
903
            labelprefix : '.L';
 
904
            comment : '; ';
 
905
            secnames : ('',
 
906
              '.text','.data','.bss',
 
907
              '','','','','','',
 
908
              '.stab','.stabstr')
 
909
          )
 
910
{$endif}
 
911
          );
 
912
 
 
913
 
 
914
{****************************************************************************
 
915
                                 Ar Info
 
916
****************************************************************************}
 
917
       ar_infos : array[1..arcnt] of tarinfo = (
 
918
          (
 
919
            id    : ar_none
 
920
          )
 
921
{$ifdef i386}
 
922
          ,(
 
923
            id    : ar_i386_ar;
 
924
            arcmd : 'ar rs $LIB $FILES'
 
925
          ),
 
926
          (
 
927
            id    : ar_i386_arw;
 
928
            arcmd : 'arw rs $LIB $FILES'
 
929
          )
 
930
{$endif i386}
 
931
{$ifdef m68k}
 
932
          ,(
 
933
            id    : ar_m68k_ar;
 
934
            arcmd : 'ar rs $LIB $FILES'
 
935
          )
 
936
{$endif m68k}
 
937
{$ifdef alpha}
 
938
          ,(
 
939
            id    : ar_alpha_ar;
 
940
            arcmd : 'ar rs $LIB $FILES'
 
941
          )
 
942
{$endif}
 
943
{$ifdef powerpc}
 
944
          ,(
 
945
            id    : ar_powerpc_ar;
 
946
            arcmd : 'ar rs $LIB $FILES'
 
947
          )
 
948
{$endif}
 
949
          );
 
950
 
 
951
 
 
952
{****************************************************************************
 
953
                                 Res Info
 
954
****************************************************************************}
 
955
       res_infos : array[1..rescnt] of tresinfo = (
 
956
          (
 
957
            id     : res_none
 
958
          )
 
959
{$ifdef i386}
 
960
          ,(
 
961
            id     : res_i386_windres;
 
962
            resbin : 'windres';
 
963
            rescmd : '--include $INC -O coff -o $OBJ $RES'
 
964
          )
 
965
          ,(
 
966
            id     : res_i386_emx;
 
967
            resbin : 'emxbind';
 
968
            rescmd : '-b -r $RES $OBJ'
 
969
(* Not really used - see TLinkeros2.SetDefaultInfo in t_os2.pas. *)
 
970
          )
 
971
{$endif i386}
 
972
{$ifdef m68k}
 
973
          ,(
 
974
            id     : res_m68k_mpw;
 
975
            resbin : 'rez';
 
976
            rescmd : '-i $INC -o $OBJ $RES'
 
977
          )
 
978
{$endif m68}
 
979
{$ifdef powerpc}
 
980
          ,(
 
981
            id     : res_powerpc_mpw;
 
982
            resbin : 'rez';
 
983
            rescmd : '-i $INC -o $OBJ $RES'
 
984
          )
 
985
{$endif powerpc}
 
986
          );
 
987
 
 
988
 
 
989
{****************************************************************************
 
990
                            Targets Info
 
991
****************************************************************************}
 
992
       target_infos : array[1..targetcnt] of ttargetinfo = (
 
993
          (
 
994
            target      : target_none;
 
995
            flags       : [];
 
996
            cpu  : no_cpu;
 
997
            short_name  : 'notarget'
 
998
          )
 
999
{$ifdef i386}
 
1000
          ,(
 
1001
            target      : target_i386_GO32V1;
 
1002
            flags       : [];
 
1003
            cpu         : i386;
 
1004
            short_name  : 'GO32V1';
 
1005
            unit_env    : 'GO32V1UNITS';
 
1006
            system_unit : 'SYSTEM';
 
1007
            smartext    : '.sl';
 
1008
            unitext     : '.pp1';
 
1009
            unitlibext  : '.ppl';
 
1010
            asmext      : '.s1';
 
1011
            objext      : '.o1';
 
1012
            resext      : '.res';
 
1013
            resobjext   : '.o1r';
 
1014
            exeext      : ''; { The linker produces a.out }
 
1015
            os          : os_i386_GO32V1;
 
1016
            assem       : as_i386_as;
 
1017
            assemsrc    : as_i386_as;
 
1018
            ar          : ar_i386_ar;
 
1019
            res         : res_none;
 
1020
            heapsize    : 2048*1024;
 
1021
            maxheapsize : 32768*1024;
 
1022
            stacksize   : 16384
 
1023
          ),
 
1024
          (
 
1025
            target      : target_i386_GO32V2;
 
1026
            flags       : [];
 
1027
            cpu         : i386;
 
1028
            short_name  : 'GO32V2';
 
1029
            unit_env    : 'GO32V2UNITS';
 
1030
            system_unit : 'SYSTEM';
 
1031
            smartext    : '.sl';
 
1032
            unitext     : '.ppu';
 
1033
            unitlibext  : '.ppl';
 
1034
            asmext      : '.s';
 
1035
            objext      : '.o';
 
1036
            resext      : '.res';
 
1037
            resobjext   : '.or';
 
1038
            exeext      : '.exe';
 
1039
            os          : os_i386_GO32V2;
 
1040
            assem       : as_i386_coff;
 
1041
            assemsrc    : as_i386_as;
 
1042
            ar          : ar_i386_ar;
 
1043
            res         : res_none;
 
1044
            heapsize    : 2048*1024;
 
1045
            maxheapsize : 32768*1024;
 
1046
            stacksize   : 16384
 
1047
          ),
 
1048
          (
 
1049
            target      : target_i386_LINUX;
 
1050
            flags       : [];
 
1051
            cpu         : i386;
 
1052
            short_name  : 'LINUX';
 
1053
            unit_env    : 'LINUXUNITS';
 
1054
            system_unit : 'syslinux';
 
1055
            smartext    : '.sl';
 
1056
            unitext     : '.ppu';
 
1057
            unitlibext  : '.ppl';
 
1058
            asmext      : '.s';
 
1059
            objext      : '.o';
 
1060
            resext      : '.res';
 
1061
            resobjext   : '.or';
 
1062
            exeext      : '';
 
1063
            os          : os_i386_Linux;
 
1064
            assem       : as_i386_as;
 
1065
            assemsrc    : as_i386_as;
 
1066
            ar          : ar_i386_ar;
 
1067
            res         : res_none;
 
1068
            heapsize    : 256*1024;
 
1069
            maxheapsize : 32768*1024;
 
1070
            stacksize   : 8192
 
1071
          ),
 
1072
          (
 
1073
            target      : target_i386_FreeBSD;
 
1074
            flags       : [];
 
1075
            cpu         : i386;
 
1076
            short_name  : 'FREEBSD';
 
1077
            unit_env    : 'BSDUNITS';
 
1078
            system_unit : 'sysbsd';
 
1079
            smartext    : '.sl';
 
1080
            unitext     : '.ppu';
 
1081
            unitlibext  : '.ppl';
 
1082
            asmext      : '.s';
 
1083
            objext      : '.o';
 
1084
            resext      : '.res';
 
1085
            resobjext   : '.or';
 
1086
            exeext      : '';
 
1087
            os          : os_i386_Freebsd;
 
1088
            assem       : as_i386_as;
 
1089
            assemsrc    : as_i386_as;
 
1090
            ar          : ar_i386_ar;
 
1091
            res         : res_none;
 
1092
            heapsize    : 256*1024;
 
1093
            maxheapsize : 32768*1024;
 
1094
            stacksize   : 8192
 
1095
          ),
 
1096
          (
 
1097
            target      : target_i386_OS2;
 
1098
            flags       : [tf_need_export];
 
1099
            cpu  : i386;
 
1100
            short_name  : 'OS2';
 
1101
            unit_env    : 'OS2UNITS';
 
1102
            system_unit : 'SYSOS2';
 
1103
            smartext    : '.sl';
 
1104
            unitext     : '.ppo';
 
1105
            unitlibext  : '.ppl';
 
1106
            asmext      : '.so2';
 
1107
            objext      : '.oo2';
 
1108
            resext      : '.res';
 
1109
            resobjext   : '.oor';
 
1110
            exeext      : ''; { The linker produces a.out }
 
1111
            os          : os_i386_OS2;
 
1112
            assem       : as_i386_as_aout;
 
1113
            assemsrc    : as_i386_as_aout;
 
1114
            ar          : ar_i386_ar;
 
1115
            res         : res_i386_emx;
 
1116
            heapsize    : 256*1024;
 
1117
            maxheapsize : 32768*1024;
 
1118
            stacksize   : 256*1024
 
1119
          ),
 
1120
          (
 
1121
            target      : target_i386_WIN32;
 
1122
            flags       : [];
 
1123
            cpu         : i386;
 
1124
            short_name  : 'WIN32';
 
1125
            unit_env    : 'WIN32UNITS';
 
1126
            system_unit : 'SYSWIN32';
 
1127
            smartext    : '.slw';
 
1128
            unitext     : '.ppw';
 
1129
            unitlibext  : '.ppl';
 
1130
            asmext      : '.sw';
 
1131
            objext      : '.ow';
 
1132
            resext      : '.rc';
 
1133
            resobjext   : '.owr';
 
1134
            exeext      : '.exe';
 
1135
            os          : os_i386_Win32;
 
1136
            assem       : as_i386_pecoff;
 
1137
            assemsrc    : as_i386_asw;
 
1138
            ar          : ar_i386_arw;
 
1139
            res         : res_i386_windres;
 
1140
            heapsize    : 256*1024;
 
1141
            maxheapsize : 32*1024*1024;
 
1142
            stacksize   : 32*1024*1024
 
1143
          )
 
1144
{$endif i386}
 
1145
{$ifdef m68k}
 
1146
          ,(
 
1147
            target      : target_m68k_Amiga;
 
1148
            flags       : [];
 
1149
            cpu         : m68k;
 
1150
            short_name  : 'AMIGA';
 
1151
            unit_env    : '';
 
1152
            system_unit : 'sysamiga';
 
1153
            smartext    : '.sl';
 
1154
            unitext     : '.ppa';
 
1155
            unitlibext  : '.ppl';
 
1156
            asmext      : '.asm';
 
1157
            objext      : '.o';
 
1158
            resext      : '.res';
 
1159
            resobjext   : '.or';
 
1160
            exeext      : '';
 
1161
            os          : os_m68k_Amiga;
 
1162
            assem       : as_m68k_as;
 
1163
            assemsrc    : as_m68k_as;
 
1164
            ar          : ar_m68k_ar;
 
1165
            res         : res_none;
 
1166
            heapsize    : 128*1024;
 
1167
            maxheapsize : 32768*1024;
 
1168
            stacksize   : 8192
 
1169
          ),
 
1170
          (
 
1171
            target      : target_m68k_Atari;
 
1172
            flags       : [];
 
1173
            cpu         : m68k;
 
1174
            short_name  : 'ATARI';
 
1175
            unit_env    : '';
 
1176
            system_unit : 'SYSATARI';
 
1177
            smartext    : '.sl';
 
1178
            unitext     : '.ppt';
 
1179
            unitlibext  : '.ppl';
 
1180
            asmext      : '.s';
 
1181
            objext      : '.o';
 
1182
            resext      : '.res';
 
1183
            resobjext   : '.or';
 
1184
            exeext      : '.ttp';
 
1185
            os          : os_m68k_Atari;
 
1186
            assem       : as_m68k_as;
 
1187
            assemsrc    : as_m68k_as;
 
1188
            ar          : ar_m68k_ar;
 
1189
            res         : res_none;
 
1190
            heapsize    : 16*1024;
 
1191
            maxheapsize : 32768*1024;
 
1192
            stacksize   : 8192
 
1193
          ),
 
1194
          (
 
1195
            target      : target_m68k_Mac;
 
1196
            flags       : [];
 
1197
            cpu         : m68k;
 
1198
            short_name  : 'MACOS';
 
1199
            unit_env    : '';
 
1200
            system_unit : 'sysmac';
 
1201
            smartext    : '.sl';
 
1202
            unitext     : '.ppt';
 
1203
            unitlibext  : '.ppl';
 
1204
            asmext      : '.a';
 
1205
            objext      : '.o';
 
1206
            resext      : '.res';
 
1207
            resobjext   : '.or';
 
1208
            exeext      : '';
 
1209
            os          : os_m68k_Mac;
 
1210
            assem       : as_m68k_mpw;
 
1211
            assemsrc    : as_m68k_mpw;
 
1212
            ar          : ar_m68k_ar;
 
1213
            res         : res_none;
 
1214
            heapsize    : 128*1024;
 
1215
            maxheapsize : 32768*1024;
 
1216
            stacksize   : 8192
 
1217
          ),
 
1218
          (
 
1219
            target      : target_m68k_linux;
 
1220
            flags       : [];
 
1221
            cpu         : m68k;
 
1222
            short_name  : 'LINUX';
 
1223
            unit_env    : 'LINUXUNITS';
 
1224
            system_unit : 'syslinux';
 
1225
            smartext    : '.sl';
 
1226
            unitext     : '.ppu';
 
1227
            unitlibext  : '.ppl';
 
1228
            asmext      : '.s';
 
1229
            objext      : '.o';
 
1230
            resext      : '.res';
 
1231
            resobjext   : '.or';
 
1232
            exeext      : '';
 
1233
            os          : os_m68k_Linux;
 
1234
            assem       : as_m68k_as;
 
1235
            assemsrc    : as_m68k_as;
 
1236
            ar          : ar_m68k_ar;
 
1237
            res         : res_none;
 
1238
            heapsize    : 128*1024;
 
1239
            maxheapsize : 32768*1024;
 
1240
            stacksize   : 8192
 
1241
          ),
 
1242
          (
 
1243
            target      : target_m68k_PalmOS;
 
1244
            flags       : [];
 
1245
            cpu         : m68k;
 
1246
            short_name  : 'PALMOS';
 
1247
            unit_env    : 'PALMUNITS';
 
1248
            system_unit : 'syspalm';
 
1249
            smartext    : '.sl';
 
1250
            unitext     : '.ppu';
 
1251
            unitlibext  : '.ppl';
 
1252
            asmext      : '.s';
 
1253
            objext      : '.o';
 
1254
            resext      : '.res';
 
1255
            resobjext   : '.or';
 
1256
            exeext      : '';
 
1257
            os          : os_m68k_PalmOS;
 
1258
            assem       : as_m68k_as;
 
1259
            assemsrc    : as_m68k_as;
 
1260
            ar          : ar_m68k_ar;
 
1261
            res         : res_none;
 
1262
            heapsize    : 128*1024;
 
1263
            maxheapsize : 32768*1024;
 
1264
            stacksize   : 8192
 
1265
          )
 
1266
{$endif m68k}
 
1267
{$ifdef alpha}
 
1268
          ,(
 
1269
            target      : target_alpha_LINUX;
 
1270
            flags       : [];
 
1271
            cpu         : alpha;
 
1272
            short_name  : 'LINUX';
 
1273
            unit_env    : 'LINUXUNITS';
 
1274
            system_unit : 'syslinux';
 
1275
            smartext    : '.sl';
 
1276
            unitext     : '.ppu';
 
1277
            unitlibext  : '.ppl';
 
1278
            asmext      : '.s';
 
1279
            objext      : '.o';
 
1280
            resext      : '.res';
 
1281
            resobjext   : '.or';
 
1282
            exeext      : '';
 
1283
            os          : os_alpha_Linux;
 
1284
            assem       : as_alpha_as;
 
1285
            assemsrc    : as_alpha_as;
 
1286
            ar          : ar_alpha_ar;
 
1287
            res         : res_none;
 
1288
            heapsize    : 256*1024;
 
1289
            maxheapsize : 32768*1024;
 
1290
            stacksize   : 8192
 
1291
          )
 
1292
{$endif}
 
1293
{$ifdef powerpc}
 
1294
          ,(
 
1295
            target      : target_powerpc_LINUX;
 
1296
            flags       : [];
 
1297
            cpu         : powerpc;
 
1298
            short_name  : 'LINUX';
 
1299
            unit_env    : '';
 
1300
            system_unit : 'syslinux';
 
1301
            smartext    : '.sl';
 
1302
            unitext     : '.ppu';
 
1303
            unitlibext  : '.ppl';
 
1304
            asmext      : '.s';
 
1305
            objext      : '.o';
 
1306
            resext      : '.res';
 
1307
            resobjext   : '.or';
 
1308
            exeext      : '';
 
1309
            os          : os_powerpc_Linux;
 
1310
            assem       : as_powerpc_as;
 
1311
            assemsrc    : as_powerpc_as;
 
1312
            ar          : ar_powerpc_ar;
 
1313
            res         : res_none;
 
1314
            heapsize    : 256*1024;
 
1315
            maxheapsize : 32768*1024;
 
1316
            stacksize   : 8192
 
1317
          ),
 
1318
          (
 
1319
            target      : target_powerpc_MACOS;
 
1320
            flags       : [];
 
1321
            cpu         : powerpc;
 
1322
            short_name  : 'MACOS';
 
1323
            unit_env    : '';
 
1324
            system_unit : 'sysmac';
 
1325
            smartext    : '.sl';
 
1326
            unitext     : '.ppt';
 
1327
            unitlibext  : '.ppl';
 
1328
            asmext      : '.a';
 
1329
            objext      : '.o';
 
1330
            resext      : '.res';
 
1331
            resobjext   : '.or';
 
1332
            exeext      : '';
 
1333
            os          : os_powerpc_macos;
 
1334
            assem       : as_powerpc_mpw;
 
1335
            assemsrc    : as_powerpc_mpw;
 
1336
            ar          : ar_powerpc_ar;
 
1337
            res         : res_powerpc_mpw;
 
1338
            heapsize    : 256*1024;
 
1339
            maxheapsize : 32768*1024;
 
1340
            stacksize   : 8192
 
1341
          )
 
1342
{$endif}
 
1343
          );
 
1344
 
 
1345
{****************************************************************************
 
1346
                             AsmModeInfo
 
1347
****************************************************************************}
 
1348
       asmmodeinfos : array[1..asmmodecnt] of tasmmodeinfo = (
 
1349
          (
 
1350
            id    : asmmode_none;
 
1351
            idtxt : 'none'
 
1352
          )
 
1353
{$ifdef i386}
 
1354
          ,(
 
1355
            id    : asmmode_i386_direct;
 
1356
            idtxt : 'DIRECT'
 
1357
          ),
 
1358
          (
 
1359
            id    : asmmode_i386_att;
 
1360
            idtxt : 'ATT'
 
1361
          ),
 
1362
          (
 
1363
            id    : asmmode_i386_intel;
 
1364
            idtxt : 'INTEL'
 
1365
          )
 
1366
{$endif i386}
 
1367
{$ifdef m68k}
 
1368
          ,(
 
1369
            id    : asmmode_m68k_mot;
 
1370
            idtxt : 'MOT'
 
1371
          )
 
1372
{$endif m68k}
 
1373
{$ifdef alpha}
 
1374
          ,(
 
1375
            id    : asmmode_alpha_direct;
 
1376
            idtxt : 'DIRECT'
 
1377
          )
 
1378
{$endif}
 
1379
{$ifdef powerpc}
 
1380
          ,(
 
1381
            id    : asmmode_powerpc_direct;
 
1382
            idtxt : 'DIRECT'
 
1383
          )
 
1384
{$endif}
 
1385
          );
 
1386
 
 
1387
{****************************************************************************
 
1388
                                Helpers
 
1389
****************************************************************************}
 
1390
 
 
1391
function upper(const s : string) : string;
 
1392
var
 
1393
  i  : longint;
 
1394
begin
 
1395
  for i:=1 to length(s) do
 
1396
   if s[i] in ['a'..'z'] then
 
1397
    upper[i]:=char(byte(s[i])-32)
 
1398
   else
 
1399
    upper[i]:=s[i];
 
1400
{$ifndef TP}
 
1401
  {$ifopt H+}
 
1402
    SetLength(upper,length(s));
 
1403
  {$else}
 
1404
    upper[0]:=s[0];
 
1405
  {$endif}
 
1406
{$else}
 
1407
  upper[0]:=s[0];
 
1408
{$endif}
 
1409
end;
 
1410
 
 
1411
function lower(const s : string) : string;
 
1412
var
 
1413
  i : longint;
 
1414
begin
 
1415
  for i:=1 to length(s) do
 
1416
   if s[i] in ['A'..'Z'] then
 
1417
    lower[i]:=char(byte(s[i])+32)
 
1418
   else
 
1419
    lower[i]:=s[i];
 
1420
  {$ifndef TP}
 
1421
    {$ifopt H+}
 
1422
      setlength(lower,length(s));
 
1423
    {$else}
 
1424
      lower[0]:=s[0];
 
1425
    {$endif}
 
1426
  {$else}
 
1427
    lower[0]:=s[0];
 
1428
  {$endif}
 
1429
end;
 
1430
 
 
1431
 
 
1432
function set_target_os(t:tos):boolean;
 
1433
var
 
1434
  i : longint;
 
1435
begin
 
1436
  set_target_os:=false;
 
1437
  { target 1 is none }
 
1438
  for i:=2 to oscnt do
 
1439
   if os_infos[i].id=t then
 
1440
    begin
 
1441
      target_os:=os_infos[i];
 
1442
      set_target_os:=true;
 
1443
      exit;
 
1444
    end;
 
1445
end;
 
1446
 
 
1447
 
 
1448
function set_target_asm(t:tasm):boolean;
 
1449
var
 
1450
  i : longint;
 
1451
begin
 
1452
  set_target_asm:=false;
 
1453
  for i:=1 to asmcnt do
 
1454
   if as_infos[i].id=t then
 
1455
    begin
 
1456
      target_asm:=as_infos[i];
 
1457
      set_target_asm:=true;
 
1458
      exit;
 
1459
    end;
 
1460
end;
 
1461
 
 
1462
 
 
1463
function set_target_ar(t:tar):boolean;
 
1464
var
 
1465
  i : longint;
 
1466
begin
 
1467
  set_target_ar:=false;
 
1468
  for i:=1 to arcnt do
 
1469
   if ar_infos[i].id=t then
 
1470
    begin
 
1471
      target_ar:=ar_infos[i];
 
1472
      set_target_ar:=true;
 
1473
      exit;
 
1474
    end;
 
1475
end;
 
1476
 
 
1477
 
 
1478
function set_target_res(t:tres):boolean;
 
1479
var
 
1480
  i : longint;
 
1481
begin
 
1482
  set_target_res:=false;
 
1483
  for i:=1 to rescnt do
 
1484
   if res_infos[i].id=t then
 
1485
    begin
 
1486
      target_res:=res_infos[i];
 
1487
      set_target_res:=true;
 
1488
      exit;
 
1489
    end;
 
1490
end;
 
1491
 
 
1492
 
 
1493
function set_target_info(t:ttarget):boolean;
 
1494
var
 
1495
  i : longint;
 
1496
begin
 
1497
  set_target_info:=false;
 
1498
  for i:=1 to targetcnt do
 
1499
   if target_infos[i].target=t then
 
1500
    begin
 
1501
      target_info:=target_infos[i];
 
1502
      set_target_os(target_info.os);
 
1503
      set_target_asm(target_info.assem);
 
1504
      set_target_ar(target_info.ar);
 
1505
      set_target_res(target_info.res);
 
1506
      target_path:=lower(target_info.short_name);
 
1507
      target_cpu:=target_info.cpu;
 
1508
      set_target_info:=true;
 
1509
      exit;
 
1510
    end;
 
1511
end;
 
1512
 
 
1513
 
 
1514
{****************************************************************************
 
1515
                             Load from string
 
1516
****************************************************************************}
 
1517
 
 
1518
function set_string_target(s : string) : boolean;
 
1519
var
 
1520
  i : longint;
 
1521
begin
 
1522
  set_string_target:=false;
 
1523
  { this should be case insensitive !! PM }
 
1524
  s:=upper(s);
 
1525
  for i:=1 to targetcnt do
 
1526
   if target_infos[i].short_name=s then
 
1527
    begin
 
1528
      set_target_info(target_infos[i].target);
 
1529
      set_string_target:=true;
 
1530
      exit;
 
1531
    end;
 
1532
end;
 
1533
 
 
1534
 
 
1535
function set_string_asm(s : string) : boolean;
 
1536
var
 
1537
  i : longint;
 
1538
begin
 
1539
  set_string_asm:=false;
 
1540
  { this should be case insensitive !! PM }
 
1541
  s:=upper(s);
 
1542
  for i:=1 to asmcnt do
 
1543
   if as_infos[i].idtxt=s then
 
1544
    begin
 
1545
      target_asm:=as_infos[i];
 
1546
      set_string_asm:=true;
 
1547
    end;
 
1548
end;
 
1549
 
 
1550
 
 
1551
function set_string_asmmode(s:string;var t:tasmmode):boolean;
 
1552
var
 
1553
  i : longint;
 
1554
begin
 
1555
  set_string_asmmode:=false;
 
1556
  { this should be case insensitive !! PM }
 
1557
  s:=upper(s);
 
1558
  for i:=1 to asmmodecnt do
 
1559
   if asmmodeinfos[i].idtxt=s then
 
1560
    begin
 
1561
      t:=asmmodeinfos[i].id;
 
1562
      set_string_asmmode:=true;
 
1563
    end;
 
1564
end;
 
1565
 
 
1566
 
 
1567
{****************************************************************************
 
1568
                      Initialization of default target
 
1569
****************************************************************************}
 
1570
 
 
1571
procedure default_os(t:ttarget);
 
1572
begin
 
1573
  set_target_info(t);
 
1574
  if source_os.name='' then
 
1575
    source_os:=target_os;
 
1576
end;
 
1577
 
 
1578
 
 
1579
procedure set_source_os(t:tos);
 
1580
var
 
1581
  i : longint;
 
1582
begin
 
1583
{ can't use message() here (PFV) }
 
1584
  if source_os.name<>'' then
 
1585
    Writeln('Warning: Source OS Redefined!');
 
1586
  for i:=1 to oscnt do
 
1587
   if os_infos[i].id=t then
 
1588
    begin
 
1589
      source_os:=os_infos[i];
 
1590
      exit;
 
1591
    end;
 
1592
end;
 
1593
 
 
1594
 
 
1595
procedure InitSystems;
 
1596
begin
 
1597
{ first get source OS }
 
1598
  source_os.name:='';
 
1599
{ please note then we use cpu86 and cpu68 here on purpose !! }
 
1600
{$ifdef cpu86}
 
1601
  {$ifdef GO32V1}
 
1602
    set_source_os(os_i386_GO32V1);
 
1603
  {$else}
 
1604
    {$ifdef GO32V2}
 
1605
      set_source_os(os_i386_GO32V2);
 
1606
    {$else}
 
1607
      {$ifdef OS2}
 
1608
        set_source_os(os_i386_OS2);
 
1609
        if (OS_Mode = osDOS) or (OS_Mode = osDPMI)
 
1610
                                            then source_os.scriptext := '.bat';
 
1611
{OS/2 via EMX can be run under DOS as well}
 
1612
      {$else}
 
1613
        {$ifdef LINUX}
 
1614
           {$Ifdef BSD}
 
1615
            set_source_os(os_i386_FreeBSD);             
 
1616
          {$else}
 
1617
            set_source_os(os_i386_LINUX);
 
1618
           {$endif}
 
1619
        {$else}
 
1620
          {$ifdef WIN32}
 
1621
            set_source_os(os_i386_WIN32);
 
1622
          {$endif win32}
 
1623
        {$endif linux}
 
1624
      {$endif os2}
 
1625
    {$endif go32v2}
 
1626
  {$endif go32v1}
 
1627
{$endif cpu86}
 
1628
{$ifdef cpu68}
 
1629
  {$ifdef AMIGA}
 
1630
    set_source_os(os_m68k_Amiga);
 
1631
  {$else}
 
1632
    {$ifdef ATARI}
 
1633
      set_source_os(os_m68k_Atari);
 
1634
    {$else}
 
1635
      {$ifdef MACOS}
 
1636
        set_source_os(os_m68k_MAC);
 
1637
      {$else}
 
1638
        {$ifdef LINUX}
 
1639
           set_source_os(os_m68k_linux);
 
1640
        {$endif linux}
 
1641
      {$endif macos}
 
1642
    {$endif atari}
 
1643
  {$endif amiga}
 
1644
{$endif cpu68}
 
1645
 
 
1646
{ Now default target !! }
 
1647
{$ifdef i386}
 
1648
  {$ifdef GO32V1}
 
1649
     default_os(target_i386_GO32V1);
 
1650
  {$else}
 
1651
    {$ifdef GO32V2}
 
1652
      default_os(target_i386_GO32V2);
 
1653
    {$else}
 
1654
      {$ifdef OS2}
 
1655
        default_os(target_i386_OS2);
 
1656
      {$else}
 
1657
        {$ifdef LINUX}
 
1658
         {$ifdef BSD}
 
1659
          default_os(target_i386_FreeBSD);
 
1660
         {$else}
 
1661
          default_os(target_i386_LINUX);
 
1662
         {$endif}
 
1663
        {$else}
 
1664
           {$ifdef WIN32}
 
1665
             default_os(target_i386_WIN32);
 
1666
           {$else}
 
1667
             default_os(target_i386_GO32V2);
 
1668
           {$endif win32}
 
1669
        {$endif linux}
 
1670
      {$endif os2}
 
1671
    {$endif go32v2}
 
1672
  {$endif go32v1}
 
1673
{$endif i386}
 
1674
{$ifdef m68k}
 
1675
  {$ifdef AMIGA}
 
1676
    default_os(target_m68k_Amiga);
 
1677
  {$else}
 
1678
    {$ifdef ATARI}
 
1679
      default_os(target_m68k_Atari);
 
1680
    {$else}
 
1681
      {$ifdef MACOS}
 
1682
        default_os(target_m68k_Mac);
 
1683
      {$else}
 
1684
        {$ifdef LINUX}
 
1685
          default_os(target_m68k_linux);
 
1686
        {$else}
 
1687
          default_os(target_m68k_Amiga);
 
1688
        {$endif linux}
 
1689
      {$endif macos}
 
1690
    {$endif atari}
 
1691
  {$endif amiga}
 
1692
{$endif m68k}
 
1693
{$ifdef alpha}
 
1694
  default_os(target_alpha_linux);
 
1695
{$endif alpha}
 
1696
{$ifdef powerpc}
 
1697
  default_os(target_powerpc_linux);
 
1698
{$endif powerpc}
 
1699
end;
 
1700
 
 
1701
 
 
1702
begin
 
1703
  InitSystems;
 
1704
end.
 
1705
{
 
1706
  $Log: systems.pas,v $
 
1707
  Revision 1.1.2.4  2000/09/24 21:13:37  hajny
 
1708
    * OS/2 default stack size increased
 
1709
 
 
1710
  Revision 1.1.2.3  2000/09/24 19:55:30  hajny
 
1711
    * OS/2 stack alignment corrected (4)
 
1712
 
 
1713
  Revision 1.1.2.2  2000/09/13 13:57:41  marco
 
1714
   * FreeBSD compiler support
 
1715
 
 
1716
  Revision 1.1.2.1  2000/08/07 12:32:47  jonas
 
1717
    * reordered severam object fields to make optimal use of memory (avoid
 
1718
      alignment padding)
 
1719
 
 
1720
  Revision 1.1  2000/07/13 06:29:57  michael
 
1721
  + Initial import
 
1722
 
 
1723
  Revision 1.106  2000/06/25 19:08:28  hajny
 
1724
    + $R support for OS/2 (EMX) added
 
1725
 
 
1726
  Revision 1.105  2000/06/23 21:31:18  pierre
 
1727
   + new target_os field: maxCstructalignment
 
1728
 
 
1729
  Revision 1.104  2000/05/23 21:26:52  pierre
 
1730
    + added supported_target fiedl to tasminfo record
 
1731
      to disregard wrong assembler settings
 
1732
 
 
1733
  Revision 1.103  2000/05/11 09:07:45  pierre
 
1734
   * change tosinfo.shortname length, reported by Kovacs Attila Zoltan
 
1735
 
 
1736
  Revision 1.102  2000/04/22 14:25:03  jonas
 
1737
    * aasm.pas: pai_align instead of pai_align_abstract if cpu <> i386
 
1738
    + systems.pas: info for macos/ppc
 
1739
    * new/cgobj.pas: compiles again without newst define
 
1740
    * new/powerpc/cgcpu: generate different entry/exit code depending on
 
1741
      whether target_os is MacOs or Linux
 
1742
 
 
1743
  Revision 1.101  2000/04/04 14:18:15  pierre
 
1744
   * nasmwin32 is 9 chars long, idtxt changed accordingly
 
1745
 
 
1746
  Revision 1.100  2000/04/04 13:54:58  pierre
 
1747
   + nasmwin32 for win32 object output with nasm assembler
 
1748
 
 
1749
  Revision 1.99  2000/02/09 13:23:06  peter
 
1750
    * log truncated
 
1751
 
 
1752
  Revision 1.98  2000/01/07 01:14:42  peter
 
1753
    * updated copyright to 2000
 
1754
 
 
1755
  Revision 1.97  1999/11/06 14:34:28  peter
 
1756
    * truncated log to 20 revs
 
1757
 
 
1758
  Revision 1.96  1999/11/03 23:43:45  peter
 
1759
    * fixed ar commands
 
1760
 
 
1761
  Revision 1.95  1999/10/21 14:29:37  peter
 
1762
    * redesigned linker object
 
1763
    + library support for linux (only procedures can be exported)
 
1764
 
 
1765
  Revision 1.94  1999/09/15 22:09:27  florian
 
1766
    + rtti is now automatically generated for published classes, i.e.
 
1767
      they are handled like an implicit property
 
1768
 
 
1769
  Revision 1.93  1999/09/15 20:24:56  daniel
 
1770
  + Dw switch now does something.
 
1771
 
 
1772
  Revision 1.92  1999/09/07 15:02:41  pierre
 
1773
   * powerpc default was alpha !!
 
1774
 
 
1775
  Revision 1.91  1999/08/16 15:35:29  pierre
 
1776
    * fix for DLL relocation problems
 
1777
    * external bss vars had wrong stabs for pecoff
 
1778
    + -WB11000000 to specify default image base, allows to
 
1779
      load several DLLs with debugging info included
 
1780
      (relocatable DLL are stripped because the relocation
 
1781
       of the .Stab section is misplaced by ldw)
 
1782
 
 
1783
  Revision 1.90  1999/08/04 13:03:11  jonas
 
1784
    * all tokens now start with an underscore
 
1785
    * PowerPC compiles!!
 
1786
 
 
1787
  Revision 1.89  1999/08/04 00:23:32  florian
 
1788
    * renamed i386asm and i386base to cpuasm and cpubase
 
1789
 
 
1790
  Revision 1.88  1999/08/03 22:03:23  peter
 
1791
    * moved bitmask constants to sets
 
1792
    * some other type/const renamings
 
1793
 
 
1794
  Revision 1.87  1999/08/03 17:09:43  florian
 
1795
    * the alpha compiler can be compiled now
 
1796
 
 
1797
  Revision 1.86  1999/08/03 15:52:00  michael
 
1798
  * changed shortname for linux alpha
 
1799
 
 
1800
  Revision 1.85  1999/08/03 13:50:19  michael
 
1801
  + Changes for alpha
 
1802
 
 
1803
  Revision 1.84  1999/08/02 23:56:51  michael
 
1804
  + Added alpha cpu and linux for alpha os
 
1805
 
 
1806
}
 
 
b'\\ No newline at end of file'