files.pas 27 KB

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