diff options
Diffstat (limited to 'libadhocutil/definedDirs.h')
-rw-r--r-- | libadhocutil/definedDirs.h | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/libadhocutil/definedDirs.h b/libadhocutil/definedDirs.h index b24a1c9..9c1cc84 100644 --- a/libadhocutil/definedDirs.h +++ b/libadhocutil/definedDirs.h @@ -10,9 +10,21 @@ #define XSTR(s) STR(s) #define STR(s) #s -const auto selfExe = boost::filesystem::canonical("/proc/self/exe"); -const auto binDir = selfExe.parent_path(); +namespace AdHoc { + static boost::filesystem::path getBuildVariant(boost::filesystem::path binDir) + { + boost::filesystem::path p; + while (strncmp(p.c_str(), "gcc-", 4)) { + p = binDir.leaf() / p; + binDir = binDir.parent_path(); + } + return p; + } +} +const boost::filesystem::path selfExe = boost::filesystem::canonical("/proc/self/exe"); +const boost::filesystem::path binDir = selfExe.parent_path(); const boost::filesystem::path rootDir(XSTR(ROOT)); +const boost::filesystem::path buildVariant = AdHoc::getBuildVariant(binDir); #endif |