Skip to content

Commit

Permalink
auto merge of #1441 : metajack/servo/unrustpkg, r=metajack,me
Browse files Browse the repository at this point in the history
  • Loading branch information
bors-servo committed Dec 27, 2013
2 parents cb336a1 + 0c62b99 commit be8ed32
Show file tree
Hide file tree
Showing 21 changed files with 52 additions and 117 deletions.
46 changes: 14 additions & 32 deletions Makefile.in
Expand Up @@ -116,15 +116,11 @@ rust: $(CFG_RUSTC)

# Strip off submodule paths to determine "raw" submodule names.
SUBMODULES=$(shell echo $(CFG_SUBMODULES) | perl -p -e 's![A-Za-z0-9_-]+/!!g')
SUBMODULES_RUSTPKG=$(shell echo $(CFG_SUBMODULES_RUSTPKG) | perl -p -e 's![A-Za-z0-9_-]+/!!g')

# Define e.g. PATH_skia = support/skia/skia
$(foreach submodule,$(CFG_SUBMODULES),\
$(eval PATH_$(shell echo $(submodule) | perl -p -e 's![A-Za-z0-9_-]+/!!g') = $(submodule)))

$(foreach submodule,$(CFG_SUBMODULES_RUSTPKG),\
$(eval PATH_$(shell echo $(submodule) | perl -p -e 's![A-Za-z0-9_-]+/!!g') = $(submodule)))

define DEF_SUBMODULE_VARS

#defaults
Expand All @@ -146,17 +142,12 @@ DEPS_SUBMODULES += $$(PATH_$(1))/.libs
DEPS_SUBMODULES += $$(PATH_$(1))/src/.libs
endef

DEPS_RUSTPKG = $(CFG_BUILD_HOME)workspace/lib/$(CFG_TARGET_TRIPLES)

# these will get populated.
DEPS_SUBMODULES =

$(foreach submodule,$(SUBMODULES),\
$(eval $(call DEF_SUBMODULE_VARS,$(submodule))))

$(foreach submodule,$(SUBMODULES_RUSTPKG),\
$(eval DONE_$(submodule) = $(DEPS_RUSTPKG)/lib$(submodule)*))

# Handle rust submodule vars specially
DONE_rust = $(CFG_RUSTC)

Expand Down Expand Up @@ -210,68 +201,61 @@ endef
$(foreach submodule,$(SUBMODULES),\
$(eval $(call DEF_SUBMODULE_RULES,$(submodule))))

# include rustpkg rules
include $(S)mk/rustpkg.mk

$(foreach submodule,$(SUBMODULES_RUSTPKG),\
$(eval $(call DEF_SUBMODULE_RUSTPKG_RULES,$(submodule))))

DONE_SUBMODULES = $(foreach submodule,$(SUBMODULES),$(DONE_$(submodule)))
DONE_SUBMODULES_RUSTPKG = $(foreach submodule,$(SUBMODULES_RUSTPKG),$(DONE_$(submodule)))

RFLAGS_util = $(strip $(CFG_RUSTC_FLAGS)) $(addprefix -L $(B)src/,$(DEPS_SUBMODULES)) -L $(DEPS_RUSTPKG)
RFLAGS_util = $(strip $(CFG_RUSTC_FLAGS)) $(addprefix -L $(B)src/,$(DEPS_SUBMODULES))
SRC_util = $(call rwildcard,$(S)src/components/util/,*.rs)
CRATE_util = $(S)src/components/util/util.rc
DONE_util = $(B)src/components/util/libutil.dummy

DEPS_util = $(CRATE_util) $(SRC_util) $(DONE_SUBMODULES) $(DONE_SUBMODULES_RUSTPKG) | $(SUBMODULES_RUSTPKG)
DEPS_util = $(CRATE_util) $(SRC_util) $(DONE_SUBMODULES)

