aboutsummaryrefslogtreecommitdiff
path: root/build2/bin/guess
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2016-03-14 13:30:47 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2016-03-14 13:30:47 +0200
commitbbff2b69459a370afd6c74b6b0d3bb080ff22b89 (patch)
treee0528ae3ffd46bdaa0b76063edb918bf1dc93de6 /build2/bin/guess
parent10dfd69f4a714f8df2ea98e8cd2ff9359a63016a (diff)
Add support for guessing ar/ranlib signatures
Diffstat (limited to 'build2/bin/guess')
-rw-r--r--build2/bin/guess41
1 files changed, 41 insertions, 0 deletions
diff --git a/build2/bin/guess b/build2/bin/guess
new file mode 100644
index 0000000..005235d
--- /dev/null
+++ b/build2/bin/guess
@@ -0,0 +1,41 @@
+// file : build2/bin/guess -*- C++ -*-
+// copyright : Copyright (c) 2014-2016 Code Synthesis Ltd
+// license : MIT; see accompanying LICENSE file
+
+#ifndef BUILD2_BIN_GUESS
+#define BUILD2_BIN_GUESS
+
+#include <build2/types>
+#include <build2/utility>
+
+namespace build2
+{
+ namespace bin
+ {
+ // ar/ranlib information.
+ //
+ // The signature is normally the --version/-V line.
+ //
+ // The checksum is used to detect ar/ranlib changes. It is calculated in
+ // a toolchain-specific manner (usually the output of --version/-V) and
+ // is not bulletproof.
+ //
+ struct bin_info
+ {
+ string ar_signature;
+ string ar_checksum;
+
+ string ranlib_signature;
+ string ranlib_checksum;
+ };
+
+ // The ranlib path can be empty, in which case no ranlib guessing will be
+ // attemplated and the returned ranlib_* members will be left empty as
+ // well.
+ //
+ bin_info
+ guess (const path& ar, const path& ranlib);
+ }
+}
+
+#endif // BUILD2_BIN_GUESS