link.pas 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788
  1. {
  2. $Id$
  3. Copyright (c) 1998 by the FPC development team
  4. This unit handles the linker and binder calls for programs and
  5. libraries
  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 link;
  20. Interface
  21. uses cobjects,files;
  22. Type
  23. TLinker = Object
  24. Glibc2,
  25. LinkToC, { Should we link to the C libs? }
  26. Strip : Boolean; { Strip symbols ? }
  27. ObjectFiles,
  28. SharedLibFiles,
  29. StaticLibFiles : TStringContainer;
  30. LibrarySearchPath, { Search path for libraries }
  31. LinkOptions : string; { Additional options to the linker }
  32. DynamicLinker : String[80]; { What Dynamic linker ? }
  33. LinkResName : String[32]; { Name of response file }
  34. { Methods }
  35. Constructor Init;
  36. Destructor Done;
  37. procedure AddModuleFiles(hp:pmodule);
  38. function FindObjectFile(s : string) : string;
  39. function FindLibraryFile(s:string;const ext:string) : string;
  40. Procedure AddObject(const S : String);
  41. Procedure AddStaticLibrary(const S : String);
  42. Procedure AddSharedLibrary(S : String);
  43. Function FindLinker:String; { Find linker, sets Name }
  44. Function DoExec(const command,para:string;info,useshell:boolean):boolean;
  45. Function WriteResponseFile:Boolean;
  46. Function MakeExecutable:boolean;
  47. Procedure MakeStaticLibrary(filescnt:longint);
  48. Procedure MakeSharedLibrary;
  49. end;
  50. PLinker=^TLinker;
  51. Var
  52. Linker : TLinker;
  53. Implementation
  54. uses
  55. globtype,systems,
  56. script,globals,verbose
  57. {$ifdef i386}
  58. ,win_targ
  59. {$endif}
  60. {$ifdef linux}
  61. ,linux
  62. {$endif}
  63. ,dos
  64. ;
  65. {$ifndef linux}
  66. Procedure Shell(command:string);
  67. { This is already defined in the linux.ppu for linux, need for the *
  68. expansion under linux }
  69. var
  70. comspec : string;
  71. begin
  72. comspec:=getenv('COMSPEC');
  73. Exec(comspec,' /C '+command);
  74. end;
  75. {$endif}
  76. Constructor TLinker.Init;
  77. begin
  78. ObjectFiles.Init_no_double;
  79. SharedLibFiles.Init_no_double;
  80. StaticLibFiles.Init_no_double;
  81. LinkToC:=False;
  82. Glibc2:=false;
  83. Strip:=false;
  84. LinkOptions:='';
  85. {$ifdef linux}
  86. { first try glibc2 }
  87. DynamicLinker:='/lib/ld-linux.so.2';
  88. if FileExists(DynamicLinker) then
  89. Glibc2:=true
  90. else
  91. DynamicLinker:='/lib/ld-linux.so.1';
  92. LibrarySearchPath:='/lib;/usr/lib;/usr/lib/X11';
  93. {$else}
  94. DynamicLinker:='';
  95. LibrarySearchPath:='';
  96. {$endif}
  97. LinkResName:='link.res';
  98. end;
  99. Destructor TLinker.Done;
  100. begin
  101. ObjectFiles.Done;
  102. SharedLibFiles.Done;
  103. StaticLibFiles.Done;
  104. end;
  105. procedure TLinker.AddModuleFiles(hp:pmodule);
  106. begin
  107. with hp^ do
  108. begin
  109. while not linkunitfiles.empty do
  110. AddObject(linkunitfiles.Get);
  111. while not linkofiles.empty do
  112. AddObject(linkofiles.Get);
  113. while not linksharedlibs.empty do
  114. AddSharedLibrary(linksharedlibs.Get);
  115. while not linkstaticlibs.empty do
  116. AddStaticLibrary(linkstaticlibs.Get);
  117. end;
  118. end;
  119. var
  120. LastLDBin : string;
  121. Function TLinker.FindLinker:string;
  122. var
  123. ldfound : boolean;
  124. begin
  125. if LastLDBin='' then
  126. begin
  127. if utilsdirectory<>'' then
  128. begin
  129. LastLDBin:=Search(target_link.linkbin+source_os.exeext,
  130. utilsdirectory,ldfound)+target_link.linkbin+source_os.exeext;
  131. end
  132. else
  133. LastLDBin:=FindExe(target_link.linkbin,ldfound);
  134. if (not ldfound) and not(cs_link_extern in aktglobalswitches) then
  135. begin
  136. Message1(exec_w_linker_not_found,LastLDBin);
  137. aktglobalswitches:=aktglobalswitches+[cs_link_extern];
  138. end;
  139. if ldfound then
  140. Message1(exec_t_using_linker,LastLDBin);
  141. end;
  142. FindLinker:=LastLDBin;
  143. end;
  144. { searches an object file }
  145. function TLinker.FindObjectFile(s:string) : string;
  146. var
  147. found : boolean;
  148. begin
  149. if pos('.',s)=0 then
  150. s:=s+target_info.objext;
  151. s:=FixFileName(s);
  152. if FileExists(s) then
  153. begin
  154. Findobjectfile:=s;
  155. exit;
  156. end;
  157. { find object file
  158. 1. cwd
  159. 2. unit search path
  160. 3. local object path
  161. 4. global object path
  162. 5. exepath }
  163. found:=false;
  164. findobjectfile:=search(s,'.',found)+s;
  165. if (not found) then
  166. findobjectfile:=search(s,unitsearchpath,found)+s;
  167. if (not found) and assigned(current_module^.localobjectsearchpath) then
  168. findobjectfile:=search(s,current_module^.localobjectsearchpath^,found)+s;
  169. if (not found) then
  170. findobjectfile:=search(s,objectsearchpath,found)+s;
  171. if (not found) then
  172. findobjectfile:=search(s,exepath,found)+s;
  173. if not(cs_link_extern in aktglobalswitches) and (not found) then
  174. Message1(exec_w_objfile_not_found,s);
  175. end;
  176. { searches an library file }
  177. function TLinker.FindLibraryFile(s:string;const ext:string) : string;
  178. var
  179. found : boolean;
  180. begin
  181. if pos('.',s)=0 then
  182. s:=s+ext;
  183. if FileExists(s) then
  184. begin
  185. FindLibraryFile:=s;
  186. exit;
  187. end;
  188. { find libary
  189. 1. cwd
  190. 2. local libary dir
  191. 3. global libary dir
  192. 4. exe path of the compiler }
  193. found:=false;
  194. findlibraryfile:=search(s,'.',found)+s;
  195. if (not found) and assigned(current_module^.locallibrarysearchpath) then
  196. findlibraryfile:=search(s,current_module^.locallibrarysearchpath^,found)+s;
  197. if (not found) then
  198. findlibraryfile:=search(s,librarysearchpath,found)+s;
  199. if (not found) then
  200. findlibraryfile:=search(s,exepath,found)+s;
  201. if not(cs_link_extern in aktglobalswitches) and (not found) then
  202. Message1(exec_w_libfile_not_found,s);
  203. end;
  204. Procedure TLinker.AddObject(const S : String);
  205. begin
  206. ObjectFiles.Insert(FindObjectFile(s));
  207. end;
  208. Procedure TLinker.AddSharedLibrary(S:String);
  209. begin
  210. { remove prefix 'lib' }
  211. if Copy(s,1,length(target_os.libprefix))=target_os.libprefix then
  212. Delete(s,1,length(target_os.libprefix));
  213. { remove extension if any }
  214. if Copy(s,length(s)-length(target_os.sharedlibext)+1,length(target_os.sharedlibext))=target_os.sharedlibext then
  215. Delete(s,length(s)-length(target_os.sharedlibext)+1,length(target_os.sharedlibext)+1);
  216. { ready to be inserted }
  217. SharedLibFiles.Insert (S);
  218. end;
  219. Procedure TLinker.AddStaticLibrary(const S:String);
  220. begin
  221. StaticLibFiles.Insert(FindLibraryFile(s,target_os.staticlibext));
  222. end;
  223. Function TLinker.DoExec(const command,para:string;info,useshell:boolean):boolean;
  224. begin
  225. DoExec:=true;
  226. if not(cs_link_extern in aktglobalswitches) then
  227. begin
  228. swapvectors;
  229. if useshell then
  230. shell(command+' '+para)
  231. else
  232. exec(command,para);
  233. swapvectors;
  234. if (doserror<>0) then
  235. begin
  236. Message(exec_w_cant_call_linker);
  237. aktglobalswitches:=aktglobalswitches+[cs_link_extern];
  238. DoExec:=false;
  239. end
  240. else
  241. if (dosexitcode<>0) then
  242. begin
  243. Message(exec_w_error_while_linking);
  244. aktglobalswitches:=aktglobalswitches+[cs_link_extern];
  245. DoExec:=false;
  246. end;
  247. end;
  248. { Update asmres when externmode is set }
  249. if cs_link_extern in aktglobalswitches then
  250. begin
  251. if info then
  252. AsmRes.AddLinkCommand(Command,Para,current_module^.exefilename^)
  253. else
  254. AsmRes.AddLinkCommand(Command,Para,'');
  255. end;
  256. end;
  257. Function TLinker.WriteResponseFile : Boolean;
  258. Var
  259. LinkResponse : Text;
  260. i : longint;
  261. prtobj,s,s2 : string;
  262. found,linux_link_c,
  263. linklibc : boolean;
  264. procedure WriteRes(const s:string);
  265. begin
  266. if s<>'' then
  267. WriteLn(Linkresponse,s);
  268. end;
  269. procedure WriteResFileName(const s:string);
  270. begin
  271. if s<>'' then
  272. begin
  273. if (pos('\',s)=0) and (pos('/',s)=0) then
  274. WriteLn(Linkresponse,'.'+DirSep+s)
  275. else
  276. WriteLn(Linkresponse,s);
  277. end;
  278. end;
  279. begin
  280. WriteResponseFile:=False;
  281. linux_link_c:=false;
  282. { set special options for some targets }
  283. linklibc:=SharedLibFiles.Find('c');
  284. prtobj:='prt0';
  285. case target_info.target of
  286. target_m68k_Palmos,
  287. target_i386_Win32 :
  288. begin
  289. if DLLsource then
  290. prtobj:='wdllprt0'
  291. else
  292. prtobj:='wprt0';
  293. end;
  294. target_m68k_linux,
  295. target_i386_linux :
  296. begin
  297. if cs_profile in aktmoduleswitches then
  298. begin
  299. prtobj:='gprt0';
  300. if not glibc2 then
  301. AddSharedLibrary('gmon');
  302. AddSharedLibrary('c');
  303. linklibc:=true;
  304. end
  305. else
  306. begin
  307. if linklibc then
  308. prtobj:='cprt0';
  309. end;
  310. if linklibc then
  311. linux_link_c:=true;
  312. end;
  313. end;
  314. { Fix command line options }
  315. If not SharedLibFiles.Empty then
  316. LinkOptions:='-dynamic-linker='+DynamicLinker+' '+LinkOptions;
  317. if Strip and not(cs_debuginfo in aktmoduleswitches) then
  318. LinkOptions:=LinkOptions+' '+target_link.stripopt;
  319. { Open linkresponse and write header }
  320. assign(linkresponse,current_module^.outpath^+LinkResName);
  321. {$I-}
  322. rewrite(linkresponse);
  323. {$I+}
  324. if ioresult<>0 then
  325. exit;
  326. { Write library searchpath }
  327. if assigned(current_module^.locallibrarysearchpath) then
  328. begin
  329. S2:=current_module^.locallibrarysearchpath^;
  330. Repeat
  331. i:=Pos(';',S2);
  332. If i=0 then
  333. i:=255;
  334. S:=Copy(S2,1,i-1);
  335. If S<>'' then
  336. WriteRes(target_link.libpathprefix+s+target_link.libpathsuffix);
  337. Delete (S2,1,i);
  338. until S2='';
  339. end;
  340. S2:=LibrarySearchPath;
  341. Repeat
  342. i:=Pos(';',S2);
  343. If i=0 then
  344. i:=255;
  345. S:=Copy(S2,1,i-1);
  346. If S<>'' then
  347. WriteRes(target_link.libpathprefix+s+target_link.libpathsuffix);
  348. Delete (S2,1,i);
  349. until S2='';
  350. WriteRes(target_link.inputstart);
  351. { add objectfiles, start with prt0 always }
  352. if prtobj<>'' then
  353. WriteResFileName(FindObjectFile(prtobj));
  354. { try to add crti and crtbegin, they are normally not required, but
  355. adding can sometimes be usefull }
  356. if linux_link_c then
  357. begin
  358. s:=search('crtbegin.o',librarysearchpath,found)+'crtbegin.o';
  359. if found then
  360. WriteResFileName(s);
  361. s:=search('crti.o',librarysearchpath,found)+'crti.o';
  362. if found then
  363. WriteResFileName(s);
  364. end;
  365. while not ObjectFiles.Empty do
  366. begin
  367. s:=ObjectFiles.Get;
  368. if s<>'' then
  369. WriteResFileName(s);
  370. end;
  371. if linux_link_c then
  372. begin
  373. s:=search('crtend.o',librarysearchpath,found)+'crtend.o';
  374. if found then
  375. WriteResFileName(s);
  376. s:=search('crtn.o',librarysearchpath,found)+'crtn.o';
  377. if found then
  378. WriteResFileName(s);
  379. end;
  380. { Write sharedlibraries like -l<lib> }
  381. While not SharedLibFiles.Empty do
  382. begin
  383. S:=SharedLibFiles.Get;
  384. if s<>'c' then
  385. begin
  386. i:=Pos(target_os.sharedlibext,S);
  387. if i>0 then
  388. Delete(S,i,255);
  389. WriteRes(target_link.libprefix+s);
  390. end
  391. else
  392. linklibc:=true;
  393. end;
  394. { be sure that libc is the last lib }
  395. { arghhhh this is wrong for DJGPP !!!
  396. DJGPP need gcc after c lib (umod...) (PM) }
  397. if linklibc then
  398. WriteRes(target_link.libprefix+'c');
  399. { add libgcc after ! }
  400. if linklibc and (target_info.target=target_i386_go32v2) then
  401. WriteRes(target_link.libprefix+'gcc');
  402. WriteRes(target_link.inputend);
  403. { Write staticlibraries }
  404. if not StaticLibFiles.Empty then
  405. begin
  406. WriteRes(target_link.GroupStart);
  407. While not StaticLibFiles.Empty do
  408. begin
  409. S:=StaticLibFiles.Get;
  410. WriteResFileName(s)
  411. end;
  412. WriteRes(target_link.GroupEnd);
  413. end;
  414. { Close response }
  415. close(linkresponse);
  416. WriteResponseFile:=True;
  417. end;
  418. function TLinker.MakeExecutable:boolean;
  419. var
  420. bindbin : string[80];
  421. bindfound : boolean;
  422. s : string;
  423. success : boolean;
  424. ii : longint;
  425. begin
  426. {$ifdef linux}
  427. if LinkToC then
  428. begin
  429. AddObject('/usr/lib/crt0.o');
  430. AddObject('lprt');
  431. AddStaticLibrary('libc.a');
  432. AddStaticLibrary('libgcc.a');
  433. end;
  434. {$endif Linux}
  435. { Write used files and libraries }
  436. WriteResponseFile;
  437. { Call linker }
  438. if not(cs_link_extern in aktglobalswitches) then
  439. Message1(exec_i_linking,current_module^.exefilename^);
  440. s:=target_link.linkcmd;
  441. if DLLsource then
  442. Replace(s,'$EXE',current_module^.sharedlibfilename^)
  443. else
  444. Replace(s,'$EXE',current_module^.exefilename^);
  445. Replace(s,'$OPT',LinkOptions);
  446. Replace(s,'$RES',current_module^.outpath^+LinkResName);
  447. success:=DoExec(FindLinker,s,true,false);
  448. {Bind}
  449. if (target_link.bindbin[1]<>'') and
  450. ((target_info.target<>target_i386_win32) or bind_win32_dll) then
  451. for ii:=1 to target_link.binders do
  452. begin
  453. s:=target_link.bindcmd[ii];
  454. Replace(s,'$OPT',LinkOptions);
  455. Replace(s,'$RES',current_module^.outpath^+LinkResName);
  456. if DLLsource then
  457. Replace(s,'$EXE',current_module^.sharedlibfilename^)
  458. else
  459. Replace(s,'$EXE',current_module^.exefilename^);
  460. {Size of the heap when an EMX program runs in OS/2.}
  461. Replace(s,'$HEAPMB',tostr((maxheapsize+1048575) shr 20));
  462. {Size of the stack when an EMX program runs in OS/2.}
  463. Replace(s,'$STACKKB',tostr((stacksize+1023) shr 10));
  464. {When an EMX program runs in DOS, the heap and stack share the
  465. same memory pool. The heap grows upwards, the stack grows downwards.}
  466. Replace(s,'$DOSHEAPKB',tostr((stacksize+maxheapsize+1023) shr 10));
  467. if utilsdirectory<>'' then
  468. begin
  469. bindbin:=Search(target_link.bindbin[ii]+source_os.exeext,
  470. utilsdirectory,bindfound)+target_link.bindbin[ii]+source_os.exeext;
  471. end
  472. else
  473. bindbin:=FindExe(target_link.bindbin[ii],bindfound);
  474. if (not bindfound) and not (cs_link_extern in aktglobalswitches) then
  475. begin
  476. Message1(exec_w_binder_not_found,bindbin);
  477. aktglobalswitches:=aktglobalswitches+[cs_link_extern];
  478. end;
  479. DoExec(bindbin,s,false,false);
  480. end;
  481. { Post processor executable }
  482. {$ifdef i386}
  483. if (target_info.target=target_i386_Win32) and success and
  484. not(cs_link_extern in aktglobalswitches) then
  485. if DLLsource then
  486. win_targ.postprocessexecutable(current_module^.sharedlibfilename^)
  487. else
  488. win_targ.postprocessexecutable(current_module^.exefilename^);
  489. {$endif}
  490. {Remove ReponseFile}
  491. if (success) and not(cs_link_extern in aktglobalswitches) then
  492. RemoveFile(current_module^.outpath^+LinkResName);
  493. MakeExecutable:=success; { otherwise a recursive call to link method }
  494. end;
  495. Procedure TLinker.MakeStaticLibrary(filescnt:longint);
  496. {
  497. FilesCnt holds the amount of .o files created, if filescnt=0 then
  498. no smartlinking is used
  499. }
  500. var
  501. smartpath,
  502. s,
  503. arbin : string;
  504. arfound : boolean;
  505. cnt : longint;
  506. begin
  507. smartpath:=current_module^.path^+FixPath(FixFileName(current_module^.modulename^)+target_info.smartext,false);
  508. { find ar binary }
  509. if utilsdirectory<>'' then
  510. begin
  511. arbin:=Search(target_ar.arbin+source_os.exeext,
  512. utilsdirectory,arfound)+target_ar.arbin+source_os.exeext;
  513. end
  514. else
  515. arbin:=FindExe(target_ar.arbin,arfound);
  516. if (not arfound) and not(cs_link_extern in aktglobalswitches) then
  517. begin
  518. Message(exec_w_ar_not_found);
  519. aktglobalswitches:=aktglobalswitches+[cs_link_extern];
  520. end;
  521. s:=target_ar.arcmd;
  522. Replace(s,'$LIB',current_module^.staticlibfilename^);
  523. if filescnt=0 then
  524. Replace(s,'$FILES',current_module^.objfilename^)
  525. else
  526. Replace(s,'$FILES',FixFileName(smartpath+current_module^.asmprefix^+'*'+target_info.objext));
  527. DoExec(arbin,s,false,true);
  528. { Clean up }
  529. if not(cs_asm_leave in aktglobalswitches) and not(cs_link_extern in aktglobalswitches) then
  530. begin
  531. if filescnt=0 then
  532. RemoveFile(current_module^.objfilename^)
  533. else
  534. begin
  535. for cnt:=1 to filescnt do
  536. if not RemoveFile(FixFileName(smartpath+current_module^.asmprefix^+tostr(cnt)+target_info.objext)) then
  537. RemoveFile(FixFileName(smartpath+current_module^.asmprefix^+'e'+tostr(cnt)+target_info.objext));
  538. RemoveDir(smartpath);
  539. end;
  540. end;
  541. end;
  542. Procedure TLinker.MakeSharedLibrary;
  543. var
  544. s : string;
  545. begin
  546. s:=' -shared -o $LIB $FILES';
  547. Replace(s,'$LIB',current_module^.sharedlibfilename^);
  548. Replace(s,'$FILES',current_module^.objfilename^);
  549. if DoExec(FindLinker,s,false,false) then
  550. RemoveFile(current_module^.objfilename^);
  551. end;
  552. end.
  553. {
  554. $Log$
  555. Revision 1.49 1999-03-25 16:55:30 peter
  556. + unitpath,librarypath,includepath,objectpath directives
  557. Revision 1.48 1999/03/23 16:22:43 peter
  558. * crtbegin/crtend only added if found
  559. Revision 1.47 1999/02/05 16:45:47 michael
  560. + Fixed gluing of options
  561. Revision 1.46 1999/02/05 08:54:26 pierre
  562. + linkofiles splitted inot linkofiles and linkunitfiles
  563. because linkofiles must be stored with directory
  564. to enabled linking of different objects with same name
  565. in a different directory
  566. Revision 1.45 1999/01/29 10:33:07 peter
  567. * objectsearchpath is now also searched if an object is not found
  568. Revision 1.44 1999/01/27 13:07:58 pierre
  569. * problem related with libc : go32v2 and linux differences
  570. Revision 1.43 1999/01/25 15:02:13 peter
  571. * link libc always as last
  572. Revision 1.42 1998/12/11 00:03:19 peter
  573. + globtype,tokens,version unit splitted from globals
  574. Revision 1.41 1998/12/01 23:39:46 pierre
  575. * postprocessexec for win32 changed
  576. Revision 1.40 1998/12/01 12:51:20 peter
  577. * fixed placing of ppas.sh and link.res when using -FE
  578. Revision 1.39 1998/11/30 13:26:23 pierre
  579. * the code for ordering the exported procs/vars was buggy
  580. + added -WB to force binding (Ozerski way of creating DLL)
  581. this is off by default as direct writing of .edata section seems
  582. OK
  583. Revision 1.38 1998/11/30 09:43:13 pierre
  584. * some range check bugs fixed (still not working !)
  585. + added DLL writing support for win32 (also accepts variables)
  586. + TempAnsi for code that could be used for Temporary ansi strings
  587. handling
  588. Revision 1.37 1998/10/26 22:23:31 peter
  589. + fixpath() has an extra option to allow a ./ as path
  590. Revision 1.36 1998/10/22 15:18:44 florian
  591. + switch -vx for win32 added
  592. Revision 1.35 1998/10/19 18:06:23 peter
  593. * use no_double
  594. Revision 1.34 1998/10/16 13:37:18 florian
  595. + switch -FD added to specify the path for utilities
  596. Revision 1.33 1998/10/14 13:38:22 peter
  597. * fixed path with staticlib/objects in ppufiles
  598. Revision 1.32 1998/10/14 11:03:55 daniel
  599. * Forgot to dereference a pointer.
  600. Revision 1.31 1998/10/14 11:01:21 daniel
  601. * Staticlibfilename no longer not include a path. Correction when calling
  602. ar.
  603. Revision 1.30 1998/10/13 13:10:18 peter
  604. * new style for m68k/i386 infos and enums
  605. Revision 1.29 1998/10/13 08:19:34 pierre
  606. + source_os is now set correctly for cross-processor compilers
  607. (tos contains all target_infos and
  608. we use CPU86 and CPU68 conditionnals to
  609. get the source operating system
  610. this only works if you do not undefine
  611. the source target !!)
  612. * several cg68k memory leaks fixed
  613. + started to change the code so that it should be possible to have
  614. a complete compiler (both for m68k and i386 !!)
  615. Revision 1.28 1998/10/08 23:28:56 peter
  616. * -vu shows unit info, -vt shows tried/used files
  617. Revision 1.27 1998/10/06 17:16:52 pierre
  618. * some memory leaks fixed (thanks to Peter for heaptrc !)
  619. Revision 1.26 1998/09/29 15:23:05 peter
  620. * remove also the end files for smartlinking
  621. Revision 1.25 1998/09/10 15:25:31 daniel
  622. + Added maxheapsize.
  623. * Corrected semi-bug in calling the assembler and the linker
  624. Revision 1.24 1998/09/07 18:32:45 peter
  625. * fixed for m68k
  626. Revision 1.23 1998/09/03 17:39:04 florian
  627. + better code for type conversation longint/dword to real type
  628. Revision 1.22 1998/09/01 09:01:00 peter
  629. + glibc2 support
  630. Revision 1.21 1998/08/31 12:26:26 peter
  631. * m68k and palmos updates from surebugfixes
  632. Revision 1.20 1998/08/19 10:06:14 peter
  633. * fixed filenames and removedir which supports slash at the end
  634. Revision 1.19 1998/08/17 09:17:47 peter
  635. * static/shared linking updates
  636. Revision 1.18 1998/08/14 21:56:34 peter
  637. * setting the outputfile using -o works now to create static libs
  638. Revision 1.17 1998/08/14 18:16:08 peter
  639. * return after a failed call will now add it to ppas
  640. Revision 1.16 1998/08/12 19:28:15 peter
  641. * better libc support
  642. Revision 1.15 1998/08/10 14:50:02 peter
  643. + localswitches, moduleswitches, globalswitches splitting
  644. Revision 1.14 1998/06/17 14:10:13 peter
  645. * small os2 fixes
  646. * fixed interdependent units with newppu (remake3 under linux works now)
  647. Revision 1.13 1998/06/08 22:59:46 peter
  648. * smartlinking works for win32
  649. * some defines to exclude some compiler parts
  650. Revision 1.12 1998/06/04 23:51:44 peter
  651. * m68k compiles
  652. + .def file creation moved to gendef.pas so it could also be used
  653. for win32
  654. Revision 1.11 1998/05/27 00:20:31 peter
  655. * some scanner optimizes
  656. * automaticly aout2exe for go32v1
  657. * fixed dynamiclinker option which was added at the wrong place
  658. Revision 1.10 1998/05/22 12:32:47 peter
  659. * fixed -L on the commandline, Dos commandline is only 128 bytes
  660. Revision 1.9 1998/05/12 10:46:59 peter
  661. * moved printstatus to verb_def
  662. + V_Normal which is between V_Error and V_Warning and doesn't have a
  663. prefix like error: warning: and is included in V_Default
  664. * fixed some messages
  665. * first time parameter scan is only for -v and -T
  666. - removed old style messages
  667. Revision 1.8 1998/05/11 13:07:54 peter
  668. + $ifdef NEWPPU for the new ppuformat
  669. + $define GDB not longer required
  670. * removed all warnings and stripped some log comments
  671. * no findfirst/findnext anymore to remove smartlink *.o files
  672. Revision 1.7 1998/05/08 09:21:20 michael
  673. * Added missing -Fl message to messages file.
  674. * Corrected mangling of file names when doing Linklib
  675. * -Fl now actually WORKS.
  676. * Librarysearchpath is now a field in linker object.
  677. Revision 1.6 1998/05/06 09:26:49 peter
  678. * fixed ld call with shell
  679. Revision 1.4 1998/05/04 17:54:25 peter
  680. + smartlinking works (only case jumptable left todo)
  681. * redesign of systems.pas to support assemblers and linkers
  682. + Unitname is now also in the PPU-file, increased version to 14
  683. Revision 1.3 1998/04/16 10:54:30 daniel
  684. * Fixed linking for OS/2.
  685. }