servo: Build cairo in-tree

Source-Repo: https://github.com/servo/servo
Source-Revision: f13e6ac388420c4f7c879c64f484ed78790f1657
This commit is contained in:
Brian Anderson 2013-01-15 11:28:08 -08:00
parent 4d8cc16eb8
commit 6708e03b22
4 changed files with 76 additions and 5 deletions

View File

@ -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)))

View File

@ -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.

45
servo/configure vendored
View File

@ -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

View File

@ -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 += \