files.pas 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899
  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. interface
  21. uses
  22. cobjects,globals;
  23. const
  24. {$ifdef FPC}
  25. maxunits = 1024;
  26. {$else}
  27. maxunits = 128;
  28. {$endif}
  29. type
  30. pextfile = ^textfile;
  31. { this isn't a text file, this is t-ext-file }
  32. { which means a extended file }
  33. { this files can be handled by a file }
  34. { manager }
  35. textfile = object(tbufferedfile)
  36. path,name,ext : pstring;
  37. { this is because there is a name conflict }
  38. { with the older next from tinputstack }
  39. _next : pextfile;
  40. { 65000 input files for a unit should be enough !! }
  41. ref_index : word;
  42. { p must be the complete path (with ending \ (or / for unix ...) }
  43. constructor init(const p,n,e : string);
  44. destructor done;virtual;
  45. end;
  46. pinputfile = ^tinputfile;
  47. tinputfile = object(textfile)
  48. filenotatend : boolean;
  49. line_no : longint;
  50. { second counter for unimportant tokens }
  51. line_count : longint;
  52. { next input file in the stack of input files }
  53. next : pinputfile;
  54. { to handle the browser refs }
  55. ref_count : longint;
  56. constructor init(const p,n,e : string);
  57. { writes the file name and line number to t }
  58. procedure write_file_line(var t : text);
  59. function get_file_line : string;
  60. end;
  61. pfilemanager = ^tfilemanager;
  62. tfilemanager = object
  63. files : pextfile;
  64. last_ref_index : word;
  65. constructor init;
  66. destructor done;
  67. procedure close_all;
  68. procedure register_file(f : pextfile);
  69. end;
  70. pimported_procedure = ^timported_procedure;
  71. timported_procedure = object(tlinkedlist_item)
  72. ordnr : word;
  73. name,func : pstring;
  74. { should be plabel, but this gaves problems with circular units }
  75. lab : pointer;
  76. constructor init(const n,s : string;o : word);
  77. destructor done;virtual;
  78. end;
  79. pimportlist = ^timportlist;
  80. timportlist = object(tlinkedlist_item)
  81. dllname : pstring;
  82. imported_procedures : plinkedlist;
  83. constructor init(const n : string);
  84. destructor done;virtual;
  85. end;
  86. type
  87. pmodule = ^tmodule;
  88. pused_unit = ^tused_unit;
  89. tused_unit = object(tlinkedlist_item)
  90. u : pmodule;
  91. in_uses, in_interface, is_stab_written : boolean;
  92. unitid : word;
  93. constructor init(_u : pmodule;f : byte);
  94. destructor done;virtual;
  95. end;
  96. tunitmap = array[0..maxunits-1] of pointer;
  97. punitmap = ^tunitmap;
  98. tmodule = object(tlinkedlist_item)
  99. { the PPU file }
  100. ppufile : pextfile;
  101. { used for global switches - in_main section after uses clause }
  102. { then TRUE else false. }
  103. in_main : boolean;
  104. { mapping of all used units }
  105. map : punitmap;
  106. { local unit counter }
  107. unitcount : word;
  108. { this is a pointer because symtable uses this unit }
  109. { it should be psymtable }
  110. symtable : pointer;
  111. { PPU version, handle different versions }
  112. ppuversion : longint;
  113. { check sum written to the file }
  114. crc : longint;
  115. { flags }
  116. flags : byte;
  117. {Set if the module imports from DLL's.}
  118. uses_imports:boolean;
  119. imports : plinkedlist;
  120. { how to write this file }
  121. output_format : tof;
  122. { for interpenetrated units }
  123. in_implementation,
  124. compiled,
  125. do_assemble,
  126. do_compile, { true, if it's needed to compile the sources }
  127. sources_avail : boolean; { true, if all sources are reachable }
  128. { only used, if the module is compiled by this compiler call }
  129. sourcefiles : tfilemanager;
  130. linklibfiles,
  131. linkofiles : tstringcontainer;
  132. used_units : tlinkedlist;
  133. current_inputfile : pinputfile;
  134. unitname, { name of the (unit) module }
  135. objfilename, { fullname of the objectfile }
  136. asmfilename, { fullname of the assemblerfile }
  137. ppufilename, { fullname of the ppufile }
  138. mainsource : pstring; { name of the main sourcefile }
  139. constructor init(const s:string;is_unit:boolean);
  140. { this is to be called only when compiling again }
  141. destructor special_done;virtual;
  142. function load_ppu(const unit_path,n,ext : string):boolean;
  143. procedure search_unit(const n : string);
  144. end;
  145. const
  146. main_module : pmodule = nil;
  147. current_module : pmodule = nil;
  148. var
  149. loaded_units : tlinkedlist;
  150. type
  151. tunitheader = array[0..19] of char;
  152. const
  153. { compiler version }
  154. { format | }
  155. { signature | | }
  156. { | | | }
  157. { /-------\ /-------\ /----\ }
  158. unitheader : tunitheader = ('P','P','U','0','1','3',#0,#99,
  159. #0,#0,#0,#0,#0,#0,#255,#255,
  160. { | | \---------/ \-------/ }
  161. { | | | | }
  162. { | | check sum | }
  163. { | \--flags unused }
  164. { target system }
  165. #0,#0,#0,#0);
  166. {\---------/ }
  167. { | }
  168. { start of machine language }
  169. const
  170. ibloadunit = 1;
  171. iborddef = 2;
  172. ibpointerdef = 3;
  173. ibtypesym = 4;
  174. ibarraydef = 5;
  175. ibprocdef = 6;
  176. ibprocsym = 7;
  177. iblinkofile = 8;
  178. ibstringdef = 9;
  179. ibvarsym = 10;
  180. ibconstsym = 11;
  181. ibinitunit = 12;
  182. ibaufzaehlsym = 13;
  183. ibtypedconstsym = 14;
  184. ibrecorddef = 15;
  185. ibfiledef = 16;
  186. ibformaldef = 17;
  187. ibobjectdef = 18;
  188. ibenumdef = 19;
  189. ibsetdef = 20;
  190. ibprocvardef = 21;
  191. ibsourcefile = 22;
  192. ibdbxcount = 23;
  193. ibfloatdef = 24;
  194. ibref = 25;
  195. ibextsymref = 26;
  196. ibextdefref = 27;
  197. ibabsolutesym = 28;
  198. ibclassrefdef = 29;
  199. ibpropertysym = 30;
  200. iblibraries = 31;
  201. iblongstringdef = 32;
  202. ibansistringdef = 33;
  203. ibunitname = 34;
  204. ibend = 255;
  205. { unit flags }
  206. uf_init = $1;
  207. uf_uses_dbx = $2;
  208. uf_uses_browser = $4;
  209. uf_in_library = $8;
  210. uf_shared_library = $10;
  211. uf_big_endian = $20;
  212. uf_smartlink = $40;
  213. implementation
  214. uses
  215. dos,verbose,systems;
  216. {****************************************************************************
  217. TFILE
  218. ****************************************************************************}
  219. constructor textfile.init(const p,n,e : string);
  220. begin
  221. {$ifdef FPC}
  222. inherited init(p+n+e,65536);
  223. {$else}
  224. inherited init(p+n+e,10000);
  225. {$endif}
  226. path:=stringdup(p);
  227. name:=stringdup(n);
  228. ext:=stringdup(e);
  229. end;
  230. destructor textfile.done;
  231. begin
  232. inherited done;
  233. end;
  234. {****************************************************************************
  235. TINPUTFILE
  236. ****************************************************************************}
  237. constructor tinputfile.init(const p,n,e : string);
  238. begin
  239. inherited init(p,n,e);
  240. filenotatend:=true;
  241. line_no:=1;
  242. line_count:=0;
  243. next:=nil;
  244. end;
  245. procedure tinputfile.write_file_line(var t : text);
  246. begin
  247. write(t,get_file_line);
  248. end;
  249. function tinputfile.get_file_line : string;
  250. begin
  251. {$ifdef USE_RHIDE}
  252. get_file_line:=lowercase(name^+ext^)+':'+tostr(line_no)+':'
  253. {$else USE_RHIDE}
  254. get_file_line:=name^+ext^+'('+tostr(line_no)+')'
  255. {$endif USE_RHIDE}
  256. end;
  257. {****************************************************************************
  258. TFILEMANAGER
  259. ****************************************************************************}
  260. constructor tfilemanager.init;
  261. begin
  262. files:=nil;
  263. last_ref_index:=0;
  264. end;
  265. destructor tfilemanager.done;
  266. var
  267. hp : pextfile;
  268. begin
  269. hp:=files;
  270. while assigned(hp) do
  271. begin
  272. files:=files^._next;
  273. dispose(hp,done);
  274. hp:=files;
  275. end;
  276. end;
  277. procedure tfilemanager.close_all;
  278. begin
  279. end;
  280. procedure tfilemanager.register_file(f : pextfile);
  281. begin
  282. inc(last_ref_index);
  283. f^._next:=files;
  284. f^.ref_index:=last_ref_index;
  285. files:=f;
  286. end;
  287. {****************************************************************************
  288. Imports stuff
  289. ****************************************************************************}
  290. constructor timported_procedure.init(const n,s : string;o : word);
  291. begin
  292. inherited init;
  293. func:=stringdup(n);
  294. name:=stringdup(s);
  295. ordnr:=o;
  296. lab:=nil;
  297. end;
  298. destructor timported_procedure.done;
  299. begin
  300. stringdispose(name);
  301. inherited done;
  302. end;
  303. constructor timportlist.init(const n : string);
  304. begin
  305. inherited init;
  306. dllname:=stringdup(n);
  307. imported_procedures:=new(plinkedlist,init);
  308. end;
  309. destructor timportlist.done;
  310. begin
  311. dispose(imported_procedures,done);
  312. stringdispose(dllname);
  313. end;
  314. {****************************************************************************
  315. TMODULE
  316. ****************************************************************************}
  317. {$I-}
  318. function tmodule.load_ppu(const unit_path,n,ext : string):boolean;
  319. var
  320. header : tunitheader;
  321. count : longint;
  322. temp,hs : string;
  323. b : byte;
  324. code : word;
  325. objfiletime,
  326. ppufiletime,
  327. asmfiletime,
  328. source_time : longint;
  329. {$ifdef UseBrowser}
  330. hp : pextfile;
  331. _d : dirstr;
  332. _n : namestr;
  333. _e : extstr;
  334. {$endif UseBrowser}
  335. begin
  336. load_ppu:=false;
  337. Message1(unit_u_ppu_loading,ppufilename^);
  338. ppufile:=new(pextfile,init(unit_path,n,ext));
  339. ppufile^.reset;
  340. ppufile^.flush;
  341. {Get ppufile time}
  342. ppufiletime:=getnamedfiletime(ppufilename^);
  343. Message1(unit_d_ppu_time,filetimestring(ppufiletime));
  344. { load the header }
  345. ppufile^.read_data(header,sizeof(header),count);
  346. if count<>sizeof(header) then
  347. begin
  348. ppufile^.done;
  349. Message(unit_d_ppu_file_too_short);
  350. exit;
  351. end;
  352. { check for a valid PPU file }
  353. if (header[0]<>'P') or (header[1]<>'P') or (header[2]<>'U') then
  354. begin
  355. ppufile^.done;
  356. Message(unit_d_ppu_invalid_header);
  357. exit;
  358. end;
  359. { load ppu version }
  360. val(header[3]+header[4]+header[5],ppuversion,code);
  361. if ppuversion<>13 then
  362. begin
  363. ppufile^.done;
  364. Message1(unit_d_ppu_invalid_version,tostr(ppuversion));
  365. exit;
  366. end;
  367. flags:=byte(header[9]);
  368. Message1(unit_d_ppu_flags,tostr(flags));
  369. crc:=plongint(@header[10])^;
  370. Message1(unit_d_ppu_crc,tostr(crc));
  371. { search source files there is at least one source file }
  372. do_compile:=false;
  373. sources_avail:=true;
  374. ppufile^.read_data(b,1,count);
  375. while b<>ibend do
  376. begin
  377. ppufile^.read_data(hs[0],1,count);
  378. ppufile^.read_data(hs[1],ord(hs[0]),count);
  379. if (flags and uf_in_library)<>0 then
  380. begin
  381. sources_avail:=false;
  382. temp:=' library';
  383. end
  384. else
  385. begin
  386. { check the date of the source files }
  387. Source_Time:=GetNamedFileTime(unit_path+hs);
  388. if Source_Time=-1 then
  389. begin
  390. sources_avail:=false;
  391. temp:=' not found';
  392. end
  393. else
  394. begin
  395. temp:=' time '+filetimestring(source_time);
  396. if (source_time>ppufiletime) then
  397. begin
  398. do_compile:=true;
  399. temp:=temp+' *'
  400. end;
  401. end;
  402. end;
  403. Message1(unit_t_ppu_source,unit_path+hs+temp);
  404. {$ifdef UseBrowser}
  405. fsplit(unit_path+hs,_d,_n,_e);
  406. new(hp,init(_d,_n,_e));
  407. { the indexing should match what is done in writeasunit }
  408. sourcefiles.register_file(hp);
  409. {$endif UseBrowser}
  410. ppufile^.read_data(b,1,count);
  411. end;
  412. { main source is always the last }
  413. stringdispose(mainsource);
  414. mainsource:=stringdup(ppufile^.path^+hs);
  415. { check the object and assembler file if not a library }
  416. if (flags and uf_in_library)=0 then
  417. begin
  418. { the objectfile should be newer than the ppu file }
  419. objfiletime:=getnamedfiletime(objfilename^);
  420. if (ppufiletime<0) or (objfiletime<0) or (ppufiletime>objfiletime) then
  421. begin
  422. { check if assembler file is older than ppu file }
  423. asmfileTime:=GetNamedFileTime(asmfilename^);
  424. if (asmfiletime<0) or (ppufiletime>asmfiletime) then
  425. begin
  426. Message(unit_d_obj_and_asm_are_older_than_ppu);
  427. do_compile:=true;
  428. end
  429. else
  430. begin
  431. Message(unit_d_obj_is_older_than_asm);
  432. do_assemble:=true;
  433. end;
  434. end;
  435. end;
  436. load_ppu:=true;
  437. end;
  438. procedure tmodule.search_unit(const n : string);
  439. var
  440. ext : string[8];
  441. singlepathstring,
  442. Path,
  443. filename : string;
  444. found : boolean;
  445. start,pos : longint;
  446. Function UnitExists(const ext:string):boolean;
  447. begin
  448. Message1(unit_t_unitsearch,Singlepathstring+filename+ext);
  449. UnitExists:=FileExists(Singlepathstring+FileName+ext);
  450. end;
  451. Procedure SetFileNames;
  452. begin
  453. stringdispose(mainsource);
  454. stringdispose(objfilename);
  455. stringdispose(asmfilename);
  456. stringdispose(ppufilename);
  457. mainsource:=stringdup(SinglePathString+FileName+ext);
  458. objfilename:=stringdup(SinglePathString+FileName+target_info.objext);
  459. asmfilename:=stringdup(SinglePathString+FileName+target_info.asmext);
  460. ppufilename:=stringdup(SinglePathString+FileName+target_info.unitext);
  461. end;
  462. begin
  463. start:=1;
  464. filename:=FixFileName(n);
  465. path:=UnitSearchPath;
  466. Found:=false;
  467. repeat
  468. {Create current path to check}
  469. pos:=system.pos(';',path);
  470. if pos=0 then
  471. pos:=length(path)+1;
  472. singlepathstring:=FixPath(copy(path,start,pos-start));
  473. delete(path,start,pos-start+1);
  474. { Check for PPL file }
  475. if not (cs_link_static in aktswitches) then
  476. begin
  477. Found:=UnitExists(target_info.libext);
  478. if Found then
  479. Begin
  480. SetFileNames;
  481. Found:=Load_PPU(singlepathstring,filename,target_info.libext);
  482. End;
  483. end;
  484. { Check for PPU file }
  485. if not (cs_link_dynamic in aktswitches) and not Found then
  486. begin
  487. Found:=UnitExists(target_info.unitext);
  488. if Found then
  489. Begin
  490. SetFileNames;
  491. Found:=Load_PPU(singlepathstring,filename,target_info.unitext);
  492. End;
  493. end;
  494. { Check for Sources }
  495. if not Found then
  496. begin
  497. ppufile:=nil;
  498. do_compile:=true;
  499. {Check for .pp file}
  500. Found:=UnitExists(target_info.sourceext);
  501. if Found then
  502. Ext:=target_info.sourceext
  503. else
  504. begin
  505. {Check for .pas}
  506. Found:=UnitExists(target_info.pasext);
  507. if Found then
  508. Ext:=target_info.pasext;
  509. end;
  510. if Found then
  511. begin
  512. sources_avail:=true;
  513. {Load Filenames when found}
  514. SetFilenames;
  515. end
  516. else
  517. begin
  518. sources_avail:=false;
  519. stringdispose(mainsource);
  520. end;
  521. end;
  522. until Found or (path='');
  523. end;
  524. constructor tmodule.init(const s:string;is_unit:boolean);
  525. var
  526. p:dirstr;
  527. n:namestr;
  528. e:extstr;
  529. begin
  530. FSplit(s,p,n,e);
  531. n:=Upper(n);
  532. unitname:=stringdup(n);
  533. objfilename:=nil;
  534. asmfilename:=nil;
  535. ppufilename:=nil;
  536. mainsource:=stringdup(s);
  537. used_units.init;
  538. sourcefiles.init;
  539. linkofiles.init;
  540. linklibfiles.init;
  541. ppufile:=nil;
  542. current_inputfile:=nil;
  543. map:=nil;
  544. symtable:=nil;
  545. flags:=0;
  546. unitcount:=1;
  547. do_assemble:=false;
  548. do_compile:=false;
  549. sources_avail:=true;
  550. compiled:=false;
  551. in_implementation:=false;
  552. in_main:=false;
  553. uses_imports:=false;
  554. imports:=new(plinkedlist,init);
  555. output_format:=commandline_output_format;
  556. { search the PPU file if it is an unit }
  557. if is_unit then
  558. search_unit(unitname^);
  559. end;
  560. destructor tmodule.special_done;
  561. begin
  562. if assigned(map) then dispose(map);
  563. { cannot remove that because it is linked
  564. in the global chain of used_objects
  565. used_units.done; }
  566. sourcefiles.done;
  567. linkofiles.done;
  568. linklibfiles.done;
  569. if assigned(ppufile) then
  570. dispose(ppufile,done);
  571. if assigned(imports) then
  572. dispose(imports,done);
  573. inherited done;
  574. end;
  575. {****************************************************************************
  576. TUSED_UNIT
  577. ****************************************************************************}
  578. constructor tused_unit.init(_u : pmodule;f : byte);
  579. begin
  580. u:=_u;
  581. in_interface:=false;
  582. in_uses:=false;
  583. is_stab_written:=false;
  584. unitid:=f;
  585. end;
  586. destructor tused_unit.done;
  587. begin
  588. inherited done;
  589. end;
  590. {$I+}
  591. end.
  592. {
  593. $Log$
  594. Revision 1.2 1998-04-21 10:16:47 peter
  595. * patches from strasbourg
  596. * objects is not used anymore in the fpc compiled version
  597. Revision 1.1.1.1 1998/03/25 11:18:12 root
  598. * Restored version
  599. Revision 1.37 1998/03/13 22:45:58 florian
  600. * small bug fixes applied
  601. Revision 1.36 1998/03/11 22:22:52 florian
  602. * Fixed circular unit uses, when the units are not in the current dir (from Peter)
  603. * -i shows correct info, not <lf> anymore (from Peter)
  604. * linking with shared libs works again (from Peter)
  605. Revision 1.35 1998/03/10 16:27:38 pierre
  606. * better line info in stabs debug
  607. * symtabletype and lexlevel separated into two fields of tsymtable
  608. + ifdef MAKELIB for direct library output, not complete
  609. + ifdef CHAINPROCSYMS for overloaded seach across units, not fully
  610. working
  611. + ifdef TESTFUNCRET for setting func result in underfunction, not
  612. working
  613. Revision 1.34 1998/03/10 01:17:18 peter
  614. * all files have the same header
  615. * messages are fully implemented, EXTDEBUG uses Comment()
  616. + AG... files for the Assembler generation
  617. Revision 1.33 1998/03/04 17:33:44 michael
  618. + Changed ifdef FPK to ifdef FPC
  619. Revision 1.32 1998/03/04 01:35:03 peter
  620. * messages for unit-handling and assembler/linker
  621. * the compiler compiles without -dGDB, but doesn't work yet
  622. + -vh for Hint
  623. Revision 1.31 1998/02/28 14:43:47 florian
  624. * final implemenation of win32 imports
  625. * extended tai_align to allow 8 and 16 byte aligns
  626. Revision 1.30 1998/02/28 09:30:57 florian
  627. + writing of win32 import section added
  628. Revision 1.29 1998/02/28 00:20:23 florian
  629. * more changes to get import libs for Win32 working
  630. Revision 1.28 1998/02/26 11:57:06 daniel
  631. * New assembler optimizations commented out, because of bugs.
  632. * Use of dir-/name- and extstr.
  633. Revision 1.27 1998/02/24 14:20:51 peter
  634. + tstringcontainer.empty
  635. * ld -T option restored for linux
  636. * libraries are placed before the objectfiles in a .PPU file
  637. * removed 'uses link' from files.pas
  638. Revision 1.26 1998/02/24 10:29:13 peter
  639. * -a works again
  640. Revision 1.25 1998/02/24 00:19:09 peter
  641. * makefile works again (btw. linux does like any char after a \ )
  642. * removed circular unit with assemble and files
  643. * fixed a sigsegv in pexpr
  644. * pmodule init unit/program is the almost the same, merged them
  645. Revision 1.24 1998/02/22 23:03:17 peter
  646. * renamed msource->mainsource and name->unitname
  647. * optimized filename handling, filename is not seperate anymore with
  648. path+name+ext, this saves stackspace and a lot of fsplit()'s
  649. * recompiling of some units in libraries fixed
  650. * shared libraries are working again
  651. + $LINKLIB <lib> to support automatic linking to libraries
  652. + libraries are saved/read from the ppufile, also allows more libraries
  653. per ppufile
  654. Revision 1.23 1998/02/17 21:20:48 peter
  655. + Script unit
  656. + __EXIT is called again to exit a program
  657. - target_info.link/assembler calls
  658. * linking works again for dos
  659. * optimized a few filehandling functions
  660. * fixed stabs generation for procedures
  661. Revision 1.22 1998/02/16 12:51:30 michael
  662. + Implemented linker object
  663. Revision 1.21 1998/02/13 10:34:58 daniel
  664. * Made Motorola version compilable.
  665. * Fixed optimizer
  666. Revision 1.20 1998/02/12 11:50:04 daniel
  667. Yes! Finally! After three retries, my patch!
  668. Changes:
  669. Complete rewrite of psub.pas.
  670. Added support for DLL's.
  671. Compiler requires less memory.
  672. Platform units for each platform.
  673. Revision 1.19 1998/02/06 23:08:33 florian
  674. + endian to targetinfo and sourceinfo added
  675. + endian independed writing of ppu file (reading missed), a PPU file
  676. is written with the target endian
  677. Revision 1.18 1998/02/02 13:13:27 pierre
  678. * line_count transfered to tinputfile, to avoid crosscounting
  679. Revision 1.17 1998/01/30 17:31:20 pierre
  680. * bug of cyclic symtablestack fixed
  681. Revision 1.16 1998/01/26 18:51:18 peter
  682. * ForceSlash() changed to FixPath() which also removes a trailing './'
  683. Revision 1.15 1998/01/23 17:12:11 pierre
  684. * added some improvements for as and ld :
  685. - doserror and dosexitcode treated separately
  686. - PATH searched if doserror=2
  687. + start of long and ansi string (far from complete)
  688. in conditionnal UseLongString and UseAnsiString
  689. * options.pas cleaned (some variables shifted to globals)gl
  690. Revision 1.14 1998/01/22 08:57:54 peter
  691. + added target_info.pasext and target_info.libext
  692. Revision 1.13 1998/01/21 00:11:35 peter
  693. * files in a ppl will now not recompile
  694. * better info about source files of a ppu, a * after the time will
  695. indicate that the file is changed
  696. Revision 1.12 1998/01/20 13:16:29 michael
  697. + Added flag for static/shared libs.
  698. Revision 1.11 1998/01/17 01:57:32 michael
  699. + Start of shared library support. First working version.
  700. Revision 1.10 1998/01/16 12:52:09 michael
  701. + Path treatment and file searching should now be more or less in their
  702. definite form:
  703. - Using now modified AddPathToList everywhere.
  704. - File Searching mechanism is uniform for all files.
  705. - Include path is working now !!
  706. All fixes by Peter Vreman. Tested with remake3 target.
  707. Revision 1.9 1998/01/16 00:00:54 michael
  708. + Better and more modular searching and loading of units.
  709. - searching in tmodule.search_unit.
  710. - initial Loading in tmpodule.load_ppu.
  711. - tmodule.init now calls search_unit.
  712. * Case sensitivity problem of unix hopefully solved now forever.
  713. (All from Peter Vreman, checked with remake3)
  714. Revision 1.8 1998/01/15 13:07:46 michael
  715. + added library treating stuff
  716. Revision 1.7 1998/01/15 12:01:19 michael
  717. * Linux prints now that actual name of the file being loaded.
  718. Revision 1.6 1998/01/13 23:39:26 michael
  719. * changed mechanism to look for unit file.
  720. + added iblibraries constant to implement shared libraries.
  721. Revision 1.5 1998/01/13 23:05:51 florian
  722. + unit format 013 (change of options size, see symtable.pas log)
  723. Revision 1.4 1998/01/13 17:13:06 michael
  724. * File time handling and file searching is now done in an OS-independent way,
  725. using the new file treating functions in globals.pas.
  726. Revision 1.3 1998/01/07 00:16:49 michael
  727. Restored released version (plus fixes) as current
  728. Revision 1.2 1997/11/28 18:14:31 pierre
  729. working version with several bug fixes
  730. Revision 1.1.1.1 1997/11/27 08:32:56 michael
  731. FPC Compiler CVS start
  732. Pre-CVS log:
  733. CEC Carl-Eric Codere
  734. FK Florian Klaempfl
  735. + feature added
  736. - removed
  737. * bug fixed or changed
  738. History (started with version 0.9.0):
  739. 2th december 1996:
  740. + unit started (FK)
  741. 22th december 1996:
  742. + tinputfile added (FK)
  743. 7th september 1997:
  744. + moved main_module and current_module to const section
  745. line ~319 and ~416: in_main initialized - added in_main
  746. field to tmodule object (CEC)
  747. }