#endif/*WIN32*/
#endif/*_MSC_VER*/
+#include <infhost.h>
+
#include "ssprintf.h"
#include "exception.h"
-#include "XML.h"
+#include "xml.h"
+
+class Backend; // forward declaration
typedef std::vector<std::string> string_list;
#define MS_VS_DEF_VERSION "7.10"
+class Directory;
class Project;
class IfableData;
class Module;
class StubbedComponent;
class StubbedSymbol;
class CompilationUnit;
+class FileLocation;
+class AutoRegister;
class SourceFileTest;
+typedef std::map<std::string,Directory*> directory_map;
+
+class Directory
+{
+public:
+ std::string name;
+ directory_map subdirs;
+ Directory ( const std::string& name );
+ void Add ( const char* subdir );
+ void GenerateTree ( const std::string& parent,
+ 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 );
+};
+
+
class Configuration
{
public:
bool CleanAsYouGo;
bool AutomaticDependencies;
bool CheckDependenciesForModuleOnly;
+ bool CompilationUnitsEnabled;
std::string CheckDependenciesForModuleOnlyModule;
std::string VSProjectVersion;
bool MakeHandlesInstallDirectories;
{
std::string xmlfile;
XMLElement *node, *head;
+ Backend* _backend;
public:
+ const Configuration& configuration;
std::string name;
std::string makefile;
XMLIncludes xmlbuildfiles;
std::vector<InstallFile*> installfiles;
IfableData non_if_data;
- Project ( const std::string& filename );
+ Project ( const Configuration& configuration,
+ const std::string& filename );
~Project ();
+ void SetBackend ( Backend* backend ) { _backend = backend; }
+ Backend& GetBackend() { return *_backend; }
void WriteConfigurationFile ();
void ExecuteInvocations ();
+
void ProcessXML ( const std::string& path );
Module* LocateModule ( const std::string& name );
const Module* LocateModule ( const std::string& name ) const;
bool mangledSymbols;
bool isUnicode;
Bootstrap* bootstrap;
+ AutoRegister* autoRegister;
IfableData non_if_data;
std::vector<Invoke*> invocations;
std::vector<Dependency*> dependencies;
const Project* project;
const Module* module;
const XMLElement* node;
+ std::string name;
std::vector<File*> files;
CompilationUnit ( File* file );
bool IsGeneratedFile () const;
bool HasFileWithExtension ( const std::string& extension ) const;
bool IsFirstFile () const;
- std::string GetFilename () const;
+ FileLocation* GetFilename ( Directory* intermediateDirectory ) const;
std::string GetSwitches () const;
};
+class CompilationUnitSupportCode
+{
+public:
+ const Project& project;
+
+ CompilationUnitSupportCode ( const Project& project );
+ ~CompilationUnitSupportCode ();
+ void Generate ( bool verbose );
+private:
+ void GenerateForModule ( Module& module,
+ bool verbose );
+ std::string GetCompilationUnitFilename ( Module& module,
+ CompilationUnit& compilationUnit );
+ void WriteCompilationUnitFile ( Module& module,
+ CompilationUnit& compilationUnit );
+};
+
+
+class FileLocation
+{
+public:
+ Directory* directory;
+ std::string filename;
+ FileLocation ( Directory* directory,
+ std::string filename );
+};
+
+
+enum AutoRegisterType
+{
+ DllRegisterServer,
+ DllInstall,
+ Both
+};
+
+class AutoRegister
+{
+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 );
+ void Initialize ();
+};
+
+
+class SysSetupGenerator
+{
+public:
+ const Project& project;
+ SysSetupGenerator ( const Project& project );
+ ~SysSetupGenerator ();
+ void Generate ();
+private:
+ std::string GetDirectoryId ( const Module& module );
+ std::string GetFlags ( const Module& module );
+ void Generate ( HINF inf,
+ const Module& module );
+};
+
+
extern void
InitializeEnvironment ();
extern std::string
Replace ( const std::string& s, const std::string& find, const std::string& with );
+extern std::string
+ChangeSeparator ( const std::string& s,
+ const char fromSeparator,
+ const char toSeparator );
+
extern std::string
FixSeparator ( const std::string& s );
extern std::string
NormalizeFilename ( const std::string& filename );
+extern std::string
+ToLower ( std::string filename );
+
#endif /* __RBUILD_H */