فهرست منبع

* fixed placing of ppas.sh and link.res when using -FE

peter 27 سال پیش
والد
کامیت
2d524e51a2
3فایلهای تغییر یافته به همراه35 افزوده شده و 32 حذف شده
  1. 8 2
      compiler/files.pas
  2. 22 28
      compiler/link.pas
  3. 5 2
      compiler/parser.pas

+ 8 - 2
compiler/files.pas

@@ -152,6 +152,7 @@ unit files;
 
 
 
 
           path,                     { path where the module is find/created }
           path,                     { path where the module is find/created }
+          outpath,
           modulename,               { name of the module in uppercase }
           modulename,               { name of the module in uppercase }
           objfilename,              { fullname of the objectfile }
           objfilename,              { fullname of the objectfile }
           asmfilename,              { fullname of the assemblerfile }
           asmfilename,              { fullname of the assemblerfile }
@@ -599,6 +600,7 @@ unit files;
          stringdispose(staticlibfilename);
          stringdispose(staticlibfilename);
          stringdispose(sharedlibfilename);
          stringdispose(sharedlibfilename);
          stringdispose(exefilename);
          stringdispose(exefilename);
+         stringdispose(outpath);
          stringdispose(path);
          stringdispose(path);
          { Create names }
          { Create names }
          fsplit(fn,p,n,e);
          fsplit(fn,p,n,e);
@@ -615,6 +617,7 @@ unit files;
              if (OutputExeDir<>'') then
              if (OutputExeDir<>'') then
               p:=OutputExeDir;
               p:=OutputExeDir;
           end;
           end;
+         outpath:=stringdup(p);
          objfilename:=stringdup(p+n+target_info.objext);
          objfilename:=stringdup(p+n+target_info.objext);
          asmfilename:=stringdup(p+n+target_info.asmext);
          asmfilename:=stringdup(p+n+target_info.asmext);
          ppufilename:=stringdup(p+n+target_info.unitext);
          ppufilename:=stringdup(p+n+target_info.unitext);
@@ -622,7 +625,6 @@ unit files;
          if AllowOutput and (OutputFile<>'') then
          if AllowOutput and (OutputFile<>'') then
           n:=OutputFile;
           n:=OutputFile;
          staticlibfilename:=stringdup(p+target_os.libprefix+n+target_os.staticlibext);
          staticlibfilename:=stringdup(p+target_os.libprefix+n+target_os.staticlibext);
-
          if target_info.target=target_i386_WIN32 then
          if target_info.target=target_i386_WIN32 then
            sharedlibfilename:=stringdup(p+n+target_os.sharedlibext)
            sharedlibfilename:=stringdup(p+n+target_os.sharedlibext)
          else
          else
@@ -995,6 +997,7 @@ unit files;
         stringdispose(staticlibfilename);
         stringdispose(staticlibfilename);
         stringdispose(sharedlibfilename);
         stringdispose(sharedlibfilename);
         stringdispose(exefilename);
         stringdispose(exefilename);
+        stringdispose(outpath);
         stringdispose(path);
         stringdispose(path);
         stringdispose(modulename);
         stringdispose(modulename);
         stringdispose(mainsource);
         stringdispose(mainsource);
@@ -1050,7 +1053,10 @@ unit files;
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.75  1998-11-16 15:41:40  peter
+  Revision 1.76  1998-12-01 12:51:19  peter
+    * fixed placing of ppas.sh and link.res when using -FE
+
+  Revision 1.75  1998/11/16 15:41:40  peter
     * tp7 didn't like my ifopt H+ :(
     * tp7 didn't like my ifopt H+ :(
 
 
   Revision 1.74  1998/11/16 12:18:01  peter
   Revision 1.74  1998/11/16 12:18:01  peter

+ 22 - 28
compiler/link.pas

@@ -281,14 +281,13 @@ begin
   prtobj:='prt0';
   prtobj:='prt0';
   case target_info.target of
   case target_info.target of
    target_m68k_Palmos,
    target_m68k_Palmos,
