aboutsummaryrefslogtreecommitdiff
path: root/libbuild2/bin/guess.hxx
diff options
context:
space:
mode:
Diffstat (limited to 'libbuild2/bin/guess.hxx')
-rw-r--r--libbuild2/bin/guess.hxx71
1 files changed, 63 insertions, 8 deletions
diff --git a/libbuild2/bin/guess.hxx b/libbuild2/bin/guess.hxx
index 27bb5ed..7dc7b33 100644
--- a/libbuild2/bin/guess.hxx
+++ b/libbuild2/bin/guess.hxx
@@ -16,7 +16,7 @@ namespace build2
// Currently recognized ar/ranlib and their ids:
//
// gnu GNU binutils
- // llvm LLVM ar
+ // llvm LLVM llvm-ar
// bsd FreeBSD (and maybe other BSDs)
// msvc Microsoft's lib.exe
// msvc-llvm LLVM llvm-lib.exe
@@ -28,6 +28,12 @@ namespace build2
// a toolchain-specific manner (usually the output of --version/-V) and
// is not bulletproof.
//
+ // The environment is an optional list of environment variables that
+ // affect ar/ranlib result.
+ //
+ // Watch out for the environment not to affect any of the extracted
+ // information since we cache it.
+ //
struct ar_info
{
process_path ar_path;
@@ -35,18 +41,20 @@ namespace build2
string ar_signature;
string ar_checksum;
semantic_version ar_version;
+ const char* const* ar_environment;
process_path ranlib_path;
string ranlib_id;
string ranlib_signature;
string ranlib_checksum;
+ const char* const* ranlib_environment;
};
// The ranlib path can be NULL, in which case no ranlib guessing will be
// attemplated and the returned ranlib_* members will be left empty.
//
- ar_info
- guess_ar (const path& ar, const path* ranlib, const char* paths);
+ const ar_info&
+ guess_ar (context&, const path& ar, const path* ranlib, const char* paths);
// ld information.
//
@@ -72,6 +80,12 @@ namespace build2
// toolchain-specific manner (usually the output of --version/-version/-v)
// and is not bulletproof.
//
+ // The environment is an optional list of environment variables that
+ // affect the linker result.
+ //
+ // Watch out for the environment not to affect any of the extracted
+ // information since we cache it.
+ //
// Note that for now the version is extracted only for some linkers. Once
// it's done for all of them, we should drop optional.
//
@@ -81,12 +95,12 @@ namespace build2
string id;
string signature;
string checksum;
-
optional<semantic_version> version;
+ const char* const* environment;
};
- ld_info
- guess_ld (const path& ld, const char* paths);
+ const ld_info&
+ guess_ld (context&, const path& ld, const char* paths);
// rc information.
//
@@ -102,16 +116,57 @@ namespace build2
// toolchain-specific manner (usually the output of --version) and is not
// bulletproof.
//
+ // The environment is an optional list of environment variables that
+ // affect the resource compiler result.
+ //
+ // Watch out for the environment not to affect any of the extracted
+ // information since we cache it.
+ //
struct rc_info
{
process_path path;
string id;
string signature;
string checksum;
+ const char* const* environment;
+ };
+
+ const rc_info&
+ guess_rc (context&, const path& rc, const char* paths);
+
+ // nm information.
+ //
+ // Currently recognized nm and nm-like utilities and their ids:
+ //
+ // gnu GNU binutils nm
+ // msvc Microsoft's dumpbin.exe
+ // llvm LLVM llvm-nm
+ // elftoolchain ELF Toolchain (used by FreeBSD)
+ // generic Other/generic/unrecognized (including Mac OS X)
+ //
+ // The signature is normally the --version line.
+ //
+ // The checksum is used to detect nm changes. It is calculated in a
+ // toolchain-specific manner (usually the output of --version) and is not
+ // bulletproof.
+ //
+ // The environment is an optional list of environment variables that
+ // affect the resource compiler result.
+ //
+ // Watch out for the environment not to affect any of the extracted
+ // information since we cache it.
+ //
+ struct nm_info
+ {
+ process_path path;
+ string id;
+ string signature;
+ string checksum;
+ const char* const* environment;
};
- rc_info
- guess_rc (const path& rc, const char* paths);
+ const nm_info&
+ guess_nm (context&, const path& nm, const char* paths);
}
}