Changeset 9 for trunk/UInstance.pas
- Timestamp:
- Feb 12, 2011, 12:33:04 PM (13 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svn:ignore
-
old new 4 4 Source 5 5 Instance 6 FreePascalManager
-
- Property svn:ignore
-
trunk/UInstance.pas
r8 r9 30 30 procedure UpdateFPCConfig; 31 31 function GetPath: string; 32 function GetBinPath: string; 32 33 property Downloaded: Boolean read GetDownloaded; 33 34 property Compiled: Boolean read GetCompiled; … … 61 62 function TInstance.GetCompiled: Boolean; 62 63 begin 63 Result := FileExistsUTF8(GetPath + DirectorySeparator + FPCSource.ProjectShortName + 64 DirectorySeparator + 'bin' + DirectorySeparator + 65 MainForm.Platform + DirectorySeparator + FPCSource.GetExecutableFile); 64 Result := FileExistsUTF8(GetBinPath + DirectorySeparator + FPCSource.GetExecutableFile); 66 65 if Assigned(IDESource) then Result := Result and 67 66 FileExistsUTF8(GetPath + DirectorySeparator + IDESource.ProjectShortName + … … 78 77 procedure TInstance.Build; 79 78 begin 80 OperationProgressForm.Environment := 'path=' + MainForm.GetBinUtilsDir; 79 {$IFDEF Windows} 80 OperationProgressForm.Environment := 'PATH=' + MainForm.GetBinUtilsDir; 81 {$ENDIF} 81 82 OperationProgressForm.Path := GetPath + DirectorySeparator + FPCSource.ProjectShortName; 82 83 OperationProgressForm.CommandLine := 'make clean all PP="' + 83 MainForm.Get BinUtilsDir + DirectorySeparator + 'fpc"';84 MainForm.GetCompilerPath + '"'; 84 85 OperationProgressForm.ShowModal; 85 86 86 OperationProgressForm.Environment := 'path=' + MainForm.GetBinUtilsDir; 87 {$IFDEF Windows} 88 OperationProgressForm.Environment := 'PATH=' + MainForm.GetBinUtilsDir; 89 {$ENDIF} 87 90 OperationProgressForm.Path := GetPath + DirectorySeparator + FPCSource.ProjectShortName; 88 OperationProgressForm.CommandLine := 'make install PREFIX= "' +89 GetPath + DirectorySeparator + FPCSource.ProjectShortName + ' "' +90 ' PP= "' + MainForm.GetBinUtilsDir + DirectorySeparator + 'fpc"';91 OperationProgressForm.CommandLine := 'make install PREFIX=' + 92 GetPath + DirectorySeparator + FPCSource.ProjectShortName + '' + 93 ' PP=' + MainForm.GetCompilerPath + ''; 91 94 OperationProgressForm.ShowModal; 92 95 93 96 if Assigned(IDESource) then begin 94 OperationProgressForm.Environment := 'path=' + MainForm.GetBinUtilsDir; 97 {$IFDEF Windows} 98 OperationProgressForm.Environment := 'PATH=' + MainForm.GetBinUtilsDir; 99 {$ENDIF} 95 100 OperationProgressForm.Path := GetPath + DirectorySeparator + IDESource.ProjectShortName; 96 101 OperationProgressForm.CommandLine := … … 124 129 Config: TStringList; 125 130 ConfigFileName: string; 131 ConfigPath: string; 126 132 begin 127 ConfigFileName := GetPath + DirectorySeparator + IDESource.ProjectShortName + 128 DirectorySeparator + 'config' + DirectorySeparator + 'environmentoptions.xml'; 133 ConfigPath := GetPath + DirectorySeparator + IDESource.ProjectShortName + 134 DirectorySeparator + 'config'; 135 ForceDirectoriesUTF8(ConfigPath); 136 ConfigFileName := ConfigPath + DirectorySeparator + 'environmentoptions.xml'; 129 137 if not FileExistsUTF8(ConfigFileName) then 130 138 try … … 135 143 Config.Text := StringReplace(Config.Text, '%BaseDir%', MainForm.GetBaseDir, [rfReplaceAll]); 136 144 Config.Text := StringReplace(Config.Text, '%LazarusDir%', GetPath + DirectorySeparator + IDESource.ProjectShortName, [rfReplaceAll]); 137 Config.Text := StringReplace(Config.Text, '%FPCPlatform%', MainForm.Platform, [rfReplaceAll]); 138 Config.Text := StringReplace(Config.Text, '%Temp%', GetEnvironmentVariableUTF8('Temp'), [rfReplaceAll]); 145 Config.Text := StringReplace(Config.Text, '%FPCCompiler%', GetBinPath + DirectorySeparator + FPCSource.ExecutableFile, [rfReplaceAll]); 146 Config.Text := StringReplace(Config.Text, '%Make%', MainForm.GetBinUtilsDir + DirectorySeparator + 'make', [rfReplaceAll]); 147 {$IFDEF Windows} 148 Config.Text := StringReplace(Config.Text, '%Temp%', GetEnvironmentVariableUTF8('TEMP'), [rfReplaceAll]); 149 Config.Text := StringReplace(Config.Text, '%GDB%', MainForm.GetBinUtilsDir + DirectorySeparator + 'mingw\gdb.exe', [rfReplaceAll]); 150 {$ENDIF} 151 {$IFDEF Linux} 152 Config.Text := StringReplace(Config.Text, '%Temp%', '/tmp', [rfReplaceAll]); 153 Config.Text := StringReplace(Config.Text, '%GDB%', '/usr/bin/gdb', [rfReplaceAll]); 154 {$ENDIF} 139 155 Config.SaveToFile(ConfigFileName); 140 156 finally … … 153 169 Config.Text := StringReplace(Config.Text, '$(FPCDir)', GetPath + 154 170 DirectorySeparator + FPCSource.ProjectShortName, [rfReplaceAll]); 155 Config.SaveToFile(GetPath + DirectorySeparator + FPCSource.ProjectShortName + 156 DirectorySeparator + 'bin' + DirectorySeparator + 157 MainForm.Platform + DirectorySeparator + 'fpc.cfg'); 171 Config.SaveToFile(GetBinPath + DirectorySeparator + 'fpc.cfg'); 158 172 finally 159 173 Config.Free; … … 167 181 end; 168 182 183 function TInstance.GetBinPath: string; 184 begin 185 Result := GetPath + DirectorySeparator + FPCSource.ProjectShortName + 186 DirectorySeparator + 'bin'; 187 {$IFDEF Windows} 188 Result := Result + DirectorySeparator + MainForm.Platform; 189 {$ENDIF} 190 end; 191 169 192 end. 170 193
Note:
See TracChangeset
for help on using the changeset viewer.