container: root: refactor using common utility

This commit is contained in:
2025-12-02 17:14:10 -08:00
parent d156f62fa7
commit 7ca01776fc
2 changed files with 19 additions and 13 deletions

View File

@@ -26,6 +26,8 @@
#include <iostream>
#include <string>
#include "./common/utility.hh" // The one-and-only `dfi` header required by rootlogon
//! \namespace dfi
//! \since docker-finance 1.0.0
namespace dfi
@@ -192,24 +194,28 @@ void help()
//! \since docker-finance 1.0.0
void rootlogon()
{
namespace common = dfi::common;
// Add nested directory headers
gInterpreter->AddIncludePath("/usr/include/botan-3");
common::add_include_dir("/usr/include/botan-3");
// Link default packaged libraries
gSystem->AddLinkedLibs("-lgtest"); // gtest/gmock
gSystem->AddLinkedLibs("-lbenchmark"); // gbenchmark
gSystem->AddLinkedLibs("-pthread"); // gtest/gmock/gbenchmark
// TODO(afiore): linking here appears to no longer be needed?
// Is ROOT loading all libraries on-the-fly (in default paths)?
common::add_linked_lib("/usr/lib/libgtest.so"); // gtest/gmock
common::add_linked_lib("/usr/lib/libbenchmark.so"); // gbenchmark
common::add_linked_lib("/usr/lib/libpthread.so.0"); // gtest/gmock/gbenchmark
gSystem->AddLinkedLibs("-lbotan-3"); // Botan
gSystem->AddLinkedLibs("-lcryptopp"); // Crypto++
gSystem->AddLinkedLibs("-lsodium"); // libsodium
common::add_linked_lib("/usr/lib/libbotan-3.so"); // Botan
common::add_linked_lib("/usr/lib/libcryptopp.so"); // Crypto++
common::add_linked_lib("/usr/lib/libsodium.so"); // libsodium
// Load default `dfi` public consumables
gInterpreter->ProcessLine(".L plugin/common/utility.hh");
gInterpreter->ProcessLine(".L macro/common/utility.hh");
gInterpreter->ProcessLine(".L src/hash.hh");
gInterpreter->ProcessLine(".L src/random.hh");
gInterpreter->ProcessLine(".L src/utility.hh");
common::load("plugin/common/utility.hh");
common::load("macro/common/utility.hh");
common::load("src/hash.hh");
common::load("src/random.hh");
common::load("src/utility.hh");
}
#endif // CONTAINER_SRC_ROOT_MACRO_ROOTLOGON_C_