123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100 |
- {
- $Id$
- Copyright (C) 1995,97 by Florian Klaempfl
- This unit contains information about the target systems supported
- (these are not processor specific)
- This progsam is free software; you can redistribute it and/or modify
- iu under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 3 of the License, or
- (at your option) any later version.
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge- MA 02139, USA.
- ****************************************************************************
- }
- unit systems;
- interface
- type
- tendian = (endian_little,endian_big);
- ttargetcpu=(no_cpu
- ,i386,m68k,alpha,powerpc
- );
- tprocessors = (no_processor
- ,Class386,ClassP5,ClassP6
- ,MC68000,MC68100,MC68020
- );
- tsection=(sec_none,
- sec_code,sec_data,sec_bss,
- sec_idata2,sec_idata4,sec_idata5,sec_idata6,sec_idata7,sec_edata,
- sec_stab,sec_stabstr
- );
- type
- tasmmode= (asmmode_none
- ,asmmode_i386_direct,asmmode_i386_att,asmmode_i386_intel
- ,asmmode_m68k_mot,asmmode_alpha_direct,asmmode_powerpc_direct
- );
- const
- {$ifdef i386} i386asmmodecnt=3; {$else} i386asmmodecnt=0; {$endif}
- {$ifdef m68k} m68kasmmodecnt=1; {$else} m68kasmmodecnt=0; {$endif}
- {$ifdef alpha} alphaasmmodecnt=1; {$else} alphaasmmodecnt=0; {$endif}
- {$ifdef powerpc} powerpcasmmodecnt=1; {$else} powerpcasmmodecnt=0; {$endif}
- asmmodecnt=i386asmmodecnt+m68kasmmodecnt+Alphaasmmodecnt+powerpcasmmodecnt+1;
- type
- ttarget = (target_none
- ,target_i386_GO32V1,target_i386_GO32V2,target_i386_linux,
- target_i386_OS2,target_i386_Win32
- ,target_m68k_Amiga,target_m68k_Atari,target_m68k_Mac,
- target_m68k_linux,target_m68k_PalmOS,target_alpha_linux,
- target_powerpc_linux
- );
- ttargetflags = (tf_none,
- tf_supports_stack_checking,tf_need_export,tf_needs_isconsole
- );
- const
- {$ifdef i386} i386targetcnt=5; {$else} i386targetcnt=0; {$endif}
- {$ifdef m68k} m68ktargetcnt=5; {$else} m68ktargetcnt=0; {$endif}
- {$ifdef alpha} alphatargetcnt=1; {$else} alphatargetcnt=0; {$endif}
- {$ifdef powerpc} powerpctargetcnt=1; {$else} powerpctargetcnt=0; {$endif}
- targetcnt=i386targetcnt+m68ktargetcnt+alphatargetcnt+powerpctargetcnt+1;
- type
- tasm = (as_none
- ,as_i386_as,as_i386_as_aout,as_i386_asw,
- as_i386_nasmcoff,as_i386_nasmelf,as_i386_nasmobj,
- as_i386_tasm,as_i386_masm,
- as_i386_dbg,as_i386_coff,as_i386_pecoff
- ,as_m68k_as,as_m68k_gas,as_m68k_mit,as_m68k_mot,as_m68k_mpw,
- as_alpha_as,as_powerpc_as
- );
- { binary assembler writers, needed to test for -a }
- const
- {$ifdef i386} i386asmcnt=11; {$else} i386asmcnt=0; {$endif}
- {$ifdef m68k} m68kasmcnt=5; {$else} m68kasmcnt=0; {$endif}
- {$ifdef alpha} alphaasmcnt=1; {$else} alphaasmcnt=0; {$endif}
- {$ifdef powerpc} powerpcasmcnt=1; {$else} powerpcasmcnt=0; {$endif}
- asmcnt=i386asmcnt+m68kasmcnt+alphaasmcnt+powerpcasmcnt+1;
- binassem : set of tasm = [
- as_i386_dbg,as_i386_coff,as_i386_pecoff
- ];
- type
- tlink = (link_none
- ,link_i386_ld,link_i386_ldgo32v1,
- link_i386_ldgo32v2,link_i386_ldw,
- link_i386_ldos2
- ,link_m68k_ld,link_alpha_ld,link_powerpc_ld
- );
- const
- {$ifdef i386} i386linkcnt=5; {$else} i386linkcnt=0; {$endif}
- {$ifdef m68k} m68klinkcnt=1; {$else} m68klinkcnt=0; {$endif}
- {$ifdef alpha} alphalinkcnt=1; {$else} alphalinkcnt=0; {$endif}
- {$ifdef powerpc} powerpclinkcnt=1; {$else} powerpclinkcnt=0; {$endif}
- linkcnt=i386linkcnt+m68klinkcnt+alphalinkcnt+powerpclinkcnt+1;
- type
- tar = (ar_none
- ,ar_i386_ar,ar_i386_arw
- ,ar_m68k_ar,ar_alpha_ar,ar_powerpc_ar
- );
- const
- {$ifdef i386} i386arcnt=2; {$else} i386arcnt=0; {$endif}
- {$ifdef m68k} m68karcnt=1; {$else} m68karcnt=0; {$endif}
- {$ifdef alpha} alphaarcnt=1; {$else} alphaarcnt=0; {$endif}
- {$ifdef powerpc} powerpcarcnt=1; {$else} powerpcarcnt=0; {$endif}
- arcnt=i386arcnt+m68karcnt+alphaarcnt+powerpcarcnt+1;
- type
- tres = (res_none
- ,res_i386_windres
- );
- const
- {$ifdef i386} i386rescnt=1; {$else} i386rescnt=0; {$endif}
- {$ifdef m68k} m68krescnt=0; {$else} m68krescnt=0; {$endif}
- {$ifdef alpha} alpharescnt=0; {$else} alpharescnt=0; {$endif}
- {$ifdef powerpc} powerpcrescnt=0; {$else} powerpcrescnt=0; {$endif}
- rescnt=i386rescnt+m68krescnt+alpharescnt+powerpcrescnt+1;
- type
- tos = ( os_none,
- os_i386_GO32V1,os_i386_GO32V2,os_i386_Linux,os_i386_OS2,
- os_i386_Win32,
- os_m68k_Amiga,os_m68k_Atari,os_m68k_Mac,os_m68k_Linux,
- os_m68k_PalmOS,os_alpha_linux,os_powerpc_linux
- );
- const
- i386oscnt=5;
- m68koscnt=5;
- alphaoscnt=1;
- powerpcoscnt=1;
- oscnt=i386oscnt+m68koscnt+alphaoscnt+powerpcoscnt+1;
- type
- tosinfo = packed record
- id : tos;
- name : string[30];
- shortname : string[8];
- sharedlibext : string[10];
- staticlibext,
- sourceext,
- pasext,
- exeext,
- defext,
- scriptext : string[4];
- libprefix : string[3];
- Cprefix : string[2];
- newline : string[2];
- endian : tendian;
- stackalignment : {longint this is a little overkill no ?? }byte;
- size_of_pointer : byte;
- size_of_longint : byte;
- use_bound_instruction : boolean;
- use_function_relative_addresses : boolean;
- end;
- tasminfo = packed record
- id : tasm;
- idtxt : string[8];
- asmbin : string[8];
- asmcmd : string[50];
- allowdirect,
- externals,
- needar : boolean;
- labelprefix : string[2];
- comment : string[2];
- secnames : array[tsection] of string[20];
- end;
- tlinkinfo = packed record
- id : tlink;
- linkbin : string[8];
- linkcmd : string[127];
- binders : word;
- bindbin : array[1..2]of string[8];
- bindcmd : array[1..2]of string[127];
- stripopt : string[2];
- stripbind : boolean; { Strip symbols in binder? }
- libpathprefix : string[13];
- libpathsuffix : string[2];
- groupstart : string[8];
- groupend : string[2];
- inputstart : string[8];
- inputend : string[2];
- libprefix : string[2];
- end;
- tarinfo = packed record
- id : tar;
- arbin : string[8];
- arcmd : string[50];
- end;
- tresinfo = packed record
- id : tres;
- resbin : string[8];
- rescmd : string[50];
- end;
- ttargetinfo = packed record
- target : ttarget;
- flags : set of ttargetflags;
- cpu : ttargetcpu;
- short_name : string[8];
- unit_env : string[12];
- system_unit : string[8];
- smartext,
- unitext,
- unitlibext,
- asmext,
- objext,
- resext,
- resobjext,
- exeext : string[4];
- os : tos;
- link : tlink;
- assem : tasm;
- assemsrc : tasm; { default source writing assembler }
- ar : tar;
- res : tres;
- heapsize,
- maxheapsize,
- stacksize : longint;
- end;
- tasmmodeinfo=packed record
- id : tasmmode;
- idtxt : string[8];
- end;
- var
- target_cpu : ttargetcpu;
- target_info : ttargetinfo;
- target_os : tosinfo;
- target_asm : tasminfo;
- target_link : tlinkinfo;
- target_ar : tarinfo;
- target_res : tresinfo;
- target_path : string[12]; { for rtl/<X>/,fcl/<X>/, etc. }
- source_os : tosinfo;
- function set_target_os(t:tos):boolean;
- function set_target_asm(t:tasm):boolean;
- function set_target_link(t:tlink):boolean;
- function set_target_ar(t:tar):boolean;
- function set_target_res(t:tres):boolean;
- function set_target_info(t:ttarget):boolean;
- function set_string_target(s : string) : boolean;
- function set_string_asm(s : string) : boolean;
- function set_string_asmmode(s:string;var t:tasmmode):boolean;
- procedure InitSystems;
- implementation
- const
- {****************************************************************************
- OS Info
- ****************************************************************************}
- os_infos : array[1..oscnt] of tosinfo = (
- (
- id : os_none;
- name : 'No operating system';
- shortname : 'none'
- ),
- (
- id : os_i386_go32v1;
- name : 'GO32 V1 DOS extender';
- shortname : 'go32v1';
- sharedlibext : '.dll';
- staticlibext : '.a';
- sourceext : '.pp';
- pasext : '.pas';
- exeext : ''; { No .exe, the linker only output a.out ! }
- defext : '.def';
- scriptext : '.bat';
- libprefix : '';
- Cprefix : '_';
- newline : #13#10;
- endian : endian_little;
- stackalignment : 2;
- size_of_pointer : 4;
- size_of_longint : 4;
- use_bound_instruction : false;
- use_function_relative_addresses : true
- ),
- (
- id : os_i386_go32v2;
- name : 'GO32 V2 DOS extender';
- shortname : 'go32v2';
- sharedlibext : '.dll';
- staticlibext : '.a';
- sourceext : '.pp';
- pasext : '.pas';
- exeext : '.exe';
- defext : '.def';
- scriptext : '.bat';
- libprefix : '';
- Cprefix : '_';
- newline : #13#10;
- endian : endian_little;
- stackalignment : 2;
- size_of_pointer : 4;
- size_of_longint : 4;
- use_bound_instruction : false;
- use_function_relative_addresses : true
- ),
- (
- id : os_i386_linux;
- name : 'Linux for i386';
- shortname : 'linux';
- sharedlibext : '.so';
- staticlibext : '.a';
- sourceext : '.pp';
- pasext : '.pas';
- exeext : '';
- defext : '.def';
- scriptext : '.sh';
- libprefix : 'lib';
- Cprefix : '';
- newline : #10;
- endian : endian_little;
- stackalignment : 4;
- size_of_pointer : 4;
- size_of_longint : 4;
- use_bound_instruction : false;
- use_function_relative_addresses : true
- ),
- (
- id : os_i386_os2;
- name : 'OS/2 via EMX';
- shortname : 'os2';
- sharedlibext : '.ao2';
- staticlibext : '.ao2';
- sourceext : '.pas';
- pasext : '.pp';
- exeext : '.exe';
- defext : '.def';
- scriptext : '.cmd';
- libprefix : '';
- Cprefix : '_';
- newline : #13#10;
- endian : endian_little;
- stackalignment : 2;
- size_of_pointer : 4;
- size_of_longint : 4;
- use_bound_instruction : false;
- use_function_relative_addresses : false
- ),
- (
- id : os_i386_win32;
- name : 'Win32 for i386';
- shortname : 'win32';
- sharedlibext : '.dll';
- staticlibext : '.aw';
- sourceext : '.pp';
- pasext : '.pas';
- exeext : '.exe';
- defext : '.def';
- scriptext : '.bat';
- libprefix : 'lib';
- Cprefix : '_';
- newline : #13#10;
- endian : endian_little;
- stackalignment : 4;
- size_of_pointer : 4;
- size_of_longint : 4;
- use_bound_instruction : false;
- use_function_relative_addresses : true
- ),
- (
- id : os_m68k_amiga;
- name : 'Commodore Amiga';
- shortname : 'amiga';
- sharedlibext : '.library';
- staticlibext : '.a';
- sourceext : '.pp';
- pasext : '.pas';
- exeext : '';
- defext : '';
- scriptext : '';
- libprefix : '';
- Cprefix : '_';
- newline : #10;
- endian : endian_big;
- stackalignment : 2;
- size_of_pointer : 4;
- size_of_longint : 4;
- use_bound_instruction : false;
- use_function_relative_addresses : false
- ),
- (
- id : os_m68k_atari;
- name : 'Atari ST/STE';
- shortname : 'atari';
- sharedlibext : '.dll';
- staticlibext : '.a';
- sourceext : '.pp';
- pasext : '.pas';
- exeext : '.tpp';
- defext : '';
- scriptext : '';
- libprefix : '';
- Cprefix : '_';
- newline : #10;
- endian : endian_big;
- stackalignment : 2;
- size_of_pointer : 4;
- size_of_longint : 4;
- use_bound_instruction : false;
- use_function_relative_addresses : false
- ),
- (
- id : os_m68k_mac;
- name : 'Macintosh m68k';
- shortname : 'mac';
- sharedlibext : '.dll';
- staticlibext : '.a';
- sourceext : '.pp';
- pasext : '.pas';
- exeext : '.tpp';
- defext : '';
- scriptext : '';
- libprefix : '';
- Cprefix : '_';
- newline : #13;
- endian : endian_big;
- stackalignment : 2;
- size_of_pointer : 4;
- size_of_longint : 4;
- use_bound_instruction : false;
- use_function_relative_addresses : false
- ),
- (
- id : os_m68k_linux;
- name : 'Linux for m68k';
- shortname : 'linux';
- sharedlibext : '.so';
- staticlibext : '.a';
- sourceext : '.pp';
- pasext : '.pas';
- exeext : '';
- defext : '';
- scriptext : '.sh';
- libprefix : 'lib';
- Cprefix : '';
- newline : #10;
- endian : endian_big;
- stackalignment : 2;
- size_of_pointer : 4;
- size_of_longint : 4;
- use_bound_instruction : false;
- use_function_relative_addresses : true
- ),
- (
- id : os_m68k_palmos;
- name : 'PalmOS';
- shortname : 'palmos';
- sharedlibext : '.so';
- staticlibext : '.a';
- sourceext : '.pp';
- pasext : '.pas';
- exeext : '';
- defext : '';
- scriptext : '.sh';
- libprefix : 'lib';
- Cprefix : '_';
- newline : #10;
- endian : endian_big;
- stackalignment : 2;
- size_of_pointer : 4;
- size_of_longint : 4;
- use_bound_instruction : false;
- use_function_relative_addresses : false
- ),
- (
- id : os_alpha_linux;
- name : 'Linux for Alpha';
- shortname : 'axplinux';
- sharedlibext : '.so';
- staticlibext : '.a';
- sourceext : '.pp';
- pasext : '.pas';
- exeext : '';
- defext : '.def';
- scriptext : '.sh';
- libprefix : 'lib';
- Cprefix : '';
- newline : #10;
- endian : endian_little;
- stackalignment : 8;
- size_of_pointer : 8;
- size_of_longint : 4;
- use_bound_instruction : false;
- use_function_relative_addresses : true
- ),
- (
- id : os_powerpc_linux;
- name : 'Linux for PowerPC';
- shortname : 'linuxppc';
- sharedlibext : '.so';
- staticlibext : '.a';
- sourceext : '.pp';
- pasext : '.pas';
- exeext : '';
- defext : '.def';
- scriptext : '.sh';
- libprefix : 'lib';
- Cprefix : '';
- newline : #10;
- endian : endian_big;
- stackalignment : 8;
- size_of_pointer : 4;
- size_of_longint : 4;
- use_bound_instruction : false;
- use_function_relative_addresses : true
- )
- );
- {****************************************************************************
- Assembler Info
- ****************************************************************************}
- as_infos : array[1..asmcnt] of tasminfo = (
- (
- id : as_none;
- idtxt : 'no'
- )
- {$ifdef i386}
- ,(
- id : as_i386_as;
- idtxt : 'AS';
- asmbin : 'as';
- asmcmd : '-o $OBJ $ASM';
- allowdirect : true;
- externals : false;
- needar : true;
- labelprefix : '.L';
- comment : '# ';
- secnames : ('',
- '.text','.data','.bss',
- '','','','','','',
- '.stab','.stabstr')
- )
- ,(
- id : as_i386_as_aout;
- idtxt : 'AS_AOUT';
- asmbin : 'as';
- asmcmd : '-o $OBJ $ASM';
- allowdirect : true;
- externals : false;
- needar : true;
- labelprefix : 'L';
- comment : '# ';
- secnames : ('',
- '.text','.data','.bss',
- '','','','','','',
- '.stab','.stabstr')
- )
- ,(
- id : as_i386_asw;
- idtxt : 'ASW';
- asmbin : 'asw';
- asmcmd : '-o $OBJ $ASM';
- allowdirect : true;
- externals : false;
- needar : true;
- labelprefix : '.L';
- comment : '# ';
- secnames : ('',
- '.text','.data','.section .bss',
- '.section .idata$2','.section .idata$4','.section .idata$5',
- '.section .idata$6','.section .idata$7','.section .edata',
- '.stab','.stabstr')
- )
- ,(
- id : as_i386_nasmcoff;
- idtxt : 'NASMCOFF';
- asmbin : 'nasm';
- asmcmd : '-f coff -o $OBJ $ASM';
- allowdirect : true;
- externals : true;
- needar : true;
- labelprefix : 'L';
- comment : '; ';
- secnames : ('',
- '.text','.data','.bss',
- '.idata2','.idata4','.idata5','.idata6','.idata7','.edata',
- '.stab','.stabstr')
- )
- ,(
- id : as_i386_nasmelf;
- idtxt : 'NASMELF';
- asmbin : 'nasm';
- asmcmd : '-f elf -o $OBJ $ASM';
- allowdirect : true;
- externals : true;
- needar : true;
- labelprefix : 'L';
- comment : '; ';
- secnames : ('',
- '.text','.data','.bss',
- '.idata2','.idata4','.idata5','.idata6','.idata7','.edata',
- '.stab','.stabstr')
- )
- ,(
- id : as_i386_nasmobj;
- idtxt : 'NASMOBJ';
- asmbin : 'nasm';
- asmcmd : '-f obj -o $OBJ $ASM';
- allowdirect : true;
- externals : true;
- needar : true;
- labelprefix : 'L';
- comment : '; ';
- secnames : ('',
- '.text','.data','.bss',
- '.idata2','.idata4','.idata5','.idata6','.idata7','.edata',
- '.stab','.stabstr')
- )
- ,(
- id : as_i386_tasm;
- idtxt : 'TASM';
- asmbin : 'tasm';
- asmcmd : '/m2 $ASM $OBJ';
- allowdirect : true;
- externals : true;
- needar : true;
- labelprefix : '@@';
- comment : '; ';
- secnames : ('',
- 'CODE','DATA','BSS',
- '','','','','','',
- '','')
- )
- ,(
- id : as_i386_masm;
- idtxt : 'MASM';
- asmbin : 'masm';
- asmcmd : '$ASM $OBJ';
- allowdirect : true;
- externals : true;
- needar : true;
- labelprefix : '.L';
- comment : '; ';
- secnames : ('',
- 'CODE','DATA','BSS',
- '','','','','','',
- '','')
- )
- ,(
- id : as_i386_dbg;
- idtxt : 'DBG';
- asmbin : '';
- asmcmd : '';
- allowdirect : false;
- externals : true;
- needar : false;
- labelprefix : 'L';
- comment : '';
- secnames : ('',
- '.text','.data','.bss',
- '.idata$2','.idata$4','.idata$5','.idata$6','.idata$7','.edata',
- '.stab','.stabstr')
- )
- ,(
- id : as_i386_coff;
- idtxt : 'COFF';
- asmbin : '';
- asmcmd : '';
- allowdirect : false;
- externals : true;
- needar : false;
- labelprefix : '.L';
- comment : '';
- secnames : ('',
- '.text','.data','.bss',
- '.idata$2','.idata$4','.idata$5','.idata$6','.idata$7','.edata',
- '.stab','.stabstr')
- )
- ,(
- id : as_i386_pecoff;
- idtxt : 'PECOFF';
- asmbin : '';
- asmcmd : '';
- allowdirect : false;
- externals : true;
- needar : false;
- labelprefix : '.L';
- comment : '';
- secnames : ('',
- '.text','.data','.bss',
- '.idata$2','.idata$4','.idata$5','.idata$6','.idata$7','.edata',
- '.stab','.stabstr')
- )
- {$endif i386}
- {$ifdef m68k}
- ,(
- id : as_m68k_as;
- idtxt : 'AS';
- asmbin : 'as';
- asmcmd : '-o $OBJ $ASM';
- allowdirect : true;
- externals : false;
- needar : true;
- labelprefix : '.L';
- comment : '# ';
- secnames : ('',
- '.text','.data','.bss',
- '.idata$2','.idata$4','.idata$5','.idata$6','.idata$7','.edata',
- '.stab','.stabstr')
- )
- ,(
- id : as_m68k_gas;
- idtxt : 'GAS';
- asmbin : 'as68k'; { Gas for the Amiga}
- asmcmd : '--register-prefix-optional -o $OBJ $ASM';
- allowdirect : true;
- externals : false;
- needar : true;
- labelprefix : '.L';
- comment : '| ';
- secnames : ('',
- '.text','.data','.bss',
- '.idata$2','.idata$4','.idata$5','.idata$6','.idata$7','.edata',
- '.stab','.stabstr')
- )
- ,(
- id : as_m68k_mit;
- idtxt : 'MIT';
- asmbin : '';
- asmcmd : '-o $OBJ $ASM';
- allowdirect : true;
- externals : false;
- needar : true;
- labelprefix : '.L';
- comment : '| ';
- secnames : ('',
- '.text','.data','.bss',
- '.idata$2','.idata$4','.idata$5','.idata$6','.idata$7','.edata',
- '.stab','.stabstr')
- )
- ,(
- id : as_m68k_mot;
- idtxt : 'MOT';
- asmbin : '';
- asmcmd : '-o $OBJ $ASM';
- allowdirect : true;
- externals : false;
- needar : true;
- labelprefix : '__L';
- comment : '| ';
- secnames : ('',
- '.text','.data','.bss',
- '.idata$2','.idata$4','.idata$5','.idata$6','.idata$7','.edata',
- '.stab','.stabstr')
- )
- ,(
- id : as_m68k_mpw;
- idtxt : 'MPW';
- asmbin : '';
- asmcmd : '-model far -o $OBJ $ASM';
- allowdirect : true;
- externals : false;
- needar : true;
- labelprefix : '__L';
- comment : '| ';
- secnames : ('',
- '.text','.data','.bss',
- '.idata$2','.idata$4','.idata$5','.idata$6','.idata$7','.edata',
- '.stab','.stabstr')
- )
- {$endif m68k}
- {$ifdef alpha}
- ,(
- id : as_alpha_as;
- idtxt : 'AS';
- asmbin : 'as';
- asmcmd : '-o $OBJ $ASM';
- allowdirect : true;
- externals : false;
- needar : true;
- labelprefix : '.L';
- comment : '# ';
- secnames : ('',
- '.text','.data','.bss',
- '','','','','','',
- '.stab','.stabstr')
- )
- {$endif}
- {$ifdef powerpc}
- ,(
- id : as_powerpc_as;
- idtxt : 'AS';
- asmbin : 'as';
- asmcmd : '-o $OBJ $ASM';
- allowdirect : true;
- externals : false;
- needar : true;
- labelprefix : '.L';
- comment : '# ';
- secnames : ('',
- '.text','.data','.bss',
- '','','','','','',
- '.stab','.stabstr')
- )
- {$endif}
- );
- {****************************************************************************
- Linker Info
- ****************************************************************************}
- link_infos : array[1..linkcnt] of tlinkinfo = (
- (
- id : link_none
- )
- {$ifdef i386}
- ,(
- id : link_i386_ld;
- linkbin : 'ld';
- linkcmd : '$OPT -o $EXE $RES';
- binders : 0;
- bindbin : ('','');
- bindcmd : ('','');
- stripopt : '-s';
- stripbind : false;
- libpathprefix : 'SEARCH_DIR(';
- libpathsuffix : ')';
- groupstart : 'GROUP(';
- groupend : ')';
- inputstart : 'INPUT(';
- inputend : ')';
- libprefix : '-l'
- )
- ,(
- id : link_i386_ldgo32v1;
- linkbin : 'ld';
- linkcmd : '-oformat coff-go32 $OPT -o $EXE @$RES';
- binders : 1;
- bindbin : ('aout2exe','');
- bindcmd : ('$EXE','');
- stripopt : '-s';
- stripbind : false;
- libpathprefix : '-L';
- libpathsuffix : '';
- groupstart : '-(';
- groupend : '-)';
- inputstart : '';
- inputend : '';
- libprefix : '-l'
- )
- ,(
- id : link_i386_ldgo32v2;
- linkbin : 'ld';
- linkcmd : '-oformat coff-go32-exe $OPT -o $EXE @$RES';
- binders:0;
- bindbin : ('','');
- bindcmd : ('','');
- stripopt : '-s';
- stripbind : false;
- libpathprefix : '-L';
- libpathsuffix : '';
- groupstart : '-(';
- groupend : '-)';
- inputstart : '';
- inputend : '';
- libprefix : '-l'
- )
- ,(
- id : link_i386_ldw;
- linkbin : 'ldw';
- linkcmd : '$OPT -o $EXE $RES';
- binders : 0;
- bindbin : ('dlltool','ldw');
- bindcmd : ('--as asw.exe --dllname $EXE --output-exp exp.$$$',
- '-s $OPT -o $EXE $RES exp.$$$');
- stripopt : '-s';
- stripbind : false;
- libpathprefix : 'SEARCH_DIR(';
- libpathsuffix : ')';
- groupstart : 'GROUP(';
- groupend : ')';
- inputstart : 'INPUT(';
- inputend : ')';
- libprefix : '-l'
- )
- ,(
- id : link_i386_ldos2;
- linkbin : 'ld'; { Os/2 }
- linkcmd : '-o $EXE @$RES';
- binders : 1;
- bindbin : ('emxbind','');
- bindcmd : ('-b $STRIP -k$STACKKB -h$HEAPMB -o $EXE.exe $EXE -aim -s$DOSHEAPKB',
- '');
- stripopt : '-s';
- stripbind : true;
- libpathprefix : '-L';
- libpathsuffix : '';
- groupstart : ''; {Linker is too primitive...}
- groupend : '';
- inputstart : '';
- inputend : '';
- libprefix : '-l'
- )
- {$endif i386}
- {$ifdef m68k}
- ,(
- id : link_m68k_ld;
- linkbin : 'ld';
- linkcmd : '$OPT -o $EXE $RES';
- binders:0;
- bindbin : ('','');
- bindcmd : ('','');
- stripopt : '-s';
- stripbind : false;
- libpathprefix : 'SEARCH_DIR(';
- libpathsuffix : ')';
- groupstart : 'GROUP(';
- groupend : ')';
- inputstart : 'INPUT(';
- inputend : ')';
- libprefix : '-l'
- )
- {$endif m68k}
- {$ifdef alpha}
- ,(
- id : link_alpha_ld;
- linkbin : 'ld';
- linkcmd : '$OPT -o $EXE $RES';
- binders : 0;
- bindbin : ('','');
- bindcmd : ('','');
- stripopt : '-s';
- stripbind : false;
- libpathprefix : 'SEARCH_DIR(';
- libpathsuffix : ')';
- groupstart : 'GROUP(';
- groupend : ')';
- inputstart : 'INPUT(';
- inputend : ')';
- libprefix : '-l'
- )
- {$endif}
- {$ifdef powerpc}
- ,(
- id : link_powerpc_ld;
- linkbin : 'ld';
- linkcmd : '$OPT -o $EXE $RES';
- binders : 0;
- bindbin : ('','');
- bindcmd : ('','');
- stripopt : '-s';
- stripbind : false;
- libpathprefix : 'SEARCH_DIR(';
- libpathsuffix : ')';
- groupstart : 'GROUP(';
- groupend : ')';
- inputstart : 'INPUT(';
- inputend : ')';
- libprefix : '-l'
- )
- {$endif}
- );
- {****************************************************************************
- Ar Info
- ****************************************************************************}
- ar_infos : array[1..arcnt] of tarinfo = (
- (
- id : ar_none
- )
- {$ifdef i386}
- ,(
- id : ar_i386_ar;
- arbin : 'ar';
- arcmd : 'rs $LIB $FILES'
- ),
- (
- id : ar_i386_arw;
- arbin : 'arw';
- arcmd : 'rs $LIB $FILES'
- )
- {$endif i386}
- {$ifdef m68k}
- ,(
- id : ar_m68k_ar;
- arbin : 'ar';
- arcmd : 'rs $LIB $FILES'
- )
- {$endif m68k}
- {$ifdef alpha}
- ,(
- id : ar_alpha_ar;
- arbin : 'ar';
- arcmd : 'rs $LIB $FILES'
- )
- {$endif}
- {$ifdef powerpc}
- ,(
- id : ar_powerpc_ar;
- arbin : 'ar';
- arcmd : 'rs $LIB $FILES'
- )
- {$endif}
- );
- {****************************************************************************
- Res Info
- ****************************************************************************}
- res_infos : array[1..rescnt] of tresinfo = (
- (
- id : res_none
- )
- {$ifdef i386}
- ,(
- id : res_i386_windres;
- resbin : 'windres';
- rescmd : '--include $INC -O coff -o $OBJ $RES'
- )
- {$endif i386}
- );
- {****************************************************************************
- Targets Info
- ****************************************************************************}
- target_infos : array[1..targetcnt] of ttargetinfo = (
- (
- target : target_none;
- flags : [];
- cpu : no_cpu;
- short_name : 'notarget'
- )
- {$ifdef i386}
- ,(
- target : target_i386_GO32V1;
- flags : [];
- cpu : i386;
- short_name : 'GO32V1';
- unit_env : 'GO32V1UNITS';
- system_unit : 'SYSTEM';
- smartext : '.sl';
- unitext : '.pp1';
- unitlibext : '.ppl';
- asmext : '.s1';
- objext : '.o1';
- resext : '.res';
- resobjext : '.o1r';
- exeext : ''; { The linker produces a.out }
- os : os_i386_GO32V1;
- link : link_i386_ldgo32v1;
- assem : as_i386_as;
- assemsrc : as_i386_as;
- ar : ar_i386_ar;
- res : res_none;
- heapsize : 2048*1024;
- maxheapsize : 32768*1024;
- stacksize : 16384
- ),
- (
- target : target_i386_GO32V2;
- flags : [];
- cpu : i386;
- short_name : 'GO32V2';
- unit_env : 'GO32V2UNITS';
- system_unit : 'SYSTEM';
- smartext : '.sl';
- unitext : '.ppu';
- unitlibext : '.ppl';
- asmext : '.s';
- objext : '.o';
- resext : '.res';
- resobjext : '.or';
- exeext : '.exe';
- os : os_i386_GO32V2;
- link : link_i386_ldgo32v2;
- assem : as_i386_coff;
- assemsrc : as_i386_as;
- ar : ar_i386_ar;
- res : res_none;
- heapsize : 2048*1024;
- maxheapsize : 32768*1024;
- stacksize : 16384
- ),
- (
- target : target_i386_LINUX;
- flags : [];
- cpu : i386;
- short_name : 'LINUX';
- unit_env : 'LINUXUNITS';
- system_unit : 'syslinux';
- smartext : '.sl';
- unitext : '.ppu';
- unitlibext : '.ppl';
- asmext : '.s';
- objext : '.o';
- resext : '.res';
- resobjext : '.or';
- exeext : '';
- os : os_i386_Linux;
- link : link_i386_ld;
- assem : as_i386_as;
- assemsrc : as_i386_as;
- ar : ar_i386_ar;
- res : res_none;
- heapsize : 256*1024;
- maxheapsize : 32768*1024;
- stacksize : 8192
- ),
- (
- target : target_i386_OS2;
- flags : [tf_need_export];
- cpu : i386;
- short_name : 'OS2';
- unit_env : 'OS2UNITS';
- system_unit : 'SYSOS2';
- smartext : '.sl';
- unitext : '.ppo';
- unitlibext : '.ppl';
- asmext : '.so2';
- objext : '.oo2';
- resext : '.res';
- resobjext : '.oor';
- exeext : ''; { The linker produces a.out }
- os : os_i386_OS2;
- link : link_i386_ldos2;
- assem : as_i386_as_aout;
- assemsrc : as_i386_as_aout;
- ar : ar_i386_ar;
- res : res_none;
- heapsize : 256*1024;
- maxheapsize : 32768*1024;
- stacksize : 32768
- ),
- (
- target : target_i386_WIN32;
- flags : [];
- cpu : i386;
- short_name : 'WIN32';
- unit_env : 'WIN32UNITS';
- system_unit : 'SYSWIN32';
- smartext : '.slw';
- unitext : '.ppw';
- unitlibext : '.ppl';
- asmext : '.sw';
- objext : '.ow';
- resext : '.rc';
- resobjext : '.owr';
- exeext : '.exe';
- os : os_i386_Win32;
- link : link_i386_ldw;
- assem : as_i386_pecoff;
- assemsrc : as_i386_asw;
- ar : ar_i386_arw;
- res : res_i386_windres;
- heapsize : 256*1024;
- maxheapsize : 32*1024*1024;
- stacksize : 32*1024*1024
- )
- {$endif i386}
- {$ifdef m68k}
- ,(
- target : target_m68k_Amiga;
- flags : [];
- cpu : m68k;
- short_name : 'AMIGA';
- unit_env : '';
- system_unit : 'sysamiga';
- smartext : '.sl';
- unitext : '.ppa';
- unitlibext : '.ppl';
- asmext : '.asm';
- objext : '.o';
- resext : '.res';
- resobjext : '.or';
- exeext : '';
- os : os_m68k_Amiga;
- link : link_m68k_ld;
- assem : as_m68k_as;
- assemsrc : as_m68k_as;
- ar : ar_m68k_ar;
- res : res_none;
- heapsize : 128*1024;
- maxheapsize : 32768*1024;
- stacksize : 8192
- ),
- (
- target : target_m68k_Atari;
- flags : [];
- cpu : m68k;
- short_name : 'ATARI';
- unit_env : '';
- system_unit : 'SYSATARI';
- smartext : '.sl';
- unitext : '.ppt';
- unitlibext : '.ppl';
- asmext : '.s';
- objext : '.o';
- resext : '.res';
- resobjext : '.or';
- exeext : '.ttp';
- os : os_m68k_Atari;
- link : link_m68k_ld;
- assem : as_m68k_as;
- assemsrc : as_m68k_as;
- ar : ar_m68k_ar;
- res : res_none;
- heapsize : 16*1024;
- maxheapsize : 32768*1024;
- stacksize : 8192
- ),
- (
- target : target_m68k_Mac;
- flags : [];
- cpu : m68k;
- short_name : 'MACOS';
- unit_env : '';
- system_unit : 'sysmac';
- smartext : '.sl';
- unitext : '.ppt';
- unitlibext : '.ppl';
- asmext : '.a';
- objext : '.o';
- resext : '.res';
- resobjext : '.or';
- exeext : '';
- os : os_m68k_Mac;
- link : link_m68k_ld;
- assem : as_m68k_mpw;
- assemsrc : as_m68k_mpw;
- ar : ar_m68k_ar;
- res : res_none;
- heapsize : 128*1024;
- maxheapsize : 32768*1024;
- stacksize : 8192
- ),
- (
- target : target_m68k_linux;
- flags : [];
- cpu : m68k;
- short_name : 'LINUX';
- unit_env : 'LINUXUNITS';
- system_unit : 'syslinux';
- smartext : '.sl';
- unitext : '.ppu';
- unitlibext : '.ppl';
- asmext : '.s';
- objext : '.o';
- resext : '.res';
- resobjext : '.or';
- exeext : '';
- os : os_m68k_Linux;
- link : link_m68k_ld;
- assem : as_m68k_as;
- assemsrc : as_m68k_as;
- ar : ar_m68k_ar;
- res : res_none;
- heapsize : 128*1024;
- maxheapsize : 32768*1024;
- stacksize : 8192
- ),
- (
- target : target_m68k_PalmOS;
- flags : [];
- cpu : m68k;
- short_name : 'PALMOS';
- unit_env : 'PALMUNITS';
- system_unit : 'syspalm';
- smartext : '.sl';
- unitext : '.ppu';
- unitlibext : '.ppl';
- asmext : '.s';
- objext : '.o';
- resext : '.res';
- resobjext : '.or';
- exeext : '';
- os : os_m68k_PalmOS;
- link : link_m68k_ld;
- assem : as_m68k_as;
- assemsrc : as_m68k_as;
- ar : ar_m68k_ar;
- res : res_none;
- heapsize : 128*1024;
- maxheapsize : 32768*1024;
- stacksize : 8192
- )
- {$endif m68k}
- {$ifdef alpha}
- ,(
- target : target_alpha_LINUX;
- flags : [];
- cpu : alpha;
- short_name : 'LINUX';
- unit_env : 'LINUXUNITS';
- system_unit : 'syslinux';
- smartext : '.sl';
- unitext : '.ppu';
- unitlibext : '.ppl';
- asmext : '.s';
- objext : '.o';
- resext : '.res';
- resobjext : '.or';
- exeext : '';
- os : os_alpha_Linux;
- link : link_alpha_ld;
- assem : as_alpha_as;
- assemsrc : as_alpha_as;
- ar : ar_alpha_ar;
- res : res_none;
- heapsize : 256*1024;
- maxheapsize : 32768*1024;
- stacksize : 8192
- )
- {$endif}
- {$ifdef powerpc}
- ,(
- target : target_powerpc_LINUX;
- flags : [];
- cpu : alpha;
- short_name : 'LINUX';
- unit_env : 'LINUXUNITS';
- system_unit : 'syslinux';
- smartext : '.sl';
- unitext : '.ppu';
- unitlibext : '.ppl';
- asmext : '.s';
- objext : '.o';
- resext : '.res';
- resobjext : '.or';
- exeext : '';
- os : os_powerpc_Linux;
- link : link_powerpc_ld;
- assem : as_powerpc_as;
- assemsrc : as_powerpc_as;
- ar : ar_powerpc_ar;
- res : res_none;
- heapsize : 256*1024;
- maxheapsize : 32768*1024;
- stacksize : 8192
- )
- {$endif}
- );
- {****************************************************************************
- AsmModeInfo
- ****************************************************************************}
- asmmodeinfos : array[1..asmmodecnt] of tasmmodeinfo = (
- (
- id : asmmode_none;
- idtxt : 'none'
- )
- {$ifdef i386}
- ,(
- id : asmmode_i386_direct;
- idtxt : 'DIRECT'
- ),
- (
- id : asmmode_i386_att;
- idtxt : 'ATT'
- ),
- (
- id : asmmode_i386_intel;
- idtxt : 'INTEL'
- )
- {$endif i386}
- {$ifdef m68k}
- ,(
- id : asmmode_m68k_mot;
- idtxt : 'MOT'
- )
- {$endif m68k}
- {$ifdef alpha}
- ,(
- id : asmmode_alpha_direct;
- idtxt : 'DIRECT'
- )
- {$endif}
- {$ifdef powerpc}
- ,(
- id : asmmode_powerpc_direct;
- idtxt : 'DIRECT'
- )
- {$endif}
- );
- {****************************************************************************
- Helpers
- ****************************************************************************}
- function upper(const s : string) : string;
- var
- i : longint;
- begin
- for i:=1 to length(s) do
- if s[i] in ['a'..'z'] then
- upper[i]:=char(byte(s[i])-32)
- else
- upper[i]:=s[i];
- {$ifndef TP}
- {$ifopt H+}
- SetLength(upper,length(s));
- {$else}
- upper[0]:=s[0];
- {$endif}
- {$else}
- upper[0]:=s[0];
- {$endif}
- end;
- function lower(const s : string) : string;
- var
- i : longint;
- begin
- for i:=1 to length(s) do
- if s[i] in ['A'..'Z'] then
- lower[i]:=char(byte(s[i])+32)
- else
- lower[i]:=s[i];
- {$ifndef TP}
- {$ifopt H+}
- setlength(lower,length(s));
- {$else}
- lower[0]:=s[0];
- {$endif}
- {$else}
- lower[0]:=s[0];
- {$endif}
- end;
- function set_target_os(t:tos):boolean;
- var
- i : longint;
- begin
- set_target_os:=false;
- { target 1 is none }
- for i:=2 to oscnt do
- if os_infos[i].id=t then
- begin
- target_os:=os_infos[i];
- set_target_os:=true;
- exit;
- end;
- end;
- function set_target_asm(t:tasm):boolean;
- var
- i : longint;
- begin
- set_target_asm:=false;
- for i:=1 to asmcnt do
- if as_infos[i].id=t then
- begin
- target_asm:=as_infos[i];
- set_target_asm:=true;
- exit;
- end;
- end;
- function set_target_link(t:tlink):boolean;
- var
- i : longint;
- begin
- set_target_link:=false;
- for i:=1 to linkcnt do
- if link_infos[i].id=t then
- begin
- target_link:=link_infos[i];
- set_target_link:=true;
- exit;
- end;
- end;
- function set_target_ar(t:tar):boolean;
- var
- i : longint;
- begin
- set_target_ar:=false;
- for i:=1 to arcnt do
- if ar_infos[i].id=t then
- begin
- target_ar:=ar_infos[i];
- set_target_ar:=true;
- exit;
- end;
- end;
- function set_target_res(t:tres):boolean;
- var
- i : longint;
- begin
- set_target_res:=false;
- for i:=1 to rescnt do
- if res_infos[i].id=t then
- begin
- target_res:=res_infos[i];
- set_target_res:=true;
- exit;
- end;
- end;
- function set_target_info(t:ttarget):boolean;
- var
- i : longint;
- begin
- set_target_info:=false;
- for i:=1 to targetcnt do
- if target_infos[i].target=t then
- begin
- target_info:=target_infos[i];
- set_target_os(target_info.os);
- set_target_asm(target_info.assem);
- set_target_link(target_info.link);
- set_target_ar(target_info.ar);
- set_target_res(target_info.res);
- target_path:=lower(target_info.short_name);
- target_cpu:=target_info.cpu;
- set_target_info:=true;
- exit;
- end;
- end;
- {****************************************************************************
- Load from string
- ****************************************************************************}
- function set_string_target(s : string) : boolean;
- var
- i : longint;
- begin
- set_string_target:=false;
- { this should be case insensitive !! PM }
- s:=upper(s);
- for i:=1 to targetcnt do
- if target_infos[i].short_name=s then
- begin
- set_target_info(target_infos[i].target);
- set_string_target:=true;
- exit;
- end;
- end;
- function set_string_asm(s : string) : boolean;
- var
- i : longint;
- begin
- set_string_asm:=false;
- { this should be case insensitive !! PM }
- s:=upper(s);
- for i:=1 to asmcnt do
- if as_infos[i].idtxt=s then
- begin
- target_asm:=as_infos[i];
- set_string_asm:=true;
- end;
- end;
- function set_string_asmmode(s:string;var t:tasmmode):boolean;
- var
- i : longint;
- begin
- set_string_asmmode:=false;
- { this should be case insensitive !! PM }
- s:=upper(s);
- for i:=1 to asmmodecnt do
- if asmmodeinfos[i].idtxt=s then
- begin
- t:=asmmodeinfos[i].id;
- set_string_asmmode:=true;
- end;
- end;
- {****************************************************************************
- Initialization of default target
- ****************************************************************************}
- procedure default_os(t:ttarget);
- begin
- set_target_info(t);
- if source_os.name='' then
- source_os:=target_os;
- end;
- procedure set_source_os(t:tos);
- var
- i : longint;
- begin
- { can't use message() here (PFV) }
- if source_os.name<>'' then
- Writeln('Warning: Source OS Redefined!');
- for i:=1 to oscnt do
- if os_infos[i].id=t then
- begin
- source_os:=os_infos[i];
- exit;
- end;
- end;
- procedure InitSystems;
- begin
- { first get source OS }
- source_os.name:='';
- { please note then we use cpu86 and cpu68 here on purpose !! }
- {$ifdef cpu86}
- {$ifdef GO32V1}
- set_source_os(os_i386_GO32V1);
- {$else}
- {$ifdef GO32V2}
- set_source_os(os_i386_GO32V2);
- {$else}
- {$ifdef OS2}
- set_source_os(os_i386_OS2);
- if (OS_Mode = osDOS) or (OS_Mode = osDPMI)
- then source_os.scriptext := '.bat';
- {OS/2 via EMX can be run under DOS as well}
- {$else}
- {$ifdef LINUX}
- set_source_os(os_i386_LINUX);
- {$else}
- {$ifdef WIN32}
- set_source_os(os_i386_WIN32);
- {$endif win32}
- {$endif linux}
- {$endif os2}
- {$endif go32v2}
- {$endif go32v1}
- {$endif cpu86}
- {$ifdef cpu68}
- {$ifdef AMIGA}
- set_source_os(os_m68k_Amiga);
- {$else}
- {$ifdef ATARI}
- set_source_os(os_m68k_Atari);
- {$else}
- {$ifdef MACOS}
- set_source_os(os_m68k_MAC);
- {$else}
- {$ifdef LINUX}
- set_source_os(os_m68k_linux);
- {$endif linux}
- {$endif macos}
- {$endif atari}
- {$endif amiga}
- {$endif cpu68}
- { Now default target !! }
- {$ifdef i386}
- {$ifdef GO32V1}
- default_os(target_i386_GO32V1);
- {$else}
- {$ifdef GO32V2}
- default_os(target_i386_GO32V2);
- {$else}
- {$ifdef OS2}
- default_os(target_i386_OS2);
- {$else}
- {$ifdef LINUX}
- default_os(target_i386_LINUX);
- {$else}
- {$ifdef WIN32}
- default_os(target_i386_WIN32);
- {$else}
- default_os(target_i386_GO32V2);
- {$endif win32}
- {$endif linux}
- {$endif os2}
- {$endif go32v2}
- {$endif go32v1}
- {$endif i386}
- {$ifdef m68k}
- {$ifdef AMIGA}
- default_os(target_m68k_Amiga);
- {$else}
- {$ifdef ATARI}
- default_os(target_m68k_Atari);
- {$else}
- {$ifdef MACOS}
- default_os(target_m68k_Mac);
- {$else}
- {$ifdef LINUX}
- default_os(target_m68k_linux);
- {$else}
- default_os(target_m68k_Amiga);
- {$endif linux}
- {$endif macos}
- {$endif atari}
- {$endif amiga}
- {$endif m68k}
- {$ifdef alpha}
- default_os(target_alpha_linux);
- {$endif alpha}
- {$ifdef powerpc}
- default_os(target_alpha_linux);
- {$endif powerpc}
- end;
- begin
- InitSystems;
- end.
- {
- $Log$
- Revision 1.90 1999-08-04 13:03:11 jonas
- * all tokens now start with an underscore
- * PowerPC compiles!!
- Revision 1.89 1999/08/04 00:23:32 florian
- * renamed i386asm and i386base to cpuasm and cpubase
- Revision 1.88 1999/08/03 22:03:23 peter
- * moved bitmask constants to sets
- * some other type/const renamings
- Revision 1.87 1999/08/03 17:09:43 florian
- * the alpha compiler can be compiled now
- Revision 1.86 1999/08/03 15:52:00 michael
- * changed shortname for linux alpha
- Revision 1.85 1999/08/03 13:50:19 michael
- + Changes for alpha
- Revision 1.84 1999/08/02 23:56:51 michael
- + Added alpha cpu and linux for alpha os
- Revision 1.83 1999/07/10 10:26:20 peter
- * merged
- Revision 1.82.2.2 1999/07/10 10:03:16 peter
- * fixed initialization/finalization in fpc mode
- * allow $TARGET also in search paths
- Revision 1.82.2.1 1999/07/02 12:52:58 pierre
- * pecoff still buggy, as_I386_asw again default
- Revision 1.82 1999/06/08 11:50:28 peter
- * 2mb again for go32v2/v1
- Revision 1.81 1999/06/02 20:46:39 peter
- * fixed os2 bindcmd which was double
- Revision 1.80 1999/06/02 14:20:31 hajny
- * fixed my mistake from previously commited version
- Revision 1.79 1999/06/02 13:25:34 hajny
- * fixed stripping symbols for OS/2
- Revision 1.78 1999/05/31 20:34:00 peter
- * changed heapsize to 256k
- Revision 1.77 1999/05/27 19:45:10 peter
- * removed oldasm
- * plabel -> pasmlabel
- * -a switches to source writing automaticly
- * assembler readers OOPed
- * asmsymbol automaticly external
- * jumptables and other label fixes for asm readers
- Revision 1.76 1999/05/18 09:30:10 michael
- + changes by thomas hajt
- Revision 1.74 1999/05/17 13:02:12 pierre
- * -Csmmm works for win32 but default is set to 32Mb
- Revision 1.73 1999/05/11 00:44:06 peter
- * released pecoff for win32 as default
- Revision 1.72 1999/05/05 22:22:05 peter
- * updated messages
- Revision 1.71 1999/05/05 17:34:33 peter
- * output is more like as 2.9.1
- * stabs really working for go32v2
- Revision 1.70 1999/05/05 09:19:18 florian
- * more fixes to get it with delphi running
- Revision 1.69 1999/05/03 18:03:29 peter
- * no ar.exe running field in target_asm
- Revision 1.68 1999/05/02 22:41:59 peter
- * moved section names to systems
- * fixed nasm,intel writer
- Revision 1.67 1999/05/01 14:18:12 peter
- * win32 pecoff disabled because it's still not ok
- Revision 1.66 1999/05/01 13:24:44 peter
- * merged nasm compiler
- * old asm moved to oldasm/
- Revision 1.65 1999/03/26 00:05:47 peter
- * released valintern
- + deffile is now removed when compiling is finished
- * ^( compiles now correct
- + static directive
- * shrd fixed
- Revision 1.64 1999/03/24 23:17:33 peter
- * fixed bugs 212,222,225,227,229,231,233
- Revision 1.63 1999/03/09 11:54:09 pierre
- * pecoff default assem for win32 with ag386bin
- Revision 1.62 1999/03/04 13:55:48 pierre
- * some m68k fixes (still not compilable !)
- * new(tobj) does not give warning if tobj has no VMT !
- Revision 1.61 1999/03/03 11:41:51 pierre
- + stabs info corrected to give results near to GAS output
- * local labels (with .L are not stored in object anymore)
- so we get the same number of symbols as from GAS !
- Revision 1.60 1999/02/26 00:48:25 peter
- * assembler writers fixed for ag386bin
- Revision 1.59 1999/02/25 21:02:53 peter
- * ag386bin updates
- + coff writer
- Revision 1.58 1999/02/24 00:59:16 peter
- * small updates for ag386bin
- Revision 1.57 1999/02/22 02:15:42 peter
- * updates for ag386bin
- Revision 1.56 1999/01/10 15:38:01 peter
- * moved some tables from ra386*.pas -> i386.pas
- + start of coff writer
- * renamed asmutils unit to rautils
- Revision 1.55 1999/01/06 22:58:47 florian
- + some stuff for the new code generator
- Revision 1.54 1998/12/28 23:26:26 peter
- + resource file handling ($R directive) for Win32
- Revision 1.53 1998/12/15 10:23:30 peter
- + -iSO, -iSP, -iTO, -iTP
- Revision 1.52 1998/12/03 10:17:32 peter
- * target_os.use_bound_instruction boolean
- Revision 1.51 1998/11/30 09:43:23 pierre
- * some range check bugs fixed (still not working !)
- + added DLL writing support for win32 (also accepts variables)
- + TempAnsi for code that could be used for Temporary ansi strings
- handling
- Revision 1.50 1998/11/16 15:41:45 peter
- * tp7 didn't like my ifopt H+ :(
- Revision 1.49 1998/11/16 10:17:09 peter
- * fixed for H+ compilation
- Revision 1.48 1998/10/26 14:19:30 pierre
- + added options -lS and -lT for source and target os output
- (to have a easier way to test OS_SOURCE abd OS_TARGET in makefiles)
- * several problems with rtti data
- (type of sym was not checked)
- assumed to be varsym when they could be procsym or property syms !!
- Revision 1.47 1998/10/20 08:07:04 pierre
- * several memory corruptions due to double freemem solved
- => never use p^.loc.location:=p^.left^.loc.location;
- + finally I added now by default
- that ra386dir translates global and unit symbols
- + added a first field in tsymtable and
- a nextsym field in tsym
- (this allows to obtain ordered type info for
- records and objects in gdb !)
- Revision 1.46 1998/10/16 08:51:54 peter
- + target_os.stackalignment
- + stack can be aligned at 2 or 4 byte boundaries
- Revision 1.45 1998/10/15 16:20:41 peter
- * removed uses verbose which is not possible! this unit may not use
- any other unit !
- Revision 1.44 1998/10/14 11:28:25 florian
- * emitpushreferenceaddress gets now the asmlist as parameter
- * m68k version compiles with -duseansistrings
- Revision 1.43 1998/10/14 08:08:56 pierre
- * following Peters remark, removed all ifdef in
- the systems unit enums
- * last bugs of cg68k removed for sysamiga
- (sysamiga assembles with as68k !!)
- Revision 1.42 1998/10/13 16:50:23 pierre
- * undid some changes of Peter that made the compiler wrong
- for m68k (I had to reinsert some ifdefs)
- * removed several memory leaks under m68k
- * removed the meory leaks for assembler readers
- * cross compiling shoud work again better
- ( crosscompiling sysamiga works
- but as68k still complain about some code !)
- Revision 1.41 1998/10/13 13:10:31 peter
- * new style for m68k/i386 infos and enums
- Revision 1.40 1998/10/13 09:13:09 pierre
- * assembler type output command line was case sensitive
- Revision 1.39 1998/10/13 08:19:42 pierre
- + source_os is now set correctly for cross-processor compilers
- (tos contains all target_infos and
- we use CPU86 and CPU68 conditionnals to
- get the source operating system
- this only works if you do not undefine
- the source target !!)
- * several cg68k memory leaks fixed
- + started to change the code so that it should be possible to have
- a complete compiler (both for m68k and i386 !!)
- Revision 1.38 1998/10/07 04:26:58 carl
- * bugfixes
- + added mpw support
- Revision 1.37 1998/10/06 20:40:58 peter
- * remove -D from assemblers
- Revision 1.36 1998/09/16 16:41:50 peter
- * merged fixes
- Revision 1.33.2.3 1998/09/16 16:13:13 peter
- * win32 .o -> .ow and .a -> .aw
- Revision 1.35 1998/09/11 17:35:33 peter
- * fixed tabs
- Revision 1.34 1998/09/11 12:27:55 pierre
- * restored m68k part
- Revision 1.33.2.2 1998/09/11 17:29:20 peter
- * fixed tabs
- Revision 1.33.2.1 1998/09/11 12:06:00 pierre
- * m68k part restored
- Revision 1.33 1998/09/10 15:25:39 daniel
- + Added maxheapsize.
- * Corrected semi-bug in calling the assembler and the linker
- Revision 1.31 1998/09/01 09:07:13 peter
- * m68k fixes, splitted cg68k like cgi386
- Revision 1.30 1998/08/31 12:26:34 peter
- * m68k and palmos updates from surebugfixes
- Revision 1.29 1998/08/26 10:09:21 peter
- * more lowercase extensions
- Revision 1.28 1998/08/25 12:42:47 pierre
- * CDECL changed to CVAR for variables
- specifications are read in structures also
- + started adding GPC compatibility mode ( option -Sp)
- * names changed to lowercase
- Revision 1.27 1998/08/21 15:16:57 peter
- * win32 compiles a bit better, no growheap crash
- Revision 1.26 1998/08/19 16:07:55 jonas
- * changed optimizer switches + cleanup of DestroyRefs in daopt386.pas
- Revision 1.25 1998/08/18 09:24:45 pierre
- * small warning position bug fixed
- * support_mmx switches splitting was missing
- * rhide error and warning output corrected
- Revision 1.24 1998/08/17 09:17:54 peter
- * static/shared linking updates
- Revision 1.23 1998/06/25 08:48:20 florian
- * first version of rtti support
- Revision 1.22 1998/06/17 14:10:21 peter
- * small os2 fixes
- * fixed interdependent units with newppu (remake3 under linux works now)
- Revision 1.20 1998/06/15 15:38:14 pierre
- * small bug in systems.pas corrected
- + operators in different units better hanlded
- Revision 1.19 1998/06/15 13:34:24 daniel
- * Fixed spelling mistakes in comments.
- * Fixed some OS/2 parameters.
- Revision 1.18 1998/06/08 22:59:54 peter
- * smartlinking works for win32
- * some defines to exclude some compiler parts
- Revision 1.17 1998/06/04 23:52:04 peter
- * m68k compiles
- + .def file creation moved to gendef.pas so it could also be used
- for win32
- Revision 1.16 1998/06/01 16:50:22 peter
- + boolean -> ord conversion
- * fixed ord -> boolean conversion
- Revision 1.15 1998/05/30 14:31:11 peter
- + $ASMMODE
- Revision 1.14 1998/05/29 13:24:45 peter
- + asw assembler
- Revision 1.13 1998/05/27 00:20:33 peter
- * some scanner optimizes
- * automaticly aout2exe for go32v1
- * fixed dynamiclinker option which was added at the wrong place
- Revision 1.12 1998/05/23 01:21:32 peter
- + aktasmmode, aktoptprocessor, aktoutputformat
- + smartlink per module $SMARTLINK-/+ (like MMX) and moved to aktswitches
- + $LIBNAME to set the library name where the unit will be put in
- * splitted cgi386 a bit (codeseg to large for bp7)
- * nasm, tasm works again. nasm moved to ag386nsm.pas
- Revision 1.11 1998/05/22 12:32:49 peter
- * fixed -L on the commandline, Dos commandline is only 128 bytes
- Revision 1.10 1998/05/11 13:07:58 peter
- + $ifdef NEWPPU for the new ppuformat
- + $define GDB not longer required
- * removed all warnings and stripped some log comments
- * no findfirst/findnext anymore to remove smartlink *.o files
- Revision 1.9 1998/05/06 08:38:49 pierre
- * better position info with UseTokenInfo
- UseTokenInfo greatly simplified
- + added check for changed tree after first time firstpass
- (if we could remove all the cases were it happen
- we could skip all firstpass if firstpasscount > 1)
- Only with ExtDebug
- Revision 1.8 1998/05/04 20:19:54 peter
- * small fix for go32v2
- Revision 1.7 1998/05/04 17:54:29 peter
- + smartlinking works (only case jumptable left todo)
- * redesign of systems.pas to support assemblers and linkers
- + Unitname is now also in the PPU-file, increased version to 14
- Revision 1.6 1998/05/01 07:43:57 florian
- + basics for rtti implemented
- + switch $m (generate rtti for published sections)
- Revision 1.5 1998/04/29 10:34:06 pierre
- + added some code for ansistring (not complete nor working yet)
- * corrected operator overloading
- * corrected nasm output
- + started inline procedures
- + added starstarn : use ** for exponentiation (^ gave problems)
- + started UseTokenInfo cond to get accurate positions
- Revision 1.4 1998/04/27 15:45:20 peter
- + -Xl for smartlink
- + target_info.arext = .a
- Revision 1.3 1998/04/16 10:50:45 daniel
- * Fixed some things that were broken for OS/2.
- }
|