RFLAGS_net = $(strip $(CFG_RUSTC_FLAGS)) $(addprefix -L $(B)src/,$(DEPS_SUBMODULES)) -L $(B)src/components/util -L $(DEPS_RUSTPKG)
RFLAGS_net = $(strip $(CFG_RUSTC_FLAGS)) $(addprefix -L $(B)src/,$(DEPS_SUBMODULES)) -L $(B)src/components/util
SRC_net = $(call rwildcard,$(S)src/components/net/,*.rs)
CRATE_net = $(S)src/components/net/net.rc
DONE_net = $(B)src/components/net/libnet.dummy

DEPS_net = $(CRATE_net) $(SRC_net) $(DONE_SUBMODULES) $(DONE_util) $(DONE_SUBMODULES_RUSTPKG) | $(SUBMODULES_RUSTPKG)
DEPS_net = $(CRATE_net) $(SRC_net) $(DONE_SUBMODULES) $(DONE_util)

RFLAGS_msg = $(strip $(CFG_RUSTC_FLAGS)) $(addprefix -L $(B)src/,$(DEPS_SUBMODULES)) -L $(DEPS_RUSTPKG)
RFLAGS_msg = $(strip $(CFG_RUSTC_FLAGS)) $(addprefix -L $(B)src/,$(DEPS_SUBMODULES))
SRC_msg = $(call rwildcard,$(S)src/components/msg/,*.rs)
CRATE_msg = $(S)src/components/msg/msg.rc
DONE_msg = $(B)src/components/msg/libmsg.dummy

DEPS_msg = $(CRATE_msg) $(SRC_msg) $(DONE_SUBMODULES) $(DONE_SUBMODULES_RUSTPKG) | $(SUBMODULES_RUSTPKG)
DEPS_msg = $(CRATE_msg) $(SRC_msg) $(DONE_SUBMODULES)

RFLAGS_gfx = $(strip $(CFG_RUSTC_FLAGS)) $(addprefix -L $(B)src/,$(DEPS_SUBMODULES)) -L $(B)src/components/util -L $(B)src/components/style -L $(B)src/components/net -L $(B)src/components/msg -L $(DEPS_RUSTPKG)
RFLAGS_gfx = $(strip $(CFG_RUSTC_FLAGS)) $(addprefix -L $(B)src/,$(DEPS_SUBMODULES)) -L $(B)src/components/util -L $(B)src/components/style -L $(B)src/components/net -L $(B)src/components/msg
SRC_gfx = $(call rwildcard,$(S)src/components/gfx/,*.rs)
CRATE_gfx = $(S)src/components/gfx/gfx.rc
DONE_gfx = $(B)src/components/gfx/libgfx.dummy

DEPS_gfx = $(CRATE_gfx) $(SRC_gfx) $(DONE_SUBMODULES) $(DONE_util) $(DONE_style) $(DONE_net) $(DONE_msg) $(DONE_SUBMODULES_RUSTPKG) | $(SUBMODULES_RUSTPKG)
DEPS_gfx = $(CRATE_gfx) $(SRC_gfx) $(DONE_SUBMODULES) $(DONE_util) $(DONE_style) $(DONE_net) $(DONE_msg)

RFLAGS_script = $(strip $(CFG_RUSTC_FLAGS)) $(addprefix -L $(B)src/,$(DEPS_SUBMODULES)) -L $(B)src/components/util -L $(B)src/components/style -L $(B)src/components/net -L $(B)src/components/msg -L $(DEPS_RUSTPKG)
RFLAGS_script = $(strip $(CFG_RUSTC_FLAGS)) $(addprefix -L $(B)src/,$(DEPS_SUBMODULES)) -L $(B)src/components/util -L $(B)src/components/style -L $(B)src/components/net -L $(B)src/components/msg
WEBIDL_script = $(call rwildcard,$(S)src/components/script/,*.webidl)
AUTOGEN_SRC_script = $(patsubst %.webidl, %Binding.rs, $(WEBIDL_script))
SRC_script = $(call rwildcard,$(S)src/components/script/,*.rs) $(AUTOGEN_SRC_script)
CRATE_script = $(S)src/components/script/script.rc
DONE_script = $(B)src/components/script/libscript.dummy

