]> 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 3693e2b0cc08386c6d9cb3bceecee05aa1d72455..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