globals.pas 43 KB

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