DEPS_script = $(CRATE_script) $(SRC_script) $(DONE_SUBMODULES) $(DONE_util) $(DONE_style) $(DONE_net) $(DONE_msg) $(DONE_SUBMODULES_RUSTPKG) | $(SUBMODULES_RUSTPKG)
DEPS_script = $(CRATE_script) $(SRC_script) $(DONE_SUBMODULES) $(DONE_util) $(DONE_style) $(DONE_net) $(DONE_msg)

RFLAGS_style = $(strip $(CFG_RUSTC_FLAGS)) $(addprefix -L $(B)src/,$(DEPS_SUBMODULES)) -L $(B)src/components/util -L $(DEPS_RUSTPKG)
RFLAGS_style = $(strip $(CFG_RUSTC_FLAGS)) $(addprefix -L $(B)src/,$(DEPS_SUBMODULES)) -L $(B)src/components/util
MAKO_ZIP = $(S)src/components/style/Mako-0.8.1.zip
MAKO_style = $(S)src/components/style/properties.rs
MAKO_SRC_style = $(MAKO_style).mako
SRC_style = $(call rwildcard,$(S)src/components/style/,*.rs) $(MAKO_style)
CRATE_style = $(S)src/components/style/style.rc
DONE_style = $(B)src/components/style/libstyle.dummy

DEPS_style = $(CRATE_style) $(SRC_style) $(DONE_SUBMODULES) $(DONE_util) | $(SUBMODULES_RUSTPKG)
DEPS_style = $(CRATE_style) $(SRC_style) $(DONE_SUBMODULES) $(DONE_util)

RFLAGS_servo = $(strip $(CFG_RUSTC_FLAGS)) $(addprefix -L $(B)src/,$(DEPS_SUBMODULES)) -L $(B)src/components/gfx -L $(B)src/components/util -L $(B)src/components/net -L $(B)src/components/script -L $(B)src/components/style -L $(B)src/components/msg -L $(DEPS_RUSTPKG)
RFLAGS_servo = $(strip $(CFG_RUSTC_FLAGS)) $(addprefix -L $(B)src/,$(DEPS_SUBMODULES)) -L $(B)src/components/gfx -L $(B)src/components/util -L $(B)src/components/net -L $(B)src/components/script -L $(B)src/components/style -L $(B)src/components/msg

SRC_servo = $(call rwildcard,$(S)src/components/main/,*.rs)
CRATE_servo = $(S)src/components/main/servo.rc

DEPS_servo = $(CRATE_servo) $(SRC_servo) $(DONE_SUBMODULES) $(DONE_util) $(DONE_gfx) $(DONE_script) $(DONE_net) $(DONE_msg) $(DONE_style) $(DONE_SUBMODULES_RUSTPKG) | $(SUBMODULES_RUSTPKG)
DEPS_servo = $(CRATE_servo) $(SRC_servo) $(DONE_SUBMODULES) $(DONE_util) $(DONE_gfx) $(DONE_script) $(DONE_net) $(DONE_msg) $(DONE_style)

SERVO_LIB_CRATES = util net msg gfx script style

Expand Down Expand Up @@ -371,5 +355,3 @@ backup-rust:

restore-rust:
$(MAKE) -f $(S)Makefile.backup $@

.NOTPARALLEL:
25 changes: 7 additions & 18 deletions configure
Expand Up @@ -402,7 +402,6 @@ probe CFG_CLANG clang++

CFG_BUILD_DIR="${CFG_BUILD_HOME}${CFG_TARGET_TRIPLES}/"
make_dir "${CFG_BUILD_DIR}"
make_dir "${CFG_BUILD_HOME}/workspace/src"

if [ ! -z "$CFG_LOCAL_RUST_ROOT" ]
then
Expand All @@ -411,7 +410,6 @@ then
LRV=`${CFG_LOCAL_RUST_ROOT}/bin/rustc --version`
step_msg "using rustc at: ${CFG_LOCAL_RUST_ROOT} with version: $LRV"
CFG_RUSTC=${CFG_LOCAL_RUST_ROOT}/bin/rustc
CFG_RUSTPKG=${CFG_LOCAL_RUST_ROOT}/bin/rustpkg
CFG_RUST_HOME=${CFG_LOCAL_RUST_ROOT}
CFG_LOCAL_RUSTC=1
else
Expand All @@ -421,7 +419,6 @@ else
step_msg "using in-tree rust compiler"
# The Rust compiler we're going to build
CFG_RUSTC="${CFG_BUILD_DIR}src/compiler/rust/${DEFAULT_TARGET_TRIPLE}/stage2/bin/rustc"
CFG_RUSTPKG="${CFG_BUILD_DIR}src/compiler/rust/${DEFAULT_TARGET_TRIPLE}/stage2/bin/rustpkg"
CFG_RUST_HOME="${CFG_BUILD_DIR}src/compiler/rust/${DEFAULT_TARGET_TRIPLE}/stage2"
fi

