globals.pas 40 KB

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