files.pas 27 KB

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