files.pas 44 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451
  1. {
  2. $Id$
  3. Copyright (c) 1996-98 by Florian Klaempfl
  4. This unit implements an extended file management and the first loading
  5. and searching of the modules (ppufiles)
  6. This program is free software; you can redistribute it and/or modify
  7. it under the terms of the GNU General Public License as published by
  8. the Free Software Foundation; either version 2 of the License, or
  9. (at your option) any later version.
  10. This program is distributed in the hope that it will be useful,
  11. but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. GNU General Public License for more details.
  14. You should have received a copy of the GNU General Public License
  15. along with this program; if not, write to the Free Software
  16. Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  17. ****************************************************************************
  18. }
  19. unit files;
  20. {$ifdef TP}
  21. {$V+}
  22. {$endif}
  23. interface
  24. uses
  25. globtype,
  26. cobjects,globals,ppu;
  27. const
  28. {$ifdef FPC}
  29. maxunits = 1024;
  30. InputFileBufSize=32*1024;
  31. linebufincrease=512;
  32. {$else}
  33. maxunits = 128;
  34. InputFileBufSize=1024;
  35. linebufincrease=64;
  36. {$endif}
  37. type
  38. {$ifdef FPC}
  39. tlongintarr = array[0..1000000] of longint;
  40. {$else}
  41. tlongintarr = array[0..16000] of longint;
  42. {$endif}
  43. plongintarr = ^tlongintarr;
  44. pinputfile = ^tinputfile;
  45. tinputfile = object
  46. path,name : pstring; { path and filename }
  47. next : pinputfile; { next file for reading }
  48. f : file; { current file handle }
  49. is_macro,
  50. endoffile, { still bytes left to read }
  51. closed : boolean; { is the file closed }
  52. buf : pchar; { buffer }
  53. bufstart, { buffer start position in the file }
  54. bufsize, { amount of bytes in the buffer }
  55. maxbufsize : longint; { size in memory for the buffer }
  56. saveinputpointer : pchar; { save fields for scanner variables }
  57. savelastlinepos,
  58. saveline_no : longint;
  59. linebuf : plongintarr; { line buffer to retrieve lines }
  60. maxlinebuf : longint;
  61. ref_count : longint; { to handle the browser refs }
  62. ref_index : longint;
  63. ref_next : pinputfile;
  64. constructor init(const fn:string);
  65. destructor done;
  66. procedure setpos(l:longint);
  67. procedure seekbuf(fpos:longint);
  68. procedure readbuf;
  69. function open:boolean;
  70. procedure close;
  71. procedure tempclose;
  72. function tempopen:boolean;
  73. procedure setmacro(p:pchar;len:longint);
  74. procedure setline(line,linepos:longint);
  75. function getlinestr(l:longint):string;
  76. end;
  77. pfilemanager = ^tfilemanager;
  78. tfilemanager = object
  79. files : pinputfile;
  80. last_ref_index : longint;
  81. cacheindex : longint;
  82. cacheinputfile : pinputfile;
  83. constructor init;
  84. destructor done;
  85. procedure register_file(f : pinputfile);
  86. procedure inverse_register_indexes;
  87. function get_file(l:longint) : pinputfile;
  88. function get_file_name(l :longint):string;
  89. function get_file_path(l :longint):string;
  90. end;
  91. type
  92. {$ifndef NEWMAP}
  93. tunitmap = array[0..maxunits-1] of pointer;
  94. punitmap = ^tunitmap;
  95. pmodule = ^tmodule;
  96. {$else NEWMAP}
  97. pmodule = ^tmodule;
  98. tunitmap = array[0..maxunits-1] of pmodule;
  99. punitmap = ^tunitmap;
  100. {$endif NEWMAP}
  101. tmodule = object(tlinkedlist_item)
  102. ppufile : pppufile; { the PPU file }
  103. crc,
  104. flags : longint; { the PPU flags }
  105. compiled, { unit is already compiled }
  106. do_assemble, { only assemble the object, don't recompile }
  107. do_compile, { need to compile the sources }
  108. sources_avail, { if all sources are reachable }
  109. is_unit,
  110. in_second_compile, { is this unit being compiled for the 2nd time? }
  111. in_implementation, { processing the implementation part? }
  112. in_global : boolean; { allow global settings }
  113. islibrary : boolean; { if it is a library (win32 dll) }
  114. map : punitmap; { mapping of all used units }
  115. unitcount : word; { local unit counter }
  116. unit_index : word; { global counter for browser }
  117. globalsymtable, { pointer to the local/static symtable of this unit }
  118. localsymtable : pointer; { pointer to the psymtable of this unit }
  119. scanner : pointer; { scanner object used }
  120. loaded_from : pmodule;
  121. uses_imports : boolean; { Set if the module imports from DLL's.}
  122. imports : plinkedlist;
  123. _exports : plinkedlist;
  124. sourcefiles : pfilemanager;
  125. resourcefiles,
  126. linksharedlibs,
  127. linkstaticlibs,
  128. linkofiles : tstringcontainer;
  129. used_units : tlinkedlist;
  130. path, { path where the module is find/created }
  131. outpath,
  132. modulename, { name of the module in uppercase }
  133. objfilename, { fullname of the objectfile }
  134. asmfilename, { fullname of the assemblerfile }
  135. ppufilename, { fullname of the ppufile }
  136. staticlibfilename, { fullname of the static libraryfile }
  137. sharedlibfilename, { fullname of the shared libraryfile }
  138. exefilename, { fullname of the exefile }
  139. asmprefix, { prefix for the smartlink asmfiles }
  140. mainsource : pstring; { name of the main sourcefile }
  141. constructor init(const s:string;_is_unit:boolean);
  142. destructor done;virtual;
  143. procedure reset;
  144. procedure setfilename(const fn:string;allowoutput:boolean);
  145. function openppu:boolean;
  146. function search_unit(const n : string;onlysource:boolean):boolean;
  147. end;
  148. pused_unit = ^tused_unit;
  149. tused_unit = object(tlinkedlist_item)
  150. unitid : word;
  151. name : pstring;
  152. checksum : longint;
  153. loaded : boolean;
  154. in_uses,
  155. in_interface,
  156. is_stab_written : boolean;
  157. u : pmodule;
  158. constructor init(_u : pmodule;intface:boolean);
  159. constructor init_to_load(const n:string;c:longint;intface:boolean);
  160. destructor done;virtual;
  161. end;
  162. var
  163. main_module : pmodule; { Main module of the program }
  164. current_module : pmodule; { Current module which is compiled }
  165. current_ppu : pppufile; { Current ppufile which is read }
  166. global_unit_count : word;
  167. usedunits : tlinkedlist; { Used units for this program }
  168. loaded_units : tlinkedlist; { All loaded units }
  169. function get_source_file(moduleindex,fileindex : word) : pinputfile;
  170. implementation
  171. uses
  172. dos,verbose,systems,
  173. symtable,scanner;
  174. {****************************************************************************
  175. TINPUTFILE
  176. ****************************************************************************}
  177. constructor tinputfile.init(const fn:string);
  178. var
  179. p:dirstr;
  180. n:namestr;
  181. e:extstr;
  182. begin
  183. FSplit(fn,p,n,e);
  184. name:=stringdup(n+e);
  185. path:=stringdup(p);
  186. next:=nil;
  187. { file info }
  188. is_macro:=false;
  189. endoffile:=false;
  190. closed:=true;
  191. buf:=nil;
  192. bufstart:=0;
  193. bufsize:=0;
  194. maxbufsize:=InputFileBufSize;
  195. { save fields }
  196. saveinputpointer:=nil;
  197. saveline_no:=0;
  198. savelastlinepos:=0;
  199. { indexing refs }
  200. ref_next:=nil;
  201. ref_count:=0;
  202. ref_index:=0;
  203. { line buffer }
  204. linebuf:=nil;
  205. maxlinebuf:=0;
  206. end;
  207. destructor tinputfile.done;
  208. begin
  209. if not closed then
  210. close;
  211. stringdispose(path);
  212. stringdispose(name);
  213. { free memory }
  214. if assigned(linebuf) then
  215. freemem(linebuf,maxlinebuf shl 2);
  216. end;
  217. procedure tinputfile.setpos(l:longint);
  218. begin
  219. bufstart:=l;
  220. end;
  221. procedure tinputfile.seekbuf(fpos:longint);
  222. begin
  223. if closed then
  224. exit;
  225. seek(f,fpos);
  226. bufstart:=fpos;
  227. bufsize:=0;
  228. end;
  229. procedure tinputfile.readbuf;
  230. {$ifdef TP}
  231. var
  232. w : word;
  233. {$endif}
  234. begin
  235. if is_macro then
  236. endoffile:=true;
  237. if closed then
  238. exit;
  239. inc(bufstart,bufsize);
  240. {$ifdef TP}
  241. blockread(f,buf^,maxbufsize-1,w);
  242. bufsize:=w;
  243. {$else}
  244. blockread(f,buf^,maxbufsize-1,bufsize);
  245. {$endif}
  246. buf[bufsize]:=#0;
  247. endoffile:=eof(f);
  248. end;
  249. function tinputfile.open:boolean;
  250. var
  251. ofm : byte;
  252. begin
  253. open:=false;
  254. if not closed then
  255. Close;
  256. ofm:=filemode;
  257. filemode:=0;
  258. Assign(f,path^+name^);
  259. {$I-}
  260. reset(f,1);
  261. {$I+}
  262. filemode:=ofm;
  263. if ioresult<>0 then
  264. exit;
  265. { file }
  266. endoffile:=false;
  267. closed:=false;
  268. Getmem(buf,MaxBufsize);
  269. bufstart:=0;
  270. bufsize:=0;
  271. open:=true;
  272. end;
  273. procedure tinputfile.close;
  274. var
  275. i : word;
  276. begin
  277. if is_macro then
  278. begin
  279. if assigned(buf) then
  280. Freemem(buf,maxbufsize);
  281. buf:=nil;
  282. {is_macro:=false;
  283. still needed for dispose in scanner PM }
  284. closed:=true;
  285. exit;
  286. end;
  287. if not closed then
  288. begin
  289. {$I-}
  290. system.close(f);
  291. {$I+}
  292. i:=ioresult;
  293. closed:=true;
  294. end;
  295. if assigned(buf) then
  296. begin
  297. Freemem(buf,maxbufsize);
  298. buf:=nil;
  299. end;
  300. bufstart:=0;
  301. end;
  302. procedure tinputfile.tempclose;
  303. var
  304. i : word;
  305. begin
  306. if is_macro then
  307. exit;
  308. if not closed then
  309. begin
  310. {$I-}
  311. system.close(f);
  312. {$I+}
  313. i:=ioresult;
  314. Freemem(buf,maxbufsize);
  315. buf:=nil;
  316. closed:=true;
  317. end;
  318. end;
  319. function tinputfile.tempopen:boolean;
  320. var
  321. ofm : byte;
  322. begin
  323. tempopen:=false;
  324. if is_macro then
  325. begin
  326. tempopen:=true;
  327. exit;
  328. end;
  329. if not closed then
  330. exit;
  331. ofm:=filemode;
  332. filemode:=0;
  333. Assign(f,path^+name^);
  334. {$I-}
  335. reset(f,1);
  336. {$I+}
  337. filemode:=ofm;
  338. if ioresult<>0 then
  339. exit;
  340. closed:=false;
  341. { get new mem }
  342. Getmem(buf,maxbufsize);
  343. { restore state }
  344. seek(f,BufStart);
  345. bufsize:=0;
  346. readbuf;
  347. tempopen:=true;
  348. end;
  349. procedure tinputfile.setmacro(p:pchar;len:longint);
  350. begin
  351. { create new buffer }
  352. getmem(buf,len+1);
  353. move(p^,buf^,len);
  354. buf[len]:=#0;
  355. { reset }
  356. bufstart:=0;
  357. bufsize:=len;
  358. maxbufsize:=len+1;
  359. is_macro:=true;
  360. endoffile:=true;
  361. closed:=true;
  362. end;
  363. procedure tinputfile.setline(line,linepos:longint);
  364. var
  365. oldlinebuf : plongintarr;
  366. begin
  367. if line<1 then
  368. exit;
  369. while (line>=maxlinebuf) do
  370. begin
  371. oldlinebuf:=linebuf;
  372. { create new linebuf and move old info }
  373. getmem(linebuf,(maxlinebuf+linebufincrease) shl 2);
  374. if assigned(oldlinebuf) then
  375. begin
  376. move(oldlinebuf^,linebuf^,maxlinebuf shl 2);
  377. freemem(oldlinebuf,maxlinebuf shl 2);
  378. end;
  379. fillchar(linebuf^[maxlinebuf],linebufincrease shl 2,0);
  380. inc(maxlinebuf,linebufincrease);
  381. end;
  382. linebuf^[line]:=linepos;
  383. end;
  384. function tinputfile.getlinestr(l:longint):string;
  385. var
  386. c : char;
  387. i,
  388. fpos : longint;
  389. p : pchar;
  390. begin
  391. getlinestr:='';
  392. if l<maxlinebuf then
  393. begin
  394. fpos:=linebuf^[l];
  395. { fpos is set negativ if the line was already written }
  396. { but we still know the correct value }
  397. if fpos<0 then
  398. fpos:=-fpos+1;
  399. if closed then
  400. open;
  401. { in current buf ? }
  402. if (fpos<bufstart) or (fpos>bufstart+bufsize) then
  403. begin
  404. seekbuf(fpos);
  405. readbuf;
  406. end;
  407. { the begin is in the buf now simply read until #13,#10 }
  408. i:=0;
  409. p:=@buf[fpos-bufstart];
  410. repeat
  411. c:=p^;
  412. if c=#0 then
  413. begin
  414. if endoffile then
  415. break;
  416. readbuf;
  417. p:=buf;
  418. c:=p^;
  419. end;
  420. if c in [#10,#13] then
  421. break;
  422. inc(i);
  423. getlinestr[i]:=c;
  424. inc(longint(p));
  425. until (i=255);
  426. {$ifndef TP}
  427. {$ifopt H+}
  428. setlength(getlinestr,i);
  429. {$else}
  430. getlinestr[0]:=chr(i);
  431. {$endif}
  432. {$else}
  433. getlinestr[0]:=chr(i);
  434. {$endif}
  435. end;
  436. end;
  437. {****************************************************************************
  438. TFILEMANAGER
  439. ****************************************************************************}
  440. constructor tfilemanager.init;
  441. begin
  442. files:=nil;
  443. last_ref_index:=0;
  444. cacheindex:=0;
  445. cacheinputfile:=nil;
  446. end;
  447. destructor tfilemanager.done;
  448. var
  449. hp : pinputfile;
  450. begin
  451. hp:=files;
  452. while assigned(hp) do
  453. begin
  454. files:=files^.ref_next;
  455. dispose(hp,done);
  456. hp:=files;
  457. end;
  458. last_ref_index:=0;
  459. end;
  460. procedure tfilemanager.register_file(f : pinputfile);
  461. begin
  462. inc(last_ref_index);
  463. f^.ref_next:=files;
  464. f^.ref_index:=last_ref_index;
  465. files:=f;
  466. { update cache }
  467. cacheindex:=last_ref_index;
  468. cacheinputfile:=f;
  469. {$ifdef FPC}
  470. {$ifdef heaptrc}
  471. writeln(stderr,f^.name^,' index ',current_module^.unit_index*100000+f^.ref_index);
  472. {$endif heaptrc}
  473. {$endif FPC}
  474. end;
  475. { this procedure is necessary after loading the
  476. sources files from a PPU file PM }
  477. procedure tfilemanager.inverse_register_indexes;
  478. var
  479. f : pinputfile;
  480. begin
  481. f:=files;
  482. while assigned(f) do
  483. begin
  484. f^.ref_index:=last_ref_index-f^.ref_index+1;
  485. f:=f^.ref_next;
  486. end;
  487. { reset cache }
  488. cacheindex:=0;
  489. cacheinputfile:=nil;
  490. end;
  491. function tfilemanager.get_file(l :longint) : pinputfile;
  492. var
  493. ff : pinputfile;
  494. begin
  495. { check cache }
  496. if (l=cacheindex) and assigned(cacheinputfile) then
  497. begin
  498. get_file:=cacheinputfile;
  499. exit;
  500. end;
  501. ff:=files;
  502. while assigned(ff) and (ff^.ref_index<>l) do
  503. ff:=ff^.ref_next;
  504. get_file:=ff;
  505. end;
  506. function tfilemanager.get_file_name(l :longint):string;
  507. var
  508. hp : pinputfile;
  509. begin
  510. hp:=get_file(l);
  511. if assigned(hp) then
  512. get_file_name:=hp^.name^
  513. else
  514. get_file_name:='';
  515. end;
  516. function tfilemanager.get_file_path(l :longint):string;
  517. var
  518. hp : pinputfile;
  519. begin
  520. hp:=get_file(l);
  521. if assigned(hp) then
  522. get_file_path:=hp^.path^
  523. else
  524. get_file_path:='';
  525. end;
  526. function get_source_file(moduleindex,fileindex : word) : pinputfile;
  527. var
  528. hp : pmodule;
  529. f : pinputfile;
  530. begin
  531. hp:=pmodule(loaded_units.first);
  532. while assigned(hp) and (hp^.unit_index<>moduleindex) do
  533. hp:=pmodule(hp^.next);
  534. get_source_file:=nil;
  535. if not assigned(hp) then
  536. exit;
  537. f:=pinputfile(hp^.sourcefiles^.files);
  538. while assigned(f) do
  539. begin
  540. if f^.ref_index=fileindex then
  541. begin
  542. get_source_file:=f;
  543. exit;
  544. end;
  545. f:=pinputfile(f^.ref_next);
  546. end;
  547. end;
  548. {****************************************************************************
  549. TMODULE
  550. ****************************************************************************}
  551. procedure tmodule.setfilename(const fn:string;allowoutput:boolean);
  552. var
  553. p : dirstr;
  554. n : NameStr;
  555. e : ExtStr;
  556. begin
  557. stringdispose(objfilename);
  558. stringdispose(asmfilename);
  559. stringdispose(ppufilename);
  560. stringdispose(staticlibfilename);
  561. stringdispose(sharedlibfilename);
  562. stringdispose(exefilename);
  563. stringdispose(outpath);
  564. stringdispose(path);
  565. { Create names }
  566. fsplit(fn,p,n,e);
  567. n:=FixFileName(n);
  568. { set path }
  569. path:=stringdup(FixPath(p,false));
  570. { obj,asm,ppu names }
  571. p:=path^;
  572. if AllowOutput then
  573. begin
  574. if (OutputUnitDir<>'') then
  575. p:=OutputUnitDir
  576. else
  577. if (OutputExeDir<>'') then
  578. p:=OutputExeDir;
  579. end;
  580. outpath:=stringdup(p);
  581. objfilename:=stringdup(p+n+target_info.objext);
  582. asmfilename:=stringdup(p+n+target_info.asmext);
  583. ppufilename:=stringdup(p+n+target_info.unitext);
  584. { lib and exe could be loaded with a file specified with -o }
  585. if AllowOutput and (OutputFile<>'') then
  586. n:=OutputFile;
  587. staticlibfilename:=stringdup(p+target_os.libprefix+n+target_os.staticlibext);
  588. if target_info.target=target_i386_WIN32 then
  589. sharedlibfilename:=stringdup(p+n+target_os.sharedlibext)
  590. else
  591. sharedlibfilename:=stringdup(p+target_os.libprefix+n+target_os.sharedlibext);
  592. { output dir of exe can be specified separatly }
  593. if AllowOutput and (OutputExeDir<>'') then
  594. p:=OutputExeDir
  595. else
  596. p:=path^;
  597. exefilename:=stringdup(p+n+target_info.exeext);
  598. end;
  599. function tmodule.openppu:boolean;
  600. var
  601. objfiletime,
  602. ppufiletime,
  603. asmfiletime : longint;
  604. begin
  605. openppu:=false;
  606. Message1(unit_t_ppu_loading,ppufilename^);
  607. { Get ppufile time (also check if the file exists) }
  608. ppufiletime:=getnamedfiletime(ppufilename^);
  609. if ppufiletime=-1 then
  610. exit;
  611. { Open the ppufile }
  612. Message1(unit_u_ppu_name,ppufilename^);
  613. ppufile:=new(pppufile,init(ppufilename^));
  614. ppufile^.change_endian:=source_os.endian<>target_os.endian;
  615. if not ppufile^.open then
  616. begin
  617. dispose(ppufile,done);
  618. Message(unit_u_ppu_file_too_short);
  619. exit;
  620. end;
  621. { check for a valid PPU file }
  622. if not ppufile^.CheckPPUId then
  623. begin
  624. dispose(ppufile,done);
  625. Message(unit_u_ppu_invalid_header);
  626. exit;
  627. end;
  628. { check for allowed PPU versions }
  629. if not (ppufile^.GetPPUVersion = 15) then
  630. begin
  631. dispose(ppufile,done);
  632. Message1(unit_u_ppu_invalid_version,tostr(ppufile^.GetPPUVersion));
  633. exit;
  634. end;
  635. { check the target processor }
  636. if ttargetcpu(ppufile^.header.cpu)<>target_cpu then
  637. begin
  638. dispose(ppufile,done);
  639. Message(unit_u_ppu_invalid_processor);
  640. exit;
  641. end;
  642. { check target }
  643. if ttarget(ppufile^.header.target)<>target_info.target then
  644. begin
  645. dispose(ppufile,done);
  646. Message(unit_u_ppu_invalid_target);
  647. exit;
  648. end;
  649. { Load values to be access easier }
  650. flags:=ppufile^.header.flags;
  651. crc:=ppufile^.header.checksum;
  652. { Show Debug info }
  653. Message1(unit_u_ppu_time,filetimestring(ppufiletime));
  654. Message1(unit_u_ppu_flags,tostr(flags));
  655. Message1(unit_u_ppu_crc,tostr(ppufile^.header.checksum));
  656. { check the object and assembler file to see if we need only to
  657. assemble, only if it's not in a library }
  658. do_compile:=false;
  659. if (flags and uf_in_library)=0 then
  660. begin
  661. if ((flags and uf_static_linked)<>0) or
  662. ((flags and uf_smartlink)<>0) then
  663. begin
  664. objfiletime:=getnamedfiletime(staticlibfilename^);
  665. Message2(unit_u_check_time,staticlibfilename^,filetimestring(objfiletime));
  666. if (ppufiletime<0) or (objfiletime<0) or (ppufiletime>objfiletime) then
  667. begin
  668. Message(unit_u_recompile_staticlib_is_older);
  669. do_compile:=true;
  670. exit;
  671. end;
  672. end
  673. else
  674. if (flags and uf_shared_linked)<>0 then
  675. begin
  676. objfiletime:=getnamedfiletime(sharedlibfilename^);
  677. Message2(unit_u_check_time,sharedlibfilename^,filetimestring(objfiletime));
  678. if (ppufiletime<0) or (objfiletime<0) or (ppufiletime>objfiletime) then
  679. begin
  680. Message(unit_u_recompile_sharedlib_is_older);
  681. do_compile:=true;
  682. exit;
  683. end;
  684. end
  685. else
  686. begin
  687. { the objectfile should be newer than the ppu file }
  688. objfiletime:=getnamedfiletime(objfilename^);
  689. Message2(unit_u_check_time,objfilename^,filetimestring(objfiletime));
  690. if (ppufiletime<0) or (objfiletime<0) or (ppufiletime>objfiletime) then
  691. begin
  692. { check if assembler file is older than ppu file }
  693. asmfileTime:=GetNamedFileTime(asmfilename^);
  694. Message2(unit_u_check_time,asmfilename^,filetimestring(asmfiletime));
  695. if (asmfiletime<0) or (ppufiletime>asmfiletime) then
  696. begin
  697. Message(unit_u_recompile_obj_and_asm_older);
  698. do_compile:=true;
  699. exit;
  700. end
  701. else
  702. begin
  703. Message(unit_u_recompile_obj_older_than_asm);
  704. if not(cs_asm_extern in aktglobalswitches) then
  705. begin
  706. do_compile:=true;
  707. exit;
  708. end;
  709. end;
  710. end;
  711. end;
  712. end;
  713. openppu:=true;
  714. end;
  715. function tmodule.search_unit(const n : string;onlysource:boolean):boolean;
  716. var
  717. ext : string[8];
  718. singlepathstring,
  719. unitPath,
  720. filename : string;
  721. found : boolean;
  722. start,i : longint;
  723. Function UnitExists(const ext:string):boolean;
  724. begin
  725. Message1(unit_t_unitsearch,Singlepathstring+filename+ext);
  726. UnitExists:=FileExists(Singlepathstring+FileName+ext);
  727. end;
  728. begin
  729. start:=1;
  730. filename:=FixFileName(n);
  731. unitpath:=UnitSearchPath;
  732. Found:=false;
  733. repeat
  734. { Create current path to check }
  735. i:=pos(';',unitpath);
  736. if i=0 then
  737. i:=length(unitpath)+1;
  738. singlepathstring:=FixPath(copy(unitpath,start,i-start),false);
  739. delete(unitpath,start,i-start+1);
  740. if not onlysource then
  741. begin
  742. { Check for PPL file }
  743. if not Found then
  744. begin
  745. Found:=UnitExists(target_info.unitlibext);
  746. if Found then
  747. Begin
  748. SetFileName(SinglePathString+FileName,false);
  749. Found:=OpenPPU;
  750. End;
  751. end;
  752. { Check for PPU file }
  753. if not Found then
  754. begin
  755. Found:=UnitExists(target_info.unitext);
  756. if Found then
  757. Begin
  758. SetFileName(SinglePathString+FileName,false);
  759. Found:=OpenPPU;
  760. End;
  761. end;
  762. end;
  763. { Check for Sources }
  764. if not Found then
  765. begin
  766. ppufile:=nil;
  767. do_compile:=true;
  768. {Check for .pp file}
  769. Found:=UnitExists(target_os.sourceext);
  770. if Found then
  771. Ext:=target_os.sourceext
  772. else
  773. begin
  774. {Check for .pas}
  775. Found:=UnitExists(target_os.pasext);
  776. if Found then
  777. Ext:=target_os.pasext;
  778. end;
  779. stringdispose(mainsource);
  780. if Found then
  781. begin
  782. sources_avail:=true;
  783. {Load Filenames when found}
  784. mainsource:=StringDup(SinglePathString+FileName+Ext);
  785. SetFileName(SinglePathString+FileName,false);
  786. end
  787. else
  788. sources_avail:=false;
  789. end;
  790. until Found or (unitpath='');
  791. search_unit:=Found;
  792. end;
  793. procedure tmodule.reset;
  794. begin
  795. if assigned(scanner) then
  796. pscannerfile(scanner)^.invalid:=true;
  797. if assigned(globalsymtable) then
  798. begin
  799. dispose(punitsymtable(globalsymtable),done);
  800. globalsymtable:=nil;
  801. end;
  802. if assigned(localsymtable) then
  803. begin
  804. dispose(punitsymtable(localsymtable),done);
  805. localsymtable:=nil;
  806. end;
  807. if assigned(map) then
  808. begin
  809. dispose(map);
  810. map:=nil;
  811. end;
  812. if assigned(ppufile) then
  813. begin
  814. dispose(ppufile,done);
  815. ppufile:=nil;
  816. end;
  817. sourcefiles^.done;
  818. sourcefiles^.init;
  819. imports^.done;
  820. imports^.init;
  821. _exports^.done;
  822. _exports^.init;
  823. used_units.done;
  824. used_units.init;
  825. resourcefiles.done;
  826. resourcefiles.init_no_double;
  827. linkofiles.done;
  828. linkofiles.init_no_double;
  829. linkstaticlibs.done;
  830. linkstaticlibs.init_no_double;
  831. linksharedlibs.done;
  832. linksharedlibs.init_no_double;
  833. uses_imports:=false;
  834. do_assemble:=false;
  835. do_compile:=false;
  836. { sources_avail:=true;
  837. should not be changed PM }
  838. compiled:=false;
  839. in_implementation:=false;
  840. in_global:=true;
  841. loaded_from:=nil;
  842. flags:=0;
  843. crc:=0;
  844. unitcount:=1;
  845. end;
  846. constructor tmodule.init(const s:string;_is_unit:boolean);
  847. var
  848. p : dirstr;
  849. n : namestr;
  850. e : extstr;
  851. begin
  852. FSplit(s,p,n,e);
  853. { Programs have the name program to don't conflict with dup id's }
  854. if _is_unit then
  855. modulename:=stringdup(Upper(n))
  856. else
  857. modulename:=stringdup('PROGRAM');
  858. mainsource:=stringdup(s);
  859. ppufilename:=nil;
  860. objfilename:=nil;
  861. asmfilename:=nil;
  862. staticlibfilename:=nil;
  863. sharedlibfilename:=nil;
  864. exefilename:=nil;
  865. outpath:=nil;
  866. { Dos has the famous 8.3 limit :( }
  867. {$ifdef tp}
  868. asmprefix:=stringdup(FixFileName('as'));
  869. {$else}
  870. {$ifdef go32v2}
  871. asmprefix:=stringdup(FixFileName('as'));
  872. {$else}
  873. {$ifdef OS2}
  874. {Allthough OS/2 supports long filenames I play it safe and
  875. use 8.3 filenames, because this allows the compiler to run
  876. on a FAT partition. (DM)}
  877. asmprefix:=stringdup(FixFileName('as'));
  878. {$else}
  879. asmprefix:=stringdup(FixFileName(n));
  880. {$endif}
  881. {$endif}
  882. {$endif tp}
  883. path:=nil;
  884. setfilename(p+n,true);
  885. used_units.init;
  886. new(sourcefiles,init);
  887. resourcefiles.init_no_double;
  888. linkofiles.init_no_double;
  889. linkstaticlibs.init_no_double;
  890. linksharedlibs.init_no_double;
  891. ppufile:=nil;
  892. scanner:=nil;
  893. map:=nil;
  894. globalsymtable:=nil;
  895. localsymtable:=nil;
  896. loaded_from:=nil;
  897. flags:=0;
  898. crc:=0;
  899. unitcount:=1;
  900. inc(global_unit_count);
  901. unit_index:=global_unit_count;
  902. do_assemble:=false;
  903. do_compile:=false;
  904. sources_avail:=true;
  905. compiled:=false;
  906. in_second_compile:=false;
  907. in_implementation:=false;
  908. in_global:=true;
  909. is_unit:=_is_unit;
  910. islibrary:=false;
  911. uses_imports:=false;
  912. imports:=new(plinkedlist,init);
  913. _exports:=new(plinkedlist,init);
  914. { search the PPU file if it is an unit }
  915. if is_unit then
  916. begin
  917. if (not search_unit(modulename^,false)) and (length(modulename^)>8) then
  918. search_unit(copy(modulename^,1,8),false);
  919. end;
  920. end;
  921. destructor tmodule.done;
  922. begin
  923. if assigned(map) then
  924. dispose(map);
  925. if assigned(ppufile) then
  926. dispose(ppufile,done);
  927. ppufile:=nil;
  928. if assigned(imports) then
  929. dispose(imports,done);
  930. imports:=nil;
  931. if assigned(_exports) then
  932. dispose(_exports,done);
  933. _exports:=nil;
  934. if assigned(scanner) then
  935. pscannerfile(scanner)^.invalid:=true;
  936. if assigned(sourcefiles) then
  937. dispose(sourcefiles,done);
  938. sourcefiles:=nil;
  939. used_units.done;
  940. resourcefiles.done;
  941. linkofiles.done;
  942. linkstaticlibs.done;
  943. linksharedlibs.done;
  944. stringdispose(objfilename);
  945. stringdispose(asmfilename);
  946. stringdispose(ppufilename);
  947. stringdispose(staticlibfilename);
  948. stringdispose(sharedlibfilename);
  949. stringdispose(exefilename);
  950. stringdispose(outpath);
  951. stringdispose(path);
  952. stringdispose(modulename);
  953. stringdispose(mainsource);
  954. stringdispose(asmprefix);
  955. if assigned(globalsymtable) then
  956. dispose(punitsymtable(globalsymtable),done);
  957. globalsymtable:=nil;
  958. if assigned(localsymtable) then
  959. dispose(punitsymtable(localsymtable),done);
  960. localsymtable:=nil;
  961. inherited done;
  962. end;
  963. {****************************************************************************
  964. TUSED_UNIT
  965. ****************************************************************************}
  966. constructor tused_unit.init(_u : pmodule;intface:boolean);
  967. begin
  968. u:=_u;
  969. in_interface:=intface;
  970. in_uses:=false;
  971. is_stab_written:=false;
  972. loaded:=true;
  973. name:=stringdup(_u^.modulename^);
  974. checksum:=_u^.crc;
  975. unitid:=0;
  976. end;
  977. constructor tused_unit.init_to_load(const n:string;c:longint;intface:boolean);
  978. begin
  979. u:=nil;
  980. in_interface:=intface;
  981. in_uses:=false;
  982. is_stab_written:=false;
  983. loaded:=false;
  984. name:=stringdup(n);
  985. checksum:=c;
  986. unitid:=0;
  987. end;
  988. destructor tused_unit.done;
  989. begin
  990. stringdispose(name);
  991. inherited done;
  992. end;
  993. end.
  994. {
  995. $Log$
  996. Revision 1.85 1999-01-14 21:47:11 peter
  997. * status.currentmodule is now also updated
  998. + status.currentsourcepath
  999. Revision 1.84 1999/01/14 11:38:39 daniel
  1000. * Exe name derived from target_info instead of target_os
  1001. Revision 1.83 1999/01/13 15:02:00 daniel
  1002. * Tinputfile.readbuf eof bugfix
  1003. Revision 1.82 1999/01/12 14:25:26 peter
  1004. + BrowserLog for browser.log generation
  1005. + BrowserCol for browser info in TCollections
  1006. * released all other UseBrowser
  1007. Revision 1.81 1998/12/28 23:26:14 peter
  1008. + resource file handling ($R directive) for Win32
  1009. Revision 1.80 1998/12/16 00:27:19 peter
  1010. * removed some obsolete version checks
  1011. Revision 1.79 1998/12/11 00:03:14 peter
  1012. + globtype,tokens,version unit splitted from globals
  1013. Revision 1.78 1998/12/04 10:18:07 florian
  1014. * some stuff for procedures of object added
  1015. * bug with overridden virtual constructors fixed (reported by Italo Gomes)
  1016. Revision 1.77 1998/12/02 16:23:37 jonas
  1017. * changed "if longintvar in set" to case or "if () or () .." statements
  1018. * tree.pas: changed inlinenumber (and associated constructor/vars) to a byte
  1019. Revision 1.76 1998/12/01 12:51:19 peter
  1020. * fixed placing of ppas.sh and link.res when using -FE
  1021. Revision 1.75 1998/11/16 15:41:40 peter
  1022. * tp7 didn't like my ifopt H+ :(
  1023. Revision 1.74 1998/11/16 12:18:01 peter
  1024. * H+ fixes
  1025. Revision 1.73 1998/11/16 11:28:58 pierre
  1026. * stackcheck removed for i386_win32
  1027. * exportlist does not crash at least !!
  1028. (was need for tests dir !)z
  1029. Revision 1.72 1998/11/15 16:32:35 florian
  1030. * some stuff of Pavel implement (win32 dll creation)
  1031. * bug with ansistring function results fixed
  1032. Revision 1.71 1998/11/06 09:45:40 pierre
  1033. * bug on errors (file used after dispose !) fixed
  1034. Revision 1.70 1998/11/03 11:33:14 peter
  1035. + search_unit arg to only search for sources
  1036. Revision 1.69 1998/10/29 11:35:44 florian
  1037. * some dll support for win32
  1038. * fixed assembler writing for PalmOS
  1039. Revision 1.68 1998/10/27 10:22:34 florian
  1040. + First things for win32 export sections
  1041. Revision 1.67 1998/10/26 22:23:29 peter
  1042. + fixpath() has an extra option to allow a ./ as path
  1043. Revision 1.66 1998/10/19 18:07:11 peter
  1044. + external dll_name name func support for linux
  1045. Revision 1.65 1998/10/15 12:22:25 pierre
  1046. * close include files immediately after end reading
  1047. instead of waiting until unit compilation ended !
  1048. Revision 1.64 1998/10/14 13:38:19 peter
  1049. * fixed path with staticlib/objects in ppufiles
  1050. Revision 1.63 1998/10/14 11:02:49 daniel
  1051. * Stupid typo fixed.
  1052. Revision 1.62 1998/10/14 10:59:37 daniel
  1053. * Staticlibfilename now doesn't include path.
  1054. Revision 1.61 1998/10/14 10:57:25 daniel
  1055. * Dirstr, namestr, extstr.
  1056. * $V+ to prevent Peter from forgetting this.
  1057. * OS/2 compiler uses 8.3 filenames to support running the compiler on an old
  1058. DOS FAT partition.
  1059. Revision 1.60 1998/10/14 10:45:07 pierre
  1060. * ppu problems for m68k fixed (at least in cross compiling)
  1061. * one last memory leak for sysamiga fixed
  1062. * the amiga RTL compiles now completely !!
  1063. Revision 1.59 1998/10/13 14:01:07 peter
  1064. * fixed -al
  1065. Revision 1.58 1998/10/12 11:59:00 peter
  1066. + show name and date of .o and .s files which the compiler checks
  1067. Revision 1.57 1998/10/09 16:36:03 pierre
  1068. * some memory leaks specific to usebrowser define fixed
  1069. * removed tmodule.implsymtable (was like tmodule.localsymtable)
  1070. Revision 1.56 1998/10/09 08:56:26 pierre
  1071. * several memory leaks fixed
  1072. Revision 1.55 1998/10/08 23:28:54 peter
  1073. * -vu shows unit info, -vt shows tried/used files
  1074. Revision 1.54 1998/10/08 17:17:19 pierre
  1075. * current_module old scanner tagged as invalid if unit is recompiled
  1076. + added ppheap for better info on tracegetmem of heaptrc
  1077. (adds line column and file index)
  1078. * several memory leaks removed ith help of heaptrc !!
  1079. Revision 1.53 1998/10/08 13:48:43 peter
  1080. * fixed memory leaks for do nothing source
  1081. * fixed unit interdependency
  1082. Revision 1.52 1998/10/06 22:09:48 peter
  1083. * fixed for compiling with 0.99.8 due circular units
  1084. Revision 1.51 1998/10/06 17:16:47 pierre
  1085. * some memory leaks fixed (thanks to Peter for heaptrc !)
  1086. Revision 1.50 1998/09/30 16:43:34 peter
  1087. * fixed unit interdependency with circular uses
  1088. Revision 1.49 1998/09/28 16:57:20 pierre
  1089. * changed all length(p^.value_str^) into str_length(p)
  1090. to get it work with and without ansistrings
  1091. * changed sourcefiles field of tmodule to a pointer
  1092. Revision 1.48 1998/09/24 23:46:34 peter
  1093. + outputdir support
  1094. Revision 1.47 1998/09/22 17:13:43 pierre
  1095. + browsing updated and developed
  1096. records and objects fields are also stored
  1097. Revision 1.46 1998/09/21 08:45:10 pierre
  1098. + added vmt_offset in tobjectdef.write for fututre use
  1099. (first steps to have objects without vmt if no virtual !!)
  1100. + added fpu_used field for tabstractprocdef :
  1101. sets this level to 2 if the functions return with value in FPU
  1102. (is then set to correct value at parsing of implementation)
  1103. THIS MIGHT refuse some code with FPU expression too complex
  1104. that were accepted before and even in some cases
  1105. that don't overflow in fact
  1106. ( like if f : float; is a forward that finally in implementation
  1107. only uses one fpu register !!)
  1108. Nevertheless I think that it will improve security on
  1109. FPU operations !!
  1110. * most other changes only for UseBrowser code
  1111. (added symtable references for record and objects)
  1112. local switch for refs to args and local of each function
  1113. (static symtable still missing)
  1114. UseBrowser still not stable and probably broken by
  1115. the definition hash array !!
  1116. Revision 1.45 1998/09/18 09:58:51 peter
  1117. * -s doesn't require the .o to be available, this allows compiling of
  1118. everything on other platforms (profiling the windows.pp loading ;)
  1119. Revision 1.44 1998/09/10 13:51:32 peter
  1120. * tp compiler also uses 'as' as asmprefix
  1121. Revision 1.43 1998/09/03 17:08:45 pierre
  1122. * better lines for stabs
  1123. (no scroll back to if before else part
  1124. no return to case line at jump outside case)
  1125. + source lines also if not in order
  1126. Revision 1.42 1998/09/03 11:24:00 peter
  1127. * moved more inputfile things from tscannerfile to tinputfile
  1128. * changed ifdef Sourceline to cs_asm_source
  1129. Revision 1.41 1998/08/26 15:35:30 peter
  1130. * fixed scannerfiles for macros
  1131. + $I %<environment>%
  1132. Revision 1.40 1998/08/26 10:08:48 peter
  1133. * fixed problem with libprefix at the wrong place
  1134. * fixed lib generation with smartlinking and no -CS used
  1135. Revision 1.39 1998/08/25 16:44:16 pierre
  1136. * openppu was true even if the object file is missing
  1137. this lead to trying to open a filename without extension
  1138. and prevented the 'make cycle' to work for win32
  1139. Revision 1.38 1998/08/19 10:06:12 peter
  1140. * fixed filenames and removedir which supports slash at the end
  1141. Revision 1.37 1998/08/18 20:52:19 peter
  1142. * renamed in_main to in_global which is more logical
  1143. Revision 1.36 1998/08/17 10:10:07 peter
  1144. - removed OLDPPU
  1145. Revision 1.35 1998/08/17 09:17:44 peter
  1146. * static/shared linking updates
  1147. Revision 1.34 1998/08/14 21:56:31 peter
  1148. * setting the outputfile using -o works now to create static libs
  1149. Revision 1.33 1998/08/11 14:09:08 peter
  1150. * fixed some messages and smaller msgtxt.inc
  1151. Revision 1.32 1998/08/10 14:49:58 peter
  1152. + localswitches, moduleswitches, globalswitches splitting
  1153. Revision 1.31 1998/07/14 14:46:48 peter
  1154. * released NEWINPUT
  1155. Revision 1.30 1998/07/07 11:19:55 peter
  1156. + NEWINPUT for a better inputfile and scanner object
  1157. Revision 1.29 1998/06/25 10:51:00 pierre
  1158. * removed a remaining ifndef NEWPPU
  1159. replaced by ifdef OLDPPU
  1160. * added uf_finalize to ppu unit
  1161. Revision 1.28 1998/06/25 08:48:12 florian
  1162. * first version of rtti support
  1163. Revision 1.27 1998/06/24 14:48:34 peter
  1164. * ifdef newppu -> ifndef oldppu
  1165. Revision 1.26 1998/06/17 14:36:19 peter
  1166. * forgot an $ifndef OLDPPU :(
  1167. Revision 1.25 1998/06/17 14:10:11 peter
  1168. * small os2 fixes
  1169. * fixed interdependent units with newppu (remake3 under linux works now)
  1170. Revision 1.24 1998/06/16 08:56:20 peter
  1171. + targetcpu
  1172. * cleaner pmodules for newppu
  1173. Revision 1.23 1998/06/15 14:44:36 daniel
  1174. * BP updates.
  1175. Revision 1.22 1998/06/14 18:25:41 peter
  1176. * small fix with crc in newppu
  1177. Revision 1.21 1998/06/13 00:10:05 peter
  1178. * working browser and newppu
  1179. * some small fixes against crashes which occured in bp7 (but not in
  1180. fpc?!)
  1181. Revision 1.20 1998/06/12 14:50:48 peter
  1182. * removed the tree dependency to types.pas
  1183. * long_fil.pas support (not fully tested yet)
  1184. Revision 1.19 1998/06/12 10:32:26 pierre
  1185. * column problem hopefully solved
  1186. + C vars declaration changed
  1187. Revision 1.18 1998/06/11 13:58:07 peter
  1188. * small fix to let newppu compile
  1189. Revision 1.17 1998/06/09 16:01:40 pierre
  1190. + added procedure directive parsing for procvars
  1191. (accepted are popstack cdecl and pascal)
  1192. + added C vars with the following syntax
  1193. var C calias 'true_c_name';(can be followed by external)
  1194. reason is that you must add the Cprefix
  1195. which is target dependent
  1196. Revision 1.16 1998/06/04 10:42:19 pierre
  1197. * small bug fix in load_ppu or openppu
  1198. Revision 1.15 1998/05/28 14:37:53 peter
  1199. * default programname is PROGRAM (like TP7) to avoid dup id's
  1200. Revision 1.14 1998/05/27 19:45:02 peter
  1201. * symtable.pas splitted into includefiles
  1202. * symtable adapted for $ifndef OLDPPU
  1203. Revision 1.13 1998/05/23 01:21:05 peter
  1204. + aktasmmode, aktoptprocessor, aktoutputformat
  1205. + smartlink per module $SMARTLINK-/+ (like MMX) and moved to aktswitches
  1206. + $LIBNAME to set the library name where the unit will be put in
  1207. * splitted cgi386 a bit (codeseg to large for bp7)
  1208. * nasm, tasm works again. nasm moved to ag386nsm.pas
  1209. Revision 1.12 1998/05/20 09:42:33 pierre
  1210. + UseTokenInfo now default
  1211. * unit in interface uses and implementation uses gives error now
  1212. * only one error for unknown symbol (uses lastsymknown boolean)
  1213. the problem came from the label code !
  1214. + first inlined procedures and function work
  1215. (warning there might be allowed cases were the result is still wrong !!)
  1216. * UseBrower updated gives a global list of all position of all used symbols
  1217. with switch -gb
  1218. Revision 1.11 1998/05/12 10:46:59 peter
  1219. * moved printstatus to verb_def
  1220. + V_Normal which is between V_Error and V_Warning and doesn't have a
  1221. prefix like error: warning: and is included in V_Default
  1222. * fixed some messages
  1223. * first time parameter scan is only for -v and -T
  1224. - removed old style messages
  1225. Revision 1.10 1998/05/11 13:07:53 peter
  1226. + $ifndef OLDPPU for the new ppuformat
  1227. + $define GDB not longer required
  1228. * removed all warnings and stripped some log comments
  1229. * no findfirst/findnext anymore to remove smartlink *.o files
  1230. Revision 1.9 1998/05/06 15:04:20 pierre
  1231. + when trying to find source files of a ppufile
  1232. check the includepathlist for included files
  1233. the main file must still be in the same directory
  1234. Revision 1.8 1998/05/04 17:54:25 peter
  1235. + smartlinking works (only case jumptable left todo)
  1236. * redesign of systems.pas to support assemblers and linkers
  1237. + Unitname is now also in the PPU-file, increased version to 14
  1238. Revision 1.7 1998/05/01 16:38:44 florian
  1239. * handling of private and protected fixed
  1240. + change_keywords_to_tp implemented to remove
  1241. keywords which aren't supported by tp
  1242. * break and continue are now symbols of the system unit
  1243. + widestring, longstring and ansistring type released
  1244. Revision 1.6 1998/05/01 07:43:53 florian
  1245. + basics for rtti implemented
  1246. + switch $m (generate rtti for published sections)
  1247. Revision 1.5 1998/04/30 15:59:40 pierre
  1248. * GDB works again better :
  1249. correct type info in one pass
  1250. + UseTokenInfo for better source position
  1251. * fixed one remaining bug in scanner for line counts
  1252. * several little fixes
  1253. Revision 1.4 1998/04/29 10:33:52 pierre
  1254. + added some code for ansistring (not complete nor working yet)
  1255. * corrected operator overloading
  1256. * corrected nasm output
  1257. + started inline procedures
  1258. + added starstarn : use ** for exponentiation (^ gave problems)
  1259. + started UseTokenInfo cond to get accurate positions
  1260. Revision 1.3 1998/04/27 23:10:28 peter
  1261. + new scanner
  1262. * $makelib -> if smartlink
  1263. * small filename fixes pmodule.setfilename
  1264. * moved import from files.pas -> import.pas
  1265. Revision 1.2 1998/04/21 10:16:47 peter
  1266. * patches from strasbourg
  1267. * objects is not used anymore in the fpc compiled version
  1268. }