pkgoptions.pp 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562
  1. {
  2. This file is part of the Free Pascal Utilities
  3. Copyright (c) 1999-2000 by the Free Pascal development team
  4. See the file COPYING.FPC, included in this distribution,
  5. for details about the copyright.
  6. This program is distributed in the hope that it will be useful,
  7. but WITHOUT ANY WARRANTY; without even the implied warranty of
  8. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  9. **********************************************************************}
  10. {$mode objfpc}
  11. {$h+}
  12. unit pkgoptions;
  13. interface
  14. uses Classes, Sysutils, Inifiles, fprepos;
  15. Const
  16. UnitConfigFileName = 'fpunits.conf';
  17. ManifestFileName = 'manifest.xml';
  18. MirrorsFileName = 'mirrors.xml';
  19. PackagesFileName = 'packages.xml';
  20. VersionsFileName = 'versions-%s.dat';
  21. CurrentConfigVersion = 3;
  22. Type
  23. { TGlobalOptions }
  24. TGlobalOptions = Class(TPersistent)
  25. private
  26. FDirty : Boolean;
  27. FConfigVersion : Integer;
  28. FRemoteMirrorsURL,
  29. FRemoteRepository,
  30. FLocalRepository,
  31. FCompilerConfigDir,
  32. FArchivesDir,
  33. FBuildDir,
  34. FDownloader,
  35. FDefaultCompilerConfig,
  36. FFPMakeCompilerConfig : String;
  37. // Parameter options
  38. FCompilerConfig : String;
  39. FAllowBroken,
  40. FInstallGlobal,
  41. FRecoveryMode : Boolean;
  42. function GetOptString(Index: integer): String;
  43. procedure SetOptString(Index: integer; const AValue: String);
  44. Public
  45. Constructor Create;
  46. Procedure InitGlobalDefaults;
  47. Procedure LoadGlobalFromFile(const AFileName : String);
  48. Procedure SaveGlobalToFile(const AFileName : String);
  49. procedure LogValues;
  50. Property Dirty : Boolean Read FDirty;
  51. Property ConfigVersion : Integer read FConfigVersion;
  52. function LocalPackagesFile:string;
  53. function LocalMirrorsFile:string;
  54. function LocalVersionsFile(const ACompilerConfig:String):string;
  55. Published
  56. Property RemoteMirrorsURL : String Index 0 Read GetOptString Write SetOptString;
  57. // 1 is unused
  58. Property RemoteRepository : String Index 2 Read GetOptString Write SetOptString;
  59. Property LocalRepository : String Index 3 Read GetOptString Write SetOptString;
  60. Property BuildDir : String Index 4 Read GetOptString Write SetOptString;
  61. Property ArchivesDir : String Index 5 Read GetOptString Write SetOptString;
  62. Property CompilerConfigDir : String Index 6 Read GetOptString Write SetOptString;
  63. Property DefaultCompilerConfig : String Index 8 Read GetOptString Write SetOptString;
  64. Property FPMakeCompilerConfig : String Index 9 Read GetOptString Write SetOptString;
  65. Property Downloader: String Index 10 Read GetOptString Write SetOptString;
  66. // Parameters
  67. Property CompilerConfig : String Read FCompilerConfig Write FCompilerConfig;
  68. Property InstallGlobal : Boolean Read FInstallGlobal Write FInstallGlobal;
  69. Property RecoveryMode : Boolean Read FRecoveryMode Write FRecoveryMode;
  70. Property AllowBroken : Boolean Read FAllowBroken Write FAllowBroken;
  71. end;
  72. { TCompilerOptions }
  73. TCompilerOptions = Class(TPersistent)
  74. private
  75. FDirty: Boolean;
  76. FConfigVersion : Integer;
  77. FCompiler,
  78. FCompilerVersion,
  79. FLocalInstallDir,
  80. FGlobalInstallDir : String;
  81. FCompilerCPU: TCPU;
  82. FCompilerOS: TOS;
  83. function GetOptString(Index: integer): String;
  84. procedure SetOptString(Index: integer; const AValue: String);
  85. procedure SetCompilerCPU(const AValue: TCPU);
  86. procedure SetCompilerOS(const AValue: TOS);
  87. Public
  88. Constructor Create;
  89. Procedure InitCompilerDefaults;
  90. Procedure LoadCompilerFromFile(const AFileName : String);
  91. Procedure SaveCompilerToFile(const AFileName : String);
  92. procedure LogValues(const ACfgName:string);
  93. Property Dirty : Boolean Read FDirty;
  94. Property ConfigVersion : Integer read FConfigVersion;
  95. Function LocalUnitDir:string;
  96. Function GlobalUnitDir:string;
  97. Published
  98. Property Compiler : String Index 1 Read GetOptString Write SetOptString;
  99. Property CompilerTarget : String Index 2 Read GetOptString Write SetOptString;
  100. Property CompilerVersion : String Index 3 Read GetOptString Write SetOptString;
  101. Property GlobalInstallDir : String Index 4 Read GetOptString Write SetOptString;
  102. Property LocalInstallDir : String Index 5 Read GetOptString Write SetOptString;
  103. Property CompilerOS : TOS Read FCompilerOS Write SetCompilerOS;
  104. Property CompilerCPU : TCPU Read FCompilerCPU Write SetCompilerCPU;
  105. end;
  106. var
  107. GlobalOptions : TGlobalOptions;
  108. CompilerOptions : TCompilerOptions;
  109. FPMakeCompilerOptions : TCompilerOptions;
  110. Implementation
  111. uses
  112. pkgglobals,
  113. pkgmessages;
  114. Const
  115. DefaultMirrorsURL = 'http://www.freepascal.org/repository/'+MirrorsFileName;
  116. {$ifdef localrepository}
  117. DefaultRemoteRepository = 'file://'+{$I %HOME%}+'/repository/';
  118. {$else}
  119. DefaultRemoteRepository = 'auto';
  120. {$endif}
  121. // ini file keys
  122. SDefaults = 'Defaults';
  123. // All configs
  124. KeyConfigVersion = 'ConfigVersion';
  125. // Global config
  126. KeyRemoteMirrorsURL = 'RemoteMirrors';
  127. KeyRemoteRepository = 'RemoteRepository';
  128. KeyLocalRepository = 'LocalRepository';
  129. KeyArchivesDir = 'ArchivesDir';
  130. KeyBuildDir = 'BuildDir';
  131. KeyCompilerConfigDir = 'CompilerConfigDir';
  132. KeyCompilerConfig = 'CompilerConfig';
  133. KeyFPMakeCompilerConfig = 'FPMakeCompilerConfig';
  134. KeyDownloader = 'Downloader';
  135. // Compiler dependent config
  136. KeyGlobalInstallDir = 'GlobalInstallDir';
  137. KeyLocalInstallDir = 'LocalInstallDir';
  138. KeyCompiler = 'Compiler' ;
  139. KeyCompilerOS = 'OS';
  140. KeyCompilerCPU = 'CPU';
  141. KeyCompilerVersion = 'Version';
  142. {*****************************************************************************
  143. TGlobalOptions
  144. *****************************************************************************}
  145. constructor TGlobalOptions.Create;
  146. begin
  147. InitGlobalDefaults;
  148. end;
  149. function TGlobalOptions.GetOptString(Index: integer): String;
  150. begin
  151. Case Index of
  152. 0 : Result:=FRemoteMirrorsURL;
  153. 2 : Result:=FRemoteRepository;
  154. 3 : Result:=FLocalRepository;
  155. 4 : Result:=FBuildDir;
  156. 5 : Result:=FArchivesDir;
  157. 6 : Result:=FCompilerConfigDir;
  158. 8 : Result:=FDefaultCompilerConfig;
  159. 9 : Result:=FFPMakeCompilerConfig;
  160. 10 : Result:=FDownloader;
  161. else
  162. Error('Unknown option');
  163. end;
  164. end;
  165. procedure TGlobalOptions.SetOptString(Index: integer; const AValue: String);
  166. begin
  167. If AValue=GetOptString(Index) then
  168. Exit;
  169. Case Index of
  170. 1 : FRemoteMirrorsURL:=AValue;
  171. 2 : FRemoteRepository:=AValue;
  172. 3 : FLocalRepository:=AValue;
  173. 4 : FBuildDir:=FixPath(AValue);
  174. 5 : FArchivesDir:=FixPath(AValue);
  175. 6 : FCompilerConfigDir:=FixPath(AValue);
  176. 8 : FDefaultCompilerConfig:=AValue;
  177. 9 : FFPMakeCompilerConfig:=AValue;
  178. 10 : FDownloader:=AValue;
  179. else
  180. Error('Unknown option');
  181. end;
  182. FDirty:=True;
  183. end;
  184. function TGlobalOptions.LocalPackagesFile:string;
  185. begin
  186. Result:=FLocalRepository+PackagesFileName;
  187. end;
  188. function TGlobalOptions.LocalMirrorsFile:string;
  189. begin
  190. Result:=FLocalRepository+MirrorsFileName;
  191. end;
  192. function TGlobalOptions.LocalVersionsFile(const ACompilerConfig:String):string;
  193. begin
  194. Result:=FLocalRepository+Format(VersionsFileName,[ACompilerConfig]);
  195. end;
  196. Procedure TGlobalOptions.InitGlobalDefaults;
  197. begin
  198. FConfigVersion:=CurrentConfigVersion;
  199. // Retrieve Local fppkg directory
  200. {$ifdef unix}
  201. if IsSuperUser then
  202. begin
  203. if DirectoryExists('/usr/local/lib/fpc') then
  204. FLocalRepository:='/usr/local/lib/fpc/fppkg/'
  205. else
  206. FLocalRepository:='/usr/lib/fpc/fppkg/';
  207. end
  208. else
  209. FLocalRepository:=IncludeTrailingPathDelimiter(GetEnvironmentVariable('HOME'))+'.fppkg/';
  210. {$else}
  211. FLocalRepository:=IncludeTrailingPathDelimiter(GetAppConfigDir(IsSuperUser));
  212. {$endif}
  213. // Directories
  214. FBuildDir:=FLocalRepository+'build'+PathDelim;
  215. FArchivesDir:=FLocalRepository+'archives'+PathDelim;
  216. FCompilerConfigDir:=FLocalRepository+'config'+PathDelim;
  217. // Remote
  218. FRemoteMirrorsURL:=DefaultMirrorsURL;
  219. FRemoteRepository:=DefaultRemoteRepository;
  220. // Other config
  221. FDefaultCompilerConfig:='default';
  222. FFPMakeCompilerConfig:='default';
  223. // Downloader
  224. {$if defined(unix) or defined(windows)}
  225. FDownloader:='lnet';
  226. {$else}
  227. FDownloader:='base';
  228. {$endif}
  229. // Parameter defaults
  230. FCompilerConfig:=FDefaultCompilerConfig;
  231. FInstallGlobal:=False;
  232. FRecoveryMode:=False;
  233. FAllowBroken:=False;
  234. end;
  235. procedure TGlobalOptions.LoadGlobalFromFile(const AFileName: String);
  236. Var
  237. Ini : TMemIniFile;
  238. begin
  239. try
  240. Ini:=TMemIniFile.Create(AFileName);
  241. With Ini do
  242. begin
  243. FConfigVersion:=ReadInteger(SDefaults,KeyConfigVersion,0);
  244. if (FConfigVersion<>CurrentConfigVersion) then
  245. begin
  246. Log(vlDebug,SLogUpgradingConfig,[AFileName]);
  247. FDirty:=true;
  248. if FConfigVersion<1 then
  249. begin
  250. FRemoteRepository:='auto';
  251. end;
  252. if FConfigVersion<3 then
  253. begin
  254. // Directories
  255. FBuildDir:=FLocalRepository+'build'+PathDelim;
  256. FArchivesDir:=FLocalRepository+'archives'+PathDelim;
  257. FCompilerConfigDir:=FLocalRepository+'config'+PathDelim;
  258. end;
  259. if (FConfigVersion>CurrentConfigVersion) then
  260. Error(SErrUnsupportedConfigVersion,[AFileName]);
  261. end;
  262. FRemoteMirrorsURL:=ReadString(SDefaults,KeyRemoteMirrorsURL,FRemoteMirrorsURL);
  263. FRemoteRepository:=ReadString(SDefaults,KeyRemoteRepository,FRemoteRepository);
  264. FLocalRepository:=ReadString(SDefaults,KeyLocalRepository,FLocalRepository);
  265. FBuildDir:=FixPath(ReadString(SDefaults,KeyBuildDir,FBuildDir));
  266. FArchivesDir:=FixPath(ReadString(SDefaults,KeyArchivesDir,FArchivesDir));
  267. FCompilerConfigDir:=FixPath(ReadString(SDefaults,KeyCompilerConfigDir,FCompilerConfigDir));
  268. FDefaultCompilerConfig:=ReadString(SDefaults,KeyCompilerConfig,FDefaultCompilerConfig);
  269. FFPMakeCompilerConfig:=ReadString(SDefaults,KeyFPMakeCompilerConfig,FFPMakeCompilerConfig);
  270. FDownloader:=ReadString(SDefaults,KeyDownloader,FDownloader);
  271. end;
  272. finally
  273. Ini.Free;
  274. end;
  275. end;
  276. procedure TGlobalOptions.SaveGlobalToFile(const AFileName: String);
  277. Var
  278. Ini : TIniFile;
  279. begin
  280. if FileExists(AFileName) then
  281. BackupFile(AFileName);
  282. try
  283. Ini:=TIniFile.Create(AFileName);
  284. With Ini do
  285. begin
  286. WriteInteger(SDefaults,KeyConfigVersion,CurrentConfigVersion);
  287. WriteString(SDefaults,KeyBuildDir,FBuildDir);
  288. WriteString(SDefaults,KeyArchivesDir,FArchivesDir);
  289. WriteString(SDefaults,KeyCompilerConfigDir,FCompilerConfigDir);
  290. WriteString(SDefaults,KeyLocalRepository,FLocalRepository);
  291. WriteString(SDefaults,KeyRemoteMirrorsURL,FRemoteMirrorsURL);
  292. WriteString(SDefaults,KeyRemoteRepository,FRemoteRepository);
  293. WriteString(SDefaults,KeyCompilerConfig,FDefaultCompilerConfig);
  294. WriteString(SDefaults,KeyFPMakeCompilerConfig,FFPMakeCompilerConfig);
  295. WriteString(SDefaults,KeyDownloader,FDownloader);
  296. FDirty:=False;
  297. end;
  298. Ini.UpdateFile;
  299. finally
  300. Ini.Free;
  301. end;
  302. end;
  303. procedure TGlobalOptions.LogValues;
  304. begin
  305. Log(vlDebug,SLogGlobalCfgHeader);
  306. Log(vlDebug,SLogGlobalCfgRemoteMirrorsURL,[FRemoteMirrorsURL]);
  307. Log(vlDebug,SLogGlobalCfgRemoteRepository,[FRemoteRepository]);
  308. Log(vlDebug,SLogGlobalCfgLocalRepository,[FLocalRepository]);
  309. Log(vlDebug,SLogGlobalCfgBuildDir,[FBuildDir]);
  310. Log(vlDebug,SLogGlobalCfgArchivesDir,[FArchivesDir]);
  311. Log(vlDebug,SLogGlobalCfgCompilerConfigDir,[FCompilerConfigDir]);
  312. Log(vlDebug,SLogGlobalCfgDefaultCompilerConfig,[FDefaultCompilerConfig]);
  313. Log(vlDebug,SLogGlobalCfgFPMakeCompilerConfig,[FFPMakeCompilerConfig]);
  314. Log(vlDebug,SLogGlobalCfgDownloader,[FDownloader]);
  315. end;
  316. {*****************************************************************************
  317. TCompilerOptions
  318. *****************************************************************************}
  319. constructor TCompilerOptions.Create;
  320. begin
  321. end;
  322. function TCompilerOptions.GetOptString(Index: integer): String;
  323. begin
  324. Case Index of
  325. 1 : Result:=FCompiler;
  326. 2 : Result:=MakeTargetString(CompilerCPU,CompilerOS);
  327. 3 : Result:=FCompilerVersion;
  328. 4 : Result:=FGlobalInstallDir;
  329. 5 : Result:=FLocalInstallDir;
  330. else
  331. Error('Unknown option');
  332. end;
  333. end;
  334. procedure TCompilerOptions.SetOptString(Index: integer; const AValue: String);
  335. begin
  336. If AValue=GetOptString(Index) then
  337. Exit;
  338. Case Index of
  339. 1 : FCompiler:=AValue;
  340. 2 : StringToCPUOS(AValue,FCompilerCPU,FCompilerOS);
  341. 3 : FCompilerVersion:=AValue;
  342. 4 : FGlobalInstallDir:=FixPath(AValue);
  343. 5 : FLocalInstallDir:=FixPath(AValue);
  344. else
  345. Error('Unknown option');
  346. end;
  347. FDirty:=True;
  348. end;
  349. procedure TCompilerOptions.SetCompilerCPU(const AValue: TCPU);
  350. begin
  351. if FCompilerCPU=AValue then
  352. exit;
  353. FCompilerCPU:=AValue;
  354. FDirty:=True;
  355. end;
  356. procedure TCompilerOptions.SetCompilerOS(const AValue: TOS);
  357. begin
  358. if FCompilerOS=AValue then
  359. exit;
  360. FCompilerOS:=AValue;
  361. FDirty:=True;
  362. end;
  363. function TCompilerOptions.LocalUnitDir:string;
  364. begin
  365. if FLocalInstallDir<>'' then
  366. result:=FLocalInstallDir+'units'+PathDelim+CompilerTarget+PathDelim
  367. else
  368. result:='';
  369. end;
  370. function TCompilerOptions.GlobalUnitDir:string;
  371. begin
  372. if FGlobalInstallDir<>'' then
  373. result:=FGlobalInstallDir+'units'+PathDelim+CompilerTarget+PathDelim
  374. else
  375. result:='';
  376. end;
  377. procedure TCompilerOptions.InitCompilerDefaults;
  378. var
  379. infoSL : TStringList;
  380. begin
  381. FConfigVersion:=CurrentConfigVersion;
  382. FCompiler:=ExeSearch('fpc'+ExeExt,GetEnvironmentVariable('PATH'));
  383. if FCompiler='' then
  384. Raise EPackagerError.Create(SErrMissingFPC);
  385. // Detect compiler version/target from -i option
  386. infosl:=TStringList.Create;
  387. infosl.Delimiter:=' ';
  388. infosl.DelimitedText:=GetCompilerInfo(FCompiler,'-iVTPTO');
  389. if infosl.Count<>3 then
  390. Raise EPackagerError.Create(SErrInvalidFPCInfo);
  391. FCompilerVersion:=infosl[0];
  392. FCompilerCPU:=StringToCPU(infosl[1]);
  393. FCompilerOS:=StringToOS(infosl[2]);
  394. // Temporary hack to workaround bug in fpc.exe that doesn't support spaces
  395. // We retrieve the real binary
  396. if FCompilerVersion='2.2.0' then
  397. FCompiler:=GetCompilerInfo(FCompiler,'-PB');
  398. Log(vlDebug,SLogDetectedCompiler,[FCompiler,FCompilerVersion,MakeTargetString(FCompilerCPU,FCompilerOS)]);
  399. // Use the same algorithm as the compiler, see options.pas
  400. {$ifdef Unix}
  401. FGlobalInstallDir:=FixPath(GetEnvironmentVariable('FPCDIR'));
  402. if FGlobalInstallDir='' then
  403. begin
  404. FGlobalInstallDir:='/usr/local/lib/fpc/'+FCompilerVersion+'/';
  405. if not DirectoryExists(FGlobalInstallDir) and
  406. DirectoryExists('/usr/lib/fpc/'+FCompilerVersion) then
  407. FGlobalInstallDir:='/usr/lib/fpc/'+FCompilerVersion+'/';
  408. end;
  409. {$else unix}
  410. FGlobalInstallDir:=FixPath(GetEnvironmentVariable('FPCDIR'));
  411. if FGlobalInstallDir='' then
  412. begin
  413. FGlobalInstallDir:=ExtractFilePath(FCompiler)+'../';
  414. if not(DirectoryExists(FGlobalInstallDir+'/units')) and
  415. not(DirectoryExists(FGlobalInstallDir+'/rtl')) then
  416. FGlobalInstallDir:=FGlobalInstallDir+'../';
  417. end;
  418. FGlobalInstallDir:=ExpandFileName(FGlobalInstallDir);
  419. {$endif unix}
  420. Log(vlDebug,SLogDetectedFPCDIR,['global',FGlobalInstallDir]);
  421. // User writable install directory
  422. if not IsSuperUser then
  423. begin
  424. FLocalInstallDir:=GlobalOptions.LocalRepository+'lib'+PathDelim+FCompilerVersion+PathDelim;
  425. Log(vlDebug,SLogDetectedFPCDIR,['local',FLocalInstallDir]);
  426. end;
  427. end;
  428. procedure TCompilerOptions.LoadCompilerFromFile(const AFileName: String);
  429. Var
  430. Ini : TMemIniFile;
  431. begin
  432. try
  433. Ini:=TMemIniFile.Create(AFileName);
  434. With Ini do
  435. begin
  436. FConfigVersion:=ReadInteger(SDefaults,KeyConfigVersion,0);
  437. if (FConfigVersion<>CurrentConfigVersion) then
  438. begin
  439. Log(vlDebug,SLogUpgradingConfig,[AFileName]);
  440. FDirty:=true;
  441. if (FConfigVersion>CurrentConfigVersion) then
  442. Error(SErrUnsupportedConfigVersion,[AFileName]);
  443. end;
  444. FGlobalInstallDir:=FixPath(ReadString(SDefaults,KeyGlobalInstallDir,FGlobalInstallDir));
  445. FLocalInstallDir:=FixPath(ReadString(SDefaults,KeyLocalInstallDir,FLocalInstallDir));
  446. FCompiler:=ReadString(SDefaults,KeyCompiler,FCompiler);
  447. FCompilerOS:=StringToOS(ReadString(SDefaults,KeyCompilerOS,OSToString(CompilerOS)));
  448. FCompilerCPU:=StringToCPU(ReadString(SDefaults,KeyCompilerCPU,CPUtoString(CompilerCPU)));
  449. FCompilerVersion:=ReadString(SDefaults,KeyCompilerVersion,FCompilerVersion);
  450. end;
  451. finally
  452. Ini.Free;
  453. end;
  454. end;
  455. procedure TCompilerOptions.SaveCompilerToFile(const AFileName: String);
  456. Var
  457. Ini : TIniFile;
  458. begin
  459. if FileExists(AFileName) then
  460. BackupFile(AFileName);
  461. try
  462. Ini:=TIniFile.Create(AFileName);
  463. With Ini do
  464. begin
  465. WriteInteger(SDefaults,KeyConfigVersion,CurrentConfigVersion);
  466. WriteString(SDefaults,KeyGlobalInstallDir,FGlobalInstallDir);
  467. WriteString(SDefaults,KeyLocalInstallDir,FLocalInstallDir);
  468. WriteString(SDefaults,KeyCompiler,FCompiler);
  469. WriteString(SDefaults,KeyCompilerOS,OSToString(CompilerOS));
  470. WriteString(SDefaults,KeyCompilerCPU,CPUtoString(CompilerCPU));
  471. WriteString(SDefaults,KeyCompilerVersion,FCompilerVersion);
  472. FDirty:=False;
  473. end;
  474. Ini.UpdateFile;
  475. finally
  476. Ini.Free;
  477. end;
  478. end;
  479. procedure TCompilerOptions.LogValues(const ACfgName:string);
  480. begin
  481. Log(vlDebug,SLogCompilerCfgHeader,[ACfgName]);
  482. Log(vlDebug,SLogCompilerCfgCompiler,[FCompiler]);
  483. Log(vlDebug,SLogCompilerCfgTarget,[MakeTargetString(CompilerCPU,CompilerOS)]);
  484. Log(vlDebug,SLogCompilerCfgVersion,[FCompilerVersion]);
  485. Log(vlDebug,SLogCompilerCfgGlobalInstallDir,[FGlobalInstallDir]);
  486. Log(vlDebug,SLogCompilerCfgLocalInstallDir,[FLocalInstallDir]);
  487. end;
  488. initialization
  489. GlobalOptions:=TGlobalOptions.Create;
  490. CompilerOptions:=TCompilerOptions.Create;
  491. FPMakeCompilerOptions:=TCompilerOptions.Create;
  492. finalization
  493. FreeAndNil(GlobalOptions);
  494. FreeAndNil(CompilerOptions);
  495. FreeAndNil(FPMakeCompilerOptions);
  496. end.