From c11bbf8455b065c22c7a2147b33fb6a9c8c43e11 Mon Sep 17 00:00:00 2001 From: Bent Bisballe Nyeng Date: Mon, 16 Jan 2023 18:17:51 +0100 Subject: Minor changes: Add help text to configure --help, use append(..) and strip ctor binary. --- src/configure.cc | 9 ++++++--- src/rebuild.cc | 2 ++ src/tasks.cc | 21 ++++++--------------- 3 files changed, 14 insertions(+), 18 deletions(-) (limited to 'src') diff --git a/src/configure.cc b/src/configure.cc index 3bb2d48..a2bb8bc 100644 --- a/src/configure.cc +++ b/src/configure.cc @@ -234,6 +234,7 @@ std::ostream& operator<<(std::ostream& ostr, const ctor::asm_flag& flag) template inline constexpr bool always_false_v = false; int regenerateCache(ctor::settings& settings, + const std::string& name, const std::vector& args, const std::map& env) { @@ -388,7 +389,9 @@ int regenerateCache(ctor::settings& settings, opt.add("help", no_argument, 'h', "Print this help text.", [&]() { - std::cout << "configure usage stuff\n"; + std::cout << "Configure how to build with " << name << "\n"; + std::cout << "Usage: " << name << " configure [options]\n\n"; + std::cout << "Options:\n"; opt.help(); exit(0); return 0; @@ -646,7 +649,7 @@ int configure(const ctor::settings& global_settings, int argc, char* argv[]) env["LD"] = ld_env; } - auto ret = regenerateCache(settings, args, env); + auto ret = regenerateCache(settings, argv[0], args, env); if(ret != 0) { return ret; @@ -688,7 +691,7 @@ int reconfigure(const ctor::settings& global_settings, int argc, char* argv[]) } std::cout << "\n"; - auto ret = regenerateCache(settings, cfg.args, cfg.env); + auto ret = regenerateCache(settings, argv[0], cfg.args, cfg.env); if(ret != 0) { return ret; diff --git a/src/rebuild.cc b/src/rebuild.cc index c97452d..f0d52d9 100644 --- a/src/rebuild.cc +++ b/src/rebuild.cc @@ -159,6 +159,7 @@ bool recompileCheck(const ctor::settings& global_settings, int argc, char* argv[ ctor::build_configuration config; + config.type = ctor::target_type::executable; config.name = "ctor"; config.system = ctor::output_system::build; @@ -176,6 +177,7 @@ bool recompileCheck(const ctor::settings& global_settings, int argc, char* argv[ config.flags.ldflags.push_back({ctor::ld_opt::library_path, c.get(ctor::cfg::ctor_libdir)}); } config.flags.ldflags.push_back({ctor::ld_opt::link, "ctor"}); + config.flags.ldflags.push_back({ctor::ld_opt::strip}); config.flags.ldflags.push_back({ctor::ld_opt::threads}); ctor::settings settings{global_settings}; diff --git a/src/tasks.cc b/src/tasks.cc index 9c64fb4..22ad2d6 100644 --- a/src/tasks.cc +++ b/src/tasks.cc @@ -52,21 +52,12 @@ const std::deque& getTargets(const ctor::settings& settings, exit(1); } const auto& flags = externals.at(external); - config.flags.cflags.insert(config.flags.cflags.end(), - flags.cflags.begin(), - flags.cflags.end()); - config.flags.cxxflags.insert(config.flags.cxxflags.end(), - flags.cxxflags.begin(), - flags.cxxflags.end()); - config.flags.ldflags.insert(config.flags.ldflags.end(), - flags.ldflags.begin(), - flags.ldflags.end()); - config.flags.asmflags.insert(config.flags.asmflags.end(), - flags.asmflags.begin(), - flags.asmflags.end()); - //config.libs.insert(config.libs.end(), - // libs.begin(), - // libs.end()); + append(config.flags.cflags, flags.cflags); + append(config.flags.cxxflags, flags.cxxflags); + append(config.flags.ldflags, flags.ldflags); + append(config.flags.arflags, flags.arflags); + append(config.flags.asmflags, flags.asmflags); + //append(config.libs.insert(config.libs libs); } } -- cgit v1.2.3