globals.pas 43 KB

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