#include <OSD_Protection.hxx>
#include <OSD_File.hxx>
#include <WOKUtils_AdmFile.hxx>
-
+//---> EUG4YAN
+Standard_IMPORT Standard_Boolean g_fCompOrLnk;
+//<--- EUG4YAN
//=======================================================================
//function : WOKBuilder_Compiler
//purpose :
//=======================================================================
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
Handle(WOKBuilder_MFile) mfile;
+//---> EUG4YAN
+ if ( !g_fCompOrLnk )
+//<--- EUG4YAN
if(Shell()->IsLaunched() == Standard_False) Shell()->Launch();
Load();
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())
} // end if
} // end if
-
+//---> EUG4YAN
+ } // end if
+//<--- EUG4YAN
return WOKBuilder_Success;
}
// 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
<< "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") ;
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);
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 );
}
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
#include <WOKBuilder_Linker.ixx>
+//---> EUG4YAN
+#include <OSD_Protection.hxx>
+#include <OSD_File.hxx>
+Standard_IMPORT Standard_Boolean g_fCompOrLnk;
+//<--- EUG4YAN
+
//=======================================================================
//function : WOKBuilder_Linker
//purpose :
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();
#include <WOKBuilder_ExportLibrary.hxx>
#include <WOKBuilder_HSequenceOfEntity.hxx>
+#include <WOKernel_FileType.hxx>
+
#include <WOKUtils_Path.hxx>
#include <WOKUtils_Param.hxx>
#include <WOKUtils_Shell.hxx>
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)
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())
{
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();
}
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;
}