aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Danny van Dyk <dvandyk@exherbo.org> 2007-04-27 18:59:17 +0000
committerAvatar Danny van Dyk <dvandyk@exherbo.org> 2007-04-27 18:59:17 +0000
commit547124a6b12ebd53f47e7b69bb86f975f7821b2d (patch)
tree77533fe7208ab12da81a20e6f3ea50c07d4fcb60
parent645c186a533497ad470f3725aaa88d1de5d2cd27 (diff)
downloadpaludis-547124a6b12ebd53f47e7b69bb86f975f7821b2d.tar.gz
paludis-547124a6b12ebd53f47e7b69bb86f975f7821b2d.tar.xz
Add support to install libc-headers when --headers option is specified.
-rw-r--r--src/clients/contrarius/default_config.txt4
-rw-r--r--src/clients/contrarius/stage.cc24
-rw-r--r--src/clients/contrarius/stage.hh24
3 files changed, 50 insertions, 2 deletions
diff --git a/src/clients/contrarius/default_config.txt b/src/clients/contrarius/default_config.txt
index bc52538..5b395ca 100644
--- a/src/clients/contrarius/default_config.txt
+++ b/src/clients/contrarius/default_config.txt
@@ -1,11 +1,11 @@
*-*-linux-* headers linux-headers
*-*-freebsd*-* headers freebsd-lib
-*-*-mingw*-* headers mingw-runtime
+*-*-mingw*-* headers w32api
*-*-*-elf headers
*-*-*-elf libc newlib
*-*-*-gnu libc glibc
*-*-*-freebsd*-* libc freebsd-lib
-*-*-*-mingw* libc w32api
+*-*-*-mingw* libc mingw-runtime
*-*-*-uclibc libc uclibc
*-*-*-* binutils binutils
*-*-*-* gcc gcc
diff --git a/src/clients/contrarius/stage.cc b/src/clients/contrarius/stage.cc
index 79285f1..4619ccb 100644
--- a/src/clients/contrarius/stage.cc
+++ b/src/clients/contrarius/stage.cc
@@ -137,6 +137,30 @@ MinimalStage::is_rebuild() const
}
int
+LibCHeadersStage::build(const StageOptions &) const
+{
+ Context context("When building LIbCHeaderStage:");
+
+ std::tr1::shared_ptr<PackageDepSpec> libc(new PackageDepSpec(TargetConfig::get_instance()->libc(),
+ pds_pm_unspecific));
+
+ _env->clear_adaptions();
+
+ _env->adapt_use(libc, UseFlagName("crosscompile_opts_headers-only"), use_enabled);
+
+ return 0 == do_install(_env, stringify(*libc));
+}
+
+bool
+LibCHeadersStage::is_rebuild() const
+{
+ return (! std::tr1::shared_ptr<const PackageDatabaseEntryCollection>(_env->package_database()->query(
+ query::Matches(PackageDepSpec(TargetConfig::get_instance()->libc(), pds_pm_unspecific)) &
+ query::InstalledAtRoot(_env->root()),
+ qo_whatever))->empty());
+}
+
+int
LibCStage::build(const StageOptions &) const
{
Context context("When building LibCStage:");
diff --git a/src/clients/contrarius/stage.hh b/src/clients/contrarius/stage.hh
index 1e4a7bb..75df029 100644
--- a/src/clients/contrarius/stage.hh
+++ b/src/clients/contrarius/stage.hh
@@ -142,6 +142,30 @@ namespace paludis
}
};
+ class LibCHeadersStage :
+ public ContrariusStage
+ {
+ public:
+ LibCHeadersStage(std::tr1::shared_ptr<AdaptedEnvironment> e) :
+ ContrariusStage(e)
+ {
+ }
+
+ virtual int build(const StageOptions &) const;
+
+ virtual std::string description() const
+ {
+ return "Building the C standard library headers as part of the cross toolchain";
+ };
+
+ virtual bool is_rebuild() const;
+
+ virtual std::string short_name() const
+ {
+ return "cross-libc-headers stage";
+ }
+ };
+
class LibCStage :
public ContrariusStage
{