fpcompil.pas 36 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310
  1. {
  2. $Id$
  3. This file is part of the Free Pascal Integrated Development Environment
  4. Copyright (c) 1998 by Berczi Gabor
  5. Compiler call 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. {$i globdir.inc}
  13. unit FPCompil;
  14. interface
  15. { don't redir under linux, because all stdout (also from the ide!) will
  16. then be redired (PFV) }
  17. { this should work now correctly because
  18. RedirDisableAll and RedirEnableAll function are added in fpredir (PM) }
  19. { $define VERBOSETXT}
  20. {$mode objfpc}
  21. uses
  22. Objects,
  23. FInput,
  24. Drivers,Views,Dialogs,
  25. WUtils,WViews,WCEdit,
  26. FPSymbol,
  27. FPViews;
  28. type
  29. TCompileMode = (cBuild,cMake,cCompile,cRun);
  30. type
  31. PCompilerMessage = ^TCompilerMessage;
  32. TCompilerMessage = object(TMessageItem)
  33. function GetText(MaxLen: Sw_Integer): String; virtual;
  34. end;
  35. PCompilerMessageListBox = ^TCompilerMessageListBox;
  36. TCompilerMessageListBox = object(TMessageListBox)
  37. function GetPalette: PPalette; virtual;
  38. procedure SelectFirstError;
  39. end;
  40. PCompilerMessageWindow = ^TCompilerMessageWindow;
  41. TCompilerMessageWindow = object(TFPWindow)
  42. constructor Init;
  43. procedure HandleEvent(var Event: TEvent); virtual;
  44. function GetPalette: PPalette; virtual;
  45. procedure Close;virtual;
  46. destructor Done; virtual;
  47. procedure SizeLimits(var Min, Max: TPoint); virtual;
  48. procedure AddMessage(AClass: longint;const Msg, Module: string; Line, Column: longint);
  49. procedure ClearMessages;
  50. constructor Load(var S: TStream);
  51. procedure Store(var S: TStream);
  52. procedure SetState(AState: Word; Enable: Boolean); virtual;
  53. procedure UpdateCommands; virtual;
  54. private
  55. {CompileShowed : boolean;}
  56. {Mode : TCompileMode;}
  57. MsgLB : PCompilerMessageListBox;
  58. {CurrST,
  59. InfoST : PColorStaticText;}
  60. end;
  61. PCompilerStatusDialog = ^TCompilerStatusDialog;
  62. TCompilerStatusDialog = object(TCenterDialog)
  63. ST : PAdvancedStaticText;
  64. KeyST : PColorStaticText;
  65. constructor Init;
  66. destructor Done;virtual;
  67. procedure Update;
  68. end;
  69. TFPInputFile = class(tinputfile)
  70. constructor Create(AEditor: PFileEditor);
  71. protected
  72. function fileopen(const filename: string): boolean; override;
  73. function fileseek(pos: longint): boolean; override;
  74. function fileread(var databuf; maxsize: longint): longint; override;
  75. function fileeof: boolean; override;
  76. function fileclose: boolean; override;
  77. private
  78. Editor: PFileEditor;
  79. S: PStream;
  80. end;
  81. const
  82. CompilerMessageWindow : PCompilerMessageWindow = nil;
  83. CompilerStatusDialog : PCompilerStatusDialog = nil;
  84. CompileStamp : longint = 0;
  85. RestartingDebugger : boolean = false;
  86. procedure DoCompile(Mode: TCompileMode);
  87. function NeedRecompile(Mode :TCompileMode; verbose : boolean): boolean;
  88. procedure ParseUserScreen;
  89. procedure RegisterFPCompile;
  90. const
  91. CompilingHiddenFile : PSourceWindow = nil;
  92. implementation
  93. uses
  94. {$ifdef Unix}
  95. {$ifdef VER1_0}
  96. Linux,
  97. {$else}
  98. Unix, BaseUnix,
  99. {$endif}
  100. {$endif}
  101. {$ifdef go32v2}
  102. dpmiexcp,
  103. {$endif}
  104. {$ifdef win32}
  105. signals,
  106. {$endif}
  107. {$ifdef HasSignal}
  108. fpcatch,
  109. {$endif HasSignal}
  110. Dos,
  111. {$ifdef fpc}
  112. Video,
  113. {$endif fpc}
  114. StdDlg,App,tokens,
  115. FVConsts,
  116. CompHook, Compiler, systems, browcol,
  117. WEditor,
  118. FPString,FPRedir,FPDesk,
  119. FPUsrScr,FPHelp,
  120. {$ifndef NODEBUG}FPDebug,{$endif}
  121. FPConst,FPVars,FPUtils,
  122. FPCodCmp,FPIntf,FPSwitch;
  123. {$ifndef NOOBJREG}
  124. const
  125. RCompilerMessageListBox: TStreamRec = (
  126. ObjType: 1211;
  127. VmtLink: Ofs(TypeOf(TCompilerMessageListBox)^);
  128. Load: @TCompilerMessageListBox.Load;
  129. Store: @TCompilerMessageListBox.Store
  130. );
  131. RCompilerMessageWindow: TStreamRec = (
  132. ObjType: 1212;
  133. VmtLink: Ofs(TypeOf(TCompilerMessageWindow)^);
  134. Load: @TCompilerMessageWindow.Load;
  135. Store: @TCompilerMessageWindow.Store
  136. );
  137. {$endif}
  138. procedure ParseUserScreen;
  139. var
  140. y : longint;
  141. Text,Attr : String;
  142. DisplayCompilerWindow : boolean;
  143. cc: integer;
  144. procedure SearchBackTrace;
  145. var AText,ModuleName,st : String;
  146. row : longint;
  147. begin
  148. if pos(' 0x',Text)=1 then
  149. begin
  150. AText:=Text;
  151. Delete(Text,1,10);
  152. While pos(' ',Text)=1 do
  153. Delete(Text,1,1);
  154. if pos('of ',Text)>0 then
  155. begin
  156. ModuleName:=Copy(Text,pos('of ',Text)+3,255);
  157. While ModuleName[Length(ModuleName)]=' ' do
  158. Delete(ModuleName,Length(ModuleName),1);
  159. end
  160. else
  161. ModuleName:='';
  162. if pos('line ',Text)>0 then
  163. begin
  164. Text:=Copy(Text,Pos('line ',Text)+5,255);
  165. st:=Copy(Text,1,Pos(' ',Text)-1);
  166. Val(st,row,cc);
  167. end
  168. else
  169. row:=0;
  170. CompilerMessageWindow^.AddMessage(V_Fatal,AText
  171. ,ModuleName,row,1);
  172. DisplayCompilerWindow:=true;
  173. end;
  174. end;
  175. procedure InsertInMessages(Const TypeStr : String;_Type : longint;EnableDisplay : boolean);
  176. var p,p2,col,row : longint;
  177. St,ModuleName : string;
  178. begin
  179. p:=pos(TypeStr,Text);
  180. p2:=Pos('(',Text);
  181. if (p>0) and (p2>0) and (p2<p) then
  182. begin
  183. ModuleName:=Copy(Text,1,p2-1);
  184. st:=Copy(Text,p2+1,255);
  185. Val(Copy(st,1,pos(',',st)-1),row,cc);
  186. st:=Copy(st,Pos(',',st)+1,255);
  187. Val(Copy(st,1,pos(')',st)-1),col,cc);
  188. CompilerMessageWindow^.AddMessage(_type,Copy(Text,pos(':',Text)+1,255)
  189. ,ModuleName,row,col);
  190. If EnableDisplay then
  191. DisplayCompilerWindow:=true;
  192. end;
  193. end;
  194. begin
  195. if not assigned(UserScreen) then
  196. exit;
  197. DisplayCompilerWindow:=false;
  198. PushStatus('Parsing User Screen');
  199. CompilerMessageWindow^.Lock;
  200. for Y:=0 to UserScreen^.GetHeight do
  201. begin
  202. UserScreen^.GetLine(Y,Text,Attr);
  203. SearchBackTrace;
  204. InsertInMessages(' Fatal:',v_Fatal,true);
  205. InsertInMessages(' Error:',v_Error,true);
  206. InsertInMessages(' Warning:',v_Warning,false);
  207. InsertInMessages(' Note:',v_Note,false);
  208. InsertInMessages(' Info:',v_Info,false);
  209. InsertInMessages(' Hint:',v_Hint,false);
  210. end;
  211. if DisplayCompilerWindow then
  212. begin
  213. if not CompilerMessageWindow^.GetState(sfVisible) then
  214. CompilerMessageWindow^.Show;
  215. CompilerMessageWindow^.MakeFirst;
  216. CompilerMessageWindow^.MsgLB^.SelectFirstError;
  217. end;
  218. CompilerMessageWindow^.UnLock;
  219. PopStatus;
  220. end;
  221. {*****************************************************************************
  222. TCompilerMessage
  223. *****************************************************************************}
  224. function TCompilerMessage.GetText(MaxLen: Sw_Integer): String;
  225. var
  226. ClassS: string[20];
  227. S: string;
  228. begin
  229. case TClass and V_LevelMask of
  230. V_Fatal : ClassS:=msg_class_Fatal;
  231. V_Error : ClassS:=msg_class_Error;
  232. V_Normal : ClassS:=msg_class_Normal;
  233. V_Warning : ClassS:=msg_class_Warning;
  234. V_Note : ClassS:=msg_class_Note;
  235. V_Hint : ClassS:=msg_class_Hint;
  236. {$ifdef VERBOSETXT}
  237. V_Conditional : ClassS:=msg_class_conditional;
  238. V_Info : ClassS:=msg_class_info;
  239. V_Status : ClassS:=msg_class_status;
  240. V_Used : ClassS:=msg_class_used;
  241. V_Tried : ClassS:=msg_class_tried;
  242. V_Debug : ClassS:=msg_class_debug;
  243. else
  244. ClassS:='???';
  245. {$endif}
  246. else
  247. ClassS:='';
  248. end;
  249. if ClassS<>'' then
  250. ClassS:=RExpand(ClassS,0)+': ';
  251. if assigned(Module) and
  252. ((TClass and V_LineInfo)=V_LineInfo) then
  253. begin
  254. if Row>0 then
  255. begin
  256. if Col>0 then
  257. S:=NameAndExtOf(Module^)+'('+IntToStr(Row)+','+IntToStr(Col)+') '+ClassS
  258. else
  259. S:=NameAndExtOf(Module^)+'('+IntToStr(Row)+') '+ClassS;
  260. end
  261. else
  262. S:=NameAndExtOf(Module^)+'('+IntToStr(Row)+') '+ClassS
  263. end
  264. else
  265. S:=ClassS;
  266. if assigned(Text) then
  267. S:=S+Text^;
  268. if length(S)>MaxLen then
  269. S:=copy(S,1,MaxLen-2)+'..';
  270. GetText:=S;
  271. end;
  272. {*****************************************************************************
  273. TCompilerMessageListBox
  274. *****************************************************************************}
  275. function TCompilerMessageListBox.GetPalette: PPalette;
  276. const
  277. P: string[length(CBrowserListBox)] = CBrowserListBox;
  278. begin
  279. GetPalette:=@P;
  280. end;
  281. procedure TCompilerMessageListBox.SelectFirstError;
  282. function IsError(P : PCompilerMessage) : boolean;
  283. begin
  284. IsError:=(P^.TClass and (V_Fatal or V_Error))<>0;
  285. end;
  286. var
  287. P : PCompilerMessage;
  288. begin
  289. P:=List^.FirstThat(@IsError);
  290. If Assigned(P) then
  291. Begin
  292. FocusItem(List^.IndexOf(P));
  293. DrawView;
  294. End;
  295. end;
  296. {*****************************************************************************
  297. TCompilerMessageWindow
  298. *****************************************************************************}
  299. constructor TCompilerMessageWindow.Init;
  300. var R: TRect;
  301. HSB,VSB: PScrollBar;
  302. begin
  303. Desktop^.GetExtent(R);
  304. R.A.Y:=R.B.Y-7;
  305. inherited Init(R,dialog_compilermessages,{SearchFreeWindowNo}wnNoNumber);
  306. HelpCtx:=hcCompilerMessagesWindow;
  307. AutoNumber:=true;
  308. HSB:=StandardScrollBar(sbHorizontal+sbHandleKeyboard);
  309. HSB^.GrowMode:=gfGrowLoY+gfGrowHiX+gfGrowHiY;
  310. Insert(HSB);
  311. VSB:=StandardScrollBar(sbVertical+sbHandleKeyboard);
  312. VSB^.GrowMode:=gfGrowLoX+gfGrowHiX+gfGrowHiY;
  313. Insert(VSB);
  314. GetExtent(R);
  315. R.Grow(-1,-1);
  316. New(MsgLB, Init(R, HSB, VSB));
  317. MsgLB^.GrowMode:=gfGrowHiX+gfGrowHiY;
  318. Insert(MsgLB);
  319. CompilerMessageWindow:=@self;
  320. end;
  321. procedure TCompilerMessageWindow.AddMessage(AClass: longint;const Msg, Module: string; Line, Column: longint);
  322. begin
  323. if (AClass and V_LineInfo)<>V_LineInfo then
  324. Line:=0;
  325. MsgLB^.AddItem(New(PCompilerMessage,Init(AClass, Msg, MsgLB^.AddModuleName(Module), Line, Column)));
  326. if (@Self=CompilerMessageWindow) and ((AClass = V_fatal) or (AClass = V_Error)) then
  327. begin
  328. if not GetState(sfVisible) then
  329. Show;
  330. if Desktop^.First<>PView(CompilerMessageWindow) then
  331. MakeFirst;
  332. end;
  333. end;
  334. procedure TCompilerMessageWindow.ClearMessages;
  335. begin
  336. MsgLB^.Clear;
  337. ReDraw;
  338. end;
  339. {procedure TCompilerMessageWindow.Updateinfo;
  340. begin
  341. if CompileShowed then
  342. begin
  343. InfoST^.SetText(
  344. RExpand(' Main file : '#1#$7f+Copy(SmartPath(MainFile),1,39),40)+#2+
  345. 'Total lines : '#1#$7e+IntToStr(Status.CompiledLines)+#2#13+
  346. RExpand(' Target : '#1#$7f+KillTilde(TargetSwitches^.ItemName(TargetSwitches^.GetCurrSel)),40)+#2+
  347. 'Total errors : '#1#$7e+IntToStr(Status.ErrorCount)
  348. );
  349. if status.currentline>0 then
  350. CurrST^.SetText(' Status: '#1#$7e+status.currentsource+'('+IntToStr(status.currentline)+')'#2)
  351. else
  352. CurrST^.SetText(' Status: '#1#$7e+status.currentsource+#2);
  353. end;
  354. ReDraw;
  355. end;}
  356. procedure TCompilerMessageWindow.HandleEvent(var Event: TEvent);
  357. begin
  358. case Event.What of
  359. evBroadcast :
  360. case Event.Command of
  361. cmListFocusChanged :
  362. if Event.InfoPtr=MsgLB then
  363. Message(Application,evBroadcast,cmClearLineHighlights,@Self);
  364. end;
  365. end;
  366. inherited HandleEvent(Event);
  367. end;
  368. procedure TCompilerMessageWindow.SizeLimits(var Min, Max: TPoint);
  369. begin
  370. inherited SizeLimits(Min,Max);
  371. Min.X:=20;
  372. Min.Y:=4;
  373. end;
  374. procedure TCompilerMessageWindow.Close;
  375. begin
  376. Hide;
  377. end;
  378. function TCompilerMessageWindow.GetPalette: PPalette;
  379. const
  380. S : string[length(CBrowserWindow)] = CBrowserWindow;
  381. begin
  382. GetPalette:=@S;
  383. end;
  384. constructor TCompilerMessageWindow.Load(var S: TStream);
  385. begin
  386. inherited Load(S);
  387. GetSubViewPtr(S,MsgLB);
  388. end;
  389. procedure TCompilerMessageWindow.Store(var S: TStream);
  390. begin
  391. if MsgLB^.List=nil then
  392. MsgLB^.NewList(New(PCollection, Init(100,100)));
  393. inherited Store(S);
  394. PutSubViewPtr(S,MsgLB);
  395. end;
  396. procedure TCompilerMessageWindow.UpdateCommands;
  397. var Active: boolean;
  398. begin
  399. Active:=GetState(sfActive);
  400. SetCmdState(CompileCmds,Active);
  401. Message(Application,evBroadcast,cmCommandSetChanged,nil);
  402. end;
  403. procedure TCompilerMessageWindow.SetState(AState: Word; Enable: Boolean);
  404. var OldState: word;
  405. begin
  406. OldState:=State;
  407. inherited SetState(AState,Enable);
  408. if ((AState and sfActive)<>0) and (((OldState xor State) and sfActive)<>0) then
  409. UpdateCommands;
  410. end;
  411. destructor TCompilerMessageWindow.Done;
  412. begin
  413. CompilerMessageWindow:=nil;
  414. inherited Done;
  415. end;
  416. {****************************************************************************
  417. CompilerStatusDialog
  418. ****************************************************************************}
  419. constructor TCompilerStatusDialog.Init;
  420. var R: TRect;
  421. begin
  422. R.Assign(0,0,50,11);
  423. ClearFormatParams; AddFormatParamStr(KillTilde(SwitchesModeName[SwitchesMode]));
  424. inherited Init(R, FormatStrF(dialog_compilingwithmode, FormatParams));
  425. GetExtent(R); R.B.Y:=11;
  426. R.Grow(-3,-2);
  427. New(ST, Init(R, ''));
  428. Insert(ST);
  429. GetExtent(R); R.B.Y:=11;
  430. R.Grow(-1,-1); R.A.Y:=R.B.Y-1;
  431. New(KeyST, Init(R, '', Blue*16+White+longint($80+Blue*16+White)*256,true));
  432. Insert(KeyST);
  433. { Reset Status infos see bug 1585 }
  434. Fillchar(Status,SizeOf(Status),#0);
  435. end;
  436. destructor TCompilerStatusDialog.Done;
  437. begin
  438. if @Self=CompilerStatusDialog then
  439. CompilerStatusDialog:=nil;
  440. Inherited Done;
  441. end;
  442. procedure TCompilerStatusDialog.Update;
  443. var
  444. StatusS,KeyS: string;
  445. const
  446. MaxFileNameSize = 46;
  447. begin
  448. case CompilationPhase of
  449. cpCompiling :
  450. begin
  451. ClearFormatParams;
  452. if Status.Compiling_current then
  453. begin
  454. AddFormatParamStr(ShrinkPath(SmartPath(Status.Currentsourcepath+Status.CurrentSource),
  455. MaxFileNameSize - Length(msg_compilingfile)));
  456. StatusS:=FormatStrF(msg_compilingfile,FormatParams);
  457. end
  458. else
  459. begin
  460. if Status.CurrentSource='' then
  461. StatusS:=''
  462. else
  463. begin
  464. StatusS:=ShrinkPath(SmartPath(DirAndNameOf(Status.Currentsourcepath+Status.CurrentSource)),
  465. MaxFileNameSize-Length(msg_loadingunit));
  466. AddFormatParamStr(StatusS);
  467. StatusS:=FormatStrF(msg_loadingunit,FormatParams);
  468. end;
  469. end;
  470. KeyS:=msg_hint_pressesctocancel;
  471. end;
  472. cpLinking :
  473. begin
  474. ClearFormatParams;
  475. AddFormatParamStr(ShrinkPath(ExeFile,
  476. MaxFileNameSize-Length(msg_linkingfile)));
  477. StatusS:=FormatStrF(msg_linkingfile,FormatParams);
  478. KeyS:=msg_hint_pleasewait;
  479. end;
  480. cpDone :
  481. begin
  482. StatusS:=msg_compiledone;
  483. KeyS:=msg_hint_compilesuccessfulpressenter;
  484. end;
  485. cpFailed :
  486. begin
  487. StatusS:=msg_failedtocompile;
  488. KeyS:=msg_hint_compilefailed;
  489. end;
  490. cpAborted :
  491. begin
  492. StatusS:=msg_compilationaborted;
  493. KeyS:=msg_hint_compileaborted;
  494. end;
  495. end;
  496. ClearFormatParams;
  497. AddFormatParamStr(ShrinkPath(SmartPath(MainFile),
  498. MaxFileNameSize-Length('Main file: %s')));
  499. AddFormatParamStr(StatusS);
  500. AddFormatParamStr(KillTilde(TargetSwitches^.ItemName(TargetSwitches^.GetCurrSel)));
  501. AddFormatParamInt(Status.CurrentLine);
  502. AddFormatParamInt(MemAvail div 1024);
  503. AddFormatParamInt(Status.CompiledLines);
  504. AddFormatParamInt(Status.ErrorCount);
  505. ST^.SetText(
  506. FormatStrF(
  507. 'Main file: %s'#13+
  508. '%s'+#13#13+
  509. 'Target: %12s '+ 'Line number: %7d'+#13+
  510. 'Free memory: %6dK '+'Total lines: %7d'+#13+
  511. 'Total errors: %5d',
  512. FormatParams)
  513. );
  514. KeyST^.SetText(^C+KeyS);
  515. end;
  516. {****************************************************************************
  517. Compiler Hooks
  518. ****************************************************************************}
  519. function CompilerStatus: boolean; {$ifndef FPC}far;{$endif}
  520. var
  521. event : tevent;
  522. begin
  523. GetKeyEvent(Event);
  524. if (Event.What=evKeyDown) and (Event.KeyCode=kbEsc) then
  525. begin
  526. CompilationPhase:=cpAborted;
  527. { update info messages }
  528. if assigned(CompilerStatusDialog) then
  529. begin
  530. {$ifdef redircompiler}
  531. RedirDisableAll;
  532. {$endif}
  533. CompilerStatusDialog^.Update;
  534. {$ifdef redircompiler}
  535. RedirEnableAll;
  536. {$endif}
  537. end;
  538. CompilerStatus:=true;
  539. exit;
  540. end;
  541. { only display line info every 100 lines, ofcourse all other messages
  542. will be displayed directly }
  543. if (status.currentline mod 100=0) then
  544. begin
  545. { update info messages }
  546. {$ifdef redircompiler}
  547. RedirDisableAll;
  548. {$endif}
  549. if assigned(CompilerStatusDialog) then
  550. CompilerStatusDialog^.Update;
  551. {$ifdef redircompiler}
  552. RedirEnableAll;
  553. {$endif}
  554. { update memory usage }
  555. { HeapView^.Update; }
  556. end;
  557. CompilerStatus:=false;
  558. end;
  559. const
  560. LONGJMPCALLED = -1;
  561. procedure CompilerStop(err: longint); {$ifndef FPC}far;{$endif}
  562. begin
  563. {$ifdef HasSignal}
  564. if StopJmpValid then
  565. Longjmp(StopJmp,LONGJMPCALLED)
  566. else
  567. Halt(err);
  568. {$endif}
  569. end;
  570. Function CompilerGetNamedFileTime(const filename : string) : Longint; {$ifndef FPC}far;{$endif}
  571. var t: longint;
  572. W: PSourceWindow;
  573. begin
  574. W:=EditorWindowFile(FExpand(filename));
  575. if Assigned(W) and (W^.Editor^.GetModified) then
  576. t:=Now
  577. else
  578. t:=def_getnamedfiletime(filename);
  579. CompilerGetNamedFileTime:=t;
  580. end;
  581. function CompilerOpenInputFile(const filename: string): tinputfile; {$ifndef FPC}far;{$endif}
  582. var f: tinputfile;
  583. W: PSourceWindow;
  584. begin
  585. if assigned(CompilingHiddenFile) and
  586. (NameandExtof(filename)=CompilingHiddenFile^.Editor^.Filename) then
  587. W:=CompilingHiddenFile
  588. else
  589. W:=EditorWindowFile(FExpand(filename));
  590. if Assigned(W) and (W^.Editor^.GetModified) then
  591. f:=TFPInputFile.Create(W^.Editor)
  592. else
  593. f:=def_openinputfile(filename);
  594. if assigned(W) then
  595. W^.Editor^.CompileStamp:=CompileStamp;
  596. CompilerOpenInputFile:=f;
  597. end;
  598. function CompilerComment(Level:Longint; const s:string):boolean; {$ifndef FPC}far;{$endif}
  599. begin
  600. CompilerComment:=false;
  601. if (status.verbosity and Level)<>0 then
  602. begin
  603. {$ifdef redircompiler}
  604. RedirDisableAll;
  605. {$endif}
  606. if not CompilerMessageWindow^.GetState(sfVisible) then
  607. CompilerMessageWindow^.Show;
  608. if Desktop^.First<>PView(CompilerMessageWindow) then
  609. CompilerMessageWindow^.MakeFirst;
  610. CompilerMessageWindow^.AddMessage(Level,S,status.currentsourcepath+status.currentsource,
  611. status.currentline,status.currentcolumn);
  612. { update info messages }
  613. if assigned(CompilerStatusDialog) then
  614. CompilerStatusDialog^.Update;
  615. {$ifdef DEBUG}
  616. {$ifndef NODEBUG}
  617. // def_gdb_stop(level);
  618. {$endif}
  619. {$endif DEBUG}
  620. {$ifdef redircompiler}
  621. RedirEnableAll;
  622. {$endif}
  623. { update memory usage }
  624. { HeapView^.Update; }
  625. end;
  626. end;
  627. {****************************************************************************
  628. DoCompile
  629. ****************************************************************************}
  630. { This function must return '' if
  631. "Options|Directories|Exe and PPU directory" is empty }
  632. function GetExePath: string;
  633. var Path: string;
  634. I: Sw_integer;
  635. begin
  636. Path:='';
  637. if DirectorySwitches<>nil then
  638. with DirectorySwitches^ do
  639. for I:=0 to ItemCount-1 do
  640. begin
  641. if ItemParam(I)='-FE' then
  642. begin
  643. Path:=GetStringItem(I);
  644. Break;
  645. end;
  646. end;
  647. if Path<>'' then
  648. GetExePath:=CompleteDir(FExpand(Path))
  649. else
  650. GetExePath:='';
  651. end;
  652. function GetMainFile(Mode: TCompileMode): string;
  653. var FileName: string;
  654. P : PSourceWindow;
  655. begin
  656. if assigned(CompilingHiddenFile) then
  657. P:=CompilingHiddenFile
  658. else
  659. P:=Message(Desktop,evBroadcast,cmSearchWindow,nil);
  660. if (PrimaryFileMain='') and (P=nil) then
  661. FileName:='' { nothing to compile }
  662. else
  663. begin
  664. if (PrimaryFileMain<>'') and (Mode<>cCompile) then
  665. FileName:=PrimaryFileMain
  666. else if assigned(P) then
  667. begin
  668. FileName:=P^.Editor^.FileName;
  669. if FileName='' then
  670. begin
  671. P^.Editor^.SaveAsk(true);
  672. FileName:=P^.Editor^.FileName;
  673. end;
  674. end
  675. else
  676. FileName:='';
  677. end;
  678. If (FileName<>'') then
  679. FileName:=FixFileName(FExpand(FileName));
  680. GetMainFile:=FileName;
  681. end;
  682. procedure ResetErrorMessages;
  683. procedure ResetErrorLine(P: PView); {$ifndef FPC}far;{$endif}
  684. begin
  685. if assigned(P) and
  686. (TypeOf(P^)=TypeOf(TSourceWindow)) then
  687. PSourceWindow(P)^.Editor^.SetErrorMessage('');
  688. end;
  689. begin
  690. Desktop^.ForEach(@ResetErrorLine);
  691. end;
  692. procedure DoCompile(Mode: TCompileMode);
  693. function IsExitEvent(E: TEvent): boolean;
  694. begin
  695. { following suggestion by Harsha Senanayake }
  696. IsExitEvent:=(E.What=evKeyDown);
  697. end;
  698. function GetTargetExeExt : string;
  699. begin
  700. GetTargetExeExt:=target_info.exeext;
  701. end;
  702. var
  703. s,FileName: string;
  704. ErrFile : Text;
  705. MustRestartDebugger,
  706. StoreStopJumpValid : boolean;
  707. StoreStopJmp : Jmp_buf;
  708. StoreExitProc : pointer;
  709. JmpRet,Error,LinkErrorCount : longint;
  710. E : TEvent;
  711. DummyView: PView;
  712. PPasFile : string[64];
  713. begin
  714. AskRecompileIfModifiedFlag:=true;
  715. { Get FileName }
  716. FileName:=GetMainFile(Mode);
  717. if FileName='' then
  718. begin
  719. ErrorBox(msg_nothingtocompile,nil);
  720. Exit;
  721. end else
  722. { THis is not longer necessary as unsaved files are loaded from a memorystream,
  723. and with the file as primaryfile set it is already incompatible with itself
  724. if FileName='*' then
  725. begin
  726. ErrorBox(msg_cantcompileunsavedfile,nil);
  727. Exit;
  728. end; }
  729. PushStatus('Beginning compilation...');
  730. { Show Compiler Messages Window }
  731. { if not CompilerMessageWindow^.GetState(sfVisible) then
  732. CompilerMessageWindow^.Show;
  733. CompilerMessageWindow^.MakeFirst;}
  734. CompilerMessageWindow^.ClearMessages;
  735. { Tell why we compile }
  736. NeedRecompile(Mode,true);
  737. MainFile:=FileName;
  738. SetStatus('Writing switches to file...');
  739. WriteSwitches(SwitchesPath);
  740. { leaving open browsers leads to crashes !! (PM) }
  741. SetStatus('Preparing symbol info...');
  742. CloseAllBrowsers;
  743. if ((DesktopFileFlags and dfSymbolInformation)<>0) then
  744. WriteSymbolsFile(BrowserName);
  745. { MainFile:=FixFileName(FExpand(FileName));}
  746. SetStatus('Preparing to compile...'+NameOf(MainFile));
  747. { Reset }
  748. CtrlBreakHit:=false;
  749. { Create Compiler Status Dialog }
  750. CompilationPhase:=cpCompiling;
  751. if not assigned(CompilingHiddenFile) then
  752. begin
  753. New(CompilerStatusDialog, Init);
  754. CompilerStatusDialog^.SetState(sfModal,true);
  755. { disable window closing }
  756. CompilerStatusDialog^.Flags:=CompilerStatusDialog^.Flags and not wfclose;
  757. Application^.Insert(CompilerStatusDialog);
  758. CompilerStatusDialog^.Update;
  759. end;
  760. { Restore dir that could be changed during debugging }
  761. {$I-}
  762. ChDir(StartUpDir);
  763. {$I+}
  764. EatIO;
  765. { hook compiler output }
  766. do_status:=@CompilerStatus;
  767. do_stop:=@CompilerStop;
  768. do_comment:=@CompilerComment;
  769. do_openinputfile:=@CompilerOpenInputFile;
  770. do_getnamedfiletime:=@CompilerGetNamedFileTime;
  771. do_initsymbolinfo:=@InitBrowserCol;
  772. do_donesymbolinfo:=@DoneBrowserCol;
  773. do_extractsymbolinfo:=@CreateBrowserCol;
  774. { Compile ! }
  775. {$ifdef redircompiler}
  776. ChangeRedirOut(FPOutFileName,false);
  777. ChangeRedirError(FPErrFileName,false);
  778. {$endif}
  779. { insert "" around name so that spaces are allowed }
  780. { only supported in compiler after 2000/01/14 PM }
  781. if pos(' ',FileName)>0 then
  782. FileName:='"'+FileName+'"';
  783. if mode=cBuild then
  784. FileName:='-B '+FileName;
  785. { tokens are created and distroed by compiler.compile !! PM }
  786. DoneTokens;
  787. PPasFile:='ppas'+source_info.scriptext;
  788. WUtils.DeleteFile(GetExePath+PpasFile);
  789. SetStatus('Compiling...');
  790. {$ifdef HasSignal}
  791. StoreStopJumpValid:=StopJmpValid;
  792. StoreStopJmp:=StopJmp;
  793. {$endif HasSignal}
  794. StoreExitProc:=ExitProc;
  795. {$ifdef HasSignal}
  796. StopJmpValid:=true;
  797. JmpRet:=SetJmp(StopJmp);
  798. {$else}
  799. JmpRet:=0;
  800. {$endif HasSignal}
  801. if JmpRet=0 then
  802. begin
  803. inc(CompileStamp);
  804. ResetErrorMessages;
  805. {$ifndef NODEBUG}
  806. MustRestartDebugger:=false;
  807. if assigned(Debugger) then
  808. if Debugger^.HasExe then
  809. begin
  810. Debugger^.Reset;
  811. MustRestartDebugger:=true;
  812. end;
  813. {$endif NODEBUG}
  814. FpIntF.Compile(FileName,SwitchesPath);
  815. SetStatus('Finished compiling...');
  816. end
  817. else
  818. begin
  819. { We need to restore Exitproc to the value
  820. it was before calling FPintF.compile PM }
  821. ExitProc:=StoreExitProc;
  822. Inc(status.errorCount);
  823. {$ifdef HasSignal}
  824. Case JmpRet of
  825. LONGJMPCALLED : s:='Error';
  826. SIGINT : s := 'Interrupted by Ctrl-C';
  827. SIGILL : s := 'Illegal instruction';
  828. SIGSEGV : s := 'Signal Segmentation violation';
  829. SIGFPE : s:='Floating point signal';
  830. else
  831. s:='Undetermined signal '+inttostr(JmpRet);
  832. end;
  833. CompilerMessageWindow^.AddMessage(V_error,s+' during compilation','',0,0);
  834. {$endif HasSignal}
  835. if JmpRet<>LONGJMPCALLED then
  836. begin
  837. CompilerMessageWindow^.AddMessage(V_error,'Long jumped out of compilation...','',0,0);
  838. SetStatus('Long jumped out of compilation...');
  839. end;
  840. end;
  841. {$ifdef HasSignal}
  842. StopJmpValid:=StoreStopJumpValid;
  843. StopJmp:=StoreStopJmp;
  844. {$endif HasSignal}
  845. { Retrieve created exefile }
  846. If GetEXEPath<>'' then
  847. EXEFile:=FixFileName(GetEXEPath+NameOf(MainFile)+GetTargetExeExt)
  848. else
  849. EXEFile:=DirOf(MainFile)+NameOf(MainFile)+GetTargetExeExt;
  850. { tokens are created and distroyed by compiler.compile !! PM }
  851. InitTokens;
  852. if LinkAfter and
  853. ExistsFile(GetExePath+PpasFile) and
  854. (CompilationPhase<>cpAborted) and
  855. (status.errorCount=0) then
  856. begin
  857. CompilationPhase:=cpLinking;
  858. if assigned(CompilerStatusDialog) then
  859. CompilerStatusDialog^.Update;
  860. SetStatus('Assembling and/or linking...');
  861. {$ifndef redircompiler}
  862. { At least here we want to catch output
  863. of batch file PM }
  864. ChangeRedirOut(FPOutFileName,false);
  865. ChangeRedirError(FPErrFileName,false);
  866. {$endif}
  867. {$ifdef Unix}
  868. {$ifdef ver1_0}
  869. Shell(GetExePath+PpasFile);
  870. Error:=LinuxError;
  871. {$else}
  872. error:=0;
  873. If Shell(GetExePath+PpasFile)=-1 Then
  874. Error:=fpgeterrno;
  875. {$endif}
  876. {$else}
  877. DosExecute(GetEnv('COMSPEC'),'/C '+GetExePath+PpasFile);
  878. Error:=DosError;
  879. {$endif}
  880. SetStatus('Finished linking...');
  881. RestoreRedirOut;
  882. RestoreRedirError;
  883. if Error<>0 then
  884. Inc(status.errorCount);
  885. if Status.IsExe and not Status.IsLibrary and not ExistsFile(EXEFile) then
  886. begin
  887. Inc(status.errorCount);
  888. ClearFormatParams; AddFormatParamStr(ExeFile);
  889. CompilerMessageWindow^.AddMessage(V_error,FormatStrF(msg_couldnotcreatefile,FormatParams),'',0,0);
  890. {$I-}
  891. Assign(ErrFile,FPErrFileName);
  892. Reset(ErrFile);
  893. if EatIO<>0 then
  894. ErrorBox(FormatStrStr(msg_cantopenfile,FPErrFileName),nil)
  895. else
  896. begin
  897. LinkErrorCount:=0;
  898. While not eof(ErrFile) and (LinkErrorCount<25) do
  899. begin
  900. readln(ErrFile,s);
  901. CompilerMessageWindow^.AddMessage(V_error,s,'',0,0);
  902. inc(LinkErrorCount);
  903. end;
  904. if not eof(ErrFile) then
  905. begin
  906. ClearFormatParams; AddFormatParamStr(FPErrFileName);
  907. CompilerMessageWindow^.AddMessage(V_error,
  908. FormatStrF(msg_therearemoreerrorsinfile,FormatParams),'',0,0);
  909. end;
  910. Close(ErrFile);
  911. end;
  912. EatIO;
  913. {$I+}
  914. end
  915. else if error=0 then
  916. WUtils.DeleteFile(GetExePath+PpasFile);
  917. end;
  918. {$ifdef redircompiler}
  919. RestoreRedirOut;
  920. RestoreRedirError;
  921. {$endif}
  922. PopStatus;
  923. { Set end status }
  924. if not (CompilationPhase in [cpAborted,cpFailed]) then
  925. if (status.errorCount=0) then
  926. begin
  927. CompilationPhase:=cpDone;
  928. LastCompileTime := cardinal(Now);
  929. end
  930. else
  931. CompilationPhase:=cpFailed;
  932. { Show end status }
  933. { reenable window closing }
  934. if assigned(CompilerStatusDialog) then
  935. begin
  936. CompilerStatusDialog^.Flags:=CompilerStatusDialog^.Flags or wfclose;
  937. CompilerStatusDialog^.Update;
  938. CompilerStatusDialog^.ReDraw;
  939. CompilerStatusDialog^.SetState(sfModal,false);
  940. if ((CompilationPhase in [cpAborted,cpDone,cpFailed]) or (ShowStatusOnError))
  941. and ((Mode<>cRun) or (CompilationPhase<>cpDone)) then
  942. repeat
  943. CompilerStatusDialog^.GetEvent(E);
  944. if IsExitEvent(E)=false then
  945. CompilerStatusDialog^.HandleEvent(E);
  946. until IsExitEvent(E) or not assigned(CompilerStatusDialog);
  947. {if IsExitEvent(E) then
  948. Application^.PutEvent(E);}
  949. if assigned(CompilerStatusDialog) then
  950. begin
  951. Application^.Delete(CompilerStatusDialog);
  952. Dispose(CompilerStatusDialog, Done);
  953. end;
  954. end;
  955. CompilerStatusDialog:=nil;
  956. { end compilation returns true if the messagewindow should be removed }
  957. if CompilationPhase=cpDone then
  958. begin
  959. CompilerMessageWindow^.Hide;
  960. { This is the last compiled main file }
  961. PrevMainFile:=MainFile;
  962. MainHasDebugInfo:=DebugInfoSwitches^.GetCurrSelParam<>'-';
  963. end;
  964. { Update the app }
  965. Message(Application,evCommand,cmUpdate,nil);
  966. DummyView:=Desktop^.First;
  967. while (DummyView<>nil) and (DummyView^.GetState(sfVisible)=false) do
  968. begin
  969. DummyView:=DummyView^.NextView;
  970. end;
  971. with DummyView^ do
  972. if GetState(sfVisible) then
  973. begin
  974. SetState(sfSelected,false);
  975. SetState(sfSelected,true);
  976. end;
  977. if Assigned(CompilerMessageWindow) then
  978. with CompilerMessageWindow^ do
  979. begin
  980. if GetState(sfVisible) then
  981. begin
  982. SetState(sfSelected,false);
  983. SetState(sfSelected,true);
  984. end;
  985. if (status.errorCount>0) then
  986. MsgLB^.SelectFirstError;
  987. end;
  988. { ^^^ we need this trick to reactivate the desktop }
  989. EditorModified:=false;
  990. {$ifndef NODEBUG}
  991. if MustRestartDebugger then
  992. InitDebugger;
  993. {$endif NODEBUG}
  994. { In case we have something that the compiler touched }
  995. AskToReloadAllModifiedFiles;
  996. { Try to read Browser info in again if compilation failure !! }
  997. if Not Assigned(Modules) and (CompilationPhase<>cpDone) and
  998. ((DesktopFileFlags and dfSymbolInformation)<>0) then
  999. ReadSymbolsFile(BrowserName);
  1000. if UseAllUnitsInCodeComplete and not assigned(CompilingHiddenFile) then
  1001. AddAvailableUnitsToCodeComplete(false);
  1002. end;
  1003. function NeedRecompile(Mode :TCompileMode; verbose : boolean): boolean;
  1004. var Need: boolean;
  1005. I: sw_integer;
  1006. SF: PSourceFile;
  1007. SourceTime,PPUTime,ObjTime: longint;
  1008. W: PSourceWindow;
  1009. begin
  1010. if Assigned(SourceFiles)=false then
  1011. Need:={(EditorModified=true)}true
  1012. else
  1013. begin
  1014. Need:=(PrevMainFile<>GetMainFile(Mode)) and (PrevMainFile<>'');
  1015. if Need then
  1016. begin
  1017. if verbose then
  1018. begin
  1019. ClearFormatParams; AddFormatParamStr(GetMainFile(Mode));
  1020. CompilerMessageWindow^.AddMessage(V_info,
  1021. FormatStrF(msg_firstcompilationof,FormatParams),
  1022. '',0,0);
  1023. end;
  1024. end
  1025. else
  1026. for I:=0 to SourceFiles^.Count-1 do
  1027. begin
  1028. SF:=SourceFiles^.At(I);
  1029. SourceTime:=GetFileTime(SF^.GetSourceFileName);
  1030. PPUTime:=GetFileTime(SF^.GetPPUFileName);
  1031. ObjTime:=GetFileTime(SF^.GetObjFileName);
  1032. { writeln('S: ',SF^.GetSourceFileName,' - ',SourceTime);
  1033. writeln('P: ',SF^.GetPPUFileName,' - ',PPUTime);
  1034. writeln('O: ',SF^.GetObjFileName,' - ',ObjTime);
  1035. writeln('------');}
  1036. { some units don't generate object files }
  1037. W:=EditorWindowFile(SF^.GetSourceFileName);
  1038. if (SourceTime<>-1) then
  1039. if ((SourceTime>PPUTime) or
  1040. ((SourceTime>ObjTime) and
  1041. (ObjTime<>-1))) or
  1042. (assigned(W) and (W^.Editor^.CompileStamp<0)) then
  1043. begin
  1044. Need:=true;
  1045. if verbose then
  1046. begin
  1047. ClearFormatParams; AddFormatParamStr(SF^.GetSourceFileName);
  1048. CompilerMessageWindow^.AddMessage(V_info,
  1049. FormatStrF(msg_recompilingbecauseof,FormatParams),
  1050. SF^.GetSourceFileName,1,1);
  1051. end;
  1052. Break;
  1053. end;
  1054. end;
  1055. { writeln('Need?', Need); system.readln;}
  1056. end;
  1057. NeedRecompile:=Need;
  1058. end;
  1059. constructor TFPInputFile.Create(AEditor: PFileEditor);
  1060. begin
  1061. if not Assigned(AEditor) then Fail;
  1062. if inherited Create(AEditor^.FileName)=nil then
  1063. Fail;
  1064. Editor:=AEditor;
  1065. end;
  1066. function TFPInputFile.fileopen(const filename: string): boolean;
  1067. var OK: boolean;
  1068. begin
  1069. S:=New(PMemoryStream, Init(0,0));
  1070. OK:=Assigned(S) and (S^.Status=stOK);
  1071. if OK then OK:=Editor^.SaveToStream(S);
  1072. if OK then
  1073. S^.Seek(0)
  1074. else
  1075. begin
  1076. if Assigned(S) then Dispose(S, Done);
  1077. S:=nil;
  1078. end;
  1079. fileopen:=OK;
  1080. end;
  1081. function TFPInputFile.fileseek(pos: longint): boolean;
  1082. var OK: boolean;
  1083. begin
  1084. OK:=assigned(S);
  1085. if OK then
  1086. begin
  1087. S^.Reset;
  1088. S^.Seek(pos);
  1089. OK:=(S^.Status=stOK);
  1090. end;
  1091. fileseek:=OK;
  1092. end;
  1093. function TFPInputFile.fileread(var databuf; maxsize: longint): longint;
  1094. var
  1095. size: longint;
  1096. begin
  1097. if not assigned(S) then size:=0 else
  1098. begin
  1099. size:=min(maxsize,(S^.GetSize-S^.GetPos));
  1100. S^.Read(databuf,size);
  1101. if S^.Status<>stOK then size:=0;
  1102. end;
  1103. fileread:=size;
  1104. end;
  1105. function TFPInputFile.fileeof: boolean;
  1106. var EOF: boolean;
  1107. begin
  1108. EOF:=not assigned(S);
  1109. if not EOF then
  1110. EOF:=(S^.Status<>stOK) or (S^.GetPos=S^.GetSize);
  1111. fileeof:=EOF;
  1112. end;
  1113. function TFPInputFile.fileclose: boolean;
  1114. var OK: boolean;
  1115. begin
  1116. OK:=assigned(S);
  1117. if OK then
  1118. begin
  1119. S^.Reset;
  1120. Dispose(S, Done);
  1121. S:=nil;
  1122. OK:=true;
  1123. end;
  1124. fileclose:=OK;
  1125. end;
  1126. procedure RegisterFPCompile;
  1127. begin
  1128. {$ifndef NOOBJREG}
  1129. RegisterType(RCompilerMessageListBox);
  1130. RegisterType(RCompilerMessageWindow);
  1131. {$endif}
  1132. end;
  1133. end.
  1134. {
  1135. $Log$
  1136. Revision 1.29 2004-11-08 20:28:26 peter
  1137. * Breakpoints are now deleted when removed from source, disabling is
  1138. still possible from the breakpoint list
  1139. * COMPILER_1_0, FVISION, GABOR defines removed, only support new
  1140. FV and 1.9.x compilers
  1141. * Run directory added to Run menu
  1142. * Useless programinfo window removed
  1143. Revision 1.28 2004/11/06 22:02:48 peter
  1144. * fixed resize helptext
  1145. Revision 1.27 2004/11/06 17:22:52 peter
  1146. * fixes for new fv
  1147. Revision 1.26 2004/11/05 00:00:33 peter
  1148. set exefile after compilation, before the target_info is not filled
  1149. Revision 1.25 2004/11/02 23:53:19 peter
  1150. * fixed crashes with ide and 1.9.x
  1151. Revision 1.24 2004/09/09 20:33:00 jonas
  1152. * made CompilerStop declaration compliant to new tstopprocedure type in
  1153. compiler
  1154. Revision 1.23 2003/11/14 17:29:38 marco
  1155. * linuxerrorcide
  1156. Revision 1.22 2003/03/28 09:55:46 armin
  1157. * Fixed TCompilerMessageWindow.AddMessage to see line numbers with 1.1
  1158. Revision 1.21 2003/03/27 14:11:53 pierre
  1159. * fix problem in CompilerComment procedure
  1160. Revision 1.20 2003/01/13 09:05:18 pierre
  1161. * fix error in last commit
  1162. Revision 1.19 2003/01/11 15:52:54 peter
  1163. * adapted for new 1.1 compiler verbosity
  1164. Revision 1.18 2002/12/02 13:58:29 pierre
  1165. * avoid longjmp messages if quitting after compilation error
  1166. Revision 1.17 2002/11/20 17:35:00 pierre
  1167. * use target_os.ExeExt for compiled executable
  1168. Revision 1.16 2002/10/23 19:19:40 hajny
  1169. * another bunch of missing HasSignal conditionals
  1170. Revision 1.15 2002/09/26 15:00:35 pierre
  1171. * fix problems with system unit is not present for __fp__ compilation
  1172. Revision 1.14 2002/09/13 22:30:50 pierre
  1173. * only fpc uses video unit
  1174. Revision 1.13 2002/09/09 06:53:54 pierre
  1175. * avoid to save file used by codecomplete
  1176. Revision 1.12 2002/09/07 15:40:42 peter
  1177. * old logs removed and tabs fixed
  1178. Revision 1.11 2002/09/05 08:45:40 pierre
  1179. * try to fix recompilation on changes problems
  1180. Revision 1.10 2002/09/04 14:07:12 pierre
  1181. + Enhance code complete by inserting unit symbols
  1182. Revision 1.9 2002/08/26 13:03:14 pierre
  1183. + add a lock to speed up parsing of userscreen
  1184. Revision 1.8 2002/04/10 22:37:37 pierre
  1185. * save and restore Exitproc if LongJmp called
  1186. Revision 1.7 2002/03/20 14:48:27 pierre
  1187. * moved StopJmp buffer to fpcatch unit
  1188. }