link.pas 23 KB

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