Prechádzať zdrojové kódy

Add scripted version of wlib call for msdos

git-svn-id: trunk@26442 -
pierre 11 rokov pred
rodič
commit
bef22b2a6f
2 zmenil súbory, kde vykonal 25 pridanie a 5 odobranie
  1. 24 5
      compiler/link.pas
  2. 1 0
      compiler/systems.inc

+ 24 - 5
compiler/link.pas

@@ -787,7 +787,8 @@ Implementation
         binstr := FindUtil(utilsprefix + binstr);
 
 
-        scripted_ar:=target_ar.id=ar_gnu_ar_scripted;
+        scripted_ar:=(target_ar.id=ar_gnu_ar_scripted) or
+                     (target_ar.id=ar_watcom_wlib_omf_scripted);
 
         if scripted_ar then
           begin
@@ -796,15 +797,25 @@ Implementation
             Assign(script, scriptfile);
             Rewrite(script);
             try
-              writeln(script, 'CREATE ' + current_module.staticlibfilename);
+              if (target_ar.id=ar_gnu_ar_scripted) then
+                writeln(script, 'CREATE ' + current_module.staticlibfilename)
+              else { wlib case }
+                writeln(script,'-q -fo -c '+
+                  maybequoted(current_module.staticlibfilename));
               current := TCmdStrListItem(SmartLinkOFiles.First);
               while current <> nil do
                 begin
-                  writeln(script, 'ADDMOD ' + current.str);
+                  if (target_ar.id=ar_gnu_ar_scripted) then
+                  writeln(script, 'ADDMOD ' + current.str)
+                  else
+                    writeln(script,'+' + current.str);
                   current := TCmdStrListItem(current.next);
                 end;
-              writeln(script, 'SAVE');
-              writeln(script, 'END');
+              if (target_ar.id=ar_gnu_ar_scripted) then
+                begin
+                  writeln(script, 'SAVE');
+                  writeln(script, 'END');
+                end;
             finally
               Close(script);
             end;
@@ -1585,10 +1596,18 @@ Implementation
             arfinishcmd : ''
           );
 
+      ar_watcom_wlib_omf_scripted_info : tarinfo =
+          (
+            id    : ar_watcom_wlib_omf_scripted;
+            arcmd : 'wlib @$SCRIPT';
+            arfinishcmd : ''
+          );
+
 
 initialization
   RegisterAr(ar_gnu_ar_info);
   RegisterAr(ar_gnu_ar_scripted_info);
   RegisterAr(ar_gnu_gar_info);
   RegisterAr(ar_watcom_wlib_omf_info);
+  RegisterAr(ar_watcom_wlib_omf_scripted_info);
 end.

+ 1 - 0
compiler/systems.inc

@@ -237,6 +237,7 @@
             ,ar_gnu_ar_scripted
             ,ar_gnu_gar
             ,ar_watcom_wlib_omf
+            ,ar_watcom_wlib_omf_scripted
        );
 
        tres = (res_none