Explorar o código

+ Patch from Christian Iversen to implement LIBPREFIX/SUFFIX/EXTENSION directives

michael %!s(int64=21) %!d(string=hai) anos
pai
achega
ff069c5ecc
Modificáronse 2 ficheiros con 44 adicións e 17 borrados
  1. 27 10
      compiler/finput.pas
  2. 17 7
      compiler/globals.pas

+ 27 - 10
compiler/finput.pas

@@ -132,12 +132,14 @@ interface
      type
         tmodulebase = class(TLinkedListItem)
           { index }
-          unit_index    : longint;  { global counter for browser }
+          unit_index       : longint;  { global counter for browser }
           { status }
-          state         : tmodulestate;
+          state            : tmodulestate;
           { sources }
-          sourcefiles   : tinputfilemanager;
+          sourcefiles      : tinputfilemanager;
           { paths and filenames }
+          paramallowoutput : boolean;  { original allowoutput parameter }
+          paramfn,                  { original filename }
           path,                     { path where the module is find/created }
           outputpath,               { path where the .s / .o / exe are created }
           modulename,               { name of the module in uppercase }
@@ -613,6 +615,9 @@ uses
         p : dirstr;
         n : NameStr;
         e : ExtStr;
+        prefix,
+        suffix,
+        extension : NameStr;
       begin
          stringdispose(objfilename);
          stringdispose(newfilename);
@@ -624,6 +629,8 @@ uses
          stringdispose(outputpath);
          stringdispose(path);
          { Create names }
+         paramfn := stringdup(fn);
+         paramallowoutput := allowoutput;
          fsplit(fn,p,n,e);
          n:=FixFileName(n);
          { set path }
@@ -643,18 +650,25 @@ uses
          objfilename:=stringdup(p+n+target_info.objext);
          ppufilename:=stringdup(p+n+target_info.unitext);
          { lib and exe could be loaded with a file specified with -o }
-         if AllowOutput and (OutputFile<>'') and (compile_level=1) then
-          n:=OutputFile;
+         prefix := target_info.sharedlibprefix;
+         suffix := '';
+         extension := target_info.sharedlibext;
+         
+         if AllowOutput and (compile_level=1) then
+         begin
+           if OutputFile <> '' then n:=OutputFile;
+           if Assigned(OutputPrefix) then prefix := OutputPrefix^;
+           if Assigned(OutputSuffix) then suffix := OutputSuffix^;
+           if OutputExtension <> '' then extension := OutputExtension;
+         end;
+         
          staticlibfilename:=stringdup(p+target_info.staticlibprefix+n+target_info.staticlibext);
          { output dir of exe can be specified separatly }
          if AllowOutput and (OutputExeDir<>'') then
           p:=OutputExeDir
          else
           p:=path^;
-         if target_info.system in [system_i386_WIN32,system_i386_wdosx] then
-           sharedlibfilename:=stringdup(p+n+target_info.sharedlibext)
-         else
-           sharedlibfilename:=stringdup(p+target_info.sharedlibprefix+n+target_info.sharedlibext);
+         sharedlibfilename:=stringdup(p+prefix+n+suffix+extension);
          exefilename:=stringdup(p+n+target_info.exeext);
          mapfilename:=stringdup(p+n+'.map');
       end;
@@ -712,7 +726,10 @@ uses
 end.
 {
   $Log$
-  Revision 1.25  2004-06-20 08:55:29  florian
+  Revision 1.26  2004-08-02 07:15:54  michael
+  + Patch from Christian Iversen to implement  LIBPREFIX/SUFFIX/EXTENSION directives
+
+  Revision 1.25  2004/06/20 08:55:29  florian
     * logs truncated
 
   Revision 1.24  2004/06/16 20:07:07  florian

+ 17 - 7
compiler/globals.pas

@@ -112,14 +112,17 @@ interface
 
     var
        { specified inputfile }
-       inputdir       : dirstr;
-       inputfile      : namestr;
-       inputextension : extstr;
+       inputdir          : dirstr;
+       inputfile         : namestr;
+       inputextension    : extstr;
        { specified outputfile with -o parameter }
-       outputfile     : namestr;
+       outputfile        : namestr;
+       outputprefix      : pstring;
+       outputsuffix      : pstring;
+       outputextension   : namestr;
        { specified with -FE or -FU }
-       outputexedir   : dirstr;
-       outputunitdir  : dirstr;
+       outputexedir      : dirstr;
+       outputunitdir     : dirstr;
 
        { things specified with parameters }
        paralinkoptions,
@@ -1803,6 +1806,10 @@ implementation
 
       { Output }
         OutputFile:='';
+        OutputPrefix:=Nil;
+        OutputSuffix:=Nil;
+        OutputExtension:='';
+        
         OutputExeDir:='';
         OutputUnitDir:='';
 
@@ -1913,7 +1920,10 @@ implementation
 end.
 {
   $Log$
-  Revision 1.133  2004-07-17 15:51:57  jonas
+  Revision 1.134  2004-08-02 07:15:54  michael
+  + Patch from Christian Iversen to implement  LIBPREFIX/SUFFIX/EXTENSION directives
+
+  Revision 1.133  2004/07/17 15:51:57  jonas
     * shell now returns an exitcode
     * print an error if linking failed when linking was done using a script