]> git.tdb.fi Git - builder.git/commitdiff
Deprecate the modular keyword for programs and host keyword for modules
authorMikko Rasa <tdb@tdb.fi>
Thu, 20 Jan 2011 08:26:24 +0000 (08:26 +0000)
committerMikko Rasa <tdb@tdb.fi>
Thu, 20 Jan 2011 08:26:24 +0000 (08:26 +0000)
source/component.cpp
source/component.h

index 04c9d17204dd8729cc2b56993bd9697041f480d5..e48e4f518477ff285d8b2878e8739d0f6b5147ca 100644 (file)
@@ -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)
index d83cc6eeb182ea525708dd7e4fc933bc5c34e888..0b84d00cb4a5cc31308a8d57ed2362db2b928b6e 100644 (file)
@@ -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; }