Bug 1294639 - Move --with-servo to python configure. r?chmanchester
Subtly, as toolkit/moz.configure happens before toolchain tests, we
can't set MOZ_SERVO_LIBS from there. And toolkit/moz.configure is
not always included either, making things awkward to do in python
configure.
OTOH, there's only one place where MOZ_SERVO_LIBS is used, and the
corresponding setup can actually be done there (in moz.build) instead.
I think we shouldn't shy away from moving things this way.
--- a/old-configure.in
+++ b/old-configure.in
@@ -5171,41 +5171,16 @@ MOZ_ARG_DISABLE_BOOL(mozril-geoloc,
DISABLE_MOZ_RIL_GEOLOC=1,
DISABLE_MOZ_RIL_GEOLOC= )
if test -n "$DISABLE_MOZ_RIL_GEOLOC"; then
AC_DEFINE(DISABLE_MOZ_RIL_GEOLOC)
fi
AC_SUBST(DISABLE_MOZ_RIL_GEOLOC)
dnl ========================================================
-dnl = Use the Servo Style System for Gecko.
-dnl =
-dnl = This linkage setup is temporary, and for experimental
-dnl = purposes. We will vendor servo and integrate the build
-dnl = systems before actually shipping anything.
-dnl ========================================================
-MOZ_ARG_WITH_STRING(servo,
-[ --with-servo=SERVO_TARGET_DIR
- Absolute path of the target directory where libgeckoservo can
- be found. This is generally servo_src_dir/target/release.
- Passing this flag enables experimental integration with the
- servo style system],
- SERVO_TARGET_DIR=$withval,
- SERVO_TARGET_DIR=)
-if test -n "$SERVO_TARGET_DIR"; then
- if test -n "$_WIN32_MSVC"; then
- MOZ_SERVO_LIBS="${SERVO_TARGET_DIR}/geckoservo"
- else
- MOZ_SERVO_LIBS="-L${SERVO_TARGET_DIR} -lgeckoservo"
- fi
- AC_DEFINE(MOZ_STYLO)
- AC_SUBST_LIST(MOZ_SERVO_LIBS)
-fi
-
-dnl ========================================================
dnl =
dnl = Misc. Options
dnl =
dnl ========================================================
MOZ_ARG_HEADER(Misc. Options)
dnl ========================================================
dnl = Define default location for MOZILLA_FIVE_HOME
--- a/toolkit/library/moz.build
+++ b/toolkit/library/moz.build
@@ -209,17 +209,22 @@ if CONFIG['MOZ_B2G_CAMERA'] and CONFIG['
if CONFIG['OS_ARCH'] == 'Linux' and CONFIG['OS_TARGET'] != 'Android':
OS_LIBS += [
'rt',
]
OS_LIBS += CONFIG['MOZ_CAIRO_OSLIBS']
OS_LIBS += CONFIG['MOZ_WEBRTC_X11_LIBS']
-OS_LIBS += CONFIG['MOZ_SERVO_LIBS']
+
+if CONFIG['SERVO_TARGET_DIR']:
+ if CONFIG['_MSC_VER']:
+ OS_LIBS += ['%s/geckoservo' % CONFIG['SERVO_TARGET_DIR']]
+ else:
+ OS_LIBS += ['-L%s' % CONFIG['SERVO_TARGET_DIR'], '-lgeckoservo']
if CONFIG['MOZ_SYSTEM_JPEG']:
OS_LIBS += CONFIG['MOZ_JPEG_LIBS']
if CONFIG['MOZ_SYSTEM_PNG']:
OS_LIBS += CONFIG['MOZ_PNG_LIBS']
if CONFIG['MOZ_SYSTEM_HUNSPELL']:
--- a/toolkit/moz.configure
+++ b/toolkit/moz.configure
@@ -484,8 +484,23 @@ option('--enable-ipc-fuzzer', env='MOZ_F
@depends_if('--enable-ipc-fuzzer', target)
def ipc_fuzzer(value, target):
if target.os == 'WINNT':
die('--enable-ipc-fuzzer is not supported on this platform.')
return bool(value)
set_config('MOZ_FAULTY', ipc_fuzzer)
set_define('MOZ_FAULTY', ipc_fuzzer)
+
+# Servo integration
+# ==============================================================
+option('--with-servo', env='SERVO_TARGET_DIR', nargs=1,
+ help='Absolute path of the target directory where libgeckoservo can '
+ 'be found. This is generally servo_src_dir/target/release.'
+ 'Passing this flag enables experimental integration with the '
+ 'servo style system')
+
+@depends_if('--with-servo')
+def servo_target_dir(value)
+ return value[0]
+
+set_define('MOZ_STYLO', depends_if(servo_target_dir)(lambda x: bool(x))
+set_config('SERVO_TARGET_DIR', servo_target_dir)