Преглед на файлове

* use an absolute output path for the linker when creating shared libraries,
so they can be used regardless where the executable is located

git-svn-id: trunk@1588 -

Jonas Maebe преди 20 години
родител
ревизия
41d2ba68fe
променени са 1 файла, в които са добавени 13 реда и са изтрити 0 реда
  1. 13 0
      compiler/systems/t_bsd.pas

+ 13 - 0
compiler/systems/t_bsd.pas

@@ -32,6 +32,11 @@ implementation
 
 
   uses
   uses
     cutils,cclasses,
     cutils,cclasses,
+{$ifdef USE_SYSUTILS}
+    sysutils,
+{$else USE_SYSUTILS}
+    dos,
+{$endif USE_SYSUTILS}
     verbose,systems,globtype,globals,
     verbose,systems,globtype,globals,
     symconst,script,
     symconst,script,
     fmodule,aasmbase,aasmtai,aasmcpu,cpubase,symsym,symdef,
     fmodule,aasmbase,aasmtai,aasmcpu,cpubase,symsym,symdef,
@@ -584,7 +589,15 @@ begin
 
 
 { Call linker }
 { Call linker }
   SplitBinCmd(Info.DllCmd[1],binstr,cmdstr);
   SplitBinCmd(Info.DllCmd[1],binstr,cmdstr);
+{$ifndef darwin}
   Replace(cmdstr,'$EXE',maybequoted(current_module.sharedlibfilename^));
   Replace(cmdstr,'$EXE',maybequoted(current_module.sharedlibfilename^));
+{$else darwin}
+{$ifdef USE_SYSUTILS}
+  Replace(cmdstr,'$EXE',maybequoted(ExpandFileName(current_module.sharedlibfilename^)));
+{$else USE_SYSUTILS}
+  Replace(cmdstr,'$EXE',maybequoted(FExpand(current_module.sharedlibfilename^)));
+{$endif USE_SYSUTILS}
+{$endif darwin}
   Replace(cmdstr,'$OPT',Info.ExtraOptions);
   Replace(cmdstr,'$OPT',Info.ExtraOptions);
   Replace(cmdstr,'$RES',maybequoted(outputexedir+Info.ResName));
   Replace(cmdstr,'$RES',maybequoted(outputexedir+Info.ResName));
   Replace(cmdstr,'$INIT',InitStr);
   Replace(cmdstr,'$INIT',InitStr);