#define MS_VS_DEF_VERSION "7.10"
+class XmlNode;
class Directory;
class Project;
class IfableData;
class LinkerScript;
class Property;
class TestSupportCode;
-class WineResource;
class AutomaticDependency;
class Bootstrap;
class CDFile;
class AutoRegister;
class SourceFileTest;
-
+class Metadata;
typedef std::map<std::string,Directory*> directory_map;
+class XmlNode
+{
+protected:
+ const Project& project;
+ const XMLElement& node;
+
+ XmlNode ( const Project& project_,
+ const XMLElement& node_ );
+ virtual ~XmlNode();
+
+public:
+ virtual void ProcessXML();
+};
+
+enum DirectoryLocation
+{
+ SourceDirectory,
+ IntermediateDirectory,
+ OutputDirectory,
+ InstallDirectory,
+ TemporaryDirectory,
+};
+
class Directory
{
public:
std::string name;
directory_map subdirs;
Directory ( const std::string& name );
+ ~Directory();
void Add ( const char* subdir );
- void GenerateTree ( const std::string& parent,
+ void GenerateTree ( DirectoryLocation root,
bool verbose );
- std::string EscapeSpaces ( std::string path );
void CreateRule ( FILE* f,
const std::string& parent );
private:
bool mkdir_p ( const char* path );
- std::string ReplaceVariable ( std::string name,
- std::string value,
- std::string path );
- std::string GetEnvironmentVariable ( const std::string& name );
- void ResolveVariablesInPath ( char* buf,
- std::string path );
- bool CreateDirectory ( std::string path );
+ bool CreateDirectory ( const std::string& path );
+ std::string EscapeSpaces ( const std::string& path );
+ void GenerateTree ( const std::string& parent,
+ bool verbose );
};
{
public:
static std::string GetVariable ( const std::string& name );
+ static std::string GetArch ();
static std::string GetIntermediatePath ();
static std::string GetOutputPath ();
static std::string GetCdOutputPath ();
{
public:
static void WriteIfChanged ( char* outbuf,
- std::string filename );
+ const std::string& filename,
+ bool ignoreError = false );
};
std::vector<Module*> modules;
std::vector<CompilerFlag*> compilerFlags;
std::vector<If*> ifs;
+ int asmFiles; // number of .asm files in compilationUnits
+ IfableData();
~IfableData();
void ProcessXML();
void ExtractModules( std::vector<Module*> &modules );
IfableData non_if_data;
Project ( const Configuration& configuration,
- const std::string& filename );
+ const std::string& filename,
+ const std::map<std::string, std::string>* properties = NULL );
~Project ();
void SetBackend ( Backend* backend ) { _backend = backend; }
Backend& GetBackend() { return *_backend; }
const std::string& GetProjectFilename () const;
std::string ResolveProperties ( const std::string& s ) const;
private:
- std::string ResolveNextProperty ( std::string& s ) const;
+ std::string ResolveNextProperty ( const std::string& s ) const;
const Property* LookupProperty ( const std::string& name ) const;
void SetConfigurationOption ( char* s,
std::string name,
- std::string* alternativeName );
+ std::string alternativeName );
void SetConfigurationOption ( char* s,
std::string name );
void ReadXml ();
Alias = 19,
BootProgram = 20,
Win32SCR = 21,
- ExportDriver = 22,
IdlHeader = 23,
IsoRegTest = 24,
LiveIsoRegTest = 25,
- TypeLib = 26
+ EmbeddedTypeLib = 26,
+ ElfExecutable = 27,
+ RpcProxy,
+ HostStaticLibrary,
+ TypeDontCare,
+ Cabinet,
+ KeyboardLayout
};
enum HostType
{
HostFalse,
HostDefault,
- HostTrue
+ HostTrue,
+ HostDontCare,
+};
+
+enum CompilerType
+{
+ CompilerTypeDontCare,
+ CompilerTypeCC,
+ CompilerTypeCPP,
+};
+
+class FileLocation
+{
+public:
+ DirectoryLocation directory;
+ std::string relative_path;
+ std::string name;
+
+ FileLocation ( const DirectoryLocation directory,
+ const std::string& relative_path,
+ const std::string& name,
+ const XMLElement *node = NULL );
+
+ FileLocation ( const FileLocation& other );
};
class Module
std::string extension;
std::string baseaddress;
std::string payload;
- std::string path;
+ std::string buildtype;
ModuleType type;
ImportLibrary* importLibrary;
+ Metadata* metadata;
bool mangledSymbols;
bool underscoreSymbols;
bool isUnicode;
bool isDefaultEntryPoint;
Bootstrap* bootstrap;
- AutoRegister* autoRegister;
+ AutoRegister* autoRegister; // <autoregister> node
IfableData non_if_data;
std::vector<Invoke*> invocations;
std::vector<Dependency*> dependencies;
bool cplusplus;
std::string prefix;
HostType host;
- std::string installBase;
- std::string installName;
std::string aliasedModuleName;
- bool useWRC;
bool allowWarnings;
bool enabled;
- bool useHostStdlib;
- bool isStartupLib;
+ bool isStartupLib;
+ FileLocation *output; // "path/foo.exe"
+ FileLocation *dependency; // "path/foo.exe" or "path/libfoo.a"
+ FileLocation *install;
+ std::string description;
+ std::string lcid;
+ std::string layoutId;
+ std::string layoutNameResId;
Module ( const Project& project,
const XMLElement& moduleNode,
const XMLAttribute& attribute );
bool HasImportLibrary () const;
bool IsDLL () const;
- bool GenerateInOutputTree () const;
- std::string GetTargetName () const; // "foo.exe"
- std::string GetDependencyPath () const; // "path/foo.exe" or "path/libfoo.a"
- std::string GetBasePath () const; // "path"
- std::string GetPath () const; // "path/foo.exe"
std::string GetPathWithPrefix ( const std::string& prefix ) const; // "path/prefixfoo.exe"
std::string GetPathToBaseDir() const; // "../" offset to rootdirectory
std::string GetEntryPoint(bool leadingUnderscore) const;
bool HasFileWithExtension ( const IfableData&, const std::string& extension ) const;
void InvokeModule () const;
void ProcessXML ();
- void GetSourceFilenames ( string_list& list,
- bool includeGeneratedFiles ) const;
private:
+ void SetImportLibrary ( ImportLibrary* importLibrary );
+ DirectoryLocation GetTargetDirectoryTree () const;
std::string GetDefaultModuleExtension () const;
std::string GetDefaultModuleEntrypoint () const;
std::string GetDefaultModuleBaseaddress () const;
std::string entrypoint;
void ProcessXMLSubElement ( const XMLElement& e,
- const std::string& path,
+ DirectoryLocation directory,
+ const std::string& relative_path,
ParseContext& parseContext );
};
class Include
{
public:
- const Project& project;
- const Module* module;
- const XMLElement* node;
- const Module* baseModule;
- std::string directory;
- std::string basePath;
- std::string root;
+ FileLocation *directory;
Include ( const Project& project,
const XMLElement* includeNode );
Include ( const Project& project,
- const Module* module,
- const XMLElement* includeNode );
+ const XMLElement* includeNode,
+ const Module* module );
Include ( const Project& project,
- std::string directory,
- std::string basePath );
+ DirectoryLocation directory,
+ const std::string& relative_path );
~Include ();
- void ProcessXML();
+ void ProcessXML ();
private:
+ const Project& project;
+ const XMLElement* node;
+ const Module* module;
+ DirectoryLocation GetDefaultDirectoryTree ( const Module* module ) const;
};
public:
const Project& project;
const Module* module;
- const XMLElement* node;
+ const XMLElement* node;
std::string name;
std::string value;
- std::string backend;
+ std::string backend;
+ bool overridable;
Define ( const Project& project,
const XMLElement& defineNode );
const XMLElement& defineNode );
Define ( const Project& project,
const Module* module,
- const std::string name_,
- const std::string backend_ = "" );
+ const std::string& name_,
+ const std::string& backend_ = "" );
~Define();
void ProcessXML();
private:
class File
{
public:
- std::string name;
+ FileLocation file;
bool first;
std::string switches;
bool isPreCompiledHeader;
- File ( const std::string& _name,
+ File ( DirectoryLocation directory,
+ const std::string& relative_path,
+ const std::string& name,
bool _first,
- std::string _switches,
+ const std::string& _switches,
bool _isPreCompiledHeader );
void ProcessXML();
+ std::string GetFullPath () const;
};
void ProcessXML();
};
-
-class ImportLibrary
+class Metadata
{
public:
const XMLElement& node;
const Module& module;
- std::string basename;
- std::string definition;
+ std::string name;
+ std::string description;
+ std::string version;
+ std::string copyright;
+ std::string url;
+ std::string date;
+ std::string owner;
+
+ Metadata ( const XMLElement& _node,
+ const Module& _module );
+
+ void ProcessXML();
+};
+
+class ImportLibrary : public XmlNode
+{
+public:
+ const Module& module;
std::string dllname;
+ FileLocation *source;
- ImportLibrary ( const XMLElement& _node,
+ ImportLibrary ( const Project& project,
+ const XMLElement& node,
const Module& module );
-
- void ProcessXML ();
+ ~ImportLibrary ();
};
const Module* module;
const XMLElement& node;
std::string flag;
+ CompilerType compiler;
CompilerFlag ( const Project& project,
const XMLElement& compilerFlagNode );
class LinkerScript
{
public:
- const Project& project;
- const Module* module;
const XMLElement& node;
- const Module* baseModule;
- std::string directory;
- std::string basePath;
+ const Module& module;
+ const FileLocation *file;
- LinkerScript ( const Project& project,
- const Module* module,
- const XMLElement& node );
+ LinkerScript ( const XMLElement& node,
+ const Module& module,
+ const FileLocation *file );
~LinkerScript ();
void ProcessXML();
};
class Property
{
public:
- const XMLElement& node;
const Project& project;
const Module* module;
std::string name, value;
+ bool isInternal;
Property ( const XMLElement& node_,
const Project& project_,
const Module* module_ );
+ Property ( const Project& project_,
+ const Module* module_,
+ const std::string& name_,
+ const std::string& value_ );
+
void ProcessXML();
};
void WriteHooksFile ( Module& module );
std::string GetStubsFilename ( Module& module );
char* WriteStubbedSymbolToStubsFile ( char* buffer,
- const StubbedComponent& component,
+ const StubbedComponent& component,
const StubbedSymbol& symbol,
int stubIndex );
char* WriteStubbedComponentToStubsFile ( char* buffer,
- const StubbedComponent& component,
+ const StubbedComponent& component,
int* stubIndex );
void WriteStubsFile ( Module& module );
std::string GetStartupFilename ( Module& module );
std::string GetTestDispatcherName ( std::string filename );
bool IsTestFile ( std::string& filename ) const;
void GetSourceFilenames ( string_list& list,
- Module& module ) const;
+ Module& module ) const;
char* WriteTestDispatcherPrototypesToStartupFile ( char* buffer,
- Module& module );
+ Module& module );
char* WriteRegisterTestsFunctionToStartupFile ( char* buffer,
Module& module );
void WriteStartupFile ( Module& module );
};
-class WineResource
-{
-public:
- const Project& project;
- std::string bin2res;
-
- WineResource ( const Project& project,
- std::string bin2res );
- ~WineResource ();
- void UnpackResources ( bool verbose );
-private:
- bool IsSpecFile ( const File& file );
- bool IsWineModule ( const Module& module );
- bool IsResourceFile ( const File& file );
- std::string GetResourceFilename ( const Module& module );
- void UnpackResourcesInModule ( Module& module,
- bool verbose );
-};
-
-
class SourceFile
{
public:
SourceFile ( AutomaticDependency* automaticDependency,
const Module& module,
- const std::string& filename,
- SourceFile* parent,
- bool isNonAutomaticDependency );
- SourceFile* ParseFile ( const std::string& normalizedFilename );
+ const File& file,
+ SourceFile* parent );
void Parse ();
- std::string Location () const;
- std::vector<SourceFile*> files;
+ std::vector<SourceFile*> files; /* List of files included in this file */
+ const File& file;
AutomaticDependency* automaticDependency;
const Module& module;
- std::string filename;
- std::string filenamePart;
- std::string directoryPart;
std::vector<SourceFile*> parents; /* List of files, this file is included from */
- bool isNonAutomaticDependency;
- std::string cachedDependencies;
time_t lastWriteTime;
time_t youngestLastWriteTime; /* Youngest last write time of this file and all children */
SourceFile* youngestFile;
private:
- void GetDirectoryAndFilenameParts ();
void Close ();
void Open ();
void SkipWhitespace ();
bool ReadInclude ( std::string& filename,
bool& searchCurrentDirectory,
bool& includeNext );
- bool IsIncludedFrom ( const std::string& normalizedFilename );
- SourceFile* GetParentSourceFile ();
- bool CanProcessFile ( const std::string& extension );
+ bool IsIncludedFrom ( const File& file );
+ SourceFile* ParseFile(const File& file);
+ bool CanProcessFile ( const File& file );
bool IsParentOf ( const SourceFile* parent,
const SourceFile* child );
std::string buf;
AutomaticDependency ( const Project& project );
~AutomaticDependency ();
- std::string GetFilename ( const std::string& filename );
- bool LocateIncludedFile ( const std::string& directory,
- const std::string& includedFilename,
- std::string& resolvedFilename );
+ bool LocateIncludedFile ( const FileLocation& directory,
+ const std::string& includedFilename );
bool LocateIncludedFile ( SourceFile* sourceFile,
const Module& module,
const std::string& includedFilename,
bool searchCurrentDirectory,
bool includeNext,
- std::string& resolvedFilename );
+ File& resolvedFile );
SourceFile* RetrieveFromCacheOrParse ( const Module& module,
- const std::string& filename,
+ const File& file,
SourceFile* parentSourceFile );
- SourceFile* RetrieveFromCache ( const std::string& filename );
+ SourceFile* RetrieveFromCache ( const File& file );
void CheckAutomaticDependencies ( bool verbose );
void CheckAutomaticDependenciesForModule ( Module& module,
bool verbose );
private:
void GetModulesToCheck ( Module& module, std::vector<const Module*>& modules );
void CheckAutomaticDependencies ( const Module& module,
- bool verbose );
+ bool verbose );
void CheckAutomaticDependenciesForFile ( SourceFile* sourceFile );
void GetIncludeDirectories ( std::vector<Include*>& includes,
- const Module& module,
- Include& currentDirectory,
- bool searchCurrentDirectory );
+ const Module& module );
void GetModuleFiles ( const Module& module,
- std::vector<File*>& files ) const;
+ std::vector<File*>& files ) const;
void ParseFiles ();
void ParseFiles ( const Module& module );
void ParseFile ( const Module& module,
};
-class CDFile
+class CDFile : public XmlNode
{
public:
- const Project& project;
- const XMLElement& node;
- std::string name;
- std::string base;
- std::string nameoncd;
- std::string path;
+ FileLocation *source;
+ FileLocation *target;
CDFile ( const Project& project,
const XMLElement& bootstrapNode,
const std::string& path );
~CDFile ();
- void ProcessXML();
- std::string GetPath () const;
private:
static std::string ReplaceVariable ( const std::string& name,
const std::string& value,
};
-class InstallFile
+class InstallFile : public XmlNode
{
public:
- const Project& project;
- const XMLElement& node;
- std::string name;
- std::string base;
- std::string newname;
- std::string path;
+ FileLocation *source;
+ FileLocation *target;
InstallFile ( const Project& project,
const XMLElement& bootstrapNode,
const std::string& path );
~InstallFile ();
- void ProcessXML ();
- std::string GetPath () const;
};
public:
const XMLElement& node;
const Module& module;
- File file;
+ const FileLocation *file;
PchFile (
const XMLElement& node,
const Module& module,
- const File file );
+ const FileLocation *file );
+ ~PchFile();
void ProcessXML();
};
class CompilationUnit
{
public:
- const Project* project;
- const Module* module;
- const XMLElement* node;
std::string name;
- std::vector<File*> files;
- CompilationUnit ( File* file );
+ CompilationUnit ( const File* file );
CompilationUnit ( const Project* project,
const Module* module,
const XMLElement* node );
bool IsGeneratedFile () const;
bool HasFileWithExtension ( const std::string& extension ) const;
bool IsFirstFile () const;
- FileLocation* GetFilename ( Directory* intermediateDirectory ) const;
- std::string GetSwitches () const;
+ const FileLocation& GetFilename () const;
+ const std::string& GetSwitches () const;
+ void AddFile ( const File * file );
+ const std::vector<const File*> GetFiles () const;
+private:
+ const Project* project;
+ const Module* module;
+ const XMLElement* node;
+ std::vector<const File*> files;
+ FileLocation *default_name;
};
};
-class FileLocation
-{
-public:
- Directory* directory;
- std::string filename;
- FileLocation ( Directory* directory,
- std::string filename );
-};
-
-
enum AutoRegisterType
{
DllRegisterServer,
Both
};
-class AutoRegister
+class AutoRegister : public XmlNode
{
public:
- const Project& project;
const Module* module;
- const XMLElement& node;
std::string infSection;
AutoRegisterType type;
AutoRegister ( const Project& project_,
const Module* module_,
const XMLElement& node_ );
- ~AutoRegister ();
- void ProcessXML();
private:
bool IsSupportedModuleType ( ModuleType type );
- AutoRegisterType GetAutoRegisterType( std::string type );
+ AutoRegisterType GetAutoRegisterType( const std::string& type );
void Initialize ();
};
extern std::string
GetSubPath (
+ const Project& project,
const std::string& location,
const std::string& path,
const std::string& att_value );
extern std::string
-GetExtension ( const std::string& filename );
-
-extern std::string
-GetDirectory ( const std::string& filename );
-
-extern std::string
-GetFilename ( const std::string& filename );
+GetExtension ( const FileLocation& file );
extern std::string
NormalizeFilename ( const std::string& filename );