From ef7ab06044c155e4728e5e30e3262de2bb40cb29 Mon Sep 17 00:00:00 2001 From: Bent Bisballe Nyeng Date: Fri, 24 Sep 2021 18:06:14 +0200 Subject: Fix re-compilation of library itself after boostrap. Add support for supplying libctor lib and include paths. --- src/rebuild.cc | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'src/rebuild.cc') diff --git a/src/rebuild.cc b/src/rebuild.cc index 353beb0..7c90fca 100644 --- a/src/rebuild.cc +++ b/src/rebuild.cc @@ -60,12 +60,24 @@ int unreg(const char* location) void recompileCheck(const Settings& settings, int argc, char* argv[], bool force, bool relaunch_allowed) { + using namespace std::string_literals; + bool dirty{force}; std::vector args; args.push_back("-s"); args.push_back("-O3"); args.push_back("-std=c++17"); + + if(hasConfiguration(cfg::ctor_includedir)) + { + args.push_back("-I"s + getConfiguration(cfg::ctor_includedir)); + } + if(hasConfiguration(cfg::ctor_libdir)) + { + args.push_back("-L"s + getConfiguration(cfg::ctor_libdir)); + } + args.push_back("-lctor"); args.push_back("-pthread"); std::filesystem::path binFile(argv[0]); @@ -113,7 +125,7 @@ void recompileCheck(const Settings& settings, int argc, char* argv[], args.push_back(location); } } - args.push_back("libctor.a"); + args.push_back("-o"); args.push_back(binFile.string()); -- cgit v1.2.3