X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fbuildinfo.h;h=fa8ae62d39606527509d7c9a8b8dd18d77db68e7;hb=22907c578cb8244c60e8ab1b3466340768491dd1;hp=e0929e7b1da9c8c9eec8bef0fd60e298697d8f55;hpb=de7ca0d3ce73bfa3f870c4257dbf71e621224876;p=builder.git diff --git a/source/buildinfo.h b/source/buildinfo.h index e0929e7..fa8ae62 100644 --- a/source/buildinfo.h +++ b/source/buildinfo.h @@ -4,7 +4,7 @@ #include #include #include -#include "misc.h" +#include /** Stores information about compiler command line parameters in a more abstract @@ -21,6 +21,13 @@ public: FORCE_DYNAMIC //< Only accept dynamic libraries }; + enum RuntimePathMode + { + NO_RPATH, //< Do not record rpath in binaries + RELATIVE, //< Record relative rpath in binaries + ABSOLUTE //< Record absolute rpath in binaries + }; + class Loader: public Msp::DataFile::ObjectLoader { public: @@ -28,8 +35,13 @@ public: private: void incpath(const std::string &); void define(const std::string &, const std::string &); + void keep_symbol(const std::string &); + void libmode_for_lib(const std::string &, LibraryMode); void libpath(const std::string &); void library(const std::string &); + void local_incpath(const std::string &); + void standard(Msp::DataFile::Symbol, const std::string &); + void sysroot(const std::string &); }; enum UpdateLevel @@ -59,21 +71,30 @@ public: public: Tracked(): value(T()), set(false) { } Tracked(T v): value(v), set(false) { } + Tracked(const Tracked &t): value(t.value), set(t.set) { } Tracked &operator=(const Tracked &v) { if(v.set) { value = v.value; set = true; } return *this; } - Tracked &operator=(T v) { value = v; set = true; return *this; } - operator T() const { return value; } + Tracked &operator=(const T &v) { value = v; set = true; return *this; } + operator const T &() const { return value; } }; typedef std::map DefineMap; typedef std::list PathList; typedef std::list WordList; + typedef std::map LibModeMap; + typedef std::map StandardMap; + Tracked sysroot; DefineMap defines; PathList incpath; + PathList local_incpath; PathList libpath; WordList libs; Tracked libmode; + Tracked rpath_mode; + LibModeMap libmodes; + WordList keep_symbols; + StandardMap standards; Tracked threads; Tracked debug; Tracked optimize; @@ -83,6 +104,11 @@ public: BuildInfo(); + /** Returns the library mode for linking a particular library. If no mode + has been specified for that library, the the global library mode is + returned. */ + LibraryMode get_libmode_for(const std::string &) const; + /** Updates the BuildInfo from another one. Lists are concatenated, with the first occurrence of each item preserved. Scalars are overwritten.