Browse Source

* fixed -L on the commandline, Dos commandline is only 128 bytes

peter 27 years ago
parent
commit
cfa06433c6
2 changed files with 41 additions and 28 deletions
  1. 17 19
      compiler/link.pas
  2. 24 9
      compiler/systems.pas

+ 17 - 19
compiler/link.pas

@@ -255,7 +255,7 @@ Function TLinker.WriteResponseFile : Boolean;
 Var
   LinkResponse : Text;
   i            : longint;
-  prtobj,s     : string;
+  prtobj,s,s2  : string;
 begin
 { Open linkresponse and write header }
   assign(linkresponse,inputdir+LinkResName);
@@ -275,8 +275,19 @@ begin
                   end;
   end;
 
-  writeln(linkresponse,target_link.inputstart);
+{ Add library searchpath }
+  S2:=LibrarySearchPath;
+  Repeat
+    i:=Pos(';',S2);
+    If i=0 then
+     i:=255;
+    S:=Copy(S2,1,i-1);
+    If S<>'' then
+      WriteLn(linkresponse,target_link.libpathprefix+s+target_link.libpathsuffix);
+    Delete (S2,1,i);
+  until S2='';
 
+  writeln(linkresponse,target_link.inputstart);
 { add objectfiles, start with prt0 always }
   if prtobj<>'' then
    Writeln(linkresponse,FindObjectFile(prtobj));
@@ -286,7 +297,6 @@ begin
      if s<>'' then
       Writeln(linkresponse,s);
    end;
-
 { Write sharedlibraries like -l<lib> }
   While not SharedLibFiles.Empty do
    begin
@@ -296,7 +306,6 @@ begin
       Delete(S,i,255);
      writeln(linkresponse,target_link.libprefix+s);
    end;
-
   writeln(linkresponse,target_link.inputend);
 
 { Write staticlibraries }
@@ -342,20 +351,6 @@ begin
   if Strip then
    LinkOptions:=LinkOptions+target_link.stripopt;
 
-{ Add library searchpath to the commandline }
-
-  S2:=LibrarySearchPath;
-  Repeat
-    i:=Pos(';',S2);
-    If i=0 then
-     i:=255;
-    S:=Copy(S2,1,i-1);
-    If S<>'' then
-      LinkOptions:=LinkOptions+' -L'+s;
-    Delete (S2,1,i);
-  until S2='';
-
-
 { Write used files and libraries }
   WriteResponseFile;
 
@@ -443,7 +438,10 @@ end;
 end.
 {
   $Log$
-  Revision 1.9  1998-05-12 10:46:59  peter
+  Revision 1.10  1998-05-22 12:32:47  peter
+    * fixed -L on the commandline, Dos commandline is only 128 bytes
+
+  Revision 1.9  1998/05/12 10:46:59  peter
     * moved printstatus to verb_def
     + V_Normal which is between V_Error and V_Warning and doesn't have a
       prefix like error: warning: and is included in V_Default

+ 24 - 9
compiler/systems.pas

@@ -75,14 +75,16 @@ unit systems;
        end;
 
        tlinkinfo = record
-          linkbin   : string[8];
-          linkcmd   : string[50];
-          stripopt  : string[2];
-          groupstart,
-          groupend,
-          inputstart,
-          inputend  : string[8];
-          libprefix : string[2];
+          linkbin       : string[8];
+          linkcmd       : string[50];
+          stripopt      : string[2];
+          libpathprefix : string[12];
+          libpathsuffix : string[2];
+          groupstart    : string[8];
+          groupend      : string[2];
+          inputstart    : string[8];
+          inputend      : string[2];
+          libprefix     : string[2];
        end;
 
        ttargetinfo = record
@@ -279,6 +281,8 @@ unit systems;
             linkbin : 'ld';
             linkcmd : '$OPT -o $EXE $RES';
             stripopt   : '-s';
+            libpathprefix : 'SEARCH_DIR(';
+            libpathsuffix : ')';
             groupstart : 'GROUP(';
             groupend   : ')';
             inputstart : 'INPUT(';
@@ -290,6 +294,8 @@ unit systems;
             linkbin : 'ld';
             linkcmd : '-oformat coff-go32 $OPT -o $EXE @$RES';
             stripopt   : '-s';
+            libpathprefix : '-L';
+            libpathsuffix : '';
             groupstart : '-(';
             groupend   : '-)';
             inputstart : '';
@@ -300,6 +306,8 @@ unit systems;
             linkbin : 'ld';
             linkcmd : '-oformat coff-go32-exe $OPT -o $EXE @$RES';
             stripopt   : '-s';
+            libpathprefix : '-L';
+            libpathsuffix : '';
             groupstart : '-(';
             groupend   : '-)';
             inputstart : '';
@@ -310,6 +318,8 @@ unit systems;
             linkbin : 'ldw';
             linkcmd : '$OPT -o $EXE $RES';
             stripopt   : '-s';
+            libpathprefix : 'SEARCH_DIR(';
+            libpathsuffix : ')';
             groupstart : 'GROUP(';
             groupend   : ')';
             inputstart : 'INPUT(';
@@ -320,6 +330,8 @@ unit systems;
             linkbin : 'ld';
             linkcmd : '-o $EXE @$RES';
             stripopt   : '-s';
+            libpathprefix : '-L';
+            libpathsuffix : '';
             groupstart : '-(';
             groupend   : '-)';
             inputstart : '';
@@ -519,7 +531,10 @@ begin
 end.
 {
   $Log$
-  Revision 1.10  1998-05-11 13:07:58  peter
+  Revision 1.11  1998-05-22 12:32:49  peter
+    * fixed -L on the commandline, Dos commandline is only 128 bytes
+
+  Revision 1.10  1998/05/11 13:07:58  peter
     + $ifdef NEWPPU for the new ppuformat
     + $define GDB not longer required
     * removed all warnings and stripped some log comments