Expand Down Expand Up @@ -488,12 +485,6 @@ then
done
fi

CFG_SUBMODULES_RUSTPKG="\
support/geom/rust-geom \
support/layers/rust-layers \
support/opengles/rust-opengles \
support/sharegl/sharegl"

CFG_SUBMODULES="\
support/alert/rust-alert \
support/azure/rust-azure \
Expand All @@ -511,17 +502,19 @@ CFG_SUBMODULES="\
support/spidermonkey/rust-mozjs \
support/stb-image/rust-stb-image \
support/png/libpng \
support/png/rust-png"
support/png/rust-png \
support/geom/rust-geom \
support/layers/rust-layers \
support/opengles/rust-opengles \
support/sharegl/sharegl"

if [ $CFG_OSTYPE = "apple-darwin" ]
then
CFG_SUBMODULES_RUSTPKG="\
CFG_SUBMODULES="\
platform/macos/rust-core-foundation \
platform/macos/rust-core-graphics \
platform/macos/rust-core-text \
platform/macos/rust-io-surface \
${CFG_SUBMODULES_RUSTPKG}"
CFG_SUBMODULES="\
support/glfw/glfw \
support/glfw/glfw-rs \
platform/macos/rust-cocoa \
Expand All @@ -530,10 +523,8 @@ fi

if [ $CFG_OSTYPE = "unknown-linux-gnu" ]
then
CFG_SUBMODULES_RUSTPKG="\
platform/linux/rust-xlib \
${CFG_SUBMODULES_RUSTPKG}"
CFG_SUBMODULES="\
platform/linux/rust-xlib \
support/glfw/glfw \
support/glfw/glfw-rs \
platform/linux/rust-fontconfig \
Expand Down Expand Up @@ -563,10 +554,8 @@ putvar CFG_BUILD_HOME
putvar CFG_BUILD_DIR
putvar CFG_CONFIGURE_ARGS
putvar CFG_SUBMODULES
putvar CFG_SUBMODULES_RUSTPKG
putvar CFG_DISABLE_MANAGE_SUBMODULES
putvar CFG_RUSTC
putvar CFG_RUSTPKG
putvar CFG_RUSTC_FLAGS
putvar CFG_RUST_HOME
putvar CFG_PATH
Expand Down
36 changes: 0 additions & 36 deletions mk/rustpkg.mk

This file was deleted.

10 changes: 5 additions & 5 deletions src/components/gfx/gfx.rc
Expand Up @@ -12,8 +12,8 @@

extern mod azure;
extern mod extra;
extern mod geom = "rust-geom";
extern mod layers = "rust-layers";
extern mod geom;
extern mod layers;
extern mod stb_image;
extern mod png;
extern mod servo_net (name = "net");
Expand All @@ -30,9 +30,9 @@ extern mod harfbuzz;
#[cfg(target_os="linux")] #[cfg(target_os="android")] extern mod freetype;

// Mac OS-specific library dependencies
#[cfg(target_os="macos")] extern mod core_foundation = "rust-core-foundation";
#[cfg(target_os="macos")] extern mod core_graphics = "rust-core-graphics";
#[cfg(target_os="macos")] extern mod core_text = "rust-core-text";
#[cfg(target_os="macos")] extern mod core_foundation;
#[cfg(target_os="macos")] extern mod core_graphics;
#[cfg(target_os="macos")] extern mod core_text;

pub use gfx_font = font;
pub use gfx_font_context = font_context;
Expand Down
6 changes: 3 additions & 3 deletions src/components/gfx/platform/macos/font.rs
Expand Up @@ -4,9 +4,9 @@