-{* Changes made by Ozerski 27.10.1998}
-   target_i386_Win32 :begin
-                       if DLLsource then
-                        prtobj:='wdllprt0'
-                       else
-                        prtobj:='wprt0';
-                      end;
-{* End changes}
+   target_i386_Win32 :
+     begin
+       if DLLsource then
+         prtobj:='wdllprt0'
+       else
+         prtobj:='wprt0';
+     end;
    target_m68k_linux,
    target_m68k_linux,
    target_i386_linux :
    target_i386_linux :
      begin
      begin
@@ -316,7 +315,7 @@ begin
    LinkOptions:=LinkOptions+target_link.stripopt;
    LinkOptions:=LinkOptions+target_link.stripopt;
 
 
 { Open linkresponse and write header }
 { Open linkresponse and write header }
-  assign(linkresponse,inputdir+LinkResName);
+  assign(linkresponse,current_module^.outpath^+LinkResName);
   {$I-}
   {$I-}
    rewrite(linkresponse);
    rewrite(linkresponse);
   {$I+}
   {$I+}
@@ -391,9 +390,7 @@ var
   bindfound  : boolean;
   bindfound  : boolean;
   s          : string;
   s          : string;
   success    : boolean;
   success    : boolean;
-{* Changes made by Ozerski 27.10.1998}
-  ii:longint;
-{* end changes}
+  ii         : longint;
 begin
 begin
 {$ifdef linux}
 {$ifdef linux}
   if LinkToC then
   if LinkToC then
@@ -412,29 +409,25 @@ begin
   if not(cs_link_extern in aktglobalswitches) then
   if not(cs_link_extern in aktglobalswitches) then
    Message1(exec_i_linking,current_module^.exefilename^);
    Message1(exec_i_linking,current_module^.exefilename^);
   s:=target_link.linkcmd;
   s:=target_link.linkcmd;
-{* Changes made by Ozerski 27.10.1998}
   if DLLsource then
   if DLLsource then
-   Replace(s,'$EXE',current_module^.sharedlibfilename^)
+    Replace(s,'$EXE',current_module^.sharedlibfilename^)
   else
   else
-   Replace(s,'$EXE',current_module^.exefilename^);
-{* end changes}
+    Replace(s,'$EXE',current_module^.exefilename^);
   Replace(s,'$OPT',LinkOptions);
   Replace(s,'$OPT',LinkOptions);
-  Replace(s,'$RES',inputdir+LinkResName);
+  Replace(s,'$RES',current_module^.outpath^+LinkResName);
   success:=DoExec(FindLinker,s,true,false);
   success:=DoExec(FindLinker,s,true,false);
 {Bind}
 {Bind}
-{* Changes made by Ozerski 27.10.1998}
   if (target_link.bindbin[1]<>'') and
   if (target_link.bindbin[1]<>'') and
      ((target_info.target<>target_i386_win32) or bind_win32_dll) then
      ((target_info.target<>target_i386_win32) or bind_win32_dll) then
    for ii:=1 to target_link.binders do
    for ii:=1 to target_link.binders do
    begin
    begin
      s:=target_link.bindcmd[ii];
      s:=target_link.bindcmd[ii];
      Replace(s,'$OPT',LinkOptions);
      Replace(s,'$OPT',LinkOptions);
-     Replace(s,'$RES',inputdir+LinkResName);
+     Replace(s,'$RES',current_module^.outpath^+LinkResName);
      if DLLsource then
      if DLLsource then
-      Replace(s,'$EXE',current_module^.sharedlibfilename^)
+       Replace(s,'$EXE',current_module^.sharedlibfilename^)
      else
      else
-      Replace(s,'$EXE',current_module^.exefilename^);
-{* end changes}
+       Replace(s,'$EXE',current_module^.exefilename^);
      {Size of the heap when an EMX program runs in OS/2.}
      {Size of the heap when an EMX program runs in OS/2.}
      Replace(s,'$HEAPMB',tostr((maxheapsize+1048575) shr 20));
      Replace(s,'$HEAPMB',tostr((maxheapsize+1048575) shr 20));
      {Size of the stack when an EMX program runs in OS/2.}
      {Size of the stack when an EMX program runs in OS/2.}
@@ -442,7 +435,6 @@ begin
      {When an EMX program runs in DOS, the heap and stack share the
      {When an EMX program runs in DOS, the heap and stack share the
       same memory pool. The heap grows upwards, the stack grows downwards.}
       same memory pool. The heap grows upwards, the stack grows downwards.}
      Replace(s,'$DOSHEAPKB',tostr((stacksize+maxheapsize+1023) shr 10));
      Replace(s,'$DOSHEAPKB',tostr((stacksize+maxheapsize+1023) shr 10));
