files.pas 26 KB

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