2
0

globals.pas 43 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566
  1. {
  2. $Id$
  3. Copyright (C) 1998-2000 by Florian Klaempfl
  4. This unit implements some support functions and global variables
  5. This program is free software; you can redistribute it and/or modify
  6. it under the terms of the GNU General Public License as published by
  7. the Free Software Foundation; either version 2 of the License, or
  8. (at your option) any later version.
  9. This program is distributed in the hope that it will be useful,
  10. but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. GNU General Public License for more details.
  13. You should have received a copy of the GNU General Public License
  14. along with this program; if not, write to the Free Software
  15. Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  16. ****************************************************************************
  17. }
  18. unit globals;
  19. {$i defines.inc}
  20. interface
  21. uses
  22. {$ifdef win32}
  23. windows,
  24. {$endif}
  25. {$ifdef unix}
  26. {$ifdef ver1_0}
  27. linux,
  28. {$else}
  29. unix,
  30. {$endif}
  31. {$endif}
  32. {$ifdef os2}
  33. doscalls,
  34. {$endif}
  35. {$ifdef Delphi}
  36. SysUtils,
  37. dmisc,
  38. {$else}
  39. strings,
  40. dos,
  41. {$endif}
  42. cutils,cclasses,
  43. globtype,version,systems;
  44. const
  45. {$ifdef Splitheap}
  46. testsplit : boolean = false;
  47. {$endif Splitheap}
  48. delphimodeswitches : tmodeswitches=
  49. [m_delphi,m_tp,m_all,m_class,m_objpas,m_result,m_string_pchar,
  50. m_pointer_2_procedure,m_autoderef,m_tp_procvar,m_initfinal,m_default_ansistring,
  51. m_out,m_default_para,m_hintdirective];
  52. fpcmodeswitches : tmodeswitches=
  53. [m_fpc,m_all,m_string_pchar,m_nested_comment,m_repeat_forward,
  54. m_cvar_support,m_initfinal,m_add_pointer];
  55. objfpcmodeswitches : tmodeswitches=
  56. [m_objfpc,m_fpc,m_all,m_class,m_objpas,m_result,m_string_pchar,m_nested_comment,
  57. m_repeat_forward,m_cvar_support,m_initfinal,m_add_pointer,m_out,m_default_para];
  58. tpmodeswitches : tmodeswitches=
  59. [m_tp7,m_tp,m_all,m_tp_procvar];
  60. gpcmodeswitches : tmodeswitches=
  61. [m_gpc,m_all];
  62. type
  63. pfileposinfo = ^tfileposinfo;
  64. tfileposinfo = record
  65. line : longint;
  66. column : word;
  67. fileindex : word;
  68. end;
  69. TSearchPathList = class(TStringList)
  70. procedure AddPath(s:string;addfirst:boolean);
  71. procedure AddList(list:TSearchPathList;addfirst:boolean);
  72. function FindFile(const f : string;var foundfile:string):boolean;
  73. end;
  74. var
  75. { specified inputfile }
  76. inputdir : dirstr;
  77. inputfile : namestr;
  78. inputextension : extstr;
  79. { specified outputfile with -o parameter }
  80. outputfile : namestr;
  81. { specified with -FE or -FU }
  82. outputexedir : dirstr;
  83. outputunitdir : dirstr;
  84. { things specified with parameters }
  85. paralinkoptions,
  86. paradynamiclinker : string;
  87. parapreprocess : boolean;
  88. { directory where the utils can be found (options -FD) }
  89. utilsdirectory : dirstr;
  90. { some flags for global compiler switches }
  91. do_build,
  92. do_release,
  93. do_make : boolean;
  94. not_unit_proc : boolean;
  95. { path for searching units, different paths can be seperated by ; }
  96. exepath : dirstr; { Path to ppc }
  97. librarysearchpath,
  98. unitsearchpath,
  99. objectsearchpath,
  100. includesearchpath : TSearchPathList;
  101. { deffile }
  102. usewindowapi : boolean;
  103. description : string;
  104. dllversion : string;
  105. dllmajor,dllminor,dllrevision : word; { revision only for netware }
  106. akttokenpos, { position of the last token }
  107. aktfilepos : tfileposinfo; { current position }
  108. { ad 18.05.2001: Screen and Threadname for Netware }
  109. nwscreenname : string;
  110. nwthreadname : string;
  111. nwcopyright : string;
  112. { type of currently parsed block }
  113. { isn't full implemented (FK) }
  114. block_type : tblock_type;
  115. in_args : boolean; { arguments must be checked especially }
  116. parsing_para_level : integer; { parameter level, used to convert
  117. proc calls to proc loads in firstcalln }
  118. compile_level : word;
  119. make_ref : boolean;
  120. resolving_forward : boolean; { used to add forward reference as second ref }
  121. use_esp_stackframe : boolean; { to test for call with ESP as stack frame }
  122. inlining_procedure : boolean; { are we inlining a procedure }
  123. statement_level : integer;
  124. aktexceptblock : integer; { each except block gets a number check gotos }
  125. { commandline values }
  126. initdefines : tstringlist;
  127. initglobalswitches : tglobalswitches;
  128. initmoduleswitches : tmoduleswitches;
  129. initlocalswitches : tlocalswitches;
  130. initmodeswitches : tmodeswitches;
  131. {$IFDEF testvarsets}
  132. Initsetalloc, {0=fixed, 1 =var}
  133. {$ENDIF}
  134. initpackenum : longint;
  135. initalignment : talignmentinfo;
  136. initoptprocessor,
  137. initspecificoptprocessor : tprocessors;
  138. initasmmode : tasmmode;
  139. initinterfacetype : tinterfacetypes;
  140. initoutputformat : tasm;
  141. { current state values }
  142. aktglobalswitches : tglobalswitches;
  143. aktmoduleswitches : tmoduleswitches;
  144. aktlocalswitches : tlocalswitches;
  145. nextaktlocalswitches : tlocalswitches;
  146. localswitcheschanged : boolean;
  147. aktmodeswitches : tmodeswitches;
  148. {$IFDEF testvarsets}
  149. aktsetalloc,
  150. {$ENDIF}
  151. aktpackenum : longint;
  152. aktmaxfpuregisters : longint;
  153. aktalignment : talignmentinfo;
  154. aktoptprocessor,
  155. aktspecificoptprocessor : tprocessors;
  156. aktasmmode : tasmmode;
  157. aktinterfacetype : tinterfacetypes;
  158. aktoutputformat : tasm;
  159. { Memory sizes }
  160. heapsize,
  161. maxheapsize,
  162. stacksize : longint;
  163. {$Ifdef EXTDEBUG}
  164. total_of_firstpass,
  165. firstpass_several : longint;
  166. {$ifdef FPC}
  167. EntryMemUsed : longint;
  168. {$endif FPC}
  169. { parameter switches }
  170. debugstop : boolean;
  171. {$EndIf EXTDEBUG}
  172. { windows / OS/2 application type }
  173. apptype : tapptype;
  174. const
  175. RelocSection : boolean = true;
  176. RelocSectionSetExplicitly : boolean = false;
  177. LinkTypeSetExplicitly : boolean = false;
  178. DLLsource : boolean = false;
  179. DLLImageBase : pstring = nil;
  180. UseDeffileForExport : boolean = true;
  181. ForceDeffileForExport : boolean = false;
  182. { used to set all registers used for each global function
  183. this should dramatically decrease the number of
  184. recompilations needed PM }
  185. simplify_ppu : boolean = true;
  186. { should we allow non static members ? }
  187. allow_only_static : boolean = false;
  188. Inside_asm_statement : boolean = false;
  189. global_unit_count : word = 0;
  190. { for error info in pp.pas }
  191. parser_current_file : string = '';
  192. {$ifdef m68k}
  193. { PalmOS resources }
  194. palmos_applicationname : string = 'FPC Application';
  195. palmos_applicationid : string[4] = 'FPCA';
  196. {$endif m68k}
  197. procedure abstract;
  198. function bstoslash(const s : string) : string;
  199. function getdatestr:string;
  200. function gettimestr:string;
  201. function filetimestring( t : longint) : string;
  202. procedure DefaultReplacements(var s:string);
  203. function GetCurrentDir:string;
  204. function path_absolute(const s : string) : boolean;
  205. Function PathExists ( F : String) : Boolean;
  206. Function FileExists ( Const F : String) : Boolean;
  207. Function RemoveFile(const f:string):boolean;
  208. Function RemoveDir(d:string):boolean;
  209. Function GetFileTime ( Var F : File) : Longint;
  210. Function GetNamedFileTime ( Const F : String) : Longint;
  211. Function SplitPath(const s:string):string;
  212. Function SplitFileName(const s:string):string;
  213. Function SplitName(const s:string):string;
  214. Function SplitExtension(Const HStr:String):String;
  215. Function AddExtension(Const HStr,ext:String):String;
  216. Function ForceExtension(Const HStr,ext:String):String;
  217. Function FixPath(s:string;allowdot:boolean):string;
  218. function FixFileName(const s:string):string;
  219. function TargetFixPath(s:string;allowdot:boolean):string;
  220. function TargetFixFileName(const s:string):string;
  221. procedure SplitBinCmd(const s:string;var bstr,cstr:string);
  222. function FindFile(const f : string;path : string;var foundfile:string):boolean;
  223. function FindExe(const bin:string;var foundfile:string):boolean;
  224. function GetShortName(const n:string):string;
  225. Procedure Shell(const command:string);
  226. function GetEnvPChar(const envname:string):pchar;
  227. procedure FreeEnvPChar(p:pchar);
  228. Function SetCompileMode(const s:string; changeInit: boolean):boolean;
  229. procedure InitGlobals;
  230. procedure DoneGlobals;
  231. function string2guid(const s: string; var GUID: TGUID): boolean;
  232. function guid2string(const GUID: TGUID): string;
  233. function UpdateAlignmentStr(s:string;var a:talignmentinfo):boolean;
  234. implementation
  235. uses
  236. comphook;
  237. procedure abstract;
  238. begin
  239. do_internalerror(255);
  240. end;
  241. function bstoslash(const s : string) : string;
  242. {
  243. return string s with all \ changed into /
  244. }
  245. var
  246. i : longint;
  247. begin
  248. for i:=1to length(s) do
  249. if s[i]='\' then
  250. bstoslash[i]:='/'
  251. else
  252. bstoslash[i]:=s[i];
  253. bstoslash[0]:=s[0];
  254. end;
  255. {****************************************************************************
  256. Time Handling
  257. ****************************************************************************}
  258. Function L0(l:longint):string;
  259. {
  260. return the string of value l, if l<10 then insert a zero, so
  261. the string is always at least 2 chars '01','02',etc
  262. }
  263. var
  264. s : string;
  265. begin
  266. Str(l,s);
  267. if l<10 then
  268. s:='0'+s;
  269. L0:=s;
  270. end;
  271. function gettimestr:string;
  272. {
  273. get the current time in a string HH:MM:SS
  274. }
  275. var
  276. hour,min,sec,hsec : word;
  277. begin
  278. {$ifdef delphi}
  279. dmisc.gettime(hour,min,sec,hsec);
  280. {$else delphi}
  281. dos.gettime(hour,min,sec,hsec);
  282. {$endif delphi}
  283. gettimestr:=L0(Hour)+':'+L0(min)+':'+L0(sec);
  284. end;
  285. function getdatestr:string;
  286. {
  287. get the current date in a string YY/MM/DD
  288. }
  289. var
  290. Year,Month,Day,Wday : Word;
  291. begin
  292. {$ifdef delphi}
  293. dmisc.getdate(year,month,day,wday);
  294. {$else}
  295. dos.getdate(year,month,day,wday);
  296. {$endif}
  297. getdatestr:=L0(Year)+'/'+L0(Month)+'/'+L0(Day);
  298. end;
  299. function filetimestring( t : longint) : string;
  300. {
  301. convert dos datetime t to a string YY/MM/DD HH:MM:SS
  302. }
  303. var
  304. DT : DateTime;
  305. begin
  306. if t=-1 then
  307. begin
  308. FileTimeString:='Not Found';
  309. exit;
  310. end;
  311. unpacktime(t,DT);
  312. filetimestring:=L0(dt.Year)+'/'+L0(dt.Month)+'/'+L0(dt.Day)+' '+L0(dt.Hour)+':'+L0(dt.min)+':'+L0(dt.sec);
  313. end;
  314. {****************************************************************************
  315. Default Macro Handling
  316. ****************************************************************************}
  317. procedure DefaultReplacements(var s:string);
  318. begin
  319. { Replace some macro's }
  320. Replace(s,'$FPCVER',version_string);
  321. Replace(s,'$VERSION',version_string);
  322. Replace(s,'$FULLVERSION',full_version_string);
  323. Replace(s,'$FPCDATE',date_string);
  324. Replace(s,'$FPCTARGET',target_cpu_string);
  325. Replace(s,'$FPCCPU',target_cpu_string);
  326. Replace(s,'$TARGET',target_path);
  327. Replace(s,'$FPCOS',target_path);
  328. end;
  329. {****************************************************************************
  330. File Handling
  331. ****************************************************************************}
  332. function GetCurrentDir:string;
  333. var
  334. CurrentDir : string;
  335. begin
  336. GetDir(0,CurrentDir);
  337. GetCurrentDir:=FixPath(CurrentDir,false);
  338. end;
  339. function path_absolute(const s : string) : boolean;
  340. {
  341. is path s an absolute path?
  342. }
  343. begin
  344. path_absolute:=false;
  345. {$ifdef unix}
  346. if (length(s)>0) and (s[1]='/') then
  347. path_absolute:=true;
  348. {$else unix}
  349. {$ifdef amiga}
  350. if ((length(s)>0) and ((s[1]='\') or (s[1]='/'))) or (Pos(':',s) = length(s)) then
  351. path_absolute:=true;
  352. {$else}
  353. if ((length(s)>0) and ((s[1]='\') or (s[1]='/'))) or
  354. ((length(s)>2) and (s[2]=':') and ((s[3]='\') or (s[3]='/'))) then
  355. path_absolute:=true;
  356. {$endif amiga}
  357. {$endif unix}
  358. end;
  359. {$ifndef FPC}
  360. Procedure FindClose(var Info : SearchRec);
  361. Begin
  362. End;
  363. {$endif not FPC}
  364. Function FileExists ( Const F : String) : Boolean;
  365. {$ifndef delphi}
  366. Var
  367. Info : SearchRec;
  368. {$endif}
  369. begin
  370. {$ifdef delphi}
  371. FileExists:=sysutils.FileExists(f);
  372. {$else}
  373. findfirst(F,readonly+archive+hidden,info);
  374. FileExists:=(doserror=0);
  375. findclose(Info);
  376. {$endif delphi}
  377. end;
  378. Function PathExists ( F : String) : Boolean;
  379. Var
  380. Info : SearchRec;
  381. {$ifdef i386}
  382. disk : byte;
  383. {$endif i386}
  384. begin
  385. {$ifdef i386}
  386. if (Length(f)=3) and (F[2]=':') and (F[3] in ['/','\']) then
  387. begin
  388. if F[1] in ['A'..'Z'] then
  389. disk:=ord(F[1])-ord('A')+1
  390. else if F[1] in ['a'..'z'] then
  391. disk:=ord(F[1])-ord('a')+1
  392. else
  393. disk:=255;
  394. if disk=255 then
  395. PathExists:=false
  396. else
  397. PathExists:=(DiskSize(disk)<>-1);
  398. exit;
  399. end;
  400. {$endif i386}
  401. if F[Length(f)] in ['/','\'] then
  402. Delete(f,length(f),1);
  403. findfirst(F,readonly+archive+hidden+directory,info);
  404. PathExists:=(doserror=0) and ((info.attr and directory)=directory);
  405. findclose(Info);
  406. end;
  407. Function RemoveFile(const f:string):boolean;
  408. var
  409. g : file;
  410. begin
  411. assign(g,f);
  412. {$I-}
  413. erase(g);
  414. {$I+}
  415. RemoveFile:=(ioresult=0);
  416. end;
  417. Function RemoveDir(d:string):boolean;
  418. begin
  419. if d[length(d)]=source_info.DirSep then
  420. Delete(d,length(d),1);
  421. {$I-}
  422. rmdir(d);
  423. {$I+}
  424. RemoveDir:=(ioresult=0);
  425. end;
  426. Function SplitPath(const s:string):string;
  427. var
  428. i : longint;
  429. begin
  430. i:=Length(s);
  431. while (i>0) and not(s[i] in ['/','\']) do
  432. dec(i);
  433. SplitPath:=Copy(s,1,i);
  434. end;
  435. Function SplitFileName(const s:string):string;
  436. var
  437. p : dirstr;
  438. n : namestr;
  439. e : extstr;
  440. begin
  441. FSplit(s,p,n,e);
  442. SplitFileName:=n+e;
  443. end;
  444. Function SplitName(const s:string):string;
  445. var
  446. i,j : longint;
  447. begin
  448. i:=Length(s);
  449. j:=Length(s);
  450. while (i>0) and not(s[i] in ['/','\']) do
  451. dec(i);
  452. while (j>0) and (s[j]<>'.') do
  453. dec(j);
  454. if j<=i then
  455. j:=255;
  456. SplitName:=Copy(s,i+1,j-(i+1));
  457. end;
  458. Function SplitExtension(Const HStr:String):String;
  459. var
  460. j : longint;
  461. begin
  462. j:=length(Hstr);
  463. while (j>0) and (Hstr[j]<>'.') do
  464. begin
  465. if hstr[j]=source_info.DirSep then
  466. j:=0
  467. else
  468. dec(j);
  469. end;
  470. if j=0 then
  471. j:=254;
  472. SplitExtension:=Copy(Hstr,j,255);
  473. end;
  474. Function AddExtension(Const HStr,ext:String):String;
  475. begin
  476. if (Ext<>'') and (SplitExtension(HStr)='') then
  477. AddExtension:=Hstr+Ext
  478. else
  479. AddExtension:=Hstr;
  480. end;
  481. Function ForceExtension(Const HStr,ext:String):String;
  482. var
  483. j : longint;
  484. begin
  485. j:=length(Hstr);
  486. while (j>0) and (Hstr[j]<>'.') do
  487. dec(j);
  488. if j=0 then
  489. j:=255;
  490. ForceExtension:=Copy(Hstr,1,j-1)+Ext;
  491. end;
  492. Function FixPath(s:string;allowdot:boolean):string;
  493. var
  494. i : longint;
  495. begin
  496. { Fix separator }
  497. for i:=1 to length(s) do
  498. if s[i] in ['/','\'] then
  499. s[i]:=source_info.DirSep;
  500. { Fix ending / }
  501. if (length(s)>0) and (s[length(s)]<>source_info.DirSep) and
  502. (s[length(s)]<>':') then
  503. s:=s+source_info.DirSep;
  504. { Remove ./ }
  505. if (not allowdot) and (s='.'+source_info.DirSep) then
  506. s:='';
  507. { return }
  508. if source_info.files_case_relevent then
  509. FixPath:=s
  510. else
  511. FixPath:=Lower(s);
  512. end;
  513. function FixFileName(const s:string):string;
  514. var
  515. i : longint;
  516. begin
  517. if source_info.files_case_relevent then
  518. begin
  519. for i:=1 to length(s) do
  520. begin
  521. case s[i] of
  522. '/','\' :
  523. FixFileName[i]:=source_info.dirsep;
  524. else
  525. FixFileName[i]:=s[i];
  526. end;
  527. end;
  528. end
  529. else
  530. begin
  531. for i:=1 to length(s) do
  532. begin
  533. case s[i] of
  534. '/','\' :
  535. FixFileName[i]:=source_info.dirsep;
  536. 'A'..'Z' :
  537. FixFileName[i]:=char(byte(s[i])+32);
  538. else
  539. FixFileName[i]:=s[i];
  540. end;
  541. end;
  542. end;
  543. FixFileName[0]:=s[0];
  544. end;
  545. Function TargetFixPath(s:string;allowdot:boolean):string;
  546. var
  547. i : longint;
  548. begin
  549. { Fix separator }
  550. for i:=1 to length(s) do
  551. if s[i] in ['/','\'] then
  552. s[i]:=target_info.DirSep;
  553. { Fix ending / }
  554. if (length(s)>0) and (s[length(s)]<>target_info.DirSep) and
  555. (s[length(s)]<>':') then
  556. s:=s+target_info.DirSep;
  557. { Remove ./ }
  558. if (not allowdot) and (s='.'+target_info.DirSep) then
  559. s:='';
  560. { return }
  561. if target_info.files_case_relevent then
  562. TargetFixPath:=s
  563. else
  564. TargetFixPath:=Lower(s);
  565. end;
  566. function TargetFixFileName(const s:string):string;
  567. var
  568. i : longint;
  569. begin
  570. if target_info.files_case_relevent then
  571. begin
  572. for i:=1 to length(s) do
  573. begin
  574. case s[i] of
  575. '/','\' :
  576. TargetFixFileName[i]:=target_info.dirsep;
  577. else
  578. TargetFixFileName[i]:=s[i];
  579. end;
  580. end;
  581. end
  582. else
  583. begin
  584. for i:=1 to length(s) do
  585. begin
  586. case s[i] of
  587. '/','\' :
  588. TargetFixFileName[i]:=target_info.dirsep;
  589. 'A'..'Z' :
  590. TargetFixFileName[i]:=char(byte(s[i])+32);
  591. else
  592. TargetFixFileName[i]:=s[i];
  593. end;
  594. end;
  595. end;
  596. TargetFixFileName[0]:=s[0];
  597. end;
  598. procedure SplitBinCmd(const s:string;var bstr,cstr:string);
  599. var
  600. i : longint;
  601. begin
  602. i:=pos(' ',s);
  603. if i>0 then
  604. begin
  605. bstr:=Copy(s,1,i-1);
  606. cstr:=Copy(s,i+1,length(s)-i);
  607. end
  608. else
  609. begin
  610. bstr:=s;
  611. cstr:='';
  612. end;
  613. end;
  614. procedure TSearchPathList.AddPath(s:string;addfirst:boolean);
  615. var
  616. j : longint;
  617. hs,hsd,
  618. CurrentDir,
  619. CurrPath : string;
  620. dir : searchrec;
  621. hp : TStringListItem;
  622. procedure addcurrpath;
  623. begin
  624. if addfirst then
  625. begin
  626. Remove(currPath);
  627. Insert(currPath);
  628. end
  629. else
  630. begin
  631. { Check if already in path, then we don't add it }
  632. hp:=Find(currPath);
  633. if not assigned(hp) then
  634. Concat(currPath);
  635. end;
  636. end;
  637. begin
  638. if s='' then
  639. exit;
  640. { Support default macro's }
  641. DefaultReplacements(s);
  642. { get current dir }
  643. CurrentDir:=GetCurrentDir;
  644. repeat
  645. { get currpath }
  646. if addfirst then
  647. begin
  648. j:=length(s);
  649. while (j>0) and (s[j]<>';') do
  650. dec(j);
  651. CurrPath:=FixPath(Copy(s,j+1,length(s)-j),false);
  652. if j=0 then
  653. s:=''
  654. else
  655. System.Delete(s,j,length(s)-j+1);
  656. end
  657. else
  658. begin
  659. j:=Pos(';',s);
  660. if j=0 then
  661. j:=255;
  662. CurrPath:=FixPath(Copy(s,1,j-1),false);
  663. System.Delete(s,1,j);
  664. end;
  665. { fix pathname }
  666. if CurrPath='' then
  667. CurrPath:='.'+source_info.DirSep
  668. else
  669. begin
  670. CurrPath:=FixPath(FExpand(CurrPath),false);
  671. if (CurrentDir<>'') and (Copy(CurrPath,1,length(CurrentDir))=CurrentDir) then
  672. CurrPath:='.'+source_info.DirSep+Copy(CurrPath,length(CurrentDir)+1,255);
  673. end;
  674. { wildcard adding ? }
  675. if pos('*',currpath)>0 then
  676. begin
  677. if currpath[length(currpath)]=source_info.dirsep then
  678. hs:=Copy(currpath,1,length(CurrPath)-1)
  679. else
  680. hs:=currpath;
  681. hsd:=SplitPath(hs);
  682. findfirst(hs,directory,dir);
  683. while doserror=0 do
  684. begin
  685. if (dir.name<>'.') and
  686. (dir.name<>'..') and
  687. ((dir.attr and directory)<>0) then
  688. begin
  689. currpath:=hsd+dir.name+source_info.dirsep;
  690. hp:=Find(currPath);
  691. if not assigned(hp) then
  692. AddCurrPath;
  693. end;
  694. findnext(dir);
  695. end;
  696. FindClose(dir);
  697. end
  698. else
  699. begin
  700. if PathExists(currpath) then
  701. addcurrpath;
  702. end;
  703. until (s='');
  704. end;
  705. procedure TSearchPathList.AddList(list:TSearchPathList;addfirst:boolean);
  706. var
  707. s : string;
  708. hl : TSearchPathList;
  709. hp,hp2 : TStringListItem;
  710. begin
  711. if list.empty then
  712. exit;
  713. { create temp and reverse the list }
  714. if addfirst then
  715. begin
  716. hl:=TSearchPathList.Create;
  717. hp:=TStringListItem(list.first);
  718. while assigned(hp) do
  719. begin
  720. hl.insert(hp.Str);
  721. hp:=TStringListItem(hp.next);
  722. end;
  723. while not hl.empty do
  724. begin
  725. s:=hl.GetFirst;
  726. Remove(s);
  727. Insert(s);
  728. end;
  729. hl.Free;
  730. end
  731. else
  732. begin
  733. hp:=TStringListItem(list.first);
  734. while assigned(hp) do
  735. begin
  736. hp2:=Find(hp.Str);
  737. { Check if already in path, then we don't add it }
  738. if not assigned(hp2) then
  739. Concat(hp.Str);
  740. hp:=TStringListItem(hp.next);
  741. end;
  742. end;
  743. end;
  744. function TSearchPathList.FindFile(const f : string;var foundfile:string):boolean;
  745. Var
  746. p : TStringListItem;
  747. begin
  748. FindFile:=false;
  749. p:=TStringListItem(first);
  750. while assigned(p) do
  751. begin
  752. {
  753. Search order for case sensitive systems:
  754. 1. lowercase
  755. 2. NormalCase
  756. 3. UPPERCASE
  757. None case sensitive only lowercase
  758. }
  759. FoundFile:=p.Str+Lower(f);
  760. If FileExists(FoundFile) then
  761. begin
  762. FindFile:=true;
  763. exit;
  764. end;
  765. {$ifdef UNIX}
  766. FoundFile:=p.Str+f;
  767. If FileExists(FoundFile) then
  768. begin
  769. FindFile:=true;
  770. exit;
  771. end;
  772. FoundFile:=p.Str+Upper(f);
  773. If FileExists(FoundFile) then
  774. begin
  775. FindFile:=true;
  776. exit;
  777. end;
  778. {$endif UNIX}
  779. p:=TStringListItem(p.next);
  780. end;
  781. { Return original filename if not found }
  782. FoundFile:=f;
  783. end;
  784. Function GetFileTime ( Var F : File) : Longint;
  785. Var
  786. {$ifdef unix}
  787. Info : Stat;
  788. {$endif}
  789. L : longint;
  790. begin
  791. {$ifdef unix}
  792. FStat (F,Info);
  793. L:=Info.Mtime;
  794. {$else}
  795. GetFTime(f,l);
  796. {$endif}
  797. GetFileTime:=L;
  798. end;
  799. Function GetNamedFileTime (Const F : String) : Longint;
  800. begin
  801. GetNamedFileTime:=do_getnamedfiletime(F);
  802. end;
  803. function FindFile(const f : string;path : string;var foundfile:string):boolean;
  804. Var
  805. singlepathstring : string;
  806. i : longint;
  807. begin
  808. {$ifdef Unix}
  809. for i:=1 to length(path) do
  810. if path[i]=':' then
  811. path[i]:=';';
  812. {$endif Unix}
  813. FindFile:=false;
  814. repeat
  815. i:=pos(';',path);
  816. if i=0 then
  817. i:=256;
  818. singlepathstring:=FixPath(copy(path,1,i-1),false);
  819. delete(path,1,i);
  820. {
  821. Search order for case sensitive systems:
  822. 1. lowercase
  823. 2. NormalCase
  824. 3. UPPERCASE
  825. None case sensitive only lowercase
  826. }
  827. FoundFile:=singlepathstring+Lower(f);
  828. If FileExists(FoundFile) then
  829. begin
  830. FindFile:=true;
  831. exit;
  832. end;
  833. {$ifdef UNIX}
  834. FoundFile:=singlepathstring+f;
  835. If FileExists(FoundFile) then
  836. begin
  837. FindFile:=true;
  838. exit;
  839. end;
  840. FoundFile:=singlepathstring+Upper(f);
  841. If FileExists(FoundFile) then
  842. begin
  843. FindFile:=true;
  844. exit;
  845. end;
  846. {$endif UNIX}
  847. until path='';
  848. FoundFile:=f;
  849. end;
  850. function FindExe(const bin:string;var foundfile:string):boolean;
  851. begin
  852. {$ifdef delphi}
  853. FindExe:=FindFile(FixFileName(AddExtension(bin,source_info.exeext)),'.;'+exepath+';'+dmisc.getenv('PATH'),foundfile);
  854. {$else delphi}
  855. FindExe:=FindFile(FixFileName(AddExtension(bin,source_info.exeext)),'.;'+exepath+';'+dos.getenv('PATH'),foundfile);
  856. {$endif delphi}
  857. end;
  858. function GetShortName(const n:string):string;
  859. {$ifdef win32}
  860. var
  861. hs,hs2 : string;
  862. i : longint;
  863. {$endif}
  864. {$ifdef go32v2}
  865. var
  866. hs : string;
  867. {$endif}
  868. begin
  869. GetShortName:=n;
  870. {$ifdef win32}
  871. hs:=n+#0;
  872. i:=Windows.GetShortPathName(@hs[1],@hs2[1],high(hs2));
  873. if (i>0) and (i<=high(hs2)) then
  874. begin
  875. hs2[0]:=chr(strlen(@hs2[1]));
  876. GetShortName:=hs2;
  877. end;
  878. {$endif}
  879. {$ifdef go32v2}
  880. hs:=n;
  881. if Dos.GetShortName(hs) then
  882. GetShortName:=hs;
  883. {$endif}
  884. end;
  885. {****************************************************************************
  886. OS Dependent things
  887. ****************************************************************************}
  888. function GetEnvPChar(const envname:string):pchar;
  889. {$ifdef win32}
  890. var
  891. s : string;
  892. i,len : longint;
  893. hp,p,p2 : pchar;
  894. {$endif}
  895. {$ifdef os2}
  896. var
  897. P1, P2: PChar;
  898. {$endif}
  899. begin
  900. {$ifdef unix}
  901. GetEnvPchar:={$ifdef ver1_0}Linux{$else}Unix{$endif}.Getenv(envname);
  902. {$define GETENVOK}
  903. {$endif}
  904. {$ifdef win32}
  905. GetEnvPchar:=nil;
  906. p:=GetEnvironmentStrings;
  907. hp:=p;
  908. while hp^<>#0 do
  909. begin
  910. s:=strpas(hp);
  911. i:=pos('=',s);
  912. len:=strlen(hp);
  913. if upper(copy(s,1,i-1))=upper(envname) then
  914. begin
  915. GetMem(p2,len-length(envname));
  916. Move(hp[i],p2^,len-length(envname));
  917. GetEnvPchar:=p2;
  918. break;
  919. end;
  920. { next string entry}
  921. hp:=hp+len+1;
  922. end;
  923. FreeEnvironmentStrings(p);
  924. {$define GETENVOK}
  925. {$endif}
  926. {$ifdef os2}
  927. P1 := StrPNew (EnvName);
  928. if Assigned (P1) then
  929. begin
  930. if DosCalls.DosScanEnv (P1, P2) = 0 then
  931. GetEnvPChar := P2
  932. else
  933. GetEnvPChar := nil;
  934. StrDispose (P1);
  935. end else GetEnvPChar := nil;
  936. {$define GETENVOK}
  937. {$endif}
  938. {$ifdef GETENVOK}
  939. {$undef GETENVOK}
  940. {$else}
  941. GetEnvPchar:=StrPNew({$ifdef delphi}DMisc{$else}Dos{$endif}.Getenv(envname));
  942. {$endif}
  943. end;
  944. procedure FreeEnvPChar(p:pchar);
  945. begin
  946. {$ifndef unix}
  947. {$ifndef os2}
  948. StrDispose(p);
  949. {$endif}
  950. {$endif}
  951. end;
  952. Procedure Shell(const command:string);
  953. { This is already defined in the linux.ppu for linux, need for the *
  954. expansion under linux }
  955. {$ifdef unix}
  956. begin
  957. {$ifdef ver1_0}Linux{$else}Unix{$endif}.Shell(command);
  958. end;
  959. {$else}
  960. var
  961. comspec : string;
  962. begin
  963. comspec:=getenv('COMSPEC');
  964. Exec(comspec,' /C '+command);
  965. end;
  966. {$endif}
  967. Function SetCompileMode(const s:string; changeInit: boolean):boolean;
  968. var
  969. b : boolean;
  970. begin
  971. b:=true;
  972. if s='DEFAULT' then
  973. aktmodeswitches:=initmodeswitches
  974. else
  975. if s='DELPHI' then
  976. aktmodeswitches:=delphimodeswitches
  977. else
  978. if s='TP' then
  979. aktmodeswitches:=tpmodeswitches
  980. else
  981. if s='FPC' then
  982. aktmodeswitches:=fpcmodeswitches
  983. else
  984. if s='OBJFPC' then
  985. aktmodeswitches:=objfpcmodeswitches
  986. else
  987. if s='GPC' then
  988. aktmodeswitches:=gpcmodeswitches
  989. else
  990. b:=false;
  991. if b and changeInit then
  992. initmodeswitches := aktmodeswitches;
  993. if b then
  994. begin
  995. { turn ansistrings on by default ? }
  996. if (m_delphi in aktmodeswitches) then
  997. begin
  998. include(aktlocalswitches,cs_ansistrings);
  999. if changeinit then
  1000. include(initlocalswitches,cs_ansistrings);
  1001. end
  1002. else
  1003. begin
  1004. exclude(aktlocalswitches,cs_ansistrings);
  1005. if changeinit then
  1006. exclude(initlocalswitches,cs_ansistrings);
  1007. end;
  1008. { enum packing }
  1009. if (m_tp7 in aktmodeswitches) then
  1010. aktpackenum:=1
  1011. else
  1012. aktpackenum:=4;
  1013. if changeinit then
  1014. initpackenum:=aktpackenum;
  1015. end;
  1016. SetCompileMode:=b;
  1017. end;
  1018. { '('D1:'00000000-'D2:'0000-'D3:'0000-'D4:'0000-000000000000)' }
  1019. function string2guid(const s: string; var GUID: TGUID): boolean;
  1020. function ishexstr(const hs: string): boolean;
  1021. var
  1022. i: integer;
  1023. begin
  1024. ishexstr:=false;
  1025. for i:=1 to Length(hs) do begin
  1026. if not (hs[i] in ['0'..'9','A'..'F','a'..'f']) then
  1027. exit;
  1028. end;
  1029. ishexstr:=true;
  1030. end;
  1031. function hexstr2longint(const hexs: string): longint;
  1032. var
  1033. i: integer;
  1034. rl: longint;
  1035. begin
  1036. rl:=0;
  1037. for i:=1 to length(hexs) do begin
  1038. rl:=rl shl 4;
  1039. case hexs[i] of
  1040. '0'..'9' : inc(rl,ord(hexs[i])-ord('0'));
  1041. 'A'..'F' : inc(rl,ord(hexs[i])-ord('A')+10);
  1042. 'a'..'f' : inc(rl,ord(hexs[i])-ord('a')+10);
  1043. end
  1044. end;
  1045. hexstr2longint:=rl;
  1046. end;
  1047. var
  1048. i: integer;
  1049. begin
  1050. if (Length(s)=38) and (s[1]='{') and (s[38]='}') and
  1051. (s[10]='-') and (s[15]='-') and (s[20]='-') and (s[25]='-') and
  1052. ishexstr(copy(s,2,8)) and ishexstr(copy(s,11,4)) and
  1053. ishexstr(copy(s,16,4)) and ishexstr(copy(s,21,4)) and
  1054. ishexstr(copy(s,26,12)) then begin
  1055. GUID.D1:=dword(hexstr2longint(copy(s,2,8)));
  1056. GUID.D2:=hexstr2longint(copy(s,11,4));
  1057. GUID.D3:=hexstr2longint(copy(s,16,4));
  1058. for i:=0 to 1 do
  1059. GUID.D4[i]:=hexstr2longint(copy(s,21+i*2,2));
  1060. for i:=2 to 7 do
  1061. GUID.D4[i]:=hexstr2longint(copy(s,22+i*2,2));
  1062. string2guid:=true;
  1063. end
  1064. else
  1065. string2guid:=false;
  1066. end;
  1067. function guid2string(const GUID: TGUID): string;
  1068. function long2hex(l, len: longint): string;
  1069. const
  1070. hextbl: array[0..15] of char = '0123456789ABCDEF';
  1071. var
  1072. rs: string;
  1073. i: integer;
  1074. begin
  1075. rs[0]:=chr(len);
  1076. for i:=len downto 1 do begin
  1077. rs[i]:=hextbl[l and $F];
  1078. l:=l shr 4;
  1079. end;
  1080. long2hex:=rs;
  1081. end;
  1082. begin
  1083. guid2string:=
  1084. '{'+long2hex(GUID.D1,8)+
  1085. '-'+long2hex(GUID.D2,4)+
  1086. '-'+long2hex(GUID.D3,4)+
  1087. '-'+long2hex(GUID.D4[0],2)+long2hex(GUID.D4[1],2)+
  1088. '-'+long2hex(GUID.D4[2],2)+long2hex(GUID.D4[3],2)+
  1089. long2hex(GUID.D4[4],2)+long2hex(GUID.D4[5],2)+
  1090. long2hex(GUID.D4[6],2)+long2hex(GUID.D4[7],2)+
  1091. '}';
  1092. end;
  1093. function UpdateAlignmentStr(s:string;var a:talignmentinfo):boolean;
  1094. var
  1095. tok : string;
  1096. vstr : string;
  1097. l : longint;
  1098. code : integer;
  1099. b : talignmentinfo;
  1100. begin
  1101. UpdateAlignmentStr:=true;
  1102. uppervar(s);
  1103. fillchar(b,sizeof(b),0);
  1104. repeat
  1105. tok:=GetToken(s,'=');
  1106. if tok='' then
  1107. break;
  1108. vstr:=GetToken(s,',');
  1109. val(vstr,l,code);
  1110. if tok='PROC' then
  1111. b.procalign:=l
  1112. else if tok='JUMP' then
  1113. b.jumpalign:=l
  1114. else if tok='LOOP' then
  1115. b.loopalign:=l
  1116. else if tok='CONSTMIN' then
  1117. b.constalignmin:=l
  1118. else if tok='CONSTMAX' then
  1119. b.constalignmax:=l
  1120. else if tok='VARMIN' then
  1121. b.varalignmin:=l
  1122. else if tok='VARMAX' then
  1123. b.varalignmax:=l
  1124. else if tok='LOCALMIN' then
  1125. b.localalignmin:=l
  1126. else if tok='LOCALMAX' then
  1127. b.localalignmax:=l
  1128. else if tok='RECORDMIN' then
  1129. b.recordalignmin:=l
  1130. else if tok='RECORDMAX' then
  1131. b.recordalignmax:=l
  1132. else if tok='PARAALIGN' then
  1133. b.paraalign:=l
  1134. else { Error }
  1135. UpdateAlignmentStr:=false;
  1136. until false;
  1137. UpdateAlignment(a,b);
  1138. end;
  1139. {****************************************************************************
  1140. Init
  1141. ****************************************************************************}
  1142. {$ifdef unix}
  1143. {$define need_path_search}
  1144. {$endif unix}
  1145. {$ifdef os2}
  1146. {$define need_path_search}
  1147. {$endif os2}
  1148. procedure get_exepath;
  1149. var
  1150. hs1 : namestr;
  1151. hs2 : extstr;
  1152. begin
  1153. {$ifdef delphi}
  1154. exepath:=dmisc.getenv('PPC_EXEC_PATH');
  1155. {$else delphi}
  1156. exepath:=dos.getenv('PPC_EXEC_PATH');
  1157. {$endif delphi}
  1158. if exepath='' then
  1159. fsplit(FixFileName(system.paramstr(0)),exepath,hs1,hs2);
  1160. {$ifdef need_path_search}
  1161. if exepath='' then
  1162. begin
  1163. if pos(source_info.exeext,hs1) <>
  1164. (length(hs1) - length(source_info.exeext)+1) then
  1165. hs1 := hs1 + source_info.exeext;
  1166. {$ifdef delphi}
  1167. findfile(hs1,dmisc.getenv('PATH'),exepath);
  1168. {$else delphi}
  1169. findfile(hs1,dos.getenv('PATH'),exepath);
  1170. {$endif delphi}
  1171. exepath:=SplitPath(exepath);
  1172. end;
  1173. {$endif need_path_search}
  1174. exepath:=FixPath(exepath,false);
  1175. end;
  1176. procedure DoneGlobals;
  1177. begin
  1178. initdefines.free;
  1179. if assigned(DLLImageBase) then
  1180. StringDispose(DLLImageBase);
  1181. RelocSection:=true;
  1182. RelocSectionSetExplicitly:=false;
  1183. UseDeffileForExport:=true;
  1184. librarysearchpath.Free;
  1185. unitsearchpath.Free;
  1186. objectsearchpath.Free;
  1187. includesearchpath.Free;
  1188. end;
  1189. procedure InitGlobals;
  1190. begin
  1191. get_exepath;
  1192. { set global switches }
  1193. do_build:=false;
  1194. do_release:=false;
  1195. do_make:=true;
  1196. compile_level:=0;
  1197. DLLsource:=false;
  1198. { Output }
  1199. OutputFile:='';
  1200. OutputExeDir:='';
  1201. OutputUnitDir:='';
  1202. { Utils directory }
  1203. utilsdirectory:='';
  1204. { Search Paths }
  1205. librarysearchpath:=TSearchPathList.Create;
  1206. unitsearchpath:=TSearchPathList.Create;
  1207. includesearchpath:=TSearchPathList.Create;
  1208. objectsearchpath:=TSearchPathList.Create;
  1209. { Def file }
  1210. usewindowapi:=false;
  1211. description:='Compiled by FPC '+version_string+' - '+target_cpu_string;
  1212. dllversion:='';
  1213. nwscreenname := '';
  1214. nwthreadname := '';
  1215. nwcopyright := '';
  1216. { Init values }
  1217. initmodeswitches:=fpcmodeswitches;
  1218. initlocalswitches:=[cs_check_io];
  1219. initmoduleswitches:=[cs_extsyntax,cs_browser];
  1220. initglobalswitches:=[cs_check_unit_name,cs_link_static];
  1221. initoutputformat:=target_asm.id;
  1222. fillchar(initalignment,sizeof(talignmentinfo),0);
  1223. {$ifdef i386}
  1224. initoptprocessor:=Class386;
  1225. initspecificoptprocessor:=Class386;
  1226. initpackenum:=4;
  1227. {$IFDEF testvarsets}
  1228. initsetalloc:=0;
  1229. {$ENDIF}
  1230. initasmmode:=asmmode_i386_att;
  1231. {$else not i386}
  1232. {$ifdef m68k}
  1233. initoptprocessor:=MC68000;
  1234. include(initmoduleswitches,cs_fp_emulation);
  1235. initpackenum:=4;
  1236. {$IFDEF testvarsets}
  1237. initsetalloc:=0;
  1238. {$ENDIF}
  1239. initasmmode:=asmmode_m68k_mot;
  1240. {$endif m68k}
  1241. {$endif i386}
  1242. initinterfacetype:=it_interfacecom;
  1243. initdefines:=TStringList.Create;
  1244. { memory sizes, will be overriden by parameter or default for target
  1245. in options or init_parser }
  1246. stacksize:=0;
  1247. heapsize:=0;
  1248. maxheapsize:=0;
  1249. { compile state }
  1250. in_args:=false;
  1251. { must_be_valid:=true; obsolete PM }
  1252. not_unit_proc:=true;
  1253. apptype:=app_cui;
  1254. end;
  1255. {$ifdef EXTDEBUG}
  1256. begin
  1257. {$ifdef FPC}
  1258. EntryMemUsed:=system.HeapSize-MemAvail;
  1259. {$endif FPC}
  1260. {$endif}
  1261. end.
  1262. {
  1263. $Log$
  1264. Revision 1.44 2001-10-12 16:06:17 peter
  1265. * pathexists fix (merged)
  1266. Revision 1.43 2001/09/18 11:30:47 michael
  1267. * Fixes win32 linking problems with import libraries
  1268. * LINKLIB Libraries are now looked for using C file extensions
  1269. * get_exepath fix
  1270. Revision 1.42 2001/09/17 21:29:11 peter
  1271. * merged netbsd, fpu-overflow from fixes branch
  1272. Revision 1.41 2001/08/19 11:22:22 peter
  1273. * palmos support from v10 merged
  1274. Revision 1.40 2001/08/04 10:23:54 peter
  1275. * updates so it works with the ide
  1276. Revision 1.39 2001/07/01 20:16:15 peter
  1277. * alignmentinfo record added
  1278. * -Oa argument supports more alignment settings that can be specified
  1279. per type: PROC,LOOP,VARMIN,VARMAX,CONSTMIN,CONSTMAX,RECORDMIN
  1280. RECORDMAX,LOCALMIN,LOCALMAX. It is possible to set the mimimum
  1281. required alignment and the maximum usefull alignment. The final
  1282. alignment will be choosen per variable size dependent on these
  1283. settings
  1284. Revision 1.38 2001/06/18 20:36:24 peter
  1285. * -Ur switch (merged)
  1286. * masm fixes (merged)
  1287. * quoted filenames for go32v2 and win32
  1288. Revision 1.37 2001/06/03 21:57:35 peter
  1289. + hint directive parsing support
  1290. Revision 1.36 2001/06/03 20:21:08 peter
  1291. * Kylix fixes, mostly case names of units
  1292. Revision 1.35 2001/05/30 21:35:48 peter
  1293. * netware patches for copyright, screenname, threadname directives
  1294. Revision 1.34 2001/05/12 12:11:31 peter
  1295. * simplify_ppu is now the default, a recompile of the compiler now
  1296. only compiles pp.pas
  1297. Revision 1.33 2001/05/06 14:49:17 peter
  1298. * ppu object to class rewrite
  1299. * move ppu read and write stuff to fppu
  1300. Revision 1.32 2001/04/18 22:01:53 peter
  1301. * registration of targets and assemblers
  1302. Revision 1.31 2001/04/15 09:48:29 peter
  1303. * fixed crash in labelnode
  1304. * easier detection of goto and label in try blocks
  1305. Revision 1.30 2001/04/13 01:22:07 peter
  1306. * symtable change to classes
  1307. * range check generation and errors fixed, make cycle DEBUG=1 works
  1308. * memory leaks fixed
  1309. Revision 1.29 2001/04/04 21:30:42 florian
  1310. * applied several fixes to get the DD8 Delphi Unit compiled
  1311. e.g. "forward"-interfaces are working now
  1312. Revision 1.28 2001/02/20 21:41:16 peter
  1313. * new fixfilename, findfile for unix. Look first for lowercase, then
  1314. NormalCase and last for UPPERCASE names.
  1315. Revision 1.27 2001/02/09 23:05:45 peter
  1316. * default packenum=1 for tp7 mode
  1317. Revision 1.26 2001/02/05 20:47:00 peter
  1318. * support linux unit for ver1_0 compilers
  1319. Revision 1.25 2001/01/21 20:32:45 marco
  1320. * Renamefest. Compiler part. Not that hard.
  1321. Revision 1.24 2001/01/20 18:32:52 hajny
  1322. + APPTYPE support under OS/2, app_fs, GetEnvPChar for OS/2
  1323. Revision 1.23 2001/01/13 00:03:41 peter
  1324. * fixed findexe to also support already extension in name
  1325. Revision 1.22 2000/12/26 15:57:25 peter
  1326. * use system.paramstr()
  1327. Revision 1.21 2000/12/25 00:07:26 peter
  1328. + new tlinkedlist class (merge of old tstringqueue,tcontainer and
  1329. tlinkedlist objects)
  1330. Revision 1.20 2000/11/13 15:26:12 marco
  1331. * Renamefest
  1332. Revision 1.19 2000/11/12 22:20:37 peter
  1333. * create generic toutputsection for binary writers
  1334. Revision 1.18 2000/11/04 14:25:19 florian
  1335. + merged Attila's changes for interfaces, not tested yet
  1336. Revision 1.17 2000/10/31 22:02:46 peter
  1337. * symtable splitted, no real code changes
  1338. Revision 1.16 2000/10/04 14:51:08 pierre
  1339. * IsExe restored
  1340. Revision 1.15 2000/09/27 21:20:56 peter
  1341. * also set initlocalswitches in setcompilemode (merged)
  1342. Revision 1.14 2000/09/26 10:50:41 jonas
  1343. * initmodeswitches is changed is you change the compiler mode from the
  1344. command line (the -S<x> switches didn't work anymore for changing the
  1345. compiler mode) (merged from fixes branch)
  1346. Revision 1.13 2000/09/24 21:33:46 peter
  1347. * message updates merges
  1348. Revision 1.12 2000/09/24 21:19:50 peter
  1349. * delphi compile fixes
  1350. Revision 1.11 2000/09/24 15:12:40 peter
  1351. * fixed typo
  1352. Revision 1.10 2000/09/24 15:06:16 peter
  1353. * use defines.inc
  1354. Revision 1.9 2000/09/24 10:33:07 peter
  1355. * searching of exe in path also for OS/2
  1356. * fixed searching of exe in path.
  1357. Revision 1.8 2000/09/11 17:00:22 florian
  1358. + first implementation of Netware Module support, thanks to
  1359. Armin Diehl ([email protected]) for providing the patches
  1360. Revision 1.7 2000/08/27 16:11:51 peter
  1361. * moved some util functions from globals,cobjects to cutils
  1362. * splitted files into finput,fmodule
  1363. Revision 1.6 2000/08/12 19:14:58 peter
  1364. * ELF writer works now also with -g
  1365. * ELF writer is default again for linux
  1366. Revision 1.5 2000/08/12 15:30:44 peter
  1367. * IDE patch for stream reading (merged)
  1368. Revision 1.4 2000/08/02 19:49:59 peter
  1369. * first things for default parameters
  1370. Revision 1.3 2000/07/13 12:08:25 michael
  1371. + patched to 1.1.0 with former 1.09patch from peter
  1372. Revision 1.2 2000/07/13 11:32:41 michael
  1373. + removed logs
  1374. }