files.pas 27 KB

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