]> OCCT Git - occt-wok.git/commitdiff
No comments
authorcas <cas@opencascade.com>
Wed, 19 Jan 2000 18:04:47 +0000 (18:04 +0000)
committercas <cas@opencascade.com>
Wed, 19 Jan 2000 18:04:47 +0000 (18:04 +0000)
src/WOKStep/WOKStep_Compile.cxx
src/WOKStep/WOKStep_DynamicLibrary.cxx
src/WOKStep/WOKStep_ExecLink.cxx
src/WOKStep/WOKStep_LibLink.cxx
src/WOKStep/WOKStep_Link.cxx
src/WOKStep/WOKStep_WNTLibrary.cxx
src/WOKStep/WOKStep_WNTLink.cxx

index 919b14616994820f17b830d342037793df3dd7f7..5eaa108462d87ec1efd6556b7a3d826b9880e533 100755 (executable)
@@ -3,11 +3,7 @@
 // Author:     Jean GAUTIER
 //             <jga@cobrax>
 
-#ifdef WNT
-#include <io.h>
-#else
 #include <unistd.h>
-#endif
 #include <fstream.h>
 
 #include <TCollection_HAsciiString.hxx>
 #include <OSD_Protection.hxx>
 #include <OSD_File.hxx>
 
+//---> EUG4YAN
+Standard_IMPORT Standard_Boolean g_fCompOrLnk;
+//<--- EUG4YAN
+
 //=======================================================================
 //function : WOKStep_Compile
 //purpose  : 
@@ -206,7 +206,9 @@ _TEST_BREAK();
       infile = execlist->Value(j);
       
       Handle(WOKBuilder_Compilable) compilable = Handle(WOKBuilder_Compilable)::DownCast(infile->BuilderEntity());
-      
+//---> EUG4YAN
+ if ( !g_fCompOrLnk )
+//<--- EUG4YAN
       if(infile->File()->Nesting()->IsSameString(Unit()->FullName()))
        {
          InfoMsg << "WOKStep_Compile::Execute" << "-------> " << infile->File()->Name() << endm;
@@ -273,10 +275,15 @@ _TEST_BREAK();
            }  // end if
           
           }  // end if
-
+//---> EUG4YAN
+ if ( !g_fCompOrLnk ) {
+//<--- EUG4YAN
          TreatOutput(infile,myiterator.Produces()); 
 
          succeeds->Append(infile);
+//---> EUG4YAN
+ }  // end if
+//<--- EUG4YAN
          break;
        case WOKBuilder_Failed:
          fails->Append(infile);
@@ -308,7 +315,7 @@ _TEST_BREAK();
               << "-----------------------------------------------------------------" << endm;
     }
 
- if (  !str -> IsEmpty ()  ) {
+ if (  g_fCompOrLnk && !str -> IsEmpty ()  ) {
 
   Handle( TCollection_HAsciiString ) s = new TCollection_HAsciiString (  Unit () -> Name ()  );
   s -> AssignCat ( ".comp" );
@@ -346,6 +353,8 @@ _TEST_BREAK();
 
   }  // end if
 
+  return;
+
  }  // end if
 
   if(fails->Length() && succeeds->Length())
index 2d2d253981560fdba4e51675beccde99e672111c..09097de4836c682a6f42137e912a5238773f7e2e 100755 (executable)
@@ -31,7 +31,9 @@
 #include <WOKMake_HSequenceOfInputFile.hxx>
 
 #include <WOKStep_DynamicLibrary.ixx>
-
+//---> EUG4YAN
+Standard_IMPORT Standard_Boolean g_fCompOrLnk;
+//<--- EUG4YAN
 //=======================================================================
 //function : WOKStep_DynamicLibrary
 //purpose  : 
@@ -137,7 +139,6 @@ void WOKStep_DynamicLibrary::Execute(const Handle(WOKMake_HSequenceOfInputFile)&
                                                                       Unit()->Params());
 
   Handle(WOKUtils_Shell) ashell = Shell();
-
 //--> EUG4YAN
   bidname = new TCollection_HAsciiString (  Unit () -> Name ()  );
   bidname -> AssignCat ( ".lnk" );
@@ -154,10 +155,9 @@ void WOKStep_DynamicLibrary::Execute(const Handle(WOKMake_HSequenceOfInputFile)&
             << lnkfile -> Path () -> Name () -> ToCString ()
             << "'" << endm;
 //<-- EUG4YAN
-
   ashell->Lock();
 //--> EUG4YAN
-  ashell -> LogInFile (  lnkfile -> Path ()  );
+  Unit () -> Params ().Set (  "%LnkFileName", lnkfile -> Path () -> Name () -> ToCString ()  );
 //<-- EUG4YAN
   ldshr->SetShell(ashell);
   
@@ -204,14 +204,18 @@ void WOKStep_DynamicLibrary::Execute(const Handle(WOKMake_HSequenceOfInputFile)&
 
   // Externals is Empty in this Step
   ldshr->SetExternals(new TColStd_HSequenceOfHAsciiString);
-
+//---> EUG4YAN
+ if ( !g_fCompOrLnk )
+//<--- EUG4YAN
   InfoMsg << "WOKStep_DynamicLibrary::Execute"
          << "Creating   : " << libname << endm;
 
-
   switch(ldshr->Execute())
     {
     case WOKBuilder_Success:
+//---> EUG4YAN
+ if ( !g_fCompOrLnk ) {
+//<--- EUG4YAN
       for(i=1; i<=ldshr->Produces()->Length(); i++)
        {
          Handle(WOKBuilder_Entity)   outent = ldshr->Produces()->Value(i);
@@ -256,6 +260,9 @@ void WOKStep_DynamicLibrary::Execute(const Handle(WOKMake_HSequenceOfInputFile)&
       InfoMsg << "WOKStep_DynamicLibrary::Execute"
              << "Succeeded  : " << libname << endm;
       SetSucceeded();
+//---> EUG4YAN
+ }  // end if
+//<--- EUG4YAN
       break;
     case WOKBuilder_Failed:
       ErrorMsg << "WOKStep_DynamicLibrary::Execute" 
index c0213f58612d499db352925f2f7a7a115ae8490d..b964b19c89b5564578824162d196c14c40039697 100755 (executable)
@@ -23,7 +23,9 @@
 #include <WOKMake_HSequenceOfOutputFile.hxx>
 
 #include <WOKStep_ExecLink.ixx>
-
+//---> EUG4YAN
+Standard_IMPORT Standard_Boolean g_fCompOrLnk;
+//<--- EUG4YAN
 //=======================================================================
 //function : WOKStep_ExecLink
 //purpose  : 
@@ -97,7 +99,7 @@ void WOKStep_ExecLink::Execute(const Handle(WOKMake_HSequenceOfInputFile)& execl
   switch(status)
     {
     case WOKMake_Success:
-      if(!outfiles.IsNull())
+      if (  !g_fCompOrLnk && !outfiles.IsNull ()  )
        {
          for(i=1; i<=execlist->Length(); i++)
            {
index 178e3edb96b625c885bf4c7cdf18af304103b64c..2b592d6763ba5318487dbed15ec0940a1afe4894 100755 (executable)
@@ -23,7 +23,9 @@
 #include <WOKMake_HSequenceOfOutputFile.hxx>
 
 #include <WOKStep_LibLink.ixx>
-
+//---> EUG4YAN
+Standard_IMPORT Standard_Boolean g_fCompOrLnk;
+//<--- EUG4YAN
 //=======================================================================
 //function : WOKStep_LibLink
 //purpose  : 
@@ -111,7 +113,7 @@ void WOKStep_LibLink::Execute(const Handle(WOKMake_HSequenceOfInputFile)& execli
   switch(status)
     {
     case WOKMake_Success:
-      if(!outfiles.IsNull())
+      if (  !g_fCompOrLnk && !outfiles.IsNull ()  )
        {
          for(i=1; i<=execlist->Length(); i++)
            {
index 5ba1b73a14d020a945039a68cd4b2a908b4ab33d..bf2f994e26557a7204cf77844cef00801cc4bd06 100755 (executable)
@@ -42,7 +42,9 @@
 #include <WOKMake_AdmFileTypes.hxx>
 
 #include <WOKStep_Link.ixx>
-
+//---> EUG4YAN
+Standard_IMPORT Standard_Boolean g_fCompOrLnk;
+//<--- EUG4YAN
 //=======================================================================
 //function : WOKStep_Link
 //purpose  : 
@@ -428,13 +430,14 @@ WOKMake_Status WOKStep_Link::ExecuteLink(Handle(WOKMake_HSequenceOfOutputFile)&
   if(lnkfile->Path()->Exists()) lnkfile->Path()->RemoveFile();
   if (!lnkfile->Path()->CreateFile()) {
     ErrorMsg << "WOKStep_Link::ExecuteLink" 
-      << "Enable to create link file " << lnkfile->Path()->Name()->ToCString() << endm;
+      << "Unable to create link file " << lnkfile->Path()->Name()->ToCString() << endm;
   }
   Handle(WOKUtils_Shell) ashell = Shell();
 
   ashell->Lock();
   ashell->SetEcho();
-  ashell->LogInFile(lnkfile->Path());
+
+  Unit () -> Params ().Set (  "%LnkFileName", lnkfile -> Path() -> Name () -> ToCString ()  );
   
   if(!ashell->IsLaunched()) ashell->Launch();
 
@@ -443,6 +446,9 @@ WOKMake_Status WOKStep_Link::ExecuteLink(Handle(WOKMake_HSequenceOfOutputFile)&
   switch(mylinker->Execute())
     {
     case WOKBuilder_Success:
+//---> EUG4YAN
+ if ( !g_fCompOrLnk )
+//<--- EUG4YAN
       {
        Handle(WOKBuilder_Entity) outent;
        for(i=1; i<=mylinker->Produces()->Length(); i++)
@@ -498,7 +504,6 @@ WOKMake_Status WOKStep_Link::ExecuteLink(Handle(WOKMake_HSequenceOfOutputFile)&
     }
   
   ashell->UnsetEcho();
-  ashell->NoLog();
   ashell->UnLock();
 
   return Status();
index da73b95b613236dd596b9c74562d128e852ff4fa..37c16041f8558600066731210b7d5b65a884120d 100755 (executable)
@@ -69,6 +69,17 @@ void WOKStep_WNTLibrary::Execute (const Handle(WOKMake_HSequenceOfInputFile)& an
 
  tool->SetTargetName(target);
  
+ Handle( WOKernel_FileType        ) stadmtype = Unit () -> GetFileType ( "stadmfile" );
+ Handle( TCollection_HAsciiString ) name =
+  new TCollection_HAsciiString (  Unit () -> Name ()  );
+
+ name -> AssignCat (  tool -> EvalCFExt ()  );
+  
+ Handle( WOKernel_File ) cmdFile = new WOKernel_File (  name, Unit (), stadmtype  );
+
+ cmdFile -> GetPath ();
+ Unit () -> Params ().Set ( "%CmdFileName", cmdFile -> Path () -> Name () -> ToCString ()  );
+
  if(!tool->OpenCommandFile()) 
    {
      SetFailed ();
index 342ba1a4f5848024d83392ce3a724ff656b7fe37..82c155a26cd07c3cc351f8b29b2dad23ee5aaf48 100755 (executable)
 #include <WOKStep_WNTLink.ixx>
 
 // ###### REFERENCER LE STORAGE MANAGER DES COLLECTIONS ######
-//extern Standard_IMPORT MMgt_StorageManager aStorageManager;
-//Standard_IMPORT MMgt_StorageManager aStorageManager;
+//extern MMgt_StorageManager aStorageManager;
 
 #ifdef WNT
 #include <windows.h>
 #endif // WNT
 
+//---> EUG4YAN
+Standard_IMPORT Standard_Boolean g_fCompOrLnk;
+//<--- EUG4YAN
+
 //=======================================================================
 //function : WOKStep_WNTLink
 //purpose  : 
@@ -64,7 +67,7 @@ Standard_Boolean WOKStep_WNTLink::HandleInputFile(const Handle(WOKMake_InputFile
   if(!anItem->File().IsNull()) 
     {
       path = anItem->File()->Path();
-      
+doHandle:      
       switch(path->Extension()) 
        {
        case WOKUtils_RESFile:
@@ -100,6 +103,11 @@ Standard_Boolean WOKStep_WNTLink::HandleInputFile(const Handle(WOKMake_InputFile
     }
   else if (!anItem->IsPhysic())
     return Standard_True;
+  else {
+
+   path = new WOKUtils_Path (  anItem -> ID ()  );
+   goto doHandle;
+  }  // end else
  return Standard_False; 
                                     
 }
@@ -193,6 +201,18 @@ void WOKStep_WNTLink::Execute(const Handle(WOKMake_HSequenceOfInputFile)& anExec
       Unit()->Params().Set("%LinkSubsystem", exetype->ToCString());
     }
 
+
+  Handle( WOKernel_FileType        ) stadmtype = Unit () -> GetFileType ( "stadmfile" );
+  Handle( TCollection_HAsciiString ) name =
+   new TCollection_HAsciiString (  Unit () -> Name ()  );
+
+  name -> AssignCat (  tool -> EvalCFExt ()  );
+  
+  Handle( WOKernel_File ) cmdFile = new WOKernel_File (  name, Unit (), stadmtype  );
+
+  cmdFile -> GetPath ();
+  Unit () -> Params ().Set ( "%CmdFileName", cmdFile -> Path () -> Name () -> ToCString ()  );
+
   if(!tool->OpenCommandFile()) 
     {
       SetFailed();
@@ -246,13 +266,19 @@ void WOKStep_WNTLink::Execute(const Handle(WOKMake_HSequenceOfInputFile)& anExec
          stubName = Unit()->Params().Eval(WOKernel_IsToolkit(Unit()) ? "%STUBS_tkMain" : "%STUBS_uMain");
          dwLen    = ExpandEnvironmentStrings(stubName->ToCString(), NULL, 0);
 
-         char* buffer = (char *) Standard::Allocate(dwLen+1);
+         char* buffer = (char *) aStorageManager.Allocate(dwLen+1);
          memset(buffer, 0, dwLen+1);
          
          ExpandEnvironmentStrings(stubName->ToCString(), buffer, dwLen);
+
+      if (  buffer[ 0 ] == '/' && buffer[ 1 ] == '/'  )
+
+       buffer[ 0 ] = buffer[ 1 ] = '\\';
+
+
          buff     = new TCollection_HAsciiString(buffer);
 
-         Standard::Free((void*&)buffer,dwLen+1);
+         aStorageManager.Free((void*&)buffer,dwLen+1);
          seq->Append(buff);
 
        }
@@ -261,13 +287,17 @@ void WOKStep_WNTLink::Execute(const Handle(WOKMake_HSequenceOfInputFile)& anExec
       
       dwLen = ExpandEnvironmentStrings(stubName->ToCString(), NULL, 0);
 
-      char* buffer = (char *) Standard::Allocate(dwLen+1);
+      char* buffer = (char *) aStorageManager.Allocate(dwLen+1);
          memset(buffer, 0, dwLen+1);
          
       ExpandEnvironmentStrings(stubName->ToCString(), buffer, dwLen);
       
+      if (  buffer[ 0 ] == '/' && buffer[ 1 ] == '/'  )
+
+       buffer[ 0 ] = buffer[ 1 ] = '\\';
+
          buff  = new TCollection_HAsciiString(buffer);
-         Standard::Free((void*&)buffer,dwLen+1);
+         aStorageManager.Free((void*&)buffer,dwLen+1);
          seq->Append(buff);
       
 
@@ -303,6 +333,9 @@ void WOKStep_WNTLink::Execute(const Handle(WOKMake_HSequenceOfInputFile)& anExec
   switch(tool->Execute()) 
     {
     case WOKBuilder_Success:
+//---> EUG4YAN
+     if ( !g_fCompOrLnk )
+//<--- EUG4YAN
       {
        Handle(WOKernel_File    ) libPath;
        Handle(WOKBuilder_Entity) outEnt;
@@ -349,7 +382,9 @@ dummyStepFile:
       SetFailed();
       break;
     }
-
+//---> EUG4YAN
+     if ( !g_fCompOrLnk )
+//<--- EUG4YAN
   InfoMsg << "WOKStep_WNTLink::Execute"
          << "------------" << endm  << "" << endm;