Bug 1637921 - Always build LDAP, and remove the MOZ_LDAP_XPCOM define. r=mkmelin
authorGeoff Lankow <geoff@darktrojan.net>
Thu, 14 May 2020 22:29:17 +1200
changeset 39152 ced94145e95c92495ccab66e4d5ac45517bcf009
parent 39151 43d2da70f9d379bed1bb5f8dd2ebd0b16715b48d
child 39153 34122197a6a4cfdc121496238d6f23c859ca6dc7
push id402
push userclokep@gmail.com
push dateMon, 29 Jun 2020 20:48:04 +0000
reviewersmkmelin
bugs1637921
Bug 1637921 - Always build LDAP, and remove the MOZ_LDAP_XPCOM define. r=mkmelin
common/src/nsCommonModule.cpp
mail/installer/Makefile.in
mail/installer/package-manifest.in
mailnews/addrbook/public/moz.build
mailnews/addrbook/src/moz.build
mailnews/build/moz.build
mailnews/build/nsMailModule.cpp
mailnews/mailnews.mozbuild
mailnews/moz.configure
--- a/common/src/nsCommonModule.cpp
+++ b/common/src/nsCommonModule.cpp
@@ -72,19 +72,17 @@ static const mozilla::Module kCommonModu
                                               kCommonContracts,
                                               nullptr,
                                               nullptr,
                                               nullptr,
                                               nullptr};
 
 extern const mozilla::Module kCalBaseModule;
 extern const mozilla::Module kMorkModule;
-#ifdef MOZ_LDAP_XPCOM
 extern const mozilla::Module kLDAPProtocolModule;
-#endif
 #ifdef MOZ_THUNDERBIRD
 extern const mozilla::Module kMailCompsModule;
 #endif
 extern const mozilla::Module kMailNewsModule;
 extern const mozilla::Module kMailNewsImportModule;
 #ifdef MOZ_MAPI_SUPPORT
 extern const mozilla::Module kMAPIModule;
 #endif
