]> git.tdb.fi Git - builder.git/blobdiff - source/gnuarchiver.cpp
Put constructor helper functions next to the constructors
[builder.git] / source / gnuarchiver.cpp
index 13b2054ff5f26d2ea9006b3513d17e924b28faf9..3f96cbfd9a94135d6c7c6348b3f91b53e358b3a0 100644 (file)
@@ -1,6 +1,7 @@
 #include <msp/fs/dir.h>
 #include <msp/fs/stat.h>
 #include <msp/fs/utils.h>
+#include <msp/strings/format.h>
 #include <stdexcept>
 #include "builder.h"
 #include "component.h"
 using namespace std;
 using namespace Msp;
 
-GnuArchiver::GnuArchiver(Builder &b):
-       Tool(b, "AR")
+GnuArchiver::GnuArchiver(Builder &b, const Architecture &a):
+       Tool(b, a, "AR")
 {
-       executable = builder.get_vfs().find_binary("ar");
+       string command = "ar";
+       if(architecture->is_cross())
+               command = format("%s-%s", architecture->get_cross_prefix(), command);
+       executable = builder.get_vfs().find_binary(command);
 
        input_suffixes.push_back(".o");
 }