-{* Changes made by Ozerski 27.10.1998}
      if utilsdirectory<>'' then
      if utilsdirectory<>'' then
        begin
        begin
           bindbin:=Search(target_link.bindbin[ii]+source_os.exeext,
           bindbin:=Search(target_link.bindbin[ii]+source_os.exeext,
@@ -450,7 +442,6 @@ begin
        end
        end
      else
      else
        bindbin:=FindExe(target_link.bindbin[ii],bindfound);
        bindbin:=FindExe(target_link.bindbin[ii],bindfound);
-{* end changes}
      if (not bindfound) and not (cs_link_extern in aktglobalswitches) then
      if (not bindfound) and not (cs_link_extern in aktglobalswitches) then
       begin
       begin
         Message1(exec_w_binder_not_found,bindbin);
         Message1(exec_w_binder_not_found,bindbin);
@@ -467,7 +458,7 @@ begin
 
 
 {Remove ReponseFile}
 {Remove ReponseFile}
   if (success) and not(cs_link_extern in aktglobalswitches) then
   if (success) and not(cs_link_extern in aktglobalswitches) then
-   RemoveFile(LinkResName);
+   RemoveFile(current_module^.outpath^+LinkResName);
   MakeExecutable:=success;   { otherwise a recursive call to link method }
   MakeExecutable:=success;   { otherwise a recursive call to link method }
 end;
 end;
 
 
@@ -501,9 +492,9 @@ begin
   s:=target_ar.arcmd;
   s:=target_ar.arcmd;
   Replace(s,'$LIB',current_module^.staticlibfilename^);
   Replace(s,'$LIB',current_module^.staticlibfilename^);
   if filescnt=0 then
   if filescnt=0 then
-   Replace(s,'$FILES',current_module^.objfilename^)
+    Replace(s,'$FILES',current_module^.objfilename^)
   else
   else
-   Replace(s,'$FILES',FixFileName(smartpath+current_module^.asmprefix^+'*'+target_info.objext));
+    Replace(s,'$FILES',FixFileName(smartpath+current_module^.asmprefix^+'*'+target_info.objext));
   DoExec(arbin,s,false,true);
   DoExec(arbin,s,false,true);
 { Clean up }
 { Clean up }
   if not(cs_asm_leave in aktglobalswitches) and not(cs_link_extern in aktglobalswitches) then
   if not(cs_asm_leave in aktglobalswitches) and not(cs_link_extern in aktglobalswitches) then
@@ -536,7 +527,10 @@ end;
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.39  1998-11-30 13:26:23  pierre
+  Revision 1.40  1998-12-01 12:51:20  peter
+    * fixed placing of ppas.sh and link.res when using -FE
+
+  Revision 1.39  1998/11/30 13:26:23  pierre
     * the code for ordering the exported procs/vars was buggy
     * the code for ordering the exported procs/vars was buggy
     + added -WB to force binding (Ozerski way of creating DLL)
     + added -WB to force binding (Ozerski way of creating DLL)
       this is off by default as direct writing of .edata section seems
       this is off by default as direct writing of .edata section seems

+ 5 - 2
compiler/parser.pas

@@ -268,7 +268,7 @@ unit parser;
          if (compile_level=1) then
          if (compile_level=1) then
           begin
           begin
           { open assembler response }
           { open assembler response }
-            AsmRes.Init('ppas');
+            AsmRes.Init(current_module^.outpath^+'ppas');
           end;
           end;
 
 
          { If the compile level > 1 we get a nice "unit expected" error
          { If the compile level > 1 we get a nice "unit expected" error
@@ -424,7 +424,10 @@ unit parser;
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.61  1998-11-10 10:09:11  peter
+  Revision 1.62  1998-12-01 12:51:21  peter
+    * fixed placing of ppas.sh and link.res when using -FE
+
+  Revision 1.61  1998/11/10 10:09:11  peter
     * va_list -> array of const
     * va_list -> array of const
 
 
   Revision 1.60  1998/10/28 18:26:14  pierre
   Revision 1.60  1998/10/28 18:26:14  pierre