From 098507f58825446484c7ae0ef96eadafa32499c8 Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Thu, 20 Jan 2011 08:26:24 +0000 Subject: [PATCH] Deprecate the modular keyword for programs and host keyword for modules --- source/component.cpp | 34 +++++----------------------------- source/component.h | 3 --- 2 files changed, 5 insertions(+), 32 deletions(-) diff --git a/source/component.cpp b/source/component.cpp index 04c9d17..e48e4f5 100644 --- a/source/component.cpp +++ b/source/component.cpp @@ -35,8 +35,6 @@ Component::Component(SourcePackage &p, Type t, const string &n): type(t), name(n), install(false), - module_host(0), - modular(false), deflt(true) { } @@ -101,18 +99,6 @@ void Component::create_build_info() build_info.cflags.push_back("-fPIC"); } - if(modular) - { - build_info.ldflags.push_back("-rdynamic"); - build_info.libs.push_back("dl"); - } - else if(module_host) - { - const StringList &host_src = module_host->get_sources(); - for(StringList::const_iterator i=host_src.begin(); i!=host_src.end(); ++i) - build_info.incpath.push_back(*i); - } - build_info.unique(); } @@ -309,24 +295,14 @@ void Component::Loader::require(const string &n) void Component::Loader::modular() { - if(comp.type!=PROGRAM) - throw Exception("Only programs can be modular"); - comp.modular = true; + IO::print("%s: Note: modular is deprecated\n", get_source()); + comp.build_info.ldflags.push_back("-rdynamic"); + comp.build_info.libs.push_back("dl"); } -void Component::Loader::host(const string &n) +void Component::Loader::host(const string &) { - const ComponentList &comps = comp.pkg.get_components(); - for(ComponentList::const_iterator i=comps.begin(); i!=comps.end(); ++i) - if(i->get_name()==n) - { - if(i->get_type()!=PROGRAM || !i->is_modular()) - throw Exception("Module host must be a modular program"); - comp.module_host = &*i; - return; - } - - throw KeyError("Unknown component", n); + IO::print("%s: Note: host is deprecated\n", get_source()); } void Component::Loader::install_headers(const string &p) diff --git a/source/component.h b/source/component.h index d83cc6e..0b84d00 100644 --- a/source/component.h +++ b/source/component.h @@ -62,8 +62,6 @@ protected: std::string name; StringList sources; bool install; - const Component *module_host; - bool modular; BuildInfo build_info; PackageList requires; bool deflt; @@ -76,7 +74,6 @@ public: const StringList &get_sources() const { return sources; } const BuildInfo &get_build_info() const { return build_info; } bool get_install() const { return install; } - bool is_modular() const { return modular; } const PackageList &get_requires() const { return requires; } bool is_default() const { return deflt; } -- 2.43.0