diff --git a/Makefile.in b/Makefile.in index d7a74b16a21..6159ff9fd2e 100644 --- a/Makefile.in +++ b/Makefile.in @@ -111,7 +111,13 @@ ROUGH_DEPS_$(1)=$$(call rwildcard,$$(S)src/$(1),*h *c *cpp *rs *rc) DONE_DEPS_$(1)=$$(foreach dep,$$(DEPS_$(1)),$$(DONE_$$(dep))) # the main target for a submodule # -- -$$(DONE_$(1)) : $$(DONE_DEPS_$(1)) $$(ROUGH_DEPS_$(1)) $$(CFG_RUSTC) + +# Native builds do not depend on the rust compiler, so we can build them in parallel with rustc +ifneq "$$(filter $(1),$$(NATIVE_BUILDS))" "$(1)" +RUSTC_DEP_$(1)=$$(CFG_RUSTC) +endif + +$$(DONE_$(1)) : $$(DONE_DEPS_$(1)) $$(ROUGH_DEPS_$(1)) $$(RUSTC_DEP_$(1)) # @$$(call E, make: $(1)) # @$$(call E, $(1) deps= $$(DEPS_$(1))) # @$$(call E, $(1) done_deps= $$(DONE_DEPS_$(1))) diff --git a/README.md b/README.md index 945dda2b9e8..c72a2f20edd 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ On OS X (MacPorts): On Debian-based Linuxes: - sudo apt-get install libcairo2-dev libpango1.0-dev autoconf2.13 freeglut3-dev + sudo apt-get install libcairo2-dev libpango1.0-dev autoconf2.13 freeglut3-dev libtool Servo builds its own copy of Rust, so there is no need to provide a Rust compiler. diff --git a/configure b/configure index 7488cddcdaa..d8355325eb9 100755 --- a/configure +++ b/configure @@ -381,9 +381,26 @@ fi step_msg "running submodule autoconf scripts" -(cd ${CFG_SRC_DIR}src/mozjs/js/src && "${CFG_AUTOCONF213}") || exit $? +if [ $CFG_OSTYPE = "apple-darwin" ] +then + LIBTOOLIZE=glibtoolize +else + LIBTOOLIZE=libtoolize +fi -CFG_SUBMODULES="libwapcaplet rust-wapcaplet rust-harfbuzz rust-opengles skia rust-azure rust-cairo rust-stb-image rust-geom rust-glut rust-layers rust-http-client libparserutils libhubbub libcss rust-netsurfcss rust-css rust-hubbub sharegl rust-mozjs mozjs" +OSX_PKG_CONFIG_M4_MACROS="/usr/local/share/aclocal" +PIXMAN_ACLOCALCMD="aclocal -I${OSX_PKG_CONFIG_M4_MACROS} --install" +CAIRO_ACLOCALCMD="aclocal -I${OSX_PKG_CONFIG_M4_MACROS} -Ibuild --install" +AUTOCMD="${LIBTOOLIZE} && autoconf && autoheader && automake --add-missing --copy --no-force" +CAIRO_BOILERPLATE="touch boilerplate/Makefile.am.features && touch src/Makefile.am.features" +PIXMAN_AUTOCMD="${PIXMAN_ACLOCALCMD} && ${AUTOCMD}" +CAIRO_AUTOCMD="${CAIRO_BOILERPLATE} && ${CAIRO_ACLOCALCMD} && ${AUTOCMD}" + +(cd ${CFG_SRC_DIR}src/mozjs/js/src && "${CFG_AUTOCONF213}") || exit $? +(cd ${CFG_SRC_DIR}src/pixman && eval ${PIXMAN_AUTOCMD}) || exit $? +(cd ${CFG_SRC_DIR}src/cairo && eval ${CAIRO_AUTOCMD}) || exit $? + +CFG_SUBMODULES="libwapcaplet rust-wapcaplet rust-harfbuzz rust-opengles skia rust-azure rust-cairo rust-stb-image rust-geom rust-glut rust-layers rust-http-client libparserutils libhubbub libcss rust-netsurfcss rust-css rust-hubbub sharegl rust-mozjs mozjs pixman cairo" if [ $CFG_OSTYPE = "apple-darwin" ] then @@ -433,6 +450,15 @@ then cd ${CFG_BUILD_DIR} fi +# Cairo expects to use an installed pixman, but we want to override that +# behavior to use our version +export pixman_CFLAGS="-I${CFG_SRC_DIR}src/pixman/pixman -I${CFG_BUILD_DIR}src/pixman/pixman" +export pixman_LDFLAGS="-I${CFG_BUILD_DIR}src/pixman/pixman/.libs" + +# PIC all the things +export CFLAGS="${CFLAGS} -fPIC" +export LDFLAGS="${CFLAGS} -fPIC" + for i in ${CFG_SUBMODULES} do if [ -d ${CFG_BUILD_DIR}src/${i} ] @@ -447,13 +473,26 @@ do # needed because Azure's configure wants "--enable-cairo --enable-skia" CONFIGURE_ARGS="" + ENV_VARS="" if [ $i = "rust-azure" ]; then CONFIGURE_ARGS="--enable-cairo --enable-skia" fi + # libpng isn't available by default on OS X so don't make it required for cairo + # png is in turn required for the svg backend + if [ $i = "cairo" -a ${CFG_OSTYPE} == "apple-darwin" ]; then + CONFIGURE_ARGS="--enable-png=no --enable-svg=no --enable-ft=no --enable-xlib=no" + fi + + # Tell pkg-config where pixman is + if [ $i = "cairo" ]; then + export PKG_CONFIG_PATH=../pixman + else + export PKG_CONFIG_PATH= + fi if [ -f ${CONFIGURE_SCRIPT} ] then - sh ${CONFIGURE_SCRIPT} ${CONFIGURE_ARGS} + (sh ${CONFIGURE_SCRIPT} ${CONFIGURE_ARGS}) || exit $? fi done diff --git a/mk/sub.mk b/mk/sub.mk index e7c83fd87fe..d23a6807b73 100644 --- a/mk/sub.mk +++ b/mk/sub.mk @@ -11,6 +11,20 @@ SLOW_BUILDS += \ mozjs \ sharegl \ skia \ + pixman \ + cairo \ + $(NULL) + +# Builds that do not require rustc +NATIVE_BUILDS += \ + libcss \ + libhubbub \ + libparserutils \ + libwapcaplet \ + mozjs \ + skia \ + pixman \ + cairo \ $(NULL) # NOTE: the make magic can only compute transitive build dependencies, @@ -19,6 +33,10 @@ SLOW_BUILDS += \ # NB. This should not be a problem once a real package system exists. +DEPS_rust-cairo += \ + cairo \ + $(NULL) + DEPS_rust-azure += \ rust-geom \ rust-cairo \ @@ -81,6 +99,14 @@ DEPS_libcss += \ libparserutils \ $(NULL) +DONE_pixman = "$(B)src/pixman/pixman/.libs/libpixman-1.a" + +DONE_cairo = "$(B)src/cairo/src/.libs/libcairo.a" + +DEPS_cairo += \ + pixman \ + $(NULL) + # Platform-specific dependencies ifeq ($(CFG_OSTYPE),apple-darwin) DEPS_rust-azure += \ diff --git a/src/cairo b/src/cairo index f228769dfe5..95b4bd33554 160000 --- a/src/cairo +++ b/src/cairo @@ -1 +1 @@ -Subproject commit f228769dfe5a8b5d73c49a41e95e31ed73a77fb3 +Subproject commit 95b4bd335549b74c4d50f34ecb074122572291ea diff --git a/src/rust-azure b/src/rust-azure index b2b53908ca6..535e779370b 160000 --- a/src/rust-azure +++ b/src/rust-azure @@ -1 +1 @@ -Subproject commit b2b53908ca67f7c74c067ec0d601776c180db09f +Subproject commit 535e779370b7d94cdd46403f1d883fbc1b04af05 diff --git a/src/rust-cairo b/src/rust-cairo index fda83465dfb..05542dff667 160000 --- a/src/rust-cairo +++ b/src/rust-cairo @@ -1 +1 @@ -Subproject commit fda83465dfb30e4724eac1f560e0e4b2d82a6783 +Subproject commit 05542dff66725cbf0620d7cbf26367a08e7dceaf diff --git a/src/rust-core-foundation b/src/rust-core-foundation index c9f172bd01b..ea2221e1ffc 160000 --- a/src/rust-core-foundation +++ b/src/rust-core-foundation @@ -1 +1 @@ -Subproject commit c9f172bd01bdbc0efe117a8cd60bd088c49d63c3 +Subproject commit ea2221e1ffcce397a0b742159a7f3def05ece039