Bug 1418652: Migrate configure options to moz.configure; r?Build,Fallen,frg draft
authorTom Prince <mozilla@hocat.ca>
Sat, 18 Nov 2017 10:24:42 -0700
changeset 23173 1e81b0ee2b91ac5ff5a2456952c420e5d4231962
parent 23141 8f7f2170dd259c43f83e1b09378d4ecbc0bcf8f9
push id155
push userbmo:mozilla@hocat.ca
push dateTue, 21 Nov 2017 20:43:48 +0000
reviewersBuild, Fallen, frg
bugs1418652
Bug 1418652: Migrate configure options to moz.configure; r?Build,Fallen,frg MozReview-Commit-ID: 51LfUVsaEVJ
mail/configure.in
mail/moz.configure
mailnews/moz.configure
suite/configure.in
suite/confvars.sh
suite/moz.configure
--- a/mail/configure.in
+++ b/mail/configure.in
@@ -29,45 +29,8 @@ if test "$OS_ARCH" != "WINNT"; then
   HAVE_MOVEMAIL=1
   AC_DEFINE(HAVE_MOVEMAIL)
 fi
 AC_SUBST(MOZ_MOVEMAIL)
 
 dnl Get other versions (for the calendar plugin)
 SEAMONKEY_VERSION=`cat ${_topsrcdir}/../suite/config/version.txt`
 AC_SUBST(SEAMONKEY_VERSION)
-
-dnl =========================================================
-dnl = Lightning extension
-dnl =========================================================
-MOZ_ARG_ENABLE_BOOL(calendar,
-[  --enable-calendar      Enable building of the Lightning calendar extension],
-    MOZ_CALENDAR=1,
-    MOZ_CALENDAR= )
-AC_SUBST(MOZ_CALENDAR)
-
-dnl =========================================================
-dnl = LDAP
-dnl =========================================================
-MOZ_ARG_DISABLE_BOOL(ldap,
-[  --disable-ldap          Disable LDAP support],
-    MOZ_LDAP_XPCOM=,
-    MOZ_LDAP_XPCOM=1)
-
-AC_SUBST(MOZ_LDAP_XPCOM)
-
-dnl =========================================================
-dnl = MAPI support (Windows only)
-dnl =========================================================
-
-if test "$_WIN32_MSVC"; then
-    MOZ_MAPI_SUPPORT=1
-fi
-
-MOZ_ARG_DISABLE_BOOL(mapi,
-[  --disable-mapi          Disable MAPI support],
-    MOZ_MAPI_SUPPORT= )
-
-AC_SUBST(MOZ_MAPI_SUPPORT)
-
-if test -n "$MOZ_MAPI_SUPPORT"; then
-    AC_DEFINE(MOZ_MAPI_SUPPORT)
-fi
--- a/mail/moz.configure
+++ b/mail/moz.configure
@@ -7,18 +7,22 @@
 imply_option('MOZ_PLACES', True)
 imply_option('MOZ_ALLOW_LEGACY_EXTENSIONS', True)
 
 
 @depends(application)
 def is_comm_topdir(app):
     return not app[0].startswith('comm/')
 
+
 set_config('MOZ_IS_COMM_TOPDIR', is_comm_topdir)
 
+
 @depends(is_comm_topdir)
 def toolkit_configure(is_comm_topdir):
     if is_comm_topdir:
         return '../mozilla/toolkit/moz.configure'
     else:
         return '../../toolkit/moz.configure'
 
+
+include('../mailnews/moz.configure')
 include(toolkit_configure)
