globals.pas 40 KB

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