about summary refs log tree commit diff
path: root/src/rustc/libc_shim
diff options
context:
space:
mode:
authorAlex Crichton <alex@alexcrichton.com>2015-11-19 15:20:12 -0800
committerAlex Crichton <alex@alexcrichton.com>2016-02-11 10:42:28 -0800
commit046e6874c47ec55e23b7a566bca51d2920562485 (patch)
tree6775c618f253d3851738f8d5572f204c0ec7db8d /src/rustc/libc_shim
parenta91ff1c9d1842918329ef7a81afd3848854d53c7 (diff)
Add a Cargo-based build system
This commit is the start of a series of commits which start to replace the
makefiles with a Cargo-based build system. The aim is not to remove the
makefiles entirely just yet but rather just replace the portions that invoke the
compiler to do the bootstrap. This commit specifically adds enough support to
perform the bootstrap (and all the cross compilation within) along with
generating documentation.

More commits will follow up in this series to actually wire up the makefiles to
call this build system, so stay tuned!
Diffstat (limited to 'src/rustc/libc_shim')
-rw-r--r--src/rustc/libc_shim/Cargo.toml20
-rw-r--r--src/rustc/libc_shim/build.rs15
2 files changed, 35 insertions, 0 deletions
diff --git a/src/rustc/libc_shim/Cargo.toml b/src/rustc/libc_shim/Cargo.toml
new file mode 100644
index 00000000000..a7860b50e08
--- /dev/null
+++ b/src/rustc/libc_shim/Cargo.toml
@@ -0,0 +1,20 @@
+# This is a shim Cargo.toml over the "real Cargo.toml" found in the libc
+# repository itself. The purpose for this is to add a build script which prints
+# out `--cfg stdbuild` to mirror the makefiles' build system.
+#
+# Note that other than that this isn't actually needed, and we should probably
+# remove this shim in favor of just working with cargo features directly with
+# libc. That should make everything nicer!
+
+[package]
+name = "libc"
+version = "0.0.0"
+authors = ["The Rust Project Developers"]
+build = "build.rs"
+
+[lib]
+name = "libc"
+path = "../../liblibc/src/lib.rs"
+
+[dependencies]
+core = { path = "../../libcore" }
diff --git a/src/rustc/libc_shim/build.rs b/src/rustc/libc_shim/build.rs
new file mode 100644
index 00000000000..bc428d69082
--- /dev/null
+++ b/src/rustc/libc_shim/build.rs
@@ -0,0 +1,15 @@
+// Copyright 2015 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+// See comments in Cargo.toml for why this exists
+
+fn main() {
+    println!("cargo:rustc-cfg=stdbuild");
+}