]> 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/WOKBuilder/WOKBuilder_Compiler.cxx
src/WOKBuilder/WOKBuilder_CompilerIterator.cxx
src/WOKBuilder/WOKBuilder_Linker.cxx
src/WOKBuilder/WOKBuilder_WNTCollector.cxx

index 9cacf738b178b41a026e48c3233095fa38c0060a..cfbea08829b9d5892e018ad0797dfa5a66368966 100755 (executable)
@@ -24,7 +24,9 @@
 #include <OSD_Protection.hxx>
 #include <OSD_File.hxx>
 #include <WOKUtils_AdmFile.hxx>
-
+//---> EUG4YAN
+Standard_IMPORT Standard_Boolean g_fCompOrLnk;
+//<--- EUG4YAN
 //=======================================================================
 //function : WOKBuilder_Compiler
 //purpose  : 
@@ -158,10 +160,13 @@ void WOKBuilder_Compiler::SetCompilable(const Handle(WOKBuilder_Compilable)& afi
 //=======================================================================
 WOKBuilder_BuildStatus WOKBuilder_Compiler::Execute()
 {
-
+#ifndef WNT
   static Handle( TCollection_HAsciiString ) NL = new TCollection_HAsciiString ( " \\\n " );
   static Handle( TCollection_HAsciiString ) LF = new TCollection_HAsciiString ( "\n"     );
-
+#else
+  static Handle( TCollection_HAsciiString ) NL = new TCollection_HAsciiString ( " \\\r\n " );
+  static Handle( TCollection_HAsciiString ) LF = new TCollection_HAsciiString ( "\r\n"     );
+#endif  // WNT
   int start;
 
 #ifdef WNT
@@ -176,6 +181,9 @@ WOKBuilder_BuildStatus WOKBuilder_Compiler::Execute()
   Handle(WOKBuilder_MFile)      mfile;
   
 
+//---> EUG4YAN
+ if ( !g_fCompOrLnk )
+//<--- EUG4YAN
   if(Shell()->IsLaunched() == Standard_False) Shell()->Launch();
 
   Load();
@@ -194,12 +202,18 @@ WOKBuilder_BuildStatus WOKBuilder_Compiler::Execute()
     VerboseMsg("WOK_CMPLRS") << "WOKBuilder_Compiler::Execute" 
                             << astr << endm;
   }
-
+//---> EUG4YAN
+ if ( !g_fCompOrLnk ) {
+//<--- EUG4YAN
   Shell()->ClearOutput();
   Shell()->Execute(astr);
-
+//---> EUG4YAN
+ }  // end if
+//<--- EUG4YAN
   myCmdLine = new TCollection_HAsciiString ( astr );
-
+//---> EUG4YAN
+ if ( !g_fCompOrLnk ) {
+//<--- EUG4YAN
   Handle(TColStd_HSequenceOfHAsciiString) resseq = Shell()->Errors();
 
   if(Shell()->Status())
@@ -300,7 +314,9 @@ WOKBuilder_BuildStatus WOKBuilder_Compiler::Execute()
    }  // end if
 
   }  // end if
-
+//---> EUG4YAN
+ }  // end if
+//<--- EUG4YAN
   return WOKBuilder_Success;
 }
 
index 31a227f354cb92856a7728381fb12a76744b2fda..d68bc108894c3687a7ff02ce2d5a73e5f1d16e3d 100755 (executable)
@@ -3,7 +3,6 @@
 // Author:     Jean GAUTIER
 //             <jga@cobrax>
 
-#include <Standard_NotImplemented.hxx>
 
 #include <WOKBuilder_CompilerIterator.ixx>
 
 #include <WOKBuilder_Compilable.hxx>
 #include <WOKBuilder_Compiler.hxx>
 
+//---> EUG4YAN
+Standard_IMPORT Standard_Boolean g_fCompOrLnk;
+//<--- EUG4YAN
+
 //=======================================================================
 //Author   : Jean Gautier (jga)
 //function : WOKBuilder_CompilerIterator
@@ -88,12 +91,15 @@ void WOKBuilder_CompilerIterator::Init(const Handle(WOKUtils_Shell)& ashell,
                << "Could not eval compiler " << acompiler->Name() << " options" << endm;
              return;
            }
-         
+//---> EUG4YAN
+ if ( !g_fCompOrLnk )
+//<--- EUG4YAN   
          InfoMsg << "WOKBuilder_CompilerIterator::Init" << optline << endm;
        }
     }
 }
 