@@ -93,19 +91,17 @@ extern const mozilla::Module kSuiteModul
 #endif
 
 class ModulesInit {
  public:
   ModulesInit() {
     XRE_AddStaticComponent(&kCommonModule);
     XRE_AddStaticComponent(&kCalBaseModule);
     XRE_AddStaticComponent(&kMorkModule);
-#ifdef MOZ_LDAP_XPCOM
     XRE_AddStaticComponent(&kLDAPProtocolModule);
-#endif
 #ifdef MOZ_THUNDERBIRD
     XRE_AddStaticComponent(&kMailCompsModule);
 #endif
     XRE_AddStaticComponent(&kMailNewsModule);
     XRE_AddStaticComponent(&kMailNewsImportModule);
 #ifdef MOZ_MAPI_SUPPORT
     XRE_AddStaticComponent(&kMAPIModule);
 #endif
--- a/mail/installer/Makefile.in
+++ b/mail/installer/Makefile.in
@@ -74,20 +74,16 @@ endif
 endif
 
 ifdef MOZ_UPDATER
 DEFINES += -DMOZ_UPDATER=1
 endif
 
 DEFINES += -DMOZ_CHILD_PROCESS_NAME=$(MOZ_CHILD_PROCESS_NAME)
 
-ifdef MOZ_LDAP_XPCOM
-DEFINES += -DMOZ_LDAP_XPCOM=1
-endif
-
 # Set MSVC dlls version to package, if any.
 ifdef MOZ_NO_DEBUG_RTL
 ifdef WIN32_REDIST_DIR
 DEFINES += -DMOZ_PACKAGE_MSVC_DLLS=1
 DEFINES += -DMSVC_C_RUNTIME_DLL=$(MSVC_C_RUNTIME_DLL)
 DEFINES += -DMSVC_CXX_RUNTIME_DLL=$(MSVC_CXX_RUNTIME_DLL)
 endif
 ifdef WIN_UCRT_REDIST_DIR
--- a/mail/installer/package-manifest.in
+++ b/mail/installer/package-manifest.in
@@ -288,21 +288,19 @@
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 
 #ifdef MOZ_OPENPGP
 @RESPATH@/chrome/openpgp@JAREXT@
 @RESPATH@/chrome/openpgp.manifest
 #endif
 
 ; LDAP components
-#ifdef MOZ_LDAP_XPCOM
 @BINPATH@/@DLL_PREFIX@ldap60@DLL_SUFFIX@
 @BINPATH@/@DLL_PREFIX@ldif60@DLL_SUFFIX@
 @BINPATH@/@DLL_PREFIX@prldap60@DLL_SUFFIX@
-#endif
 
 ; misson control, autoconfig
 #ifdef MOZ_PREF_EXTENSIONS
 @RESPATH@/defaults/autoconfig/prefcalls.js
 #endif
 
 ; Windows Search integration
 ; the module is included as part of the "Modules" rule
--- a/mailnews/addrbook/public/moz.build
+++ b/mailnews/addrbook/public/moz.build
@@ -8,32 +8,28 @@ XPIDL_SOURCES += [
     'nsIAbAutoCompleteResult.idl',
     'nsIAbBooleanExpression.idl',
     'nsIAbCard.idl',
     'nsIAbDirectory.idl',
     'nsIAbDirectoryQuery.idl',
     'nsIAbDirectoryQueryProxy.idl',
     'nsIAbDirSearchListener.idl',
     'nsIAbLDAPAttributeMap.idl',
+    'nsIAbLDAPDirectory.idl',
+    'nsIAbLDAPReplicationData.idl',
+    'nsIAbLDAPReplicationQuery.idl',
+    'nsIAbLDAPReplicationService.idl',
     'nsIAbLDIFService.idl',
     'nsIAbListener.idl',
     'nsIAbManager.idl',
     'nsIAddbookUrl.idl',
     'nsIAddrDatabase.idl',
     'nsIMsgVCardService.idl',
 ]
 
-if CONFIG['MOZ_LDAP_XPCOM']:
-    XPIDL_SOURCES += [
-        'nsIAbLDAPDirectory.idl',
-        'nsIAbLDAPReplicationData.idl',
-        'nsIAbLDAPReplicationQuery.idl',
-        'nsIAbLDAPReplicationService.idl',
-    ]
-
 if CONFIG['OS_ARCH'] == 'WINNT' and CONFIG['MOZ_MAPI_SUPPORT']:
     XPIDL_SOURCES += [
         'nsIAbOutlookInterface.idl',
     ]
 
 XPIDL_MODULE = 'addrbook'
 
 EXPORTS += [
--- a/mailnews/addrbook/src/moz.build
+++ b/mailnews/addrbook/src/moz.build
@@ -7,21 +7,28 @@ EXPORTS += [
     'nsAbDirProperty.h',
     'nsDirPrefs.h',
     'nsVCardObj.h',
 ]
 
 SOURCES += [
     'nsAbAddressCollector.cpp',
     'nsAbBooleanExpression.cpp',
+    'nsAbBoolExprToLDAPFilter.cpp',
     'nsAbCardProperty.cpp',
     'nsAbContentHandler.cpp',
     'nsAbDirectoryQuery.cpp',
     'nsAbDirectoryQueryProxy.cpp',
     'nsAbDirProperty.cpp',
+    'nsAbLDAPDirectory.cpp',
+    'nsAbLDAPDirectoryQuery.cpp',
+    'nsAbLDAPListenerBase.cpp',
+    'nsAbLDAPReplicationData.cpp',
+    'nsAbLDAPReplicationQuery.cpp',
+    'nsAbLDAPReplicationService.cpp',
     'nsAbLDIFService.cpp',
     'nsAbQueryStringToExpression.cpp',
     'nsAddbookProtocolHandler.cpp',
     'nsAddbookUrl.cpp',
     'nsAddrDatabase.cpp',
     'nsMsgVCardService.cpp',
     'nsVCard.cpp',
     'nsVCardObj.cpp',
@@ -38,36 +45,20 @@ if CONFIG['OS_ARCH'] == 'WINNT' and CONF
 
 if CONFIG['OS_ARCH'] == 'Darwin':
     SOURCES += [
         'nsAbOSXCard.mm',
         'nsAbOSXDirectory.mm',
         'nsAbOSXUtils.mm',
     ]
 
-if CONFIG['MOZ_LDAP_XPCOM']:
-    SOURCES += [
-        'nsAbBoolExprToLDAPFilter.cpp',
-        'nsAbLDAPDirectory.cpp',
-        'nsAbLDAPDirectoryQuery.cpp',
-        'nsAbLDAPListenerBase.cpp',
-        'nsAbLDAPReplicationData.cpp',
-        'nsAbLDAPReplicationQuery.cpp',
-        'nsAbLDAPReplicationService.cpp',
-    ]
-
-    EXTRA_JS_MODULES += [
-        'AbLDAPAutoCompleteSearch.jsm',
-    ]
-
-    DEFINES['MOZ_LDAP_XPCOM'] = True
-
 EXTRA_JS_MODULES += [
     'AbAutoCompleteMyDomain.jsm',
     'AbAutoCompleteSearch.jsm',
     'AbLDAPAttributeMap.jsm',
+    'AbLDAPAutoCompleteSearch.jsm',
 ]
 
 FINAL_LIBRARY = 'mail'
 
 XPCOM_MANIFESTS += [
     'components.conf',
 ]
--- a/mailnews/build/moz.build
+++ b/mailnews/build/moz.build
@@ -44,11 +44,8 @@ LOCAL_INCLUDES += [
     '../extensions/smime/src',
     '../imap/src',
     '../intl',
     '../local/src',
     '../mime/emitters',
     '../mime/src',
     '../news/src',
 ]
-
-if CONFIG['MOZ_LDAP_XPCOM']:
-    DEFINES['MOZ_LDAP_XPCOM'] = True
--- a/mailnews/build/nsMailModule.cpp
+++ b/mailnews/build/nsMailModule.cpp
@@ -120,23 +120,21 @@
 #include "nsAddbookUrl.h"
 
 #include "nsAbDirectoryQuery.h"
 #include "nsAbBooleanExpression.h"
 #include "nsAbDirectoryQueryProxy.h"
 #include "nsMsgVCardService.h"
 #include "nsAbLDIFService.h"
 
-#if defined(MOZ_LDAP_XPCOM)
-#  include "nsAbLDAPDirectory.h"
-#  include "nsAbLDAPDirectoryQuery.h"
-#  include "nsAbLDAPReplicationService.h"
-#  include "nsAbLDAPReplicationQuery.h"
-#  include "nsAbLDAPReplicationData.h"
-#endif
+#include "nsAbLDAPDirectory.h"
+#include "nsAbLDAPDirectoryQuery.h"
+#include "nsAbLDAPReplicationService.h"
+#include "nsAbLDAPReplicationQuery.h"
+#include "nsAbLDAPReplicationData.h"
 
 #if defined(MOZ_MAPI_SUPPORT)
 #  include "nsAbOutlookInterface.h"
 #  include "nsAbOutlookDirectory.h"
 #endif
 
 #ifdef XP_MACOSX
 #  include "nsAbOSXDirectory.h"
@@ -436,23 +434,21 @@ NS_GENERIC_FACTORY_CONSTRUCTOR(nsAddbook
 NS_GENERIC_FACTORY_CONSTRUCTOR(nsAbOutlookDirectory)
 NS_GENERIC_FACTORY_CONSTRUCTOR(nsAbOutlookInterface)
 #endif
 
 NS_GENERIC_FACTORY_CONSTRUCTOR(nsAbDirectoryQueryArguments)
 NS_GENERIC_FACTORY_CONSTRUCTOR(nsAbBooleanConditionString)
 NS_GENERIC_FACTORY_CONSTRUCTOR(nsAbBooleanExpression)
 
-#if defined(MOZ_LDAP_XPCOM)
 NS_GENERIC_FACTORY_CONSTRUCTOR(nsAbLDAPDirectory)
 NS_GENERIC_FACTORY_CONSTRUCTOR(nsAbLDAPDirectoryQuery)
 NS_GENERIC_FACTORY_CONSTRUCTOR(nsAbLDAPReplicationService)
 NS_GENERIC_FACTORY_CONSTRUCTOR(nsAbLDAPReplicationQuery)
 NS_GENERIC_FACTORY_CONSTRUCTOR(nsAbLDAPProcessReplicationData)
-#endif
 
 NS_GENERIC_FACTORY_CONSTRUCTOR(nsAbDirectoryQueryProxy)
 NS_GENERIC_FACTORY_CONSTRUCTOR(nsMsgVCardService)
 NS_GENERIC_FACTORY_CONSTRUCTOR(nsAbLDIFService)
 
 #ifdef XP_MACOSX
 NS_GENERIC_FACTORY_CONSTRUCTOR(nsAbOSXDirectory)
 NS_GENERIC_FACTORY_CONSTRUCTOR(nsAbOSXCard)
@@ -468,23 +464,21 @@ NS_DEFINE_NAMED_CID(NS_ABCONTENTHANDLER_
 NS_DEFINE_NAMED_CID(NS_ABDIRECTORYQUERYARGUMENTS_CID);
 NS_DEFINE_NAMED_CID(NS_BOOLEANCONDITIONSTRING_CID);
 NS_DEFINE_NAMED_CID(NS_BOOLEANEXPRESSION_CID);
 #if defined(MOZ_MAPI_SUPPORT)
 NS_DEFINE_NAMED_CID(NS_ABOUTLOOKDIRECTORY_CID);
 NS_DEFINE_NAMED_CID(NS_ABOUTLOOKINTERFACE_CID);
 #endif
 
-#if defined(MOZ_LDAP_XPCOM)
 NS_DEFINE_NAMED_CID(NS_ABLDAPDIRECTORY_CID);
 NS_DEFINE_NAMED_CID(NS_ABLDAPDIRECTORYQUERY_CID);
 NS_DEFINE_NAMED_CID(NS_ABLDAP_REPLICATIONSERVICE_CID);
 NS_DEFINE_NAMED_CID(NS_ABLDAP_REPLICATIONQUERY_CID);
 NS_DEFINE_NAMED_CID(NS_ABLDAP_PROCESSREPLICATIONDATA_CID);
-#endif
 NS_DEFINE_NAMED_CID(NS_ABDIRECTORYQUERYPROXY_CID);
 #ifdef XP_MACOSX
 NS_DEFINE_NAMED_CID(NS_ABOSXDIRECTORY_CID);
 NS_DEFINE_NAMED_CID(NS_ABOSXCARD_CID);
 #endif
 NS_DEFINE_NAMED_CID(NS_MSGVCARDSERVICE_CID);
 NS_DEFINE_NAMED_CID(NS_ABLDIFSERVICE_CID);
 
@@ -882,27 +876,25 @@ const mozilla::Module::CIDEntry kMailNew
     {&kNS_ABOUTLOOKINTERFACE_CID, false, NULL, nsAbOutlookInterfaceConstructor},
 #endif
     {&kNS_ABDIRECTORYQUERYARGUMENTS_CID, false, NULL,
      nsAbDirectoryQueryArgumentsConstructor},
     {&kNS_BOOLEANCONDITIONSTRING_CID, false, NULL,
      nsAbBooleanConditionStringConstructor},
     {&kNS_BOOLEANEXPRESSION_CID, false, NULL, nsAbBooleanExpressionConstructor},
 
-#if defined(MOZ_LDAP_XPCOM)
     {&kNS_ABLDAPDIRECTORY_CID, false, NULL, nsAbLDAPDirectoryConstructor},
     {&kNS_ABLDAPDIRECTORYQUERY_CID, false, NULL,
      nsAbLDAPDirectoryQueryConstructor},
     {&kNS_ABLDAP_REPLICATIONSERVICE_CID, false, NULL,
      nsAbLDAPReplicationServiceConstructor},
     {&kNS_ABLDAP_REPLICATIONQUERY_CID, false, NULL,
      nsAbLDAPReplicationQueryConstructor},
     {&kNS_ABLDAP_PROCESSREPLICATIONDATA_CID, false, NULL,
      nsAbLDAPProcessReplicationDataConstructor},
-#endif
     {&kNS_ABDIRECTORYQUERYPROXY_CID, false, NULL,
      nsAbDirectoryQueryProxyConstructor},
 #ifdef XP_MACOSX
     {&kNS_ABOSXDIRECTORY_CID, false, NULL, nsAbOSXDirectoryConstructor},
     {&kNS_ABOSXCARD_CID, false, NULL, nsAbOSXCardConstructor},
 #endif
     {&kNS_MSGVCARDSERVICE_CID, false, NULL, nsMsgVCardServiceConstructor},
     {&kNS_ABLDIFSERVICE_CID, false, NULL, nsAbLDIFServiceConstructor},
@@ -1115,26 +1107,23 @@ const mozilla::Module::ContractIDEntry k
     {NS_ABOUTLOOKDIRECTORY_CONTRACTID, &kNS_ABOUTLOOKDIRECTORY_CID},
     {NS_ABOUTLOOKINTERFACE_CONTRACTID, &kNS_ABOUTLOOKINTERFACE_CID},
 #endif
     {NS_ABDIRECTORYQUERYARGUMENTS_CONTRACTID,
      &kNS_ABDIRECTORYQUERYARGUMENTS_CID},
     {NS_BOOLEANCONDITIONSTRING_CONTRACTID, &kNS_BOOLEANCONDITIONSTRING_CID},
     {NS_BOOLEANEXPRESSION_CONTRACTID, &kNS_BOOLEANEXPRESSION_CID},
 
-#if defined(MOZ_LDAP_XPCOM)
     {NS_ABLDAPDIRECTORY_CONTRACTID, &kNS_ABLDAPDIRECTORY_CID},
     {NS_ABLDAPDIRECTORYQUERY_CONTRACTID, &kNS_ABLDAPDIRECTORYQUERY_CID},
     {NS_ABLDAP_REPLICATIONSERVICE_CONTRACTID,
      &kNS_ABLDAP_REPLICATIONSERVICE_CID},
     {NS_ABLDAP_REPLICATIONQUERY_CONTRACTID, &kNS_ABLDAP_REPLICATIONQUERY_CID},
     {NS_ABLDAP_PROCESSREPLICATIONDATA_CONTRACTID,
      &kNS_ABLDAP_PROCESSREPLICATIONDATA_CID},
-#endif
-
     {NS_ABDIRECTORYQUERYPROXY_CONTRACTID, &kNS_ABDIRECTORYQUERYPROXY_CID},
 #ifdef XP_MACOSX
     {NS_ABOSXDIRECTORY_CONTRACTID, &kNS_ABOSXDIRECTORY_CID},
     {NS_ABOSXCARD_CONTRACTID, &kNS_ABOSXCARD_CID},
 #endif
     {NS_MSGVCARDSERVICE_CONTRACTID, &kNS_MSGVCARDSERVICE_CID},
     {NS_ABLDIFSERVICE_CONTRACTID, &kNS_ABLDIFSERVICE_CID},
     // Bayesian Filter Entries
--- a/mailnews/mailnews.mozbuild
+++ b/mailnews/mailnews.mozbuild
@@ -1,16 +1,12 @@
 # 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/.
 
-if CONFIG['MOZ_LDAP_XPCOM']:
-    DIRS += [
-        '/%s/ldap' % CONFIG['commreltopsrcdir'],
-        '/%s/ldap/xpcom' % CONFIG['commreltopsrcdir'],
-    ]
-
 DIRS += [
+    '/%s/db' % CONFIG['commreltopsrcdir'],
+    '/%s/ldap' % CONFIG['commreltopsrcdir'],
+    '/%s/ldap/xpcom' % CONFIG['commreltopsrcdir'],
     '/%s/mailnews' % CONFIG['commreltopsrcdir'],
-    '/%s/db' % CONFIG['commreltopsrcdir'],
 ]
 
--- a/mailnews/moz.configure
+++ b/mailnews/moz.configure
@@ -1,30 +1,15 @@
 # -*- 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/.
 
 # =========================================================
-# = 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)