From d20eaac8a8ba343e74dbbc443a60f0b92880cdfe Mon Sep 17 00:00:00 2001 From: cas Date: Wed, 19 Jan 2000 18:04:47 +0000 Subject: [PATCH] No comments --- src/WOKBuilder/WOKBuilder_Compiler.cxx | 30 +++-- .../WOKBuilder_CompilerIterator.cxx | 39 +++++- src/WOKBuilder/WOKBuilder_Linker.cxx | 117 ++++++++++++++---- src/WOKBuilder/WOKBuilder_WNTCollector.cxx | 71 ++++++++--- 4 files changed, 201 insertions(+), 56 deletions(-) diff --git a/src/WOKBuilder/WOKBuilder_Compiler.cxx b/src/WOKBuilder/WOKBuilder_Compiler.cxx index 9cacf73..cfbea08 100755 --- a/src/WOKBuilder/WOKBuilder_Compiler.cxx +++ b/src/WOKBuilder/WOKBuilder_Compiler.cxx @@ -24,7 +24,9 @@ #include #include #include - +//---> 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; } diff --git a/src/WOKBuilder/WOKBuilder_CompilerIterator.cxx b/src/WOKBuilder/WOKBuilder_CompilerIterator.cxx index 31a227f..d68bc10 100755 --- a/src/WOKBuilder/WOKBuilder_CompilerIterator.cxx +++ b/src/WOKBuilder/WOKBuilder_CompilerIterator.cxx @@ -3,7 +3,6 @@ // Author: Jean GAUTIER // -#include #include @@ -14,6 +13,10 @@ #include #include +//---> 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 diff --git a/src/WOKBuilder/WOKBuilder_Linker.cxx b/src/WOKBuilder/WOKBuilder_Linker.cxx index a4d38a1..0abd5ab 100755 --- a/src/WOKBuilder/WOKBuilder_Linker.cxx +++ b/src/WOKBuilder/WOKBuilder_Linker.cxx @@ -23,6 +23,12 @@ #include +//---> EUG4YAN +#include +#include +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(); diff --git a/src/WOKBuilder/WOKBuilder_WNTCollector.cxx b/src/WOKBuilder/WOKBuilder_WNTCollector.cxx index b2fb78c..9b2b573 100755 --- a/src/WOKBuilder/WOKBuilder_WNTCollector.cxx +++ b/src/WOKBuilder/WOKBuilder_WNTCollector.cxx @@ -8,6 +8,8 @@ #include #include +#include + #include #include #include @@ -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; } -- 2.39.5