2005-07-12 16:47:34 +00:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2005 Casper S. Hornstrup
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
|
|
|
*/
|
2005-05-06 10:38:30 +00:00
|
|
|
#ifndef MINGW_MODULEHANDLER_H
|
|
|
|
#define MINGW_MODULEHANDLER_H
|
|
|
|
|
|
|
|
#include "../backend.h"
|
|
|
|
#include "mingw.h"
|
|
|
|
|
|
|
|
class MingwBackend;
|
|
|
|
|
|
|
|
extern std::string
|
|
|
|
GetTargetMacro ( const Module&, bool with_dollar = true );
|
|
|
|
|
|
|
|
extern std::string
|
|
|
|
PrefixFilename (
|
|
|
|
const std::string& filename,
|
|
|
|
const std::string& prefix );
|
|
|
|
|
|
|
|
class MingwModuleHandler
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
MingwModuleHandler ( const Module& module_ );
|
|
|
|
virtual ~MingwModuleHandler();
|
|
|
|
|
|
|
|
static void SetBackend ( MingwBackend* backend_ );
|
|
|
|
static void SetMakefile ( FILE* f );
|
2005-11-23 15:05:53 +00:00
|
|
|
void EnablePreCompiledHeaderSupport ();
|
2005-05-06 10:38:30 +00:00
|
|
|
|
2007-09-07 14:59:23 +00:00
|
|
|
static const FileLocation* PassThruCacheDirectory (const FileLocation* fileLocation );
|
2005-05-06 10:38:30 +00:00
|
|
|
|
2007-09-07 14:59:23 +00:00
|
|
|
static const FileLocation* GetTargetFilename (
|
2005-05-06 10:38:30 +00:00
|
|
|
const Module& module,
|
|
|
|
string_list* pclean_files );
|
|
|
|
|
2007-09-07 14:59:23 +00:00
|
|
|
static const FileLocation* GetImportLibraryFilename (
|
2005-05-06 10:38:30 +00:00
|
|
|
const Module& module,
|
|
|
|
string_list* pclean_files );
|
|
|
|
|
2007-10-06 07:53:20 +00:00
|
|
|
static std::string GenerateGccDefineParametersFromVector ( const std::vector<Define*>& defines, std::set<std::string> &used_defs );
|
2005-05-14 15:07:11 +00:00
|
|
|
static std::string GenerateGccIncludeParametersFromVector ( const std::vector<Include*>& includes );
|
|
|
|
|
2005-05-06 10:38:30 +00:00
|
|
|
std::string GetModuleTargets ( const Module& module );
|
|
|
|
void GetObjectsVector ( const IfableData& data,
|
2007-09-07 14:59:23 +00:00
|
|
|
std::vector<FileLocation>& objectFiles ) const;
|
2007-10-11 10:18:47 +00:00
|
|
|
void GenerateSourceMacro();
|
2005-05-06 10:38:30 +00:00
|
|
|
void GenerateObjectMacro();
|
|
|
|
void GenerateTargetMacro();
|
|
|
|
void GenerateOtherMacros();
|
|
|
|
|
|
|
|
static MingwModuleHandler* InstanciateHandler ( const Module& module_,
|
|
|
|
MingwBackend* backend_ );
|
|
|
|
virtual HostType DefaultHost() = 0;
|
|
|
|
void GeneratePreconditionDependencies ();
|
|
|
|
virtual void Process () = 0;
|
|
|
|
virtual std::string TypeSpecificCFlags() { return ""; }
|
|
|
|
virtual std::string TypeSpecificNasmFlags() { return ""; }
|
|
|
|
virtual std::string TypeSpecificLinkerFlags() { return ""; }
|
|
|
|
void GenerateInvocations () const;
|
|
|
|
void GenerateCleanTarget () const;
|
2005-05-06 16:05:37 +00:00
|
|
|
void GenerateInstallTarget () const;
|
2005-06-12 10:18:51 +00:00
|
|
|
void GenerateDependsTarget () const;
|
2005-05-06 10:38:30 +00:00
|
|
|
static bool ReferenceObjects ( const Module& module );
|
2006-09-06 20:00:41 +00:00
|
|
|
virtual void AddImplicitLibraries ( Module& module ) { return; }
|
2007-09-07 14:59:23 +00:00
|
|
|
|
|
|
|
void OutputCopyCommand ( const FileLocation& source,
|
|
|
|
const FileLocation& destination );
|
2005-05-06 10:38:30 +00:00
|
|
|
protected:
|
2005-11-22 14:23:17 +00:00
|
|
|
virtual void GetModuleSpecificCompilationUnits ( std::vector<CompilationUnit*>& compilationUnits );
|
2005-05-06 10:38:30 +00:00
|
|
|
std::string GetWorkingDirectory () const;
|
|
|
|
std::string GetBasename ( const std::string& filename ) const;
|
2007-09-07 14:59:23 +00:00
|
|
|
const FileLocation* GetActualSourceFilename ( const FileLocation* file ) const;
|
|
|
|
std::string GetExtraDependencies ( const FileLocation *file ) const;
|
2006-01-05 16:35:08 +00:00
|
|
|
std::string GetCompilationUnitDependencies ( const CompilationUnit& compilationUnit ) const;
|
2007-09-07 14:59:23 +00:00
|
|
|
const FileLocation* GetModuleArchiveFilename () const;
|
2005-05-06 10:38:30 +00:00
|
|
|
bool IsGeneratedFile ( const File& file ) const;
|
|
|
|
std::string GetImportLibraryDependency ( const Module& importedModule );
|
|
|
|
void GetTargets ( const Module& dependencyModule,
|
|
|
|
string_list& targets );
|
|
|
|
void GetModuleDependencies ( string_list& dependencies );
|
|
|
|
std::string GetAllDependencies () const;
|
2007-09-07 14:59:23 +00:00
|
|
|
void GetSourceFilenames ( std::vector<FileLocation>& list,
|
2007-08-07 15:08:09 +00:00
|
|
|
bool includeGeneratedFiles ) const;
|
2007-09-07 14:59:23 +00:00
|
|
|
void GetSourceFilenamesWithoutGeneratedFiles ( std::vector<FileLocation>& list ) const;
|
|
|
|
const FileLocation* GetObjectFilename ( const FileLocation* sourceFile,
|
2007-11-05 15:57:06 +00:00
|
|
|
const Module& module,
|
2007-09-07 14:59:23 +00:00
|
|
|
string_list* pclean_files ) const;
|
2005-05-06 10:38:30 +00:00
|
|
|
|
|
|
|
std::string GetObjectFilenames ();
|
2007-03-10 03:51:27 +00:00
|
|
|
|
2005-05-06 10:38:30 +00:00
|
|
|
std::string GetPreconditionDependenciesName () const;
|
|
|
|
std::string GetCFlagsMacro () const;
|
|
|
|
static std::string GetObjectsMacro ( const Module& );
|
|
|
|
std::string GetLinkingDependenciesMacro () const;
|
|
|
|
std::string GetLibsMacro () const;
|
|
|
|
std::string GetLinkerMacro () const;
|
|
|
|
void GenerateCleanObjectsAsYouGoCode () const;
|
2005-05-15 13:57:03 +00:00
|
|
|
void GenerateRunRsymCode () const;
|
2006-06-13 04:50:14 +00:00
|
|
|
void GenerateRunStripCode () const;
|
2005-05-06 10:38:30 +00:00
|
|
|
void GenerateLinkerCommand ( const std::string& dependencies,
|
|
|
|
const std::string& linker,
|
|
|
|
const std::string& linkerParameters,
|
|
|
|
const std::string& objectsMacro,
|
2005-08-02 18:13:21 +00:00
|
|
|
const std::string& libsMacro,
|
|
|
|
const std::string& pefixupParameters );
|
2005-05-06 10:38:30 +00:00
|
|
|
void GeneratePhonyTarget() const;
|
2007-09-07 14:59:23 +00:00
|
|
|
void GenerateBuildMapCode ( const FileLocation *mapTarget = NULL );
|
2005-05-06 10:38:30 +00:00
|
|
|
void GenerateRules ();
|
|
|
|
void GenerateImportLibraryTargetIfNeeded ();
|
2007-09-07 14:59:23 +00:00
|
|
|
void GetDefinitionDependencies ( std::vector<FileLocation>& dependencies ) const;
|
2007-09-03 01:57:36 +00:00
|
|
|
|
2005-05-06 10:38:30 +00:00
|
|
|
std::string GetLinkingDependencies () const;
|
|
|
|
static MingwBackend* backend;
|
|
|
|
static FILE* fMakefile;
|
2005-11-23 15:05:53 +00:00
|
|
|
bool use_pch;
|
2005-05-06 10:38:30 +00:00
|
|
|
private:
|
|
|
|
std::string ConcatenatePaths ( const std::string& path1,
|
|
|
|
const std::string& path2 ) const;
|
|
|
|
std::string GenerateGccDefineParameters () const;
|
|
|
|
std::string GenerateCompilerParametersFromVector ( const std::vector<CompilerFlag*>& compilerFlags ) const;
|
|
|
|
std::string GenerateLinkerParametersFromVector ( const std::vector<LinkerFlag*>& linkerFlags ) const;
|
|
|
|
std::string GenerateImportLibraryDependenciesFromVector ( const std::vector<Library*>& libraries );
|
|
|
|
std::string GenerateLinkerParameters () const;
|
|
|
|
void GenerateMacro ( const char* assignmentOperation,
|
|
|
|
const std::string& macro,
|
2007-10-19 13:24:06 +00:00
|
|
|
const IfableData& data,
|
2007-11-05 08:57:04 +00:00
|
|
|
std::set<const Define *>* used_defs,
|
2007-10-19 14:16:18 +00:00
|
|
|
bool generatingCompilerMacro );
|
2005-05-06 10:38:30 +00:00
|
|
|
void GenerateMacros ( const char* op,
|
|
|
|
const IfableData& data,
|
2007-10-19 13:24:06 +00:00
|
|
|
const std::vector<LinkerFlag*>* linkerFlags,
|
2007-11-05 08:57:04 +00:00
|
|
|
std::set<const Define *>& used_defs );
|
2007-10-11 10:18:47 +00:00
|
|
|
void GenerateSourceMacros ( const char* assignmentOperation,
|
|
|
|
const IfableData& data );
|
2005-05-06 10:38:30 +00:00
|
|
|
void GenerateObjectMacros ( const char* assignmentOperation,
|
2007-10-11 10:18:47 +00:00
|
|
|
const IfableData& data );
|
2005-05-06 10:38:30 +00:00
|
|
|
std::string GenerateGccIncludeParameters () const;
|
|
|
|
std::string GenerateGccParameters () const;
|
|
|
|
std::string GenerateNasmParameters () const;
|
2007-09-07 14:59:23 +00:00
|
|
|
const FileLocation* GetPrecompiledHeaderFilename () const;
|
|
|
|
void GenerateGccCommand ( const FileLocation* sourceFile,
|
2005-07-19 18:46:13 +00:00
|
|
|
const std::string& extraDependencies,
|
2005-05-06 10:38:30 +00:00
|
|
|
const std::string& cc,
|
|
|
|
const std::string& cflagsMacro );
|
2007-09-07 14:59:23 +00:00
|
|
|
void GenerateGccAssemblerCommand ( const FileLocation* sourceFile,
|
2005-05-06 10:38:30 +00:00
|
|
|
const std::string& cc,
|
|
|
|
const std::string& cflagsMacro );
|
2007-09-07 14:59:23 +00:00
|
|
|
void GenerateNasmCommand ( const FileLocation* sourceFile,
|
2005-05-06 10:38:30 +00:00
|
|
|
const std::string& nasmflagsMacro );
|
2007-09-07 14:59:23 +00:00
|
|
|
void GenerateWindresCommand ( const FileLocation* sourceFile,
|
2005-05-06 10:38:30 +00:00
|
|
|
const std::string& windresflagsMacro );
|
2007-09-07 14:59:23 +00:00
|
|
|
void GenerateWinebuildCommands ( const FileLocation* sourceFile );
|
2005-11-22 14:23:17 +00:00
|
|
|
std::string GetWidlFlags ( const CompilationUnit& compilationUnit );
|
2005-05-06 10:38:30 +00:00
|
|
|
void GenerateWidlCommandsServer (
|
2005-11-22 14:23:17 +00:00
|
|
|
const CompilationUnit& compilationUnit,
|
2005-05-06 10:38:30 +00:00
|
|
|
const std::string& widlflagsMacro );
|
|
|
|
void GenerateWidlCommandsClient (
|
2005-11-22 14:23:17 +00:00
|
|
|
const CompilationUnit& compilationUnit,
|
2005-05-06 10:38:30 +00:00
|
|
|
const std::string& widlflagsMacro );
|
2006-06-18 19:39:13 +00:00
|
|
|
void GenerateWidlCommandsIdlHeader (
|
|
|
|
const CompilationUnit& compilationUnit,
|
|
|
|
const std::string& widlflagsMacro );
|
2007-07-03 19:10:33 +00:00
|
|
|
void GenerateWidlCommandsEmbeddedTypeLib (
|
2007-07-03 15:27:43 +00:00
|
|
|
const CompilationUnit& compilationUnit,
|
|
|
|
const std::string& widlflagsMacro );
|
2005-11-22 14:23:17 +00:00
|
|
|
void GenerateWidlCommands ( const CompilationUnit& compilationUnit,
|
2005-05-06 10:38:30 +00:00
|
|
|
const std::string& widlflagsMacro );
|
2005-11-22 14:23:17 +00:00
|
|
|
void GenerateCommands ( const CompilationUnit& compilationUnit,
|
2007-09-24 12:53:33 +00:00
|
|
|
const std::string& extraDependencies,
|
2005-05-06 10:38:30 +00:00
|
|
|
const std::string& cc,
|
|
|
|
const std::string& cppc,
|
|
|
|
const std::string& cflagsMacro,
|
|
|
|
const std::string& nasmflagsMacro,
|
|
|
|
const std::string& windresflagsMacro,
|
|
|
|
const std::string& widlflagsMacro );
|
|
|
|
void GenerateObjectFileTargets ( const IfableData& data,
|
|
|
|
const std::string& cc,
|
|
|
|
const std::string& cppc,
|
|
|
|
const std::string& cflagsMacro,
|
|
|
|
const std::string& nasmflagsMacro,
|
|
|
|
const std::string& windresflagsMacro,
|
|
|
|
const std::string& widlflagsMacro );
|
|
|
|
void GenerateObjectFileTargets ( const std::string& cc,
|
|
|
|
const std::string& cppc,
|
|
|
|
const std::string& cflagsMacro,
|
|
|
|
const std::string& nasmflagsMacro,
|
|
|
|
const std::string& windresflagsMacro,
|
|
|
|
const std::string& widlflagsMacro );
|
2007-09-07 14:59:23 +00:00
|
|
|
const FileLocation* GenerateArchiveTarget ( const std::string& ar,
|
|
|
|
const std::string& objs_macro ) const;
|
|
|
|
void GetSpecObjectDependencies ( std::vector<FileLocation>& dependencies,
|
|
|
|
const FileLocation *file ) const;
|
|
|
|
void GetWidlObjectDependencies ( std::vector<FileLocation>& dependencies,
|
|
|
|
const FileLocation *file ) const;
|
2005-05-06 10:38:30 +00:00
|
|
|
void GetDefaultDependencies ( string_list& dependencies ) const;
|
|
|
|
void GetInvocationDependencies ( const Module& module, string_list& dependencies );
|
|
|
|
bool IsWineModule () const;
|
2007-09-07 14:59:23 +00:00
|
|
|
const FileLocation* GetDefinitionFilename () const;
|
2005-05-06 10:38:30 +00:00
|
|
|
void GenerateBuildNonSymbolStrippedCode ();
|
2005-11-22 14:23:17 +00:00
|
|
|
void CleanupCompilationUnitVector ( std::vector<CompilationUnit*>& compilationUnits );
|
2007-09-07 14:59:23 +00:00
|
|
|
void GetRpcHeaderDependencies ( std::vector<FileLocation>& dependencies ) const;
|
2007-09-02 13:08:00 +00:00
|
|
|
static std::string GetPropertyValue ( const Module& module, const std::string& name );
|
2007-09-07 14:59:23 +00:00
|
|
|
const FileLocation* GetRpcServerHeaderFilename ( const FileLocation *base ) const;
|
|
|
|
const FileLocation* GetRpcClientHeaderFilename ( const FileLocation *base ) const;
|
|
|
|
const FileLocation* GetIdlHeaderFilename ( const FileLocation *base ) const;
|
2005-07-17 15:10:03 +00:00
|
|
|
std::string GetModuleCleanTarget ( const Module& module ) const;
|
|
|
|
void GetReferencedObjectLibraryModuleCleanTargets ( std::vector<std::string>& moduleNames ) const;
|
2005-05-06 10:38:30 +00:00
|
|
|
public:
|
|
|
|
const Module& module;
|
|
|
|
string_list clean_files;
|
|
|
|
std::string cflagsMacro;
|
|
|
|
std::string nasmflagsMacro;
|
|
|
|
std::string windresflagsMacro;
|
|
|
|
std::string widlflagsMacro;
|
|
|
|
std::string linkerflagsMacro;
|
2007-10-11 10:18:47 +00:00
|
|
|
std::string sourcesMacro;
|
2005-05-06 10:38:30 +00:00
|
|
|
std::string objectsMacro;
|
|
|
|
std::string libsMacro;
|
|
|
|
std::string linkDepsMacro;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
class MingwBuildToolModuleHandler : public MingwModuleHandler
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
MingwBuildToolModuleHandler ( const Module& module );
|
|
|
|
virtual HostType DefaultHost() { return HostTrue; }
|
|
|
|
virtual void Process ();
|
|
|
|
private:
|
|
|
|
void GenerateBuildToolModuleTarget ();
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
class MingwKernelModuleHandler : public MingwModuleHandler
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
MingwKernelModuleHandler ( const Module& module );
|
|
|
|
virtual HostType DefaultHost() { return HostFalse; }
|
|
|
|
virtual void Process ();
|
|
|
|
private:
|
|
|
|
void GenerateKernelModuleTarget ();
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
class MingwStaticLibraryModuleHandler : public MingwModuleHandler
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
MingwStaticLibraryModuleHandler ( const Module& module );
|
|
|
|
virtual HostType DefaultHost() { return HostFalse; }
|
|
|
|
virtual void Process ();
|
|
|
|
private:
|
|
|
|
void GenerateStaticLibraryModuleTarget ();
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
class MingwObjectLibraryModuleHandler : public MingwModuleHandler
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
MingwObjectLibraryModuleHandler ( const Module& module );
|
|
|
|
virtual HostType DefaultHost() { return HostFalse; }
|
|
|
|
virtual void Process ();
|
|
|
|
private:
|
|
|
|
void GenerateObjectLibraryModuleTarget ();
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
class MingwKernelModeDLLModuleHandler : public MingwModuleHandler
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
MingwKernelModeDLLModuleHandler ( const Module& module );
|
|
|
|
virtual HostType DefaultHost() { return HostFalse; }
|
|
|
|
virtual void Process ();
|
2006-07-09 16:25:25 +00:00
|
|
|
std::string TypeSpecificLinkerFlags() { return "-nostartfiles -nostdlib"; }
|
2007-03-10 03:51:27 +00:00
|
|
|
void AddImplicitLibraries ( Module& module );
|
2005-05-06 10:38:30 +00:00
|
|
|
private:
|
|
|
|
void GenerateKernelModeDLLModuleTarget ();
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
class MingwKernelModeDriverModuleHandler : public MingwModuleHandler
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
MingwKernelModeDriverModuleHandler ( const Module& module );
|
|
|
|
virtual HostType DefaultHost() { return HostFalse; }
|
|
|
|
virtual void Process ();
|
!!! ATTENTION EVERYONE - do a make clean after getting this revision !!!
!!! ATTENTION PSEH USERS - new features & a change in rules !!!
modified include/reactos/libs/pseh/framebased.h
modified include/reactos/libs/pseh/framebased/internal.h
deleted include/reactos/libs/pseh/setjmp.h
modified lib/pseh/framebased.c
deleted lib/pseh/i386/setjmp.asm
modified lib/pseh/pseh.rbuild
Big PSEH revamp. If God is kind and merciful, this might be the last revision to PSEH ever
!!! RULE CHANGE !!! Obsoleted _SEH_NO_NATIVE_NLG, do NOT use it anymore, it will now cause fatal compile-time errors
!!! RULE CHANGE !!! As a side effect to the fix for a bug where a _SEH_TRY nested in a _SEH_HANDLE would lead to stack corruption, using "return" or "goto" from anywhere inside a PSEH block is now FORBIDDEN; all code that already did has been fixed in this revision
!!! NEW FEATURE !!! To leave a PSEH block from anywhere inside it, use the new _SEH_YIELD(<statement>) macro; examples: _SEH_YIELD(return value), _SEH_YIELD(goto label), _SEH_YIELD(returnvalue = value; goto label); ALWAYS ensure a _SEH_YIELD() leads outside the top-level _SEH_TRY block - do NOT goto into an ancestor _SEH_TRY block!!! Also note that _SEH_YIELD() disables SEH protection for the enclosed statement, so do NOT perform operations that might throw exceptions inside a _SEH_YIELD(); finally, ensure the enclosed statement does NOT allow execution to continue, or _SEH_YIELD() will get in an infinite loop; bear with me, for I have done the impossible, so don't expect miracles
Don't use a fake setjmp/longjmp *ever*, too dangerous; removed _SEHLongJmp & _SEHSetJmp, obsoleted _SEH_NO_NATIVE_NLG
On GCC, use __builtin_setjmp/__builtin_longjmp instead of setjmp/longjmp; they produce efficient code that plays well with optimizations, require no external library and are designed specifically for exception handling; should result in faster code and no hidden bugs
Use inline code to enter/leave trylevels; yields much better binary code
Inline handlers inside _SEH_PortableFrame_t instead of pointing to them; yields better code for the most common usages
Turn all top-level statements generated by macros from bare scopes into for loops, to ensure they are used correctly as stand-alone statements
Removed bitrotten old syntax, because it wasn't being used nor maintained
modified dll/3rdparty/freetype/freetype.rbuild
modified dll/win32/kernel32/kernel32.rbuild
modified drivers/network/tcpip/tcpip.rbuild
modified lib/drivers/ip/ip.rbuild
modified lib/rtl/rtl.rbuild
modified ntoskrnl/ntoskrnl.rbuild
modified subsystems/win32/win32k/win32k.rbuild
Removed obsolete _SEH_NO_NATIVE_NLG define
modified drivers/network/afd/afd/lock.c
modified drivers/network/afd/afd/tdi.c
modified subsystems/csr/csrsrv/api.c
modified subsystems/win32/win32k/ntuser/clipboard.c
modified subsystems/win32/win32k/ntuser/window.c
Use the new _SEH_YIELD macro to return/goto from SEH blocks
modified tools/rbuild/backend/mingw/modulehandler.cpp
modified tools/rbuild/backend/mingw/modulehandler.h
modified tools/rbuild/module.cpp
modified tools/rbuild/project.dtd
modified tools/rbuild/rbuild.h
Don't use the obsolete _SEH_NO_NATIVE_NLG flag anymore
Only add underscores to imported symbols when module is marked underscoresymbols="true"; fixes debugsup and, indirectly, PSEH tracing
modified lib/3rdparty/mingw/mingw.rbuild
Build with underscoresymbols="true"
svn path=/trunk/; revision=26224
2007-04-01 00:07:25 +00:00
|
|
|
std::string TypeSpecificCFlags() { return "-D__NTDRIVER__"; }
|
2006-07-09 16:25:25 +00:00
|
|
|
std::string TypeSpecificLinkerFlags() { return "-nostartfiles -nostdlib"; }
|
2007-03-10 03:51:27 +00:00
|
|
|
void AddImplicitLibraries ( Module& module );
|
2005-05-06 10:38:30 +00:00
|
|
|
private:
|
|
|
|
void GenerateKernelModeDriverModuleTarget ();
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
class MingwNativeDLLModuleHandler : public MingwModuleHandler
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
MingwNativeDLLModuleHandler ( const Module& module );
|
|
|
|
virtual HostType DefaultHost() { return HostFalse; }
|
|
|
|
virtual void Process ();
|
|
|
|
std::string TypeSpecificLinkerFlags() { return "-nostartfiles -nostdlib"; }
|
2007-03-10 03:51:27 +00:00
|
|
|
void AddImplicitLibraries ( Module& module );
|
2005-05-06 10:38:30 +00:00
|
|
|
private:
|
|
|
|
void GenerateNativeDLLModuleTarget ();
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
class MingwNativeCUIModuleHandler : public MingwModuleHandler
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
MingwNativeCUIModuleHandler ( const Module& module );
|
|
|
|
virtual HostType DefaultHost() { return HostFalse; }
|
|
|
|
virtual void Process ();
|
!!! ATTENTION EVERYONE - do a make clean after getting this revision !!!
!!! ATTENTION PSEH USERS - new features & a change in rules !!!
modified include/reactos/libs/pseh/framebased.h
modified include/reactos/libs/pseh/framebased/internal.h
deleted include/reactos/libs/pseh/setjmp.h
modified lib/pseh/framebased.c
deleted lib/pseh/i386/setjmp.asm
modified lib/pseh/pseh.rbuild
Big PSEH revamp. If God is kind and merciful, this might be the last revision to PSEH ever
!!! RULE CHANGE !!! Obsoleted _SEH_NO_NATIVE_NLG, do NOT use it anymore, it will now cause fatal compile-time errors
!!! RULE CHANGE !!! As a side effect to the fix for a bug where a _SEH_TRY nested in a _SEH_HANDLE would lead to stack corruption, using "return" or "goto" from anywhere inside a PSEH block is now FORBIDDEN; all code that already did has been fixed in this revision
!!! NEW FEATURE !!! To leave a PSEH block from anywhere inside it, use the new _SEH_YIELD(<statement>) macro; examples: _SEH_YIELD(return value), _SEH_YIELD(goto label), _SEH_YIELD(returnvalue = value; goto label); ALWAYS ensure a _SEH_YIELD() leads outside the top-level _SEH_TRY block - do NOT goto into an ancestor _SEH_TRY block!!! Also note that _SEH_YIELD() disables SEH protection for the enclosed statement, so do NOT perform operations that might throw exceptions inside a _SEH_YIELD(); finally, ensure the enclosed statement does NOT allow execution to continue, or _SEH_YIELD() will get in an infinite loop; bear with me, for I have done the impossible, so don't expect miracles
Don't use a fake setjmp/longjmp *ever*, too dangerous; removed _SEHLongJmp & _SEHSetJmp, obsoleted _SEH_NO_NATIVE_NLG
On GCC, use __builtin_setjmp/__builtin_longjmp instead of setjmp/longjmp; they produce efficient code that plays well with optimizations, require no external library and are designed specifically for exception handling; should result in faster code and no hidden bugs
Use inline code to enter/leave trylevels; yields much better binary code
Inline handlers inside _SEH_PortableFrame_t instead of pointing to them; yields better code for the most common usages
Turn all top-level statements generated by macros from bare scopes into for loops, to ensure they are used correctly as stand-alone statements
Removed bitrotten old syntax, because it wasn't being used nor maintained
modified dll/3rdparty/freetype/freetype.rbuild
modified dll/win32/kernel32/kernel32.rbuild
modified drivers/network/tcpip/tcpip.rbuild
modified lib/drivers/ip/ip.rbuild
modified lib/rtl/rtl.rbuild
modified ntoskrnl/ntoskrnl.rbuild
modified subsystems/win32/win32k/win32k.rbuild
Removed obsolete _SEH_NO_NATIVE_NLG define
modified drivers/network/afd/afd/lock.c
modified drivers/network/afd/afd/tdi.c
modified subsystems/csr/csrsrv/api.c
modified subsystems/win32/win32k/ntuser/clipboard.c
modified subsystems/win32/win32k/ntuser/window.c
Use the new _SEH_YIELD macro to return/goto from SEH blocks
modified tools/rbuild/backend/mingw/modulehandler.cpp
modified tools/rbuild/backend/mingw/modulehandler.h
modified tools/rbuild/module.cpp
modified tools/rbuild/project.dtd
modified tools/rbuild/rbuild.h
Don't use the obsolete _SEH_NO_NATIVE_NLG flag anymore
Only add underscores to imported symbols when module is marked underscoresymbols="true"; fixes debugsup and, indirectly, PSEH tracing
modified lib/3rdparty/mingw/mingw.rbuild
Build with underscoresymbols="true"
svn path=/trunk/; revision=26224
2007-04-01 00:07:25 +00:00
|
|
|
std::string TypeSpecificCFlags() { return "-D__NTAPP__"; }
|
2005-05-06 10:38:30 +00:00
|
|
|
std::string TypeSpecificLinkerFlags() { return "-nostartfiles -nostdlib"; }
|
2007-03-10 03:51:27 +00:00
|
|
|
void AddImplicitLibraries ( Module& module );
|
2005-05-06 10:38:30 +00:00
|
|
|
private:
|
|
|
|
void GenerateNativeCUIModuleTarget ();
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
class MingwWin32DLLModuleHandler : public MingwModuleHandler
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
MingwWin32DLLModuleHandler ( const Module& module );
|
|
|
|
virtual HostType DefaultHost() { return HostFalse; }
|
|
|
|
virtual void Process ();
|
2007-09-19 11:11:57 +00:00
|
|
|
std::string TypeSpecificLinkerFlags() { return module.cplusplus ? "-nostartfiles -lgcc" : "-nostartfiles -nostdlib -lgcc"; }
|
2007-08-07 15:08:09 +00:00
|
|
|
void AddImplicitLibraries ( Module& module );
|
2005-05-06 10:38:30 +00:00
|
|
|
private:
|
|
|
|
void GenerateWin32DLLModuleTarget ();
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2007-04-27 15:18:34 +00:00
|
|
|
class MingwWin32OCXModuleHandler : public MingwModuleHandler
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
MingwWin32OCXModuleHandler ( const Module& module );
|
|
|
|
virtual HostType DefaultHost() { return HostFalse; }
|
|
|
|
virtual void Process ();
|
2007-09-19 11:11:57 +00:00
|
|
|
std::string TypeSpecificLinkerFlags() { return module.cplusplus ? "-nostartfiles -lgcc" : "-nostartfiles -nostdlib -lgcc"; }
|
2007-08-07 15:08:09 +00:00
|
|
|
void AddImplicitLibraries ( Module& module );
|
2007-04-27 15:18:34 +00:00
|
|
|
private:
|
|
|
|
void GenerateWin32OCXModuleTarget ();
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2005-05-06 10:38:30 +00:00
|
|
|
class MingwWin32CUIModuleHandler : public MingwModuleHandler
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
MingwWin32CUIModuleHandler ( const Module& module );
|
|
|
|
virtual HostType DefaultHost() { return HostFalse; }
|
|
|
|
virtual void Process ();
|
2007-09-19 11:11:57 +00:00
|
|
|
std::string TypeSpecificLinkerFlags() { return module.cplusplus ? "-nostartfiles -lgcc" : "-nostartfiles -nostdlib -lgcc"; }
|
2007-08-07 15:08:09 +00:00
|
|
|
void AddImplicitLibraries ( Module& module );
|
2005-05-06 10:38:30 +00:00
|
|
|
private:
|
|
|
|
void GenerateWin32CUIModuleTarget ();
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
class MingwWin32GUIModuleHandler : public MingwModuleHandler
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
MingwWin32GUIModuleHandler ( const Module& module );
|
|
|
|
virtual HostType DefaultHost() { return HostFalse; }
|
|
|
|
virtual void Process ();
|
2007-09-19 11:11:57 +00:00
|
|
|
std::string TypeSpecificLinkerFlags() { return module.cplusplus ? "-nostartfiles -lgcc" : "-nostartfiles -nostdlib -lgcc"; }
|
2007-08-07 15:08:09 +00:00
|
|
|
void AddImplicitLibraries ( Module& module );
|
2005-05-06 10:38:30 +00:00
|
|
|
private:
|
|
|
|
void GenerateWin32GUIModuleTarget ();
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
class MingwBootLoaderModuleHandler : public MingwModuleHandler
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
MingwBootLoaderModuleHandler ( const Module& module );
|
|
|
|
virtual HostType DefaultHost() { return HostFalse; }
|
|
|
|
virtual void Process ();
|
|
|
|
std::string TypeSpecificLinkerFlags() { return "-nostartfiles -nostdlib"; }
|
|
|
|
private:
|
|
|
|
void GenerateBootLoaderModuleTarget ();
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
class MingwBootSectorModuleHandler : public MingwModuleHandler
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
MingwBootSectorModuleHandler ( const Module& module );
|
|
|
|
virtual HostType DefaultHost() { return HostFalse; }
|
|
|
|
virtual void Process ();
|
|
|
|
std::string TypeSpecificNasmFlags() { return "-f bin"; }
|
|
|
|
private:
|
|
|
|
void GenerateBootSectorModuleTarget ();
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2005-12-04 12:02:45 +00:00
|
|
|
class MingwBootProgramModuleHandler : public MingwModuleHandler
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
MingwBootProgramModuleHandler ( const Module& module );
|
|
|
|
virtual HostType DefaultHost() { return HostFalse; }
|
|
|
|
virtual void Process ();
|
|
|
|
std::string GetProgTextAddrMacro ();
|
|
|
|
std::string TypeSpecificLinkerFlags() { return "-nostartfiles -nostdlib"; }
|
|
|
|
private:
|
|
|
|
void GenerateBootProgramModuleTarget ();
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2005-05-06 10:38:30 +00:00
|
|
|
class MingwIsoModuleHandler : public MingwModuleHandler
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
MingwIsoModuleHandler ( const Module& module );
|
|
|
|
virtual HostType DefaultHost() { return HostFalse; }
|
|
|
|
virtual void Process ();
|
|
|
|
private:
|
|
|
|
void GenerateIsoModuleTarget ();
|
2007-09-07 14:59:23 +00:00
|
|
|
void GetBootstrapCdDirectories ( std::vector<FileLocation>& out, const std::string& bootcdDirectory );
|
|
|
|
void GetNonModuleCdDirectories ( std::vector<FileLocation>& out, const std::string& bootcdDirectory );
|
|
|
|
void GetCdDirectories ( std::vector<FileLocation>& out, const std::string& bootcdDirectory );
|
|
|
|
void GetBootstrapCdFiles ( std::vector<FileLocation>& out ) const;
|
|
|
|
void GetNonModuleCdFiles ( std::vector<FileLocation>& out ) const;
|
|
|
|
void GetCdFiles ( std::vector<FileLocation>& out ) const;
|
2005-05-06 10:38:30 +00:00
|
|
|
void OutputBootstrapfileCopyCommands ( const std::string& bootcdDirectory );
|
|
|
|
void OutputCdfileCopyCommands ( const std::string& bootcdDirectory );
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
class MingwLiveIsoModuleHandler : public MingwModuleHandler
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
MingwLiveIsoModuleHandler ( const Module& module );
|
|
|
|
virtual HostType DefaultHost() { return HostFalse; }
|
|
|
|
virtual void Process ();
|
|
|
|
private:
|
|
|
|
void GenerateLiveIsoModuleTarget ();
|
|
|
|
void CreateDirectory ( const std::string& directory );
|
|
|
|
void OutputModuleCopyCommands ( std::string& livecdDirectory,
|
|
|
|
std::string& livecdReactos );
|
|
|
|
void OutputNonModuleCopyCommands ( std::string& livecdDirectory,
|
|
|
|
std::string& livecdReactos );
|
|
|
|
void OutputProfilesDirectoryCommands ( std::string& livecdDirectory );
|
|
|
|
void OutputLoaderCommands ( std::string& livecdDirectory );
|
|
|
|
void OutputRegistryCommands ( std::string& livecdDirectory );
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
class MingwTestModuleHandler : public MingwModuleHandler
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
MingwTestModuleHandler ( const Module& module );
|
|
|
|
virtual HostType DefaultHost() { return HostFalse; }
|
|
|
|
virtual void Process ();
|
2006-09-06 20:00:41 +00:00
|
|
|
std::string TypeSpecificLinkerFlags() { return "-nostartfiles -nostdlib"; }
|
2005-05-15 22:07:07 +00:00
|
|
|
protected:
|
2005-11-22 14:23:17 +00:00
|
|
|
virtual void GetModuleSpecificCompilationUnits ( std::vector<CompilationUnit*>& compilationUnits );
|
2005-05-06 10:38:30 +00:00
|
|
|
private:
|
|
|
|
void GenerateTestModuleTarget ();
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
class MingwRpcServerModuleHandler : public MingwModuleHandler
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
MingwRpcServerModuleHandler ( const Module& module );
|
|
|
|
virtual HostType DefaultHost() { return HostFalse; }
|
|
|
|
virtual void Process ();
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
class MingwRpcClientModuleHandler : public MingwModuleHandler
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
MingwRpcClientModuleHandler ( const Module& module );
|
|
|
|
virtual HostType DefaultHost() { return HostFalse; }
|
|
|
|
virtual void Process ();
|
|
|
|
};
|
|
|
|
|
2005-07-27 19:10:57 +00:00
|
|
|
class MingwAliasModuleHandler : public MingwModuleHandler
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
MingwAliasModuleHandler ( const Module& module );
|
|
|
|
virtual HostType DefaultHost() { return HostFalse; }
|
|
|
|
virtual void Process ();
|
|
|
|
};
|
|
|
|
|
2006-06-18 19:39:13 +00:00
|
|
|
class MingwIdlHeaderModuleHandler : public MingwModuleHandler
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
MingwIdlHeaderModuleHandler ( const Module& module );
|
|
|
|
virtual HostType DefaultHost() { return HostFalse; }
|
|
|
|
virtual void Process ();
|
|
|
|
};
|
|
|
|
|
2007-07-03 19:10:33 +00:00
|
|
|
class MingwEmbeddedTypeLibModuleHandler : public MingwModuleHandler
|
2007-07-03 15:27:43 +00:00
|
|
|
{
|
|
|
|
public:
|
2007-07-03 19:10:33 +00:00
|
|
|
MingwEmbeddedTypeLibModuleHandler ( const Module& module );
|
2007-07-03 15:27:43 +00:00
|
|
|
virtual HostType DefaultHost() { return HostFalse; }
|
|
|
|
virtual void Process ();
|
|
|
|
};
|
|
|
|
|
2007-09-03 01:57:36 +00:00
|
|
|
class MingwElfExecutableModuleHandler : public MingwModuleHandler
|
|
|
|
{
|
|
|
|
public:
|
2007-09-03 04:12:48 +00:00
|
|
|
MingwElfExecutableModuleHandler ( const Module& module );
|
2007-09-03 01:57:36 +00:00
|
|
|
virtual HostType DefaultHost() { return HostFalse; }
|
|
|
|
virtual void Process ();
|
|
|
|
};
|
|
|
|
|
2005-05-06 10:38:30 +00:00
|
|
|
#endif /* MINGW_MODULEHANDLER_H */
|