Bug 1256988 - Move --with-gl-provider to moz.configure draft
authorMike Hommey <mh+mozilla@glandium.org>
Wed, 16 Mar 2016 15:14:20 +0900
changeset 341016 6de2107e0849b8997cec6a98c954807f02072335
parent 341015 9f33957b7da66bb0d5d255e5852a0975ee421767
child 341017 470d42ad0d2c900932c50b12de6c8634991c673d
child 341057 e6e4d03141b06606a977158992a7198328942a96
push id13117
push userbmo:mh+mozilla@glandium.org
push dateWed, 16 Mar 2016 11:04:10 +0000
bugs1256988
milestone48.0a1
Bug 1256988 - Move --with-gl-provider to moz.configure
build/moz.configure/old.configure
old-configure.in
toolkit/moz.configure
--- a/build/moz.configure/old.configure
+++ b/build/moz.configure/old.configure
@@ -326,17 +326,16 @@ def old_configure_options(*options):
     '--with-debug-label',
     '--with-default-mozilla-five-home',
     '--with-distribution-id',
     '--with-doc-include-dirs',
     '--with-doc-input-dirs',
     '--with-doc-output-dir',
     '--with-float-abi',
     '--with-fpu',
-    '--with-gl-provider',
     '--with-gonk-toolchain-prefix',
     '--with-google-api-keyfile',
     '--with-google-oauth-api-keyfile',
     '--with-gradle',
     '--with-intl-api',
     '--with-ios-sdk',
     '--with-java-bin-path',
     '--with-jitreport-granularity',
--- a/old-configure.in
+++ b/old-configure.in
@@ -6059,34 +6059,16 @@ dnl = Disable zipwriter
 dnl ========================================================
 MOZ_ARG_DISABLE_BOOL(zipwriter,
 [  --disable-zipwriter     Disable zipwriter component],
     MOZ_ZIPWRITER=,
     MOZ_ZIPWRITER=1 )
 AC_SUBST(MOZ_ZIPWRITER)
 
 dnl ========================================================
-dnl GL provider
-dnl ========================================================
-MOZ_GL_PROVIDER=
-MOZ_ARG_WITH_STRING(gl-provider,
-[  --with-gl-provider=ID
-                          Set GL provider backend type],
-[ val=`echo $withval`
-    MOZ_GL_PROVIDER="$val"])
-
-if test -n "$MOZ_GL_PROVIDER"; then
-MOZ_GL_DEFAULT_PROVIDER=$MOZ_GL_PROVIDER
-AC_SUBST(MOZ_GL_PROVIDER)
-AC_DEFINE_UNQUOTED(MOZ_GL_PROVIDER, GLContextProvider$MOZ_GL_PROVIDER)
-fi
-AC_SUBST(MOZ_GL_DEFAULT_PROVIDER)
-AC_DEFINE_UNQUOTED(GL_PROVIDER_$MOZ_GL_DEFAULT_PROVIDER)
-
-dnl ========================================================
 dnl = faststripe theme
 dnl ========================================================
 MOZ_ARG_ENABLE_BOOL(faststripe,
 [  --enable-faststripe     Use faststripe theme],
     MOZ_THEME_FASTSTRIPE=1,
     MOZ_THEME_FASTSTRIPE= )
 AC_SUBST(MOZ_THEME_FASTSTRIPE)
 
--- a/toolkit/moz.configure
+++ b/toolkit/moz.configure
@@ -83,11 +83,27 @@ def x11(value, toolkit):
               % ','.join(x11_toolkits))
 
     if value and toolkit in x11_toolkits:
         set_config('MOZ_ENABLE_XREMOTE', '1')
         set_define('MOZ_ENABLE_XREMOTE', '1')
         set_config('MOZ_X11', '1')
         set_define('MOZ_X11', '1')
         add_old_configure_assignment('MOZ_X11', '1')
-        add_old_configure_assignment('MOZ_GL_DEFAULT_PROVIDER', 'GLX')
 
     return value and toolkit in x11_toolkits
+
+
+# GL Provider
+# ==============================================================
+option('--with-gl-provider', nargs=1, help='Set GL provider backend type')
+
+@depends('--with-gl-provider', x11)
+def gl_provider(value, x11):
+    if value:
+        provider = value[0]
+        set_config('MOZ_GL_PROVIDER', provider)
+        set_define('MOZ_GL_PROVIDER', 'GLContextProvider%s' % provider)
+        set_config('MOZ_GL_DEFAULT_PROVIDER', provider)
+        set_define('GL_PROVIDER_%s' % provider, '1')
+    elif x11:
+        set_config('MOZ_GL_DEFAULT_PROVIDER', 'GLX')
+        set_define('GL_PROVIDER_GLX', '1')