new file mode 100644
--- /dev/null
+++ b/mailnews/moz.configure
@@ -0,0 +1,53 @@
+# -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*-
+# vim: set filetype=python:
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+
+# =========================================================
+# = Lightning extension
+# =========================================================
+option('--enable-calendar',
+       help='Enable building of the Lightning calendar extension')
+
+
+@depends_if('--enable-calendar')
+def calendar(arg):
+    return True
+
+
+set_config('MOZ_CALENDAR', calendar)
+
+# =========================================================
+# = LDAP
+# =========================================================
+option('--disable-ldap',
+       help='Disable LDAP support')
+
+
+@depends_if('--enable-ldap')
+def ldap(arg):
+    return True
+
+
+set_config('MOZ_LDAP_XPCOM', ldap)
+set_define('MOZ_LDAP_XPCOM', ldap)
+
+# =========================================================
+# = MAPI support (Windows only)
+# =========================================================
+
+option('--disable-mapi',
+       help='Disable MAPI support',
+       when=target_is_windows)
+
+
+@depends_if('--enable-mapi',
+            when=target_is_windows)
+def mapi_support(arg):
+    return True
+
+
+set_config('MOZ_MAPI_SUPPORT', mapi_support)
+set_define('MOZ_MAPI_SUPPORT', mapi_support)
--- a/suite/configure.in
+++ b/suite/configure.in
@@ -32,45 +32,8 @@ if test "$OS_ARCH" != "WINNT"; then
   HAVE_MOVEMAIL=1
   AC_DEFINE(HAVE_MOVEMAIL)
 fi
 AC_SUBST(MOZ_MOVEMAIL)
 
 dnl Get other versions (for the calendar plugin)
 THUNDERBIRD_VERSION=`cat ${_topsrcdir}/../mail/config/version.txt`
 AC_SUBST(THUNDERBIRD_VERSION)
-
-dnl =========================================================
-dnl = Lightning extension
-dnl =========================================================
-MOZ_ARG_ENABLE_BOOL(calendar,
-[  --enable-calendar      Enable building of the Lightning calendar extension],
-    MOZ_CALENDAR=1,
-    MOZ_CALENDAR= )
-AC_SUBST(MOZ_CALENDAR)
-
-dnl =========================================================
-dnl = LDAP
-dnl =========================================================
-MOZ_ARG_DISABLE_BOOL(ldap,
-[  --disable-ldap          Disable LDAP support],
-    MOZ_LDAP_XPCOM=,
-    MOZ_LDAP_XPCOM=1)
-
-AC_SUBST(MOZ_LDAP_XPCOM)
-
-dnl =========================================================
-dnl = MAPI support (Windows only)
-dnl =========================================================
-
-if test "$_WIN32_MSVC"; then
-    MOZ_MAPI_SUPPORT=1
-fi
-
-MOZ_ARG_DISABLE_BOOL(mapi,
-[  --disable-mapi          Disable MAPI support],
-    MOZ_MAPI_SUPPORT= )
-
-AC_SUBST(MOZ_MAPI_SUPPORT)
-
-if test -n "$MOZ_MAPI_SUPPORT"; then
-    AC_DEFINE(MOZ_MAPI_SUPPORT)
-fi
--- a/suite/confvars.sh
+++ b/suite/confvars.sh
@@ -40,23 +40,22 @@ if test "$OS_ARCH" = "WINNT" -o \
         "$OS_ARCH" = "Linux"; then
   MOZ_BUNDLED_FONTS=1
 fi
 
 # Include the DevTools client, not just the server (which is the default)
 MOZ_DEVTOOLS=all
 
 # Bundled extensions Lightning Chatzilla DOM Inspector and debugQA
-MOZ_CALENDAR=1
 MOZ_IRC=1
 MOZ_DOMINSPECTOR=1
 
 if [[ $MOZ_APP_VERSION == *a* ]]; then
   MOZ_DEBUGQA=1
 fi
 
 if [[ $MOZ_IRC == 1 ]]; then
   MOZ_EXTENSIONS_DEFAULT='irc'
 fi
 
 if [[ $MOZ_DOMINSPECTOR == 1 ]]; then
   MOZ_EXTENSIONS_DEFAULT+=' inspector'
-fi
\ No newline at end of file
+fi
--- a/suite/moz.configure
+++ b/suite/moz.configure
@@ -3,22 +3,26 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 imply_option('MOZ_PLACES', True)
 imply_option('MOZ_SERVICES_SYNC', True)
 imply_option('MOZ_ALLOW_LEGACY_EXTENSIONS', True)
 
+imply_option('--enable-calendar', True)
+
 
 @depends(application)
 def is_comm(app):
     return app[0].startswith('comm/')
 
 
 @depends(is_comm)
 def toolkit_configure(is_comm):
     if is_comm:
         return '../../toolkit/moz.configure'
     else:
         return '../mozilla/toolkit/moz.configure'
 
+
+include('../mailnews/moz.configure')
 include(toolkit_configure)