diff --git a/components/profile/Cargo.toml b/components/profile/Cargo.toml index dfb3a187e30..05900ad7dbc 100644 --- a/components/profile/Cargo.toml +++ b/components/profile/Cargo.toml @@ -10,9 +10,6 @@ path = "lib.rs" [dependencies.profile_traits] path = "../profile_traits" -[dependencies.task_info] -path = "../../support/rust-task_info" - [dependencies.util] path = "../util" @@ -20,3 +17,9 @@ path = "../util" libc = "*" regex = "0.1.14" time = "0.1.12" + +[target.x86_64-apple-darwin.dependencies.task_info] +path = "../../support/rust-task_info" + +[target.i686-apple-darwin.dependencies.task_info] +path = "../../support/rust-task_info" diff --git a/components/servo/Cargo.lock b/components/servo/Cargo.lock index 4c6ff5d1ed0..ffd53bb25a9 100644 --- a/components/servo/Cargo.lock +++ b/components/servo/Cargo.lock @@ -1180,6 +1180,9 @@ dependencies = [ [[package]] name = "task_info" version = "0.0.1" +dependencies = [ + "gcc 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", +] [[package]] name = "tempdir" diff --git a/ports/cef/Cargo.lock b/ports/cef/Cargo.lock index 7afa33f29df..d67bf315e3e 100644 --- a/ports/cef/Cargo.lock +++ b/ports/cef/Cargo.lock @@ -1173,6 +1173,9 @@ dependencies = [ [[package]] name = "task_info" version = "0.0.1" +dependencies = [ + "gcc 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", +] [[package]] name = "tempdir" diff --git a/ports/gonk/Cargo.lock b/ports/gonk/Cargo.lock index 3c49472e14c..7a10f08a05d 100644 --- a/ports/gonk/Cargo.lock +++ b/ports/gonk/Cargo.lock @@ -1044,6 +1044,9 @@ dependencies = [ [[package]] name = "task_info" version = "0.0.1" +dependencies = [ + "gcc 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", +] [[package]] name = "tempdir" diff --git a/support/rust-task_info/Cargo.toml b/support/rust-task_info/Cargo.toml index 27f3385f5ed..499bd39f5f3 100644 --- a/support/rust-task_info/Cargo.toml +++ b/support/rust-task_info/Cargo.toml @@ -5,3 +5,6 @@ version = "0.0.1" authors = ["The Servo Project Developers"] build = "build.rs" + +[build-dependencies] +gcc = "0.3.4" diff --git a/support/rust-task_info/Makefile.in b/support/rust-task_info/Makefile.in deleted file mode 100644 index a844cdf6371..00000000000 --- a/support/rust-task_info/Makefile.in +++ /dev/null @@ -1,32 +0,0 @@ -VPATH=%VPATH% - -CC ?= gcc -RUSTC ?= rustc -AR ?= ar -RUSTFLAGS ?= -CFLAGS += -Wall - -RUST_SRC = $(shell find $(VPATH)/. -type f -name '*.rs') - -.PHONY: all -all: libtask_info-servo.dummy - -libtask_info-servo.dummy: task_info.rc $(RUST_SRC) libtask_info.a - $(RUSTC) $(RUSTFLAGS) $< --out-dir . -C extra-filename=-servo - touch $@ - -task_info-test: task_info.rc $(RUST_SRC) libtask_info.a - $(RUSTC) $(RUSTFLAGS) $< -o $@ --test - -libtask_info.a: task_info.o - $(AR) rcs libtask_info.a task_info.o - -task_info.o: task_info.c - $(CC) $(CFLAGS) $< -o $@ -c - -check: task_info-test - ./task_info-test - -.PHONY: clean -clean: - rm -f task_info-test *.a *.o *.so *.dylib *.rlib *.dll *.dummy task_info-test diff --git a/support/rust-task_info/build.rs b/support/rust-task_info/build.rs index 99552a2ed48..b7461713a09 100644 --- a/support/rust-task_info/build.rs +++ b/support/rust-task_info/build.rs @@ -2,14 +2,10 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -use std::process::Command; -use std::env; +extern crate gcc; fn main() { - assert!(Command::new("make") - .args(&["-f", "makefile.cargo"]) - .status() - .unwrap() - .success()); - println!("cargo:rustc-flags=-L native={}", env::var("OUT_DIR").unwrap()); + let mut cfg = gcc::Config::new(); + cfg.file("src/task_info.c"); + cfg.compile("libtask_info.a"); } diff --git a/support/rust-task_info/makefile.cargo b/support/rust-task_info/makefile.cargo deleted file mode 100644 index 01be6df7b4c..00000000000 --- a/support/rust-task_info/makefile.cargo +++ /dev/null @@ -1,20 +0,0 @@ -CC ?= gcc -AR ?= ar -CFLAGS += -Wall - -.PHONY: all -ifeq (darwin,$(findstring darwin,$(TARGET))) - -all: $(OUT_DIR)/libtask_info.a - -$(OUT_DIR)/libtask_info.a: $(OUT_DIR)/task_info.o - $(AR) rcs $@ $^ - -$(OUT_DIR)/task_info.o: src/task_info.c - $(CC) $(CFLAGS) $< -o $@ -c - -else - -all: - -endif diff --git a/support/rust-task_info/src/lib.rs b/support/rust-task_info/src/lib.rs index fe2a5bd3524..bf7580b3263 100644 --- a/support/rust-task_info/src/lib.rs +++ b/support/rust-task_info/src/lib.rs @@ -14,6 +14,5 @@ extern crate libc; -#[cfg(target_os="macos")] pub mod task_basic_info;