]> git.tdb.fi Git - builder.git/blobdiff - source/gnulinker.cpp
Make tools capable of reporting a system-wide path used to locate input files
[builder.git] / source / gnulinker.cpp
index ad9de775f3acecf3534cf61b37b6b630fc2574ab..ee4f02dd2fd520bd4e05402b596dbcd718601eae 100644 (file)
@@ -22,6 +22,19 @@ GnuLinker::GnuLinker(Builder &b):
 {
        input_suffixes.push_back(".o");
        input_suffixes.push_back(".a");
+
+       const Architecture &arch = builder.get_current_arch();
+       if(arch.is_native())
+       {
+               system_path.push_back("/lib");
+               system_path.push_back("/usr/lib");
+               if(arch.match_name("pc-32-linux"))
+                       system_path.push_back("/usr/lib/i386-linux-gnu");
+               else if(arch.match_name("pc-64-linux"))
+                       system_path.push_back("/usr/lib/x86_64-linux-gnu");
+       }
+       else
+               system_path.push_back("/usr/"+arch.get_cross_prefix()+"/lib");
 }
 
 Target *GnuLinker::create_target(const list<Target *> &sources, const std::string &arg) const
@@ -58,7 +71,7 @@ Task *GnuLinker::run(const Target &target) const
                if(ObjectFile *obj = dynamic_cast<ObjectFile *>(*i))
                {
                        const Tool *tool = obj->get_tool();
-                       if(dynamic_cast<const GnuCxxCompiler *>(tool))
+                       if(tool->get_tag()=="CXX")
                                command = "g++";
                }