Bug 1294639 - Move --with-servo to python configure. r=chmanchester
authorMike Hommey <mh+mozilla@glandium.org>
Fri, 12 Aug 2016 16:14:08 +0900
changeset 309527 626e971c8ac98468f7c15821455a05e1b21dbc37
parent 309526 5dd2ba45526f0c5ac61ec69ca5643504f424c17a
child 309528 702bca0deee2dbe875029264fedfc5995bf6dbfd
push id20328
push userkwierso@gmail.com
push dateWed, 17 Aug 2016 05:10:33 +0000
treeherderfx-team@72f11467d2cf [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerschmanchester
bugs1294639
milestone51.0a1
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.
old-configure.in
toolkit/library/moz.build
toolkit/moz.configure
--- a/old-configure.in
+++ b/old-configure.in
@@ -5189,41 +5189,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
@@ -470,8 +470,23 @@ include('../build/moz.configure/keyfiles
 
 simple_keyfile('Mozilla API')
 
 simple_keyfile('Google API')
 
 id_and_secret_keyfile('Bing API')
 
 simple_keyfile('Adjust SDK')
+
+# 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)