X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fgnulinker.h;h=713b978064747ab570b15f9cbc764ddaa149b014;hb=1ed833343bc83b83c5f61cbfd74423bbba677a04;hp=626894433505a10f2f959ad4b2544694a63d0ed6;hpb=338eefb513953ae55e8e3614c009c242ba8ad74e;p=builder.git diff --git a/source/gnulinker.h b/source/gnulinker.h index 6268944..713b978 100644 --- a/source/gnulinker.h +++ b/source/gnulinker.h @@ -3,13 +3,45 @@ #include "tool.h" +class Binary; + +/** +The GNU linker. Turns ObjectFiles into Executables and SharedLibraries. To +create a shared library, specify "shared" as the second argument to +create_target. + +Uses either gcc or g++ depending on what was used to compile the object files. +*/ class GnuLinker: public Tool { +private: + class Linker: public SubTool + { + private: + std::string compiler_tag; + + public: + Linker(GnuLinker &, const std::string &); + + std::string create_build_signature(const BuildInfo &) const override; + private: + void do_prepare() override; + + public: + static Task *_run(const Binary &); + }; + + Linker *default_linker = 0; + Linker *cxx_linker = 0; + public: - GnuLinker(Builder &); + GnuLinker(Builder &, const Architecture &); + ~GnuLinker(); - virtual Target *create_target(const std::list &, const std::string &) const; - virtual Task *run(const Target &) const; + Target *create_target(const std::vector &, const std::string &) override; + Target *create_install(Target &) const override; +protected: + void do_prepare() override; }; #endif