fpswitch.pas 36 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294
  1. {
  2. $Id$
  3. This file is part of the Free Pascal Integrated Development Environment
  4. Copyright (c) 1998-2000 by Berczi Gabor
  5. Compiler switches routines for the IDE
  6. See the file COPYING.FPC, included in this distribution,
  7. for details about the copyright.
  8. This program is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  11. **********************************************************************}
  12. unit FPSwitch;
  13. interface
  14. uses
  15. Objects,
  16. Systems,
  17. WUtils,
  18. FPConst;
  19. const
  20. MinMemSize = 1024; { min. local heap and stack size }
  21. MaxMemSize = 67107840; { max. local heap and stack size }
  22. type
  23. TParamID =
  24. (idNone,idAlign,idRangeChecks,idStackChecks,idIOChecks,
  25. idOverflowChecks,idAsmDirect,idAsmATT,idAsmIntel,
  26. idSymInfNone,idSymInfGlobalOnly,idSymInfGlobalLocal,
  27. idStackSize,idHeapSize,idStrictVarStrings,idExtendedSyntax,
  28. idMMXOps,idTypedAddress,idPackRecords,idPackEnum,idStackFrames,
  29. idReferenceInfo,idDebugInfo,idBoolEval,
  30. idLongString,idTypeInfo);
  31. TSwitchMode = (om_Normal,om_Debug,om_Release);
  32. TSwitchItemTyp = (ot_Select,ot_Boolean,ot_String,ot_Longint);
  33. PSwitchItem = ^TSwitchItem;
  34. TSwitchItem = object(TObject)
  35. Typ : TSwitchItemTyp;
  36. Name : string[50];
  37. Param : string[10];
  38. ParamID : TParamID;
  39. constructor Init(const n,p:string; AID: TParamID);
  40. function NeedParam:boolean;virtual;
  41. function ParamValue:string;virtual;
  42. function ParamValueBool(SM: TSwitchMode):boolean;virtual;
  43. function GetSwitchStr(SM: TSwitchMode): string; virtual;
  44. function GetNumberStr(SM: TSwitchMode): string; virtual;
  45. function GetOptionStr(SM: TSwitchMode): string; virtual;
  46. procedure Reset;virtual;
  47. end;
  48. PSelectItem = ^TSelectItem;
  49. TSelectItem = object(TSwitchItem)
  50. IsDefault : boolean;
  51. constructor Init(const n,p:string; AID: TParamID);
  52. { Select to avoid anything in config file }
  53. constructor InitDefault(const n:string);
  54. end;
  55. PBooleanItem = ^TBooleanItem;
  56. TBooleanItem = object(TSwitchItem)
  57. IsSet : array[TSwitchMode] of boolean;
  58. constructor Init(const n,p:string; AID: TParamID);
  59. function NeedParam:boolean;virtual;
  60. procedure Reset;virtual;
  61. function GetSwitchStr(SM: TSwitchMode): string; virtual;
  62. function ParamValueBool(SM: TSwitchMode):boolean;virtual;
  63. end;
  64. PStringItem = ^TStringItem;
  65. TStringItem = object(TSwitchItem)
  66. Str : array[TSwitchMode] of string;
  67. multiple : boolean;
  68. constructor Init(const n,p:string;AID: TParamID; mult:boolean);
  69. function NeedParam:boolean;virtual;
  70. function ParamValue:string;virtual;
  71. procedure Reset;virtual;
  72. end;
  73. PLongintItem = ^TLongintItem;
  74. TLongintItem = object(TSwitchItem)
  75. Val : array[TSwitchMode] of longint;
  76. constructor Init(const n,p:string; AID: TParamID);
  77. function NeedParam:boolean;virtual;
  78. function ParamValue:string;virtual;
  79. function GetNumberStr(SM: TSwitchMode): string; virtual;
  80. procedure Reset;virtual;
  81. end;
  82. PSwitches = ^TSwitches;
  83. TSwitches = object
  84. constructor Init(ch:char);
  85. constructor InitSelect(ch:char);
  86. destructor Done;
  87. { general items }
  88. function ItemCount:integer;
  89. function ItemName(index:integer):string;
  90. function ItemParam(index:integer):string;
  91. { type specific }
  92. procedure AddSelectItem(const name,param:string; AID: TParamID);
  93. procedure AddDefaultSelect(const name:string);
  94. procedure AddBooleanItem(const name,param:string; AID: TParamID);
  95. procedure AddLongintItem(const name,param:string; AID: TParamID);
  96. procedure AddStringItem(const name,param:string;AID: TParamID;mult:boolean);
  97. function GetCurrSel:integer;
  98. function GetCurrSelParam : String;
  99. function GetBooleanItem(index:integer):boolean;
  100. function GetLongintItem(index:integer):longint;
  101. function GetStringItem(index:integer):string;
  102. procedure SetCurrSel(index:integer);
  103. function SetCurrSelParam(const s : String) : boolean;
  104. procedure SetBooleanItem(index:integer;b:boolean);
  105. procedure SetLongintItem(index:integer;l:longint);
  106. procedure SetStringItem(index:integer;const s:string);
  107. { read / write to cfgfile which must be open }
  108. procedure WriteItemsCfg;
  109. function ReadItemsCfg(const s:string):boolean;
  110. private
  111. IsSel : boolean;
  112. Prefix : char;
  113. SelNr : array[TSwitchMode] of integer;
  114. Items : PCollection;
  115. end;
  116. const
  117. SwitchesMode : TSwitchMode = om_Normal;
  118. SwitchesModeName : array[TSwitchMode] of string[10]=
  119. ('~N~ormal','~D~ebug','~R~elease');
  120. SwitchesModeStr : array[TSwitchMode] of string[8]=
  121. ('NORMAL','DEBUG','RELEASE');
  122. CustomArg : array[TSwitchMode] of string{$ifndef FPC}[128]{$endif}=
  123. ('','','');
  124. var
  125. LibLinkerSwitches,
  126. DebugInfoSwitches,
  127. LinkAfterSwitches,
  128. ProfileInfoSwitches,
  129. {MemorySizeSwitches, doubled !! }
  130. SyntaxSwitches,
  131. VerboseSwitches,
  132. CodegenSwitches,
  133. OptimizationSwitches,
  134. OptimizingGoalSwitches,
  135. ProcessorSwitches,
  136. AsmReaderSwitches,
  137. AsmInfoSwitches,
  138. AsmOutputSwitches,
  139. TargetSwitches,
  140. ConditionalSwitches,
  141. MemorySwitches,
  142. BrowserSwitches,
  143. DirectorySwitches : PSwitches;
  144. { write/read the Switches to ppc.cfg file }
  145. procedure WriteSwitches(const fn:string);
  146. procedure ReadSwitches(const fn:string);
  147. { initialize }
  148. procedure InitSwitches;
  149. procedure SetDefaultSwitches;
  150. procedure DoneSwitches;
  151. function GetSourceDirectories : string;
  152. procedure GetCompilerOptionLines(C: PUnsortedStringCollection);
  153. implementation
  154. uses
  155. Dos,
  156. GlobType,
  157. FPString,FPVars,FPUtils;
  158. var
  159. CfgFile : text;
  160. {*****************************************************************************
  161. TSwitchItem
  162. *****************************************************************************}
  163. constructor TSwitchItem.Init(const n,p:string; AID: TParamID);
  164. begin
  165. Inherited Init;
  166. Name:=n;
  167. Param:=p;
  168. ParamID:=AID;
  169. end;
  170. function TSwitchItem.NeedParam:boolean;
  171. begin
  172. NeedParam:=false;
  173. end;
  174. function TSwitchItem.ParamValue:string;
  175. begin
  176. ParamValue:='';
  177. end;
  178. function TSwitchItem.ParamValueBool(SM: TSwitchMode):boolean;
  179. begin
  180. Abstract;
  181. ParamValueBool:=false;
  182. end;
  183. function TSwitchItem.GetSwitchStr(SM: TSwitchMode): string;
  184. begin
  185. Abstract;
  186. GetSwitchStr:='';
  187. end;
  188. function TSwitchItem.GetNumberStr(SM: TSwitchMode): string;
  189. begin
  190. Abstract;
  191. GetNumberStr:='';
  192. end;
  193. function TSwitchItem.GetOptionStr(SM: TSwitchMode): string;
  194. begin
  195. Abstract;
  196. GetOptionStr:='';
  197. end;
  198. procedure TSwitchItem.Reset;
  199. begin
  200. end;
  201. {*****************************************************************************
  202. TSelectItem
  203. *****************************************************************************}
  204. constructor TSelectItem.Init(const n,p:string; AID: TParamID);
  205. begin
  206. Inherited Init(n,p,AID);
  207. Typ:=ot_Select;
  208. IsDefault:=false;
  209. end;
  210. constructor TSelectItem.InitDefault(const n:string);
  211. begin
  212. Inherited Init(n,'',idNone);
  213. Typ:=ot_Select;
  214. IsDefault:=true;
  215. end;
  216. {*****************************************************************************
  217. TBooleanItem
  218. *****************************************************************************}
  219. constructor TBooleanItem.Init(const n,p:string; AID: TParamID);
  220. begin
  221. Inherited Init(n,p,AID);
  222. Typ:=ot_Boolean;
  223. Reset;
  224. end;
  225. function TBooleanItem.NeedParam:boolean;
  226. begin
  227. NeedParam:=IsSet[SwitchesMode];
  228. end;
  229. procedure TBooleanItem.Reset;
  230. begin
  231. FillChar(IsSet,sizeof(IsSet),0);
  232. end;
  233. function TBooleanItem.ParamValueBool(SM: TSwitchMode):boolean;
  234. begin
  235. ParamValueBool:=IsSet[SM];
  236. end;
  237. function TBooleanItem.GetSwitchStr(SM: TSwitchMode): string;
  238. begin
  239. GetSwitchStr:=BoolToStr(IsSet[SM],'+','-');
  240. end;
  241. {*****************************************************************************
  242. TStringItem
  243. *****************************************************************************}
  244. constructor TStringItem.Init(const n,p:string; AID: TParamID; mult:boolean);
  245. begin
  246. Inherited Init(n,p,AID);
  247. Typ:=ot_String;
  248. Multiple:=mult;
  249. Reset;
  250. end;
  251. function TStringItem.NeedParam:boolean;
  252. begin
  253. NeedParam:=(Str[SwitchesMode]<>'');
  254. end;
  255. function TStringItem.ParamValue:string;
  256. begin
  257. ParamValue:=Str[SwitchesMode];
  258. end;
  259. procedure TStringItem.Reset;
  260. begin
  261. FillChar(Str,sizeof(Str),0);
  262. end;
  263. {*****************************************************************************
  264. TLongintItem
  265. *****************************************************************************}
  266. constructor TLongintItem.Init(const n,p:string; AID: TParamID);
  267. begin
  268. Inherited Init(n,p,AID);
  269. Typ:=ot_Longint;
  270. Reset;
  271. end;
  272. function TLongintItem.NeedParam:boolean;
  273. begin
  274. NeedParam:=(Val[SwitchesMode]<>0);
  275. end;
  276. function TLongintItem.ParamValue:string;
  277. var
  278. s : string;
  279. begin
  280. Str(Val[SwitchesMode],s);
  281. ParamValue:=s;
  282. end;
  283. procedure TLongintItem.Reset;
  284. begin
  285. FillChar(Val,sizeof(Val),0);
  286. end;
  287. function TLongintItem.GetNumberStr(SM: TSwitchMode): string;
  288. begin
  289. GetNumberStr:=IntToStr(Val[SM]);
  290. end;
  291. {*****************************************************************************
  292. TSwitch
  293. *****************************************************************************}
  294. constructor TSwitches.Init(ch:char);
  295. begin
  296. new(Items,Init(10,5));
  297. Prefix:=ch;
  298. FillChar(SelNr,SizeOf(SelNr),#0);
  299. IsSel:=false;
  300. end;
  301. constructor TSwitches.InitSelect(ch:char);
  302. begin
  303. new(Items,Init(10,5));
  304. Prefix:=ch;
  305. FillChar(SelNr,SizeOf(SelNr),#0);
  306. IsSel:=true;
  307. end;
  308. destructor TSwitches.Done;
  309. begin
  310. dispose(Items,Done);
  311. end;
  312. procedure TSwitches.AddSelectItem(const name,param:string; AID: TParamID);
  313. begin
  314. Items^.Insert(New(PSelectItem,Init(name,Param,AID)));
  315. end;
  316. procedure TSwitches.AddDefaultSelect(const name:string);
  317. begin
  318. Items^.Insert(New(PSelectItem,InitDefault(name)));
  319. end;
  320. procedure TSwitches.AddBooleanItem(const name,param:string; AID: TParamID);
  321. begin
  322. Items^.Insert(New(PBooleanItem,Init(name,Param,AID)));
  323. end;
  324. procedure TSwitches.AddLongintItem(const name,param:string; AID: TParamID);
  325. begin
  326. Items^.Insert(New(PLongintItem,Init(name,Param,AID)));
  327. end;
  328. procedure TSwitches.AddStringItem(const name,param:string;AID: TParamID;mult:boolean);
  329. begin
  330. Items^.Insert(New(PStringItem,Init(name,Param,AID,mult)));
  331. end;
  332. function TSwitches.ItemCount:integer;
  333. begin
  334. ItemCount:=Items^.Count;
  335. end;
  336. function TSwitches.ItemName(index:integer):string;
  337. var
  338. P : PSwitchItem;
  339. begin
  340. P:=Items^.At(Index);
  341. if assigned(P) then
  342. ItemName:=P^.Name
  343. else
  344. ItemName:='';
  345. end;
  346. function TSwitches.ItemParam(index:integer):string;
  347. var
  348. P : PSwitchItem;
  349. begin
  350. P:=Items^.At(Index);
  351. if assigned(P) then
  352. ItemParam:='-'+Prefix+P^.Param
  353. else
  354. ItemParam:='';
  355. end;
  356. function TSwitches.GetBooleanItem(index:integer):boolean;
  357. var
  358. P : PBooleanItem;
  359. begin
  360. P:=Items^.At(Index);
  361. if assigned(P) and (P^.Typ=ot_boolean) then
  362. GetBooleanItem:=P^.IsSet[SwitchesMode]
  363. else
  364. GetBooleanItem:=false;
  365. end;
  366. function TSwitches.GetLongintItem(index:integer):longint;
  367. var
  368. P : PLongintItem;
  369. begin
  370. P:=Items^.At(Index);
  371. if assigned(P) and (P^.Typ=ot_longint) then
  372. GetLongintItem:=P^.Val[SwitchesMode]
  373. else
  374. GetLongintItem:=0;
  375. end;
  376. function TSwitches.GetStringItem(index:integer):string;
  377. var
  378. P : PStringItem;
  379. begin
  380. P:=Items^.At(Index);
  381. if assigned(P) and (P^.Typ=ot_string) then
  382. GetStringItem:=P^.Str[SwitchesMode]
  383. else
  384. GetStringItem:='';
  385. end;
  386. procedure TSwitches.SetBooleanItem(index:integer;b:boolean);
  387. var
  388. P : PBooleanItem;
  389. begin
  390. P:=Items^.At(Index);
  391. if assigned(P) and (P^.Typ=ot_boolean) then
  392. P^.IsSet[SwitchesMode]:=b;
  393. end;
  394. procedure TSwitches.SetLongintItem(index:integer;l:longint);
  395. var
  396. P : PLongintItem;
  397. begin
  398. P:=Items^.At(Index);
  399. if assigned(P) and (P^.Typ=ot_longint) then
  400. P^.Val[SwitchesMode]:=l;
  401. end;
  402. procedure TSwitches.SetStringItem(index:integer;const s:string);
  403. var
  404. P : PStringItem;
  405. begin
  406. P:=Items^.At(Index);
  407. if assigned(P) and (P^.Typ=ot_string) then
  408. P^.Str[SwitchesMode]:=s;
  409. end;
  410. function TSwitches.GetCurrSel:integer;
  411. begin
  412. if IsSel then
  413. GetCurrSel:=SelNr[SwitchesMode]
  414. else
  415. GetCurrSel:=-1;
  416. end;
  417. function TSwitches.GetCurrSelParam : String;
  418. begin
  419. if IsSel then
  420. GetCurrSelParam:=PSwitchItem(Items^.At(SelNr[SwitchesMode]))^.Param
  421. else
  422. GetCurrSelParam:='';
  423. end;
  424. procedure TSwitches.SetCurrSel(index:integer);
  425. begin
  426. if IsSel then
  427. SelNr[SwitchesMode]:=index;
  428. end;
  429. function TSwitches.SetCurrSelParam(const s : String) : boolean;
  430. function checkitem(P:PSwitchItem):boolean;{$ifndef FPC}far;{$endif}
  431. begin
  432. { empty items are not equivalent to others !! }
  433. CheckItem:=((S='') and (P^.Param='')) or
  434. ((Length(S)>0) and (P^.Param=s));
  435. end;
  436. var
  437. FoundP : PSwitchItem;
  438. begin
  439. FoundP:=Items^.FirstThat(@CheckItem);
  440. if Assigned(FoundP) then
  441. begin
  442. SetCurrSelParam:=true;
  443. SelNr[SwitchesMode]:=Items^.IndexOf(FoundP);
  444. end
  445. else
  446. SetCurrSelParam:=false;
  447. end;
  448. procedure TSwitches.WriteItemsCfg;
  449. var
  450. Pref : char;
  451. procedure writeitem(P:PSwitchItem);{$ifndef FPC}far;{$endif}
  452. var
  453. s,s1 : string;
  454. i,j : integer;
  455. begin
  456. if P^.NeedParam then
  457. begin
  458. if (P^.Typ=ot_string) and (PStringItem(P)^.Multiple) then
  459. begin
  460. s:=PStringItem(P)^.Str[SwitchesMode];
  461. repeat
  462. i:=pos(';',s);
  463. j:=pos(' ',s);
  464. if i=0 then
  465. i:=256;
  466. if (j>0) and (j<i) then
  467. i:=j;
  468. s1:=Copy(s,1,i-1);
  469. if s1<>'' then
  470. writeln(CfgFile,' -'+Pref+P^.Param+s1);
  471. Delete(s,1,i);
  472. until s='';
  473. end
  474. else
  475. Writeln(CfgFile,' -'+Pref+P^.Param+P^.ParamValue);
  476. end;
  477. end;
  478. var
  479. P : PSelectItem;
  480. begin
  481. Pref:=Prefix;
  482. if IsSel then
  483. begin
  484. P:=Items^.At(SelNr[SwitchesMode]);
  485. if not P^.IsDefault then
  486. writeln(CfgFile,' '+ItemParam(SelNr[SwitchesMode]));
  487. end
  488. else
  489. Items^.ForEach(@writeitem);
  490. end;
  491. procedure WriteCustom;
  492. var
  493. s : string;
  494. i : longint;
  495. begin
  496. s:=CustomArg[SwitchesMode];
  497. While s<>'' do
  498. begin
  499. i:=pos(' ',s);
  500. if i=0 then i:=256;
  501. writeln(CfgFile,' '+Copy(s,1,i-1));
  502. if i=256 then
  503. s:=''
  504. else
  505. s:=copy(s,i+1,255);
  506. end;
  507. end;
  508. function TSwitches.ReadItemsCfg(const s:string):boolean;
  509. function checkitem(P:PSwitchItem):boolean;{$ifndef FPC}far;{$endif}
  510. begin
  511. { empty items are not equivalent to others !! }
  512. { but -dGDB didn't work because of this PM }
  513. CheckItem:=((P^.Param='') and ((S='') or (P^.typ=ot_String))) or
  514. ((Length(P^.Param)>0) and (P^.Param=Copy(s,1,length(P^.Param))));
  515. end;
  516. var
  517. FoundP : PSwitchItem;
  518. code : integer;
  519. begin
  520. FoundP:=Items^.FirstThat(@checkitem);
  521. if assigned(FoundP) then
  522. begin
  523. case FoundP^.Typ of
  524. ot_Select : SelNr[SwitchesMode]:=Items^.IndexOf(FoundP);
  525. ot_Boolean : PBooleanItem(FoundP)^.IsSet[SwitchesMode]:=true;
  526. ot_String : begin
  527. if (PStringItem(FoundP)^.Multiple) and (PStringItem(FoundP)^.Str[SwitchesMode]<>'') then
  528. PStringItem(FoundP)^.Str[SwitchesMode]:=PStringItem(FoundP)^.Str[SwitchesMode]+';'+
  529. Copy(s,length(FoundP^.Param)+1,255)
  530. else
  531. PStringItem(FoundP)^.Str[SwitchesMode]:=Copy(s,length(FoundP^.Param)+1,255);
  532. end;
  533. ot_Longint : Val(Copy(s,length(FoundP^.Param)+1,255),PLongintItem(FoundP)^.Val[SwitchesMode],code);
  534. end;
  535. ReadItemsCfg:=true;
  536. end
  537. else
  538. ReadItemsCfg:=false;
  539. end;
  540. {*****************************************************************************
  541. Read / Write
  542. *****************************************************************************}
  543. procedure WriteSwitches(const fn:string);
  544. var
  545. OldSwitchesMode : TSwitchMode;
  546. begin
  547. { create the switches }
  548. assign(CfgFile,fn);
  549. {$I-}
  550. rewrite(CfgFile);
  551. {$I+}
  552. if ioresult<>0 then
  553. exit;
  554. writeln(CfgFile,'# '+msg_automaticallycreateddontedit);
  555. OldSwitchesMode:=SwitchesMode;
  556. for SwitchesMode:=low(TSwitchMode) to high(TSwitchMode) do
  557. begin
  558. Writeln(CfgFile,'#IFDEF '+SwitchesModeStr[SwitchesMode]);
  559. TargetSwitches^.WriteItemsCfg;
  560. VerboseSwitches^.WriteItemsCfg;
  561. SyntaxSwitches^.WriteItemsCfg;
  562. CodegenSwitches^.WriteItemsCfg;
  563. OptimizationSwitches^.WriteItemsCfg;
  564. OptimizingGoalSwitches^.WriteItemsCfg;
  565. ProcessorSwitches^.WriteItemsCfg;
  566. AsmReaderSwitches^.WriteItemsCfg;
  567. AsmInfoSwitches^.WriteItemsCfg;
  568. AsmOutputSwitches^.WriteItemsCfg;
  569. DirectorySwitches^.WriteItemsCfg;
  570. MemorySwitches^.WriteItemsCfg;
  571. ConditionalSwitches^.WriteItemsCfg;
  572. LibLinkerSwitches^.WriteItemsCfg;
  573. DebugInfoSwitches^.WriteItemsCfg;
  574. ProfileInfoSwitches^.WriteItemsCfg;
  575. LinkAfterSwitches^.WriteItemsCfg;
  576. BrowserSwitches^.WriteItemsCfg;
  577. {MemorySizeSwitches^.WriteItemsCfg;}
  578. WriteCustom;
  579. Writeln(CfgFile,'#ENDIF');
  580. Writeln(CfgFile,'');
  581. end;
  582. close(CfgFile);
  583. SwitchesMode:=OldSwitchesMode;
  584. end;
  585. procedure ReadSwitches(const fn:string);
  586. var
  587. c : char;
  588. s : string;
  589. res : boolean;
  590. OldSwitchesMode,i : TSwitchMode;
  591. begin
  592. assign(CfgFile,fn);
  593. {$I-}
  594. reset(CfgFile);
  595. {$I+}
  596. if ioresult<>0 then
  597. begin
  598. SetDefaultSwitches;
  599. exit;
  600. end;
  601. OldSwitchesMode:=SwitchesMode;
  602. SwitchesMode:=om_Normal;
  603. while not eof(CfgFile) do
  604. begin
  605. readln(CfgFile,s);
  606. s:=LTrim(s);
  607. if (length(s)>=2) and (s[1]='-') then
  608. begin
  609. c:=s[2];
  610. res:=false;
  611. Delete(s,1,2);
  612. case c of
  613. 'a' : res:=AsmInfoSwitches^.ReadItemsCfg(s);
  614. 'A' : res:=AsmOutputSwitches^.ReadItemsCfg(s);
  615. 'b' : res:=BrowserSwitches^.ReadItemsCfg(s);
  616. 'C' : begin
  617. res:=CodegenSwitches^.ReadItemsCfg(s);
  618. if not res then
  619. res:=MemorySwitches^.ReadItemsCfg(s);
  620. end;
  621. 'd' : res:=ConditionalSwitches^.ReadItemsCfg(s);
  622. 'F' : res:=DirectorySwitches^.ReadItemsCfg(s);
  623. 'g' : res:=DebugInfoSwitches^.ReadItemsCfg(s);
  624. 'O' : begin
  625. res:=true;
  626. if not OptimizationSwitches^.ReadItemsCfg(s) then
  627. if not ProcessorSwitches^.ReadItemsCfg(s) then
  628. res:=OptimizingGoalSwitches^.ReadItemsCfg(s);
  629. end;
  630. 'p' : res:=ProfileInfoSwitches^.ReadItemsCfg(s);
  631. 's' : res:=LinkAfterSwitches^.ReadItemsCfg(s);
  632. 'R' : res:=AsmReaderSwitches^.ReadItemsCfg(s);
  633. 'S' : res:=SyntaxSwitches^.ReadItemsCfg(s);
  634. 'T' : res:=TargetSwitches^.ReadItemsCfg(s);
  635. 'v' : res:=VerboseSwitches^.ReadItemsCfg(s);
  636. 'X' : res:=LibLinkerSwitches^.ReadItemsCfg(s);
  637. end;
  638. { keep all others as a string }
  639. if not res then
  640. CustomArg[SwitchesMode]:=CustomArg[SwitchesMode]+' -'+c+s;
  641. end
  642. else
  643. if (Copy(s,1,7)='#IFDEF ') then
  644. begin
  645. Delete(s,1,7);
  646. for i:=low(TSwitchMode) to high(TSwitchMode) do
  647. if s=SwitchesModeStr[i] then
  648. begin
  649. SwitchesMode:=i;
  650. break;
  651. end;
  652. end
  653. else;
  654. end;
  655. close(CfgFile);
  656. SwitchesMode:=OldSwitchesMode;
  657. end;
  658. function GetSourceDirectories : string;
  659. var
  660. P : PStringItem;
  661. S : String;
  662. c : char;
  663. function checkitem(P:PSwitchItem):boolean;{$ifndef FPC}far;{$endif}
  664. begin
  665. CheckItem:=(P^.Typ=ot_string) and (P^.Param=c);
  666. end;
  667. begin
  668. GetSourceDirectories:='';
  669. c:='u';
  670. P:=DirectorySwitches^.Items^.FirstThat(@CheckItem);
  671. S:='';
  672. if assigned(P) then
  673. S:=P^.Str[SwitchesMode];
  674. c:='i';
  675. P:=DirectorySwitches^.Items^.FirstThat(@CheckItem);
  676. if assigned(P) then
  677. S:=P^.Str[SwitchesMode]+';'+S;
  678. if S='' then
  679. GetSourceDirectories:=SourceDirs+';'
  680. else
  681. GetSourceDirectories:=SourceDirs+';'+S+';';
  682. end;
  683. {*****************************************************************************
  684. Initialize
  685. *****************************************************************************}
  686. procedure InitSwitches;
  687. begin
  688. New(SyntaxSwitches,Init('S'));
  689. with SyntaxSwitches^ do
  690. begin
  691. AddBooleanItem(opt_delphi2extensions,'2',idNone);
  692. AddBooleanItem(opt_clikeoperators,'c',idNone);
  693. AddBooleanItem(opt_stopafterfirsterror,'e',idNone);
  694. AddBooleanItem(opt_allowlabelandgoto,'g',idNone);
  695. AddBooleanItem(opt_cplusplusstyledinline,'i',idNone);
  696. AddBooleanItem(opt_globalcmacros,'m',idNone);
  697. AddBooleanItem(opt_tp7compatibility,'o',idNone);
  698. AddBooleanItem(opt_delphicompatibility,'d',idNone);
  699. AddBooleanItem(opt_allowstaticinobjects,'s',idNone);
  700. AddBooleanItem(opt_strictvarstrings,'',idStrictVarStrings);
  701. AddBooleanItem(opt_extendedsyntax,'',idExtendedSyntax);
  702. AddBooleanItem(opt_allowmmxoperations,'',idMMXOps);
  703. end;
  704. New(VerboseSwitches,Init('v'));
  705. with VerboseSwitches^ do
  706. begin
  707. AddBooleanItem(opt_warnings,'w',idNone);
  708. AddBooleanItem(opt_notes,'n',idNone);
  709. AddBooleanItem(opt_hints,'h',idNone);
  710. AddBooleanItem(opt_generalinfo,'i',idNone);
  711. AddBooleanItem(opt_usedtriedinfo,'ut',idNone);
  712. AddBooleanItem(opt_all,'a',idNone);
  713. AddBooleanItem(opt_showallprocsonerror,'b',idNone);
  714. end;
  715. New(CodegenSwitches,Init('C'));
  716. with CodegenSwitches^ do
  717. begin
  718. AddBooleanItem(opt_rangechecking,'r',idRangeChecks);
  719. AddBooleanItem(opt_stackchecking,'t',idStackChecks);
  720. AddBooleanItem(opt_iochecking,'i',idIOChecks);
  721. AddBooleanItem(opt_overflowchecking,'o',idOverflowChecks);
  722. end;
  723. New(OptimizingGoalSwitches,InitSelect('O'));
  724. with OptimizingGoalSwitches^ do
  725. begin
  726. AddSelectItem(opt_generatefastercode,'G',idNone);
  727. AddSelectItem(opt_generatesmallercode,'g',idNone);
  728. end;
  729. New(OptimizationSwitches,Init('O'));
  730. with OptimizationSwitches^ do
  731. begin
  732. AddBooleanItem(opt_useregistervariables,'r',idNone);
  733. AddBooleanItem(opt_uncertainoptimizations,'u',idNone);
  734. AddBooleanItem(opt_level1optimizations,'1',idNone);
  735. AddBooleanItem(opt_level2optimizations,'2',idNone);
  736. end;
  737. New(ProcessorSwitches,InitSelect('O'));
  738. with ProcessorSwitches^ do
  739. begin
  740. AddSelectItem(opt_i386486,'p1',idNone);
  741. AddSelectItem(opt_pentiumandmmx,'p2',idNone);
  742. AddSelectItem(opt_pentiumpro,'p3',idNone);
  743. end;
  744. New(TargetSwitches,InitSelect('T'));
  745. with TargetSwitches^ do
  746. begin
  747. AddSelectItem('DOS (GO32V~1~)','go32v1',idNone);
  748. AddSelectItem('~D~OS (GO32V2)','go32v2',idNone);
  749. AddSelectItem('~L~inux','linux',idNone);
  750. AddSelectItem('~O~S/2','os2',idNone);
  751. AddSelectItem('~W~IN32','win32',idNone);
  752. end;
  753. New(AsmReaderSwitches,InitSelect('R'));
  754. with AsmReaderSwitches^ do
  755. begin
  756. AddSelectItem(opt_directassembler,'direct',idAsmDirect);
  757. AddSelectItem(opt_attassembler,'att',idAsmATT);
  758. AddSelectItem(opt_intelassembler,'intel',idAsmIntel);
  759. end;
  760. New(AsmInfoSwitches,Init('a'));
  761. with AsmInfoSwitches^ do
  762. begin
  763. AddBooleanItem(opt_listsource,'l',idNone);
  764. AddBooleanItem(opt_listregisterallocation,'r',idNone);
  765. AddBooleanItem(opt_listtempallocation,'t',idNone);
  766. end;
  767. New(AsmOutputSwitches,InitSelect('A'));
  768. with AsmOutputSwitches^ do
  769. begin
  770. AddDefaultSelect(opt_usedefaultas);
  771. AddSelectItem(opt_usegnuas,'as',idNone);
  772. AddSelectItem(opt_usenasmcoff,'nasmcoff',idNone);
  773. AddSelectItem(opt_usenasmelf,'nasmelf',idNone);
  774. AddSelectItem(opt_usenasmobj,'nasmobj',idNone);
  775. AddSelectItem(opt_usemasm,'masm',idNone);
  776. AddSelectItem(opt_usetasm,'tasm',idNone);
  777. AddSelectItem(opt_usecoff,'coff',idNone);
  778. AddSelectItem(opt_usepecoff,'pecoff',idNone);
  779. end;
  780. New(BrowserSwitches,InitSelect('b'));
  781. with BrowserSwitches^ do
  782. begin
  783. AddSelectItem(opt_nobrowser,'-',idSymInfNone);
  784. AddSelectItem(opt_globalonlybrowser,'+',idSymInfGlobalOnly);
  785. AddSelectItem(opt_localglobalbrowser,'l',idSymInfGlobalLocal);
  786. end;
  787. New(ConditionalSwitches,Init('d'));
  788. with ConditionalSwitches^ do
  789. begin
  790. AddStringItem(opt_conditionaldefines,'',idNone,true);
  791. end;
  792. New(MemorySwitches,Init('C'));
  793. with MemorySwitches^ do
  794. begin
  795. AddLongintItem(opt_stacksize,'s',idStackSize);
  796. AddLongintItem(opt_heapsize,'h',idHeapSize);
  797. end;
  798. New(DirectorySwitches,Init('F'));
  799. with DirectorySwitches^ do
  800. begin
  801. AddStringItem(opt_unitdirectories,'u',idNone,true);
  802. AddStringItem(opt_includedirectories,'i',idNone,true);
  803. AddStringItem(opt_librarydirectories,'l',idNone,true);
  804. AddStringItem(opt_objectdirectories,'o',idNone,true);
  805. AddStringItem(opt_exeppudirectories,'E',idNone,true);
  806. end;
  807. New(LibLinkerSwitches,InitSelect('X'));
  808. with LibLinkerSwitches^ do
  809. begin
  810. AddDefaultSelect(opt_librariesdefault);
  811. AddSelectItem(opt_dynamiclibraries,'D',idNone);
  812. AddSelectItem(opt_staticlibraries,'S',idNone);
  813. AddSelectItem(opt_smartlibraries,'X',idNone);
  814. end;
  815. New(DebugInfoSwitches,InitSelect('g'));
  816. with DebugInfoSwitches^ do
  817. begin
  818. AddSelectItem(opt_stripalldebugsymbols,'-',idNone);
  819. AddSelectItem(opt_gendebugsymbolinfo,'',idNone);
  820. AddSelectItem(opt_gensymbolandbacktraceinfo,'l',idNone);
  821. { AddSelectItem('Generate ~d~bx symbol information','d');
  822. does not work anyhow (PM) }
  823. end;
  824. New(LinkAfterSwitches,Init('s'));
  825. LinkAfterSwitches^.AddBooleanItem(opt_linkafter,'',idNone);
  826. New(ProfileInfoSwitches,InitSelect('p'));
  827. with ProfileInfoSwitches^ do
  828. begin
  829. AddSelectItem(opt_noprofileinfo,'-',idNone);
  830. AddSelectItem(opt_gprofinfo,'g',idNone);
  831. end;
  832. {New(MemorySizeSwitches,Init('C'));
  833. with MemorySizeSwitches^ do
  834. begin
  835. AddLongIntItem('~S~tack size','s');
  836. AddLongIntItem('Local ~h~eap size','h');
  837. end;}
  838. SwitchesPath:=LocateFile(SwitchesName);
  839. if SwitchesPath='' then
  840. SwitchesPath:=SwitchesName;
  841. SwitchesPath:=FExpand(SwitchesPath);
  842. end;
  843. procedure SetDefaultSwitches;
  844. var
  845. i,OldSwitchesMode : TSwitchMode;
  846. begin
  847. { setup some useful defaults }
  848. OldSwitchesMode:=SwitchesMode;
  849. for i:=low(TSwitchMode) to high(TSwitchMode) do
  850. begin
  851. SwitchesMode:=i;
  852. { default is Pentium }
  853. ProcessorSwitches^.SetCurrSel(1);
  854. { AT&T reader }
  855. AsmReaderSwitches^.SetCurrSel(1);
  856. { 128k stack }
  857. MemorySwitches^.SetLongintItem(0,65536*2);
  858. { 2 MB heap }
  859. MemorySwitches^.SetLongintItem(1,1024*1024*2);
  860. { goto/lable allowed }
  861. SyntaxSwitches^.SetBooleanItem(3,true);
  862. case i of
  863. om_debug:
  864. begin
  865. { debugging info on }
  866. DebugInfoSwitches^.SetCurrSel(1);
  867. { range checking }
  868. CodegenSwitches^.SetBooleanItem(0,true);
  869. { io checking }
  870. CodegenSwitches^.SetBooleanItem(2,true);
  871. { overflow checking }
  872. CodegenSwitches^.SetBooleanItem(3,true);
  873. end;
  874. om_normal:
  875. begin
  876. OptimizationSwitches^.SetBooleanItem(2,true);
  877. end;
  878. om_release:
  879. begin
  880. OptimizationSwitches^.SetBooleanItem(2,true);
  881. OptimizationSwitches^.SetBooleanItem(3,true);
  882. end;
  883. end;
  884. { set appriopriate default target }
  885. {$ifdef go32v2}
  886. TargetSwitches^.SetCurrSel(1);
  887. {$endif}
  888. {$ifdef Linux}
  889. TargetSwitches^.SetCurrSel(2);
  890. {$endif}
  891. {$ifdef win32}
  892. TargetSwitches^.SetCurrSel(4);
  893. {$endif}
  894. {$ifdef os2}
  895. TargetSwitches^.SetCurrSel(3);
  896. {$endif}
  897. end;
  898. SwitchesMode:=OldSwitchesMode;
  899. end;
  900. procedure DoneSwitches;
  901. begin
  902. dispose(SyntaxSwitches,Done);
  903. dispose(VerboseSwitches,Done);
  904. dispose(CodegenSwitches,Done);
  905. dispose(OptimizationSwitches,Done);
  906. dispose(OptimizingGoalSwitches,Done);
  907. dispose(ProcessorSwitches,Done);
  908. dispose(BrowserSwitches,Done);
  909. dispose(TargetSwitches,Done);
  910. dispose(AsmReaderSwitches,Done);
  911. dispose(ConditionalSwitches,Done);
  912. dispose(MemorySwitches,Done);
  913. {dispose(MemorySizeSwitches,Done);}
  914. dispose(DirectorySwitches,Done);
  915. dispose(DebugInfoSwitches,Done);
  916. dispose(LibLinkerSwitches,Done);
  917. dispose(ProfileInfoSwitches,Done);
  918. end;
  919. procedure GetCompilerOptionLines(C: PUnsortedStringCollection);
  920. procedure AddLine(const S: string);
  921. begin
  922. C^.Insert(NewStr(S));
  923. end;
  924. procedure ConstructSwitchModeDirectives(SM: TSwitchMode; const IfDefSym: string);
  925. var SwitchParams: PStringCollection;
  926. MiscParams : PStringCollection;
  927. procedure AddSwitch(const S: string);
  928. begin
  929. SwitchParams^.Insert(NewStr(S));
  930. end;
  931. procedure AddParam(const S: string);
  932. begin
  933. MiscParams^.Insert(NewStr(S));
  934. end;
  935. procedure EnumSwitches(P: PSwitches);
  936. procedure HandleSwitch(P: PSwitchItem); {$ifndef FPC}far;{$endif}
  937. begin
  938. case P^.ParamID of
  939. { idAlign :}
  940. idRangeChecks : AddSwitch('R'+P^.GetSwitchStr(SM));
  941. idStackChecks : AddSwitch('S'+P^.GetSwitchStr(SM));
  942. idIOChecks : AddSwitch('I'+P^.GetSwitchStr(SM));
  943. idOverflowChecks : AddSwitch('Q'+P^.GetSwitchStr(SM));
  944. { idAsmDirect : if P^.GetParamValueBool[SM] then AddParam('ASMMODE DIRECT');
  945. idAsmATT : if P^.GetParamValueBool[SM] then AddParam('ASMMODE ATT');
  946. idAsmIntel : if P^.GetParamValueBool[SM] then AddParam('ASMMODE INTEL');}
  947. { idSymInfNone : ;
  948. idSymInfGlobalOnly:;
  949. idSymInfGlobalLocal:if P^.ParamValueBool(SM) then AddSwitch('L+');}
  950. { idStackSize
  951. idHeapSize}
  952. idStrictVarStrings: AddSwitch('V'+P^.GetSwitchStr(SM));
  953. idExtendedSyntax : AddSwitch('X'+P^.GetSwitchStr(SM));
  954. idMMXOps : if P^.ParamValueBool(SM) then AddParam('MMX');
  955. idTypedAddress : AddSwitch('T'+P^.GetSwitchStr(SM));
  956. { idPackRecords
  957. idPackEnum}
  958. idStackFrames : AddSwitch('W'+P^.GetSwitchStr(SM));
  959. idReferenceInfo : AddSwitch('Y'+P^.GetSwitchStr(SM));
  960. idDebugInfo : AddSwitch('D'+P^.GetSwitchStr(SM));
  961. idBoolEval : AddSwitch('B'+P^.GetSwitchStr(SM));
  962. idLongString : AddSwitch('H'+P^.GetSwitchStr(SM));
  963. idTypeInfo : AddSwitch('M'+P^.GetSwitchStr(SM));
  964. end;
  965. end;
  966. begin
  967. P^.Items^.ForEach(@HandleSwitch);
  968. end;
  969. var I: integer;
  970. S: string;
  971. begin
  972. AddLine('{$IFDEF '+IfDefSym+'}');
  973. New(SwitchParams, Init(10,10));
  974. New(MiscParams, Init(10,10));
  975. EnumSwitches(LibLinkerSwitches);
  976. EnumSwitches(DebugInfoSwitches);
  977. EnumSwitches(ProfileInfoSwitches);
  978. EnumSwitches(SyntaxSwitches);
  979. EnumSwitches(VerboseSwitches);
  980. EnumSwitches(CodegenSwitches);
  981. EnumSwitches(OptimizationSwitches);
  982. EnumSwitches(OptimizingGoalSwitches);
  983. EnumSwitches(ProcessorSwitches);
  984. EnumSwitches(AsmReaderSwitches);
  985. EnumSwitches(AsmInfoSwitches);
  986. EnumSwitches(AsmOutputSwitches);
  987. EnumSwitches(TargetSwitches);
  988. EnumSwitches(ConditionalSwitches);
  989. EnumSwitches(MemorySwitches);
  990. EnumSwitches(BrowserSwitches);
  991. EnumSwitches(DirectorySwitches);
  992. S:='';
  993. for I:=0 to SwitchParams^.Count-1 do
  994. begin
  995. if I=0 then S:='{$' else S:=S+',';
  996. S:=S+PString(SwitchParams^.At(I))^;
  997. end;
  998. if S<>'' then S:=S+'}';
  999. if S<>'' then AddLine(' '+S);
  1000. for I:=0 to MiscParams^.Count-1 do
  1001. AddLine(' {$'+PString(MiscParams^.At(I))^+'}');
  1002. Dispose(SwitchParams, Done); Dispose(MiscParams, Done);
  1003. AddLine('{$ENDIF '+IfDefSym+'}');
  1004. end;
  1005. var SM: TSwitchMode;
  1006. begin
  1007. for SM:=Low(TSwitchMode) to High(TSwitchMode) do
  1008. ConstructSwitchModeDirectives(SM,SwitchesModeStr[SM]);
  1009. end;
  1010. end.
  1011. {
  1012. $Log$
  1013. Revision 1.4 2000-11-15 00:14:10 pierre
  1014. new merge
  1015. Revision 1.1.2.6 2000/11/14 17:40:44 pierre
  1016. + External linking now optional
  1017. Revision 1.1.2.5 2000/11/14 09:40:35 marco
  1018. * Third batch renamefest
  1019. Revision 1.3 2000/10/31 22:35:55 pierre
  1020. * New big merge from fixes branch
  1021. Revision 1.1.2.4 2000/10/26 10:17:10 pierre
  1022. * fix reading of -dGDB switch in cfg file
  1023. Revision 1.2 2000/08/22 09:41:40 pierre
  1024. * first big merge from fixes branch
  1025. Revision 1.1.2.3 2000/08/04 14:05:19 michael
  1026. * Fixes from Gabor:
  1027. [*] the IDE now doesn't disable Compile|Make & Build when all windows
  1028. are closed, but there's still a primary file set
  1029. (set bug 1059 to fixed!)
  1030. [*] the IDE didn't read some compiler options correctly back from the
  1031. FP.CFG file, for ex. the linker options. Now it read everything
  1032. correctly, and also automatically handles smartlinking option synch-
  1033. ronization.
  1034. (set bug 1048 to fixed!)
  1035. Revision 1.1.2.2 2000/07/15 21:38:47 pierre
  1036. + Add default selection that does not write anything to config file
  1037. + Add smart link
  1038. Revision 1.1.2.1 2000/07/15 21:30:06 pierre
  1039. * Wrong commit text
  1040. Revision 1.1 2000/07/13 09:48:36 michael
  1041. + Initial import
  1042. Revision 1.23 2000/06/22 09:07:12 pierre
  1043. * Gabor changes: see fixes.txt
  1044. Revision 1.22 2000/05/02 08:42:28 pierre
  1045. * new set of Gabor changes: see fixes.txt
  1046. Revision 1.21 2000/04/25 08:42:33 pierre
  1047. * New Gabor changes : see fixes.txt
  1048. Revision 1.20 2000/03/08 16:51:50 pierre
  1049. + -gl option support
  1050. Revision 1.19 2000/03/07 22:52:50 pierre
  1051. + Assembler tab in Options|Compiler
  1052. Revision 1.18 2000/03/07 21:17:29 pierre
  1053. +ASMInfoSwitches AsmOutputSwitches
  1054. Revision 1.17 2000/02/04 14:34:47 pierre
  1055. readme.txt
  1056. Revision 1.16 2000/02/04 00:05:20 pierre
  1057. * -Fi must also be used for GetSourceDirectories
  1058. Revision 1.15 2000/01/10 15:52:53 pierre
  1059. * use default command line switches only if fp.cfg not found
  1060. Revision 1.14 1999/10/14 14:22:23 florian
  1061. * if no ini file is found the ide uses some useful defaults
  1062. Revision 1.13 1999/04/29 09:36:12 peter
  1063. * fixed hotkeys with Compiler switches
  1064. * fixed compiler status dialog
  1065. * Run shows again the output
  1066. Revision 1.12 1999/03/23 15:11:34 peter
  1067. * desktop saving things
  1068. * vesa mode
  1069. * preferences dialog
  1070. Revision 1.11 1999/03/12 01:14:01 peter
  1071. * flag if trytoopen should look for other extensions
  1072. + browser tab in the tools-compiler
  1073. Revision 1.10 1999/02/16 12:46:38 pierre
  1074. * String items can also be separated by spaces
  1075. Revision 1.9 1999/02/10 09:45:55 pierre
  1076. * MemorySizeSwitches Removed (was duplicate of MemorySwitches !)
  1077. * Added missing disposes at exit
  1078. Revision 1.8 1999/02/08 17:38:52 pierre
  1079. + added CustomArg
  1080. Revision 1.7 1999/02/06 00:07:48 florian
  1081. * speed/size optimization is now a radio button
  1082. Revision 1.6 1999/02/05 13:51:44 peter
  1083. * unit name of FPSwitches -> FPSwitch which is easier to use
  1084. * some fixes for tp7 compiling
  1085. Revision 1.5 1999/02/05 12:12:00 pierre
  1086. + SourceDir that stores directories for sources that the
  1087. compiler should not know about
  1088. Automatically asked for addition when a new file that
  1089. needed filedialog to be found is in an unknown directory
  1090. Stored and retrieved from INIFile
  1091. + Breakpoints conditions added to INIFile
  1092. * Breakpoints insterted and removed at debin and end of debug session
  1093. Revision 1.4 1999/02/04 13:32:10 pierre
  1094. * Several things added (I cannot commit them independently !)
  1095. + added TBreakpoint and TBreakpointCollection
  1096. + added cmResetDebugger,cmGrep,CmToggleBreakpoint
  1097. + Breakpoint list in INIFile
  1098. * Select items now also depend of SwitchMode
  1099. * Reading of option '-g' was not possible !
  1100. + added search for -Fu args pathes in TryToOpen
  1101. + added code for automatic opening of FileDialog
  1102. if source not found
  1103. Revision 1.3 1999/01/12 14:29:39 peter
  1104. + Implemented still missing 'switch' entries in Options menu
  1105. + Pressing Ctrl-B sets ASCII mode in editor, after which keypresses (even
  1106. ones with ASCII < 32 ; entered with Alt+<###>) are interpreted always as
  1107. ASCII chars and inserted directly in the text.
  1108. + Added symbol browser
  1109. * splitted fp.pas to fpide.pas
  1110. Revision 1.2 1999/01/04 11:49:50 peter
  1111. * 'Use tab characters' now works correctly
  1112. + Syntax highlight now acts on File|Save As...
  1113. + Added a new class to syntax highlight: 'hex numbers'.
  1114. * There was something very wrong with the palette managment. Now fixed.
  1115. + Added output directory (-FE<xxx>) support to 'Directories' dialog...
  1116. * Fixed some possible bugs in Running/Compiling, and the compilation/run
  1117. process revised
  1118. Revision 1.1 1998/12/28 15:47:52 peter
  1119. + Added user screen support, display & window
  1120. + Implemented Editor,Mouse Options dialog
  1121. + Added location of .INI and .CFG file
  1122. + Option (INI) file managment implemented (see bottom of Options Menu)
  1123. + Switches updated
  1124. + Run program
  1125. }