/// Implementation of Quartz (CoreGraphics) fonts.

extern mod core_foundation = "rust-core-foundation";
extern mod core_graphics = "rust-core-graphics";
extern mod core_text = "rust-core-text";
extern mod core_foundation;
extern mod core_graphics;
extern mod core_text;

use font::{CSSFontWeight, FontHandleMethods, FontMetrics, FontTableMethods};
use font::{FontTableTag, FontWeight100, FontWeight200, FontWeight300, FontWeight400};
Expand Down
10 changes: 5 additions & 5 deletions src/components/main/servo.rc
Expand Up @@ -15,15 +15,15 @@

extern mod alert;
extern mod azure;
extern mod geom = "rust-geom";
extern mod geom;
extern mod gfx (name = "gfx");
#[cfg(not(target_os="android"))]
extern mod glfw;
#[cfg(target_os="android")]
extern mod glut;
extern mod js;
extern mod layers = "rust-layers";
extern mod opengles = "rust-opengles";
extern mod layers;
extern mod opengles;
extern mod png;
extern mod script;
extern mod servo_net (name = "net");
Expand All @@ -35,9 +35,9 @@ extern mod stb_image;
extern mod extra;

#[cfg(target_os="macos")]
extern mod core_graphics = "rust-core-graphics";
extern mod core_graphics;
#[cfg(target_os="macos")]
extern mod core_text = "rust-core-text";
extern mod core_text;

use compositing::{CompositorChan, CompositorTask};
use constellation::Constellation;
Expand Down
8 changes: 4 additions & 4 deletions src/components/msg/msg.rc
Expand Up @@ -10,14 +10,14 @@

extern mod azure;
extern mod extra;
extern mod geom = "rust-geom";
extern mod layers = "rust-layers";
extern mod geom;
extern mod layers;
extern mod std;

#[cfg(target_os="macos")]
extern mod core_foundation = "rust-core-foundation";
extern mod core_foundation;
#[cfg(target_os="macos")]
extern mod io_surface = "rust-io-surface";
extern mod io_surface;

pub mod compositor_msg;
pub mod constellation_msg;
Expand Down
2 changes: 1 addition & 1 deletion src/components/net/net.rc
Expand Up @@ -10,7 +10,7 @@

#[feature(globs, managed_boxes)];

extern mod geom = "rust-geom";
extern mod geom;
extern mod http;
extern mod servo_util (name = "util");
extern mod stb_image;
Expand Down
2 changes: 1 addition & 1 deletion src/components/script/script.rc
Expand Up @@ -13,7 +13,7 @@

#[feature(globs, macro_rules, struct_variant, managed_boxes)];

extern mod geom = "rust-geom";
extern mod geom;
extern mod hubbub;
extern mod encoding;
extern mod js;
Expand Down
2 changes: 1 addition & 1 deletion src/components/util/util.rc
Expand Up @@ -11,7 +11,7 @@
#[feature(macro_rules, managed_boxes)];

extern mod extra;
extern mod geom = "rust-geom";
extern mod geom;

pub mod cache;
pub mod geometry;
Expand Down
2 changes: 1 addition & 1 deletion src/platform/linux/rust-xlib
2 changes: 1 addition & 1 deletion src/platform/macos/rust-core-foundation
2 changes: 1 addition & 1 deletion src/platform/macos/rust-core-graphics
2 changes: 1 addition & 1 deletion src/platform/macos/rust-core-text
2 changes: 1 addition & 1 deletion src/platform/macos/rust-io-surface
2 changes: 1 addition & 1 deletion src/support/alert/rust-alert
2 changes: 1 addition & 1 deletion src/support/azure/rust-azure
2 changes: 1 addition & 1 deletion src/support/geom/rust-geom
2 changes: 1 addition & 1 deletion src/support/layers/rust-layers
2 changes: 1 addition & 1 deletion src/support/opengles/rust-opengles
2 changes: 1 addition & 1 deletion src/support/sharegl/sharegl

0 comments on commit be8ed32

Please sign in to comment.