files.pas 42 KB

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