+  
 void WOKBuilder_CompilerIterator::Init(const Handle(WOKUtils_Shell)& ashell,const Handle(WOKUtils_Path)& adir)
 {
 // Standard_NotImplemented::Raise("WOKBuilder_CompilerIterator::Init(const Handle(WOKUtils_Shell)& ashell,const Handle(WOKUtils_Path)& adir) not implemented") ;
@@ -123,14 +129,18 @@ WOKBuilder_BuildStatus WOKBuilder_CompilerIterator::Execute(const Handle(WOKBuil
   myproduction.Nullify();
 
   acompiler = Handle(WOKBuilder_Compiler)::DownCast(AppropriateTool(acompilable));
-
+//---> EUG4YAN
+ if ( !g_fCompOrLnk ) {
+//<--- EUG4YAN
   if(acompiler.IsNull())
     {
       ErrorMsg << "WOKBuilder_CompilerIterator::Execute" 
        << "Could not find appropriate Compiler for " << acompilable->Path()->Name() << endm;
       return WOKBuilder_Failed;
     }
-
+//---> EUG4YAN
+ } else if (  acompiler.IsNull ()  ) return WOKBuilder_Success;
+//<--- EUG4YAN
   // setter le .compilable
   acompiler->SetCompilable(acompilable);
 
@@ -138,8 +148,13 @@ WOKBuilder_BuildStatus WOKBuilder_CompilerIterator::Execute(const Handle(WOKBuil
 
   if(status == WOKBuilder_Success)
     {
+//---> EUG4YAN
+ if ( !g_fCompOrLnk )
+//<--- EUG4YAN   
       myproduction = acompiler->Produces();
-
+//---> EUG4YAN
+ else
+//<--- EUG4YAN
       if (  !acompiler -> myCmdLine.IsNull ()  ) myCmdLine = new TCollection_HAsciiString ( acompiler -> myCmdLine );
 
     }
@@ -150,4 +165,16 @@ const Handle( TCollection_HAsciiString )& WOKBuilder_CompilerIterator :: CmdLine
 
  return myCmdLine;
 
-}  // end 
+}  // end WOKBuilder_CompilerIterator :: CmdLine
+#if 0
+WOKBuilder_BuildStatus
+ WOKBuilder_CompilerIterator ::
+  Execute (  const Handle(WOKMake_HSequenceOfInputFile )&  anExecList  ) {
+
+ WOKBuilder_BuildStatus retVal = WOKBuilder_Failed;
+
+
+ return retVal;
+
+}  // end WOKBuilder_CompilerIterator ::Execute
+#endif
index a4d38a182930de2321bf60bc5d4947de5cb4aa64..0abd5abbedb3a96b4487413833802885db8960a0 100755 (executable)
 
 #include <WOKBuilder_Linker.ixx>
 
+//---> EUG4YAN
+#include <OSD_Protection.hxx>
+#include <OSD_File.hxx>
+Standard_IMPORT Standard_Boolean g_fCompOrLnk;
+//<--- EUG4YAN
+
 //=======================================================================
 //function : WOKBuilder_Linker
 //purpose  : 
@@ -454,49 +460,110 @@ WOKBuilder_BuildStatus WOKBuilder_Linker::Execute()
   objstream.close();
 
   Params().Set("%LD_ObjList", objlistpath->Name()->ToCString()); 
+#ifndef LIN
+  Handle( TCollection_HAsciiString ) args[  4 ];
+#else
+  Handle( TCollection_HAsciiString ) args[ 11 ];
+#endif  // LIN
 
-  Shell()->Send(EvalHeader());
-  Shell()->Send(EvalObjectList());
-  Shell()->Send(EvalLibraryList());
+  args[ 0 ] = EvalHeader      ();
+  args[ 1 ] = EvalObjectList  ();
+  args[ 2 ] = EvalLibraryList ();
+  args[ 3 ] = EvalFooter      ();
+
+ if ( !g_fCompOrLnk ) {
+
+  Shell () -> Send ( args[ 0 ] );
+  Shell () -> Send ( args[ 1 ] );
+  Shell () -> Send ( args[ 2 ] );
 #ifndef LIN
-  Shell()->Execute(EvalFooter());
+  Shell () -> Execute ( args[ 3 ] );
+
+ } else {
 #else
-  Handle( TCollection_HAsciiString ) target = Params ().Value ( "%Target", 0 );
+  Shell () -> Send ( args[ 3 ] );
+
+ }  // end if
 
 Shell () -> Send (  EvalFooter ()  );
Handle( TCollection_HAsciiString ) target = Params ().Value ( "%Target", 0 );
 
 static Handle( TCollection_HAsciiString ) skipStr =
-   new TCollection_HAsciiString ( "/usr/bin/ld: warning: cannot find entry symbol _start" );
+ static Handle( TCollection_HAsciiString ) skipStr =
+  new TCollection_HAsciiString ( "/usr/bin/ld: warning: cannot find entry symbol _start" );
 
 Handle( TCollection_HAsciiString ) uType = Params ().Value ( "%UnitType", 0 );
+ Handle( TCollection_HAsciiString ) uType = Params ().Value ( "%UnitType", 0 );
 
-  if (  !uType.IsNull () &&
-        (   !strcmp (  uType -> ToCString (), "toolkit"     ) ||
-            !strcmp (  uType -> ToCString (), "executable"  )
-        )
+ if (  !uType.IsNull () &&
+       (   !strcmp (  uType -> ToCString (), "toolkit"     ) ||
+           !strcmp (  uType -> ToCString (), "executable"  )
+       )
+ ) {
+
+  Handle( TCollection_HAsciiString ) paramH = EvalToolTemplate ( "CheckUndefHeader" );
+  Handle( TCollection_HAsciiString ) paramF = EvalToolTemplate ( "CheckUndefFooter" );
+
+  if (  !paramH.IsNull     () && !paramF.IsNull     () &&
+        !paramH -> IsEmpty () && !paramF -> IsEmpty ()
   ) {
 
-   Handle( TCollection_HAsciiString ) paramH = EvalToolTemplate ( "CheckUndefHeader" );
-   Handle( TCollection_HAsciiString ) paramF = EvalToolTemplate ( "CheckUndefFooter" );
+   args[ 4 ] = paramH;
+   args[ 5 ] = EvalLibSearchDirectives ();
+   args[ 6 ] = EvalDatabaseDirectives  ();
+   args[ 7 ] = target;
+   args[ 8 ] = EvalLibraryList         ();
+   args[ 9 ] = paramF;
 
-   if (  !paramH.IsNull     () && !paramF.IsNull     () &&
-         !paramH -> IsEmpty () && !paramF -> IsEmpty ()
-   ) {
+   if ( !g_fCompOrLnk ) {
 
-    Shell () -> Send ( paramH );
-    Shell () -> Send ( EvalLibSearchDirectives ()  );
-    Shell () -> Send ( EvalDatabaseDirectives  ()  );
-    Shell () -> Send ( target );
-    Shell () -> Send (  EvalLibraryList ()  );
-    Shell () -> Send ( paramF );
+    Shell () -> Send ( args[ 4 ] );
+    Shell () -> Send ( args[ 5 ] );
+    Shell () -> Send ( args[ 6 ] );
+    Shell () -> Send ( args[ 7 ] );
+    Shell () -> Send ( args[ 8 ] );
+    Shell () -> Send ( args[ 9 ] );
 
    }  // end if
 
   }  // end if
 
-  Shell () -> Execute (  new TCollection_HAsciiString ( "\n" )  );
+ }  // end if
+
+ args[ 10 ] = new TCollection_HAsciiString ( "\n" );
+
+ if ( !g_fCompOrLnk )
+
+  Shell () -> Execute ( args[ 10 ] );
+
+ else {
 #endif  // LIN
 
+//  OSD_File f (   OSD_Path (  Params ().Value ( "%LnkFileName" ) -> String ()  )   );
+  OSD_Path aPath = OSD_Path (  Params ().Value ( "%LnkFileName" ) -> String () ) ;
+  OSD_File f ( aPath );
+
+  f.Build (  OSD_WriteOnly, OSD_Protection ()  );
+
+  if (  !f.Failed ()  ) {
+#ifndef LIN
+   for ( i = 0; i < 4; ++i ) {
+#else
+   for ( i = 0; i < 11; ++i ) {
+#endif  // LIN
+    if (  !args[ i ].IsNull ()  )
+
+     f.Write (  args[ i ] -> String (), args[ i ] -> Length ()  );
+
+   }  // end for
+#ifndef LIN
+   f.Write ( "\n", 1 );
+#endif  // LIN
+   f.Close ();
+
+  }  // end if
+
+  return WOKBuilder_Success;
+
+ }  // end else
+
   if(Shell()->Status())
     {
       Standard_Boolean ph = ErrorMsg.PrintHeader();
index b2fb78c7360862b9d502f1c39d6c7b4c6d9c719a..9b2b573631a2be7064420dc8279cf4f2fda310ad 100755 (executable)
@@ -8,6 +8,8 @@
 #include <WOKBuilder_ExportLibrary.hxx>
 #include <WOKBuilder_HSequenceOfEntity.hxx>
 
+#include <WOKernel_FileType.hxx>
+
 #include <WOKUtils_Path.hxx>
 #include <WOKUtils_Param.hxx>
 #include <WOKUtils_Shell.hxx>
@@ -23,6 +25,9 @@
 
 static void FASTCALL _print_output ( Standard_CString, WOKBuilder_Tool* );
 static void FASTCALL _delete_file  (  const Handle( TCollection_HAsciiString )&  );
+//---> EUG4YAN
+Standard_IMPORT Standard_Boolean g_fCompOrLnk;
+//<--- EUG4YAN
 
 WOKBuilder_WNTCollector::WOKBuilder_WNTCollector (const Handle(TCollection_HAsciiString)& aName,
                                                  const WOKUtils_Param&                   aParams)
@@ -47,13 +52,12 @@ Standard_Boolean WOKBuilder_WNTCollector::OpenCommandFile()
      ErrorMsg << "WOKBuilder_WNTCollector::OpenCommandFile"
        << "Could not evaluate extension for tool command file" << endm;
    }
- else 
-   {
-     Handle(TCollection_HAsciiString) fileName = new TCollection_HAsciiString(myTargetName);
-     fileName->AssignCat(ext);
+ else {
+
+  Handle( TCollection_HAsciiString ) fileName = Params ().Value ( "%CmdFileName" );
 
-     myCommandFile.SetPath(OSD_Path(fileName->String()));
-     myCommandFile.Build(OSD_WriteOnly, OSD_Protection());
+  myCommandFile.SetPath (   OSD_Path (  fileName -> String ()  )   );
+  myCommandFile.Build   (  OSD_WriteOnly, OSD_Protection ()  );
 
      if(myCommandFile.Failed())
        {
@@ -104,27 +108,34 @@ WOKBuilder_BuildStatus WOKBuilder_WNTCollector::Execute()
   OSD_Path                                cmdPath;
   Handle(WOKUtils_Path)                   prodPath;
   Handle(TColStd_HSequenceOfHAsciiString) errmsgs;
-  Handle(TCollection_HAsciiString)        cmdFileName;
+//---> EUG4YAN
+  Handle( TCollection_HAsciiString ) args[ 5 ];
 
-  myCommandFile.Path(cmdPath);
-  cmdPath.SystemName(cmdFile);
-  
+  myCommandFile.Path ( cmdPath );
+  cmdPath.SystemName ( cmdFile );
+
+  args[ 0 ] = EvalHeader ();
+  args[ 1 ] =  new TCollection_HAsciiString ( "@"     );
+  args[ 2 ] =  new TCollection_HAsciiString ( cmdFile );
+  args[ 3 ] =  new TCollection_HAsciiString ( " "     );
+  args[ 4 ] = EvalFooter ();
+
+  if ( !g_fCompOrLnk ) {
+//<--- EUG4YAN  
   if(!Shell()->IsLaunched()) Shell()->Launch();
   
   Shell()->ClearOutput();
 
-  Shell()->Send(EvalHeader());
-  Shell()->Send(new TCollection_HAsciiString("@"));
-  Shell()->Send(cmdFileName = new TCollection_HAsciiString(cmdFile));
-  Shell()->Send(new TCollection_HAsciiString(" "));
-  Shell()->Send(EvalFooter());
+  Shell () -> Send ( args[ 0 ] );
+  Shell () -> Send ( args[ 1 ] );
+  Shell () -> Send ( args[ 2 ] );
+  Shell () -> Send ( args[ 3 ] );
+  Shell () -> Send ( args[ 4 ] );
 
   _print_output("Creating   : ", this);
 
   Shell()->Execute(new TCollection_HAsciiString(" "));
 
-  _delete_file(cmdFileName);
-
   if(Shell()->Status())
     {
       Standard_Boolean ph = ErrorMsg.PrintHeader();
@@ -184,7 +195,31 @@ WOKBuilder_BuildStatus WOKBuilder_WNTCollector::Execute()
     }
   
   Shell()->ClearOutput();
-  
+//---> EUG4YAN
+ } else {
+
+  OSD_Path p;
+
+  myCommandFile.Path ( p );
+  p.SetExtension ( ".lnk" );
+
+  OSD_File f ( p );
+
+  f.Build (  OSD_WriteOnly, OSD_Protection ()  );
+
+  if (  !f.Failed ()  ) {
+
+   for ( i = 0; i < 5; ++i )
+
+    f.Write (  args[ i ] -> String (), args[ i ] -> Length ()  );
+   
+   f.Write ( "\r\n", 2 );
+   f.Close ();
+
+  }  // end if
+
+ }
+//<--- EUG4YAN
   return WOKBuilder_Success;
 }