Bug 846540 - Emasculate comm-central/configure.in, part 1: make the subconfigures. r=Standard8, Callek
authorJoshua Cranmer <Pidgeot18@gmail.com>
Sun, 07 Apr 2013 11:32:36 -0500
changeset 13723 c845afc74ced6f27e6dd4af4f76329186613fc31
parent 13722 1d584cce7616839c52757d1d947d2216d31447a3
child 13724 6fc0ac415187cfa6d5f6ccba41d00609e3dbbc7d
push id933
push userbugzilla@standard8.plus.com
push dateMon, 13 May 2013 17:31:10 +0000
treeherdercomm-aurora@09630b06812b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersStandard8, Callek
bugs846540
Bug 846540 - Emasculate comm-central/configure.in, part 1: make the subconfigures. r=Standard8, Callek
configure.in
mail/app-config.mk
mail/configure.in
mail/confvars.sh
suite/configure.in
suite/confvars.sh
--- a/configure.in
+++ b/configure.in
@@ -3774,20 +3774,18 @@ dnl = Application
 dnl =
 dnl ========================================================
 
 MOZ_ARG_HEADER(Application)
 
 ENABLE_TESTS=1
 MOZ_BRANDING_DIRECTORY=
 MOZ_OFFICIAL_BRANDING=
-MOZ_CALENDAR=
 MOZ_FEEDS=1
 MOZ_JSDEBUGGER=1
-MOZ_LDAP_XPCOM=
 MOZ_MORK=
 MOZ_MORKREADER=1
 MOZ_AUTH_EXTENSION=1
 MOZ_NO_FAST_LOAD=
 MOZ_OGG=1
 MOZ_SYDNEYAUDIO=
 MOZ_WAVE=1
 MOZ_PANGO=1
@@ -3870,16 +3868,30 @@ fi
 AC_MSG_CHECKING([if app-specific confvars.sh exists])
 if test -f "${srcdir}/${MOZ_BUILD_APP}/confvars.sh" ; then
   AC_MSG_RESULT([${srcdir}/${MOZ_BUILD_APP}/confvars.sh])
   . "${srcdir}/${MOZ_BUILD_APP}/confvars.sh"
 else
   AC_MSG_RESULT([no])
 fi
 
+# Allow the application to provide a subconfigure script
+if test -f "${srcdir}/${MOZ_BUILD_APP}/configure.in" ; then
+  do_output_subdirs() {
+    # XXX: This will be run by mozilla's configure for LDAP for us.
+    :
+  }
+  tmpscript=`$PYTHON -c 'import os, tempfile; print tempfile.mktemp(prefix="subscript.").replace(os.sep, "/")'` || exit 1
+  m4 "${srcdir}/mozilla/build/autoconf/subconfigure.m4" \
+     "${srcdir}/mozilla/build/autoconf/altoptions.m4" \
+     "${srcdir}/${MOZ_BUILD_APP}/configure.in" > $tmpscript
+  . $tmpscript
+  rm -f $tmpscript
+fi
+
 # Special cases where we need to AC_DEFINE something. Also a holdover for apps
 # that haven't made a confvars.sh yet. Don't add new stuff here, use
 # MOZ_BUILD_APP.
 case "$MOZ_BUILD_APP" in
 suite)
   AC_DEFINE(MOZ_SUITE)
   ;;
 
@@ -4094,33 +4106,16 @@ dnl ====================================
 dnl = Localization
 dnl ========================================================
 MOZ_ARG_ENABLE_STRING(ui-locale,
 [  --enable-ui-locale=ab-CD
                           Select the user interface locale (default: en-US)],
     MOZ_UI_LOCALE=$enableval )
 AC_SUBST(MOZ_UI_LOCALE)
 
-dnl =========================================================
-dnl = Calendar client
-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)
-
 dnl ========================================================
 dnl = Trademarked Branding 
 dnl ========================================================
 MOZ_ARG_ENABLE_BOOL(official-branding,
 [  --enable-official-branding Enable Official mozilla.org Branding
                           Do not distribute builds with
                           --enable-official-branding unless you have
                           permission to use trademarks per
@@ -5755,24 +5750,16 @@ if test -n "$ENABLE_SHARED_JS"; then
 else
   MOZ_JS_LIBS=$MOZ_JS_STATIC_LIBS
   AC_DEFINE(MOZ_STATIC_JS)
 fi
 AC_SUBST(JS_SHARED_LIBRARY)
 
 XPCOM_LIBS="$LIBXUL_LIBS"
 
-MOZ_ARG_ENABLE_BOOL(incomplete-external-linkage,
-[  --enable-incomplete-external-linkage Changes some comm-central code to be built with external linkage. Developer only option, incomplete broken builds will result - There are already existing bugs for this. ],
-    MOZ_INCOMPLETE_EXTERNAL_LINKAGE=1,
-    MOZ_INCOMPLETE_EXTERNAL_LINKAGE= )
-
-export MOZ_INCOMPLETE_EXTERNAL_LINKAGE
-AC_SUBST(MOZ_INCOMPLETE_EXTERNAL_LINKAGE)
-
 dnl ========================================================
 dnl =
 dnl = Standalone module options
 dnl = 
 dnl ========================================================
 MOZ_ARG_HEADER(Standalone module options (Not for building Mozilla))
 
 dnl Check for GLib.
@@ -5908,32 +5895,16 @@ MOZ_ARG_DISABLE_BOOL(ctypes,
 [  --disable-ctypes        Disable js-ctypes],
     BUILD_CTYPES=,
     BUILD_CTYPES=1)
 AC_SUBST(BUILD_CTYPES)
 if test "$BUILD_CTYPES"; then
     AC_DEFINE(BUILD_CTYPES)
 fi
 
-dnl Only build Mork if it's required
-AC_SUBST(MOZ_MORK)
-if test "$MOZ_MORK"; then
-  AC_DEFINE(MOZ_MORK)
-  MORK_COMPONENT=mork
-  export MORK_COMPONENT
-  MORK_MODULE="MODULE(nsMorkModule)"
-  export MORK_MODULE
-fi
-
-dnl Build the lightweight Mork reader if required
-AC_SUBST(MOZ_MORKREADER)
-if test "$MOZ_MORKREADER"; then
-  AC_DEFINE(MOZ_MORKREADER)
-fi
-
 AC_SUBST(MOZ_PLACES)
 if test "$MOZ_PLACES"; then
   AC_DEFINE(MOZ_PLACES)
 fi
 
 dnl Build Apps in the Cloud (AITC) if required
 AC_SUBST(MOZ_SERVICES_AITC)
 if test -n "$MOZ_SERVICES_AITC"; then
@@ -5964,47 +5935,16 @@ if test -n "$MOZ_SERVICES_SYNC"; then
   AC_DEFINE(MOZ_SERVICES_SYNC)
 fi
 
 dnl ========================================================
 if test "$MOZ_DEBUG" -o "$NS_TRACE_MALLOC"; then
     MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS=
 fi
 
-if test "$MOZ_LDAP_XPCOM"; then
-    MOZ_ARG_ENABLE_BOOL(incomplete-toolkit-ldap-autocomplete,
-    [  --enable-incomplete-toolkit-ldap-autocomplete Builds a JavaScript component that implements an LDAP autocomplete component using the toolkit interfaces rather than the C++ component using the obsolete XPFE interfaces. ],
-        MOZ_INCOMPLETE_TOOLKIT_LDAP_AUTOCOMPLETE=1,
-        MOZ_INCOMPLETE_TOOLKIT_LDAP_AUTOCOMPLETE= )
-
-    LDAP_CFLAGS='-I${DIST}/public/ldap'
-    if test "$OS_ARCH" = "WINNT"; then
-        if test -n "$GNU_CC"; then
-            LDAP_LIBS='-L$(DIST)/lib -lnsldap32v60 -lnsldappr32v60 -lnsldif32v60'
-        else
-            LDAP_LIBS='$(DIST)/lib/$(LIB_PREFIX)nsldap32v60.${IMPORT_LIB_SUFFIX} $(DIST)/lib/$(LIB_PREFIX)nsldappr32v60.${IMPORT_LIB_SUFFIX} $(DIST)/lib/$(LIB_PREFIX)nsldif32v60.${IMPORT_LIB_SUFFIX}'
-        fi
-    elif test "$OS_ARCH" = "OS2"; then
-            LDAP_LIBS='$(DIST)/lib/$(LIB_PREFIX)ldap60.${IMPORT_LIB_SUFFIX} $(DIST)/lib/$(LIB_PREFIX)prldap60.${IMPORT_LIB_SUFFIX} $(DIST)/lib/$(LIB_PREFIX)ldif60.${IMPORT_LIB_SUFFIX}'
-    else
-        LDAP_LIBS='-L${DIST}/bin -L${DIST}/lib -lldap60 -lprldap60 -lldif60'
-    fi
-
-    dnl export LDAP_LIBS so that confvars.sh can pick it up, so when we get to
-    dnl linking libxul in the mozilla-central build system, we'll have the LDAP
-    dnl LIBS
-    export LDAP_LIBS
-    LDAP_COMPONENT=mozldap
-    export LDAP_COMPONENT
-    LDAP_MODULE="MODULE(nsLDAPProtocolModule)"
-    export LDAP_MODULE
-fi
-AC_SUBST(MOZ_INCOMPLETE_TOOLKIT_LDAP_AUTOCOMPLETE)
-
-
 dnl ========================================================
 dnl =
 dnl = Maintainer debug option (no --enable equivalent)
 dnl =
 dnl ========================================================
 
 AC_SUBST(AR)
 AC_SUBST(AR_FLAGS)
@@ -6041,19 +5981,16 @@ AC_SUBST(MOZ_DEBUG_LDFLAGS)
 AC_SUBST(WARNINGS_AS_ERRORS)
 AC_SUBST(MOZ_JSDEBUGGER)
 AC_SUBST(MOZ_PLUGINS)
 AC_SUBST(MOZ_LOG_REFCNT)
 AC_SUBST(MOZ_ENABLE_PROFILER_SPS)
 AC_SUBST(MOZ_JPROF)
 AC_SUBST(MOZ_SHARK)
 AC_SUBST(MOZ_PROFILING)
-AC_SUBST(MOZ_LDAP_XPCOM)
-AC_SUBST(LDAP_CFLAGS)
-AC_SUBST(LDAP_LIBS)
 AC_SUBST(LIBICONV)
 AC_SUBST(MOZ_PLACES_BOOKMARKS)
 AC_SUBST(MOZ_STORAGE)
 AC_SUBST(MOZ_FEEDS)
 AC_SUBST(NS_PRINTING)
 AC_SUBST(MOZ_HELP_VIEWER)
 
 AC_SUBST(MOZ_PROFILELOCKING)
@@ -6307,23 +6244,20 @@ fi # MOZ_X11
 fi # COMPILE_ENVIRONMENT
 
 dnl Set various defines and substitutions
 dnl ========================================================
 
 if test "$OS_ARCH" = "Darwin"; then
   AC_DEFINE(XP_UNIX)
   AC_DEFINE(UNIX_ASYNC_DNS)
-  MOZ_MOVEMAIL=1
 elif test "$OS_ARCH" != "WINNT" -a "$OS_ARCH" != "OS2"; then
   AC_DEFINE(XP_UNIX)
   AC_DEFINE(UNIX_ASYNC_DNS)
-  MOZ_MOVEMAIL=1
-fi
-AC_SUBST(MOZ_MOVEMAIL)
+fi
 
 if test "$ACCESSIBILITY" -a "$MOZ_ENABLE_GTK2" ; then
     AC_DEFINE(MOZ_ACCESSIBILITY_ATK)
     ATK_FULL_VERSION=`$PKG_CONFIG --modversion atk`
     ATK_MAJOR_VERSION=`echo ${ATK_FULL_VERSION} | $AWK -F\. '{ print $1 }'`
     ATK_MINOR_VERSION=`echo ${ATK_FULL_VERSION} | $AWK -F\. '{ print $2 }'`
     ATK_REV_VERSION=`echo ${ATK_FULL_VERSION} | $AWK -F\. '{ print $3 }'`
     AC_DEFINE_UNQUOTED(ATK_MAJOR_VERSION, $ATK_MAJOR_VERSION)
@@ -6443,38 +6377,8 @@ fi
 MOZ_BUILD_APP_CACHED="$MOZ_BUILD_APP"
 if test -n "$MOZ_CURRENT_PROJECT"; then
     export MOZ_BUILD_APP="$MOZ_CURRENT_PROJECT"
 fi
 
 AC_OUTPUT_SUBDIRS(mozilla)
 ac_configure_args="$_SUBDIR_CONFIG_ARGS"
 MOZ_BUILD_APP="$MOZ_BUILD_APP_CACHED"
-
-# if we're building the LDAP XPCOM component, we need to build 
-# the c-sdk first.  
-if test -n "$COMPILE_ENVIRONMENT" -a -n "$MOZ_LDAP_XPCOM"; then
-    # these subdirs may not yet have been created in the build tree.
-    # don't use the "-p" switch to mkdir, since not all platforms have it
-    if test ! -d "ldap/sdks/c-sdk/ldap"; then
-        if test ! -d "ldap/sdks/c-sdk"; then
-            if test ! -d "ldap/sdks"; then
-                if test ! -d "ldap"; then
-                    mkdir "ldap"
-                fi
-                mkdir "ldap/sdks"
-            fi
-            mkdir "ldap/sdks/c-sdk"
-        fi
-        mkdir "ldap/sdks/c-sdk/ldap"
-    fi
-
-    ac_configure_args="$_SUBDIR_CONFIG_ARGS --prefix=$MOZ_BUILD_ROOT/mozilla/dist --with-dist-prefix=$MOZ_BUILD_ROOT/mozilla/dist --without-nss --with-mozilla"
-    if test -n "$HAVE_64BIT_OS"; then
-        dnl A 64-bit OS was (auto-)detected: (explicitly) enable 64-bit support.
-        ac_configure_args="$ac_configure_args --enable-64bit"
-    fi
-    if test -n "$LIBXUL_SDK"; then
-        ac_configure_args="$ac_configure_args --with-nspr=$LIBXUL_DIST"
-    fi
-    AC_OUTPUT_SUBDIRS(ldap/sdks/c-sdk)
-    ac_configure_args="$_SUBDIR_CONFIG_ARGS"
-fi # COMPILE_ENVIRONMENT && MOZ_LDAP_XPCOM
--- a/mail/app-config.mk
+++ b/mail/app-config.mk
@@ -1,10 +1,12 @@
 # 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/.
 
 MOZ_THUNDERBIRD = 1
 DEFINES += -DMOZ_THUNDERBIRD=1
 
+ifdef COMM_BUILD
 ifdef MOZ_CALENDAR
 include $(topsrcdir)/calendar/lightning/app-config.mk
 endif
+endif
new file mode 100644
--- /dev/null
+++ b/mail/configure.in
@@ -0,0 +1,148 @@
+dnl -*- Mode: Autoconf; tab-width: 2; indent-tabs-mode: nil; -*-
+dnl vi: set tabstop=2 shiftwidth=2 expandtab:
+dnl This Source Code Form is subject to the terms of the Mozilla Public
+dnl License, v. 2.0. If a copy of the MPL was not distributed with this
+dnl file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+dnl Things we need to carry from confvars.sh
+AC_DEFINE(MOZ_THUNDERBIRD)
+AC_SUBST(MOZ_THUNDERBIRD)
+AC_SUBST(MOZ_COMPOSER)
+AC_SUBST(THUNDERBIRD_VERSION)
+
+dnl Optional parts of the build.
+AC_SUBST(MOZ_MORK)
+if test "$MOZ_MORK"; then
+  AC_DEFINE(MOZ_MORK)
+  MORK_COMPONENT=mork
+  MORK_MODULE="MODULE(nsMorkModule)"
+fi
+if test "$OS_ARCH" != "WINNT" -a "$OS_ARCH" != "OS2"; then
+  MOZ_MOVEMAIL=1
+fi
+AC_SUBST(MOZ_MOVEMAIL)
+
+dnl Get other versions (for the calendar plugin)
+if test "$COMM_BUILD" = "1"; then
+  commdir=$topsrcdir
+else
+  commdir=$topsrcdir/..
+fi
+SUNBIRD_VERSION=`cat $commdir/calendar/sunbird/config/version.txt`
+SEAMONKEY_VERSION=`cat $commdir/suite/config/version.txt`
+AC_SUBST(SUNBIRD_VERSION)
+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)
+
+MOZ_ARG_ENABLE_BOOL(incomplete-external-linkage,
+[  --enable-incomplete-external-linkage Changes some comm-central code to be built with external linkage. Developer only option, incomplete broken builds will result - There are already existing bugs for this. ],
+    MOZ_INCOMPLETE_EXTERNAL_LINKAGE=1,
+    MOZ_INCOMPLETE_EXTERNAL_LINKAGE= )
+
+export MOZ_INCOMPLETE_EXTERNAL_LINKAGE
+AC_SUBST(MOZ_INCOMPLETE_EXTERNAL_LINKAGE)
+
+dnl =========================================================
+dnl = LDAP
+dnl =========================================================
+MOZ_ARG_DISABLE_BOOL(ldap,
+[  --disable-ldap          Disable LDAP support],
+    MOZ_LDAP_XPCOM=,
+    MOZ_LDAP_XPCOM=1)
+
+if test "$MOZ_LDAP_XPCOM"; then
+    MOZ_ARG_ENABLE_BOOL(incomplete-toolkit-ldap-autocomplete,
+    [  --enable-incomplete-toolkit-ldap-autocomplete Builds a JavaScript component that implements an LDAP autocomplete component using the toolkit interfaces rather than the C++ component using the obsolete XPFE interfaces. ],
+        MOZ_INCOMPLETE_TOOLKIT_LDAP_AUTOCOMPLETE=1,
+        MOZ_INCOMPLETE_TOOLKIT_LDAP_AUTOCOMPLETE= )
+
+    LDAP_CFLAGS='-I${DIST}/public/ldap'
+    if test "$OS_ARCH" = "WINNT"; then
+        if test -n "$GNU_CC"; then
+            LDAP_LIBS='-L$(DIST)/lib -lnsldap32v60 -lnsldappr32v60 -lnsldif32v60'
+        else
+            LDAP_LIBS='$(DIST)/lib/$(LIB_PREFIX)nsldap32v60.${IMPORT_LIB_SUFFIX} $(DIST)/lib/$(LIB_PREFIX)nsldappr32v60.${IMPORT_LIB_SUFFIX} $(DIST)/lib/$(LIB_PREFIX)nsldif32v60.${IMPORT_LIB_SUFFIX}'
+        fi
+    elif test "$OS_ARCH" = "OS2"; then
+            LDAP_LIBS='$(DIST)/lib/$(LIB_PREFIX)ldap60.${IMPORT_LIB_SUFFIX} $(DIST)/lib/$(LIB_PREFIX)prldap60.${IMPORT_LIB_SUFFIX} $(DIST)/lib/$(LIB_PREFIX)ldif60.${IMPORT_LIB_SUFFIX}'
+    else
+        LDAP_LIBS='-L${DIST}/bin -L${DIST}/lib -lldap60 -lprldap60 -lldif60'
+    fi
+
+    dnl export LDAP_LIBS so that confvars.sh can pick it up, so when we get to
+    dnl linking libxul in the mozilla-central build system, we'll have the LDAP
+    dnl LIBS
+    export LDAP_LIBS
+    LDAP_COMPONENT=mozldap
+    export LDAP_COMPONENT
+    LDAP_MODULE="MODULE(nsLDAPProtocolModule)"
+    export LDAP_MODULE
+fi
+AC_SUBST(MOZ_INCOMPLETE_TOOLKIT_LDAP_AUTOCOMPLETE)
+
+AC_SUBST(MOZ_LDAP_XPCOM)
+AC_SUBST(LDAP_CFLAGS)
+AC_SUBST(LDAP_LIBS)
+
+# Rerun the confvars, since we need to add to our components list.
+. "${srcdir}/${MOZ_BUILD_APP}/confvars.sh"
+
+# Check for PBBUILD on OS X.
+case "$target_os" in
+darwin*)
+  for name in pbbuild xcodebuild pbxbuild; do
+    PBBUILD_BIN=`which $name`
+    test -n "$PBBUILD_BIN" && break
+  done
+  AC_SUBST(PBBUILD_BIN)
+  ;;
+esac
+
+# if we're building the LDAP XPCOM component, we need to build
+# the c-sdk first.
+if test -n "$COMPILE_ENVIRONMENT" -a -n "$MOZ_LDAP_XPCOM"; then
+    # Save configure args so we can restore them after configuring LDAP.
+    _save_ac_configure_args="$ac_configure_args"
+    ac_configure_args="$_SUBDIR_CONFIG_ARGS"
+
+    mkdir -p ../ldap/sdks/c-sdk/ldap
+    # these subdirs may not yet have been created in the build tree.
+    # don't use the "-p" switch to mkdir, since not all platforms have it
+    if test ! -d "ldap/sdks/c-sdk/ldap"; then
+        if test ! -d "ldap/sdks/c-sdk"; then
+            if test ! -d "ldap/sdks"; then
+                if test ! -d "ldap"; then
+                    mkdir "ldap"
+                fi
+                mkdir "ldap/sdks"
+            fi
+            mkdir "ldap/sdks/c-sdk"
+        fi
+        mkdir "ldap/sdks/c-sdk/ldap"
+    fi
+
+    ac_configure_args="$_SUBDIR_CONFIG_ARGS --prefix=$MOZ_BUILD_ROOT/dist --with-dist-prefix=$MOZ_BUILD_ROOT/dist --without-nss --with-mozilla"
+    if test -n "$HAVE_64BIT_OS"; then
+        dnl A 64-bit OS was (auto-)detected: (explicitly) enable 64-bit support.
+        ac_configure_args="$ac_configure_args --enable-64bit"
+    fi
+    if test -n "$LIBXUL_SDK"; then
+        ac_configure_args="$ac_configure_args --with-nspr=$LIBXUL_DIST"
+    fi
+
+    dnl The cache file needs to be an absolute path to work properly.
+    cache_file_base=`dirname $cache_file`
+    cache_file=`cd $cache_file_base && pwd`/`basename $cache_file`
+
+    AC_OUTPUT_SUBDIRS(../ldap/sdks/c-sdk)
+    ac_configure_args="$_save_ac_configure_args"
+fi # COMPILE_ENVIRONMENT && MOZ_LDAP_XPCOM
+
--- a/mail/confvars.sh
+++ b/mail/confvars.sh
@@ -5,33 +5,37 @@
 
 MOZ_APP_BASENAME=Thunderbird
 MOZ_APP_NAME=thunderbird
 MOZ_UPDATER=1
 MOZ_THUNDERBIRD=1
 MOZ_CHROME_FILE_FORMAT=omni
 MOZ_NO_ACTIVEX_SUPPORT=1
 MOZ_ACTIVEX_SCRIPTING_SUPPORT=
-if [ "$COMM_BUILD" ]; then
-  MOZ_LDAP_XPCOM=1
-fi
+MOZ_LDAP_XPCOM=1
 MOZ_COMPOSER=1
 if test "$OS_ARCH" = "WINNT"; then
   if ! test "$HAVE_64BIT_OS"; then
     MOZ_VERIFY_MAR_SIGNATURE=1
     MOZ_MAINTENANCE_SERVICE=1
   fi
 fi
 
 # Disable WebRTC as we don't use it currently and to work around bug 837618
 # for Mac
 MOZ_WEBRTC=
 
 MOZ_SAFE_BROWSING=1
 MOZ_MORK=1
+MAIL_COMPONENT="mail msgsmime import"
+MAIL_MODULE="MODULE(nsMailModule) MODULE(nsMsgSMIMEModule) MODULE(nsImportServiceModule)"
+if test -n "$_WIN32_MSVC"; then
+  MAIL_COMPONENT="$MAIL_COMPONENT msgMapi"
+  MAIL_MODULE="$MAIL_MODULE MODULE(msgMapiModule)"
+fi
 if test -z "$MOZ_INCOMPLETE_EXTERNAL_LINKAGE"; then
 MOZ_APP_COMPONENT_LIBS="xpautocomplete mailcomps $MAIL_COMPONENT $LDAP_COMPONENT $MORK_COMPONENT"
 MOZ_APP_COMPONENT_MODULES="MODULE(xpAutoComplete) MODULE(nsMailCompsModule) $MAIL_MODULE $LDAP_MODULE $MORK_MODULE"
 MOZ_APP_EXTRA_LIBS="$LDAP_LIBS"
 fi
 
 MOZ_APP_VERSION_TXT=${_topsrcdir}/$MOZ_BUILD_APP/config/version.txt
 MOZ_APP_VERSION=`cat $MOZ_APP_VERSION_TXT`
new file mode 100644
--- /dev/null
+++ b/suite/configure.in
@@ -0,0 +1,137 @@
+dnl -*- Mode: Autoconf; tab-width: 2; indent-tabs-mode: nil; -*-
+dnl vi: set tabstop=2 shiftwidth=2 expandtab:
+dnl This Source Code Form is subject to the terms of the Mozilla Public
+dnl License, v. 2.0. If a copy of the MPL was not distributed with this
+dnl file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+dnl Things we need to carry from confvars.sh
+AC_DEFINE(MOZ_SUITE)
+AC_SUBST(MOZ_SUITE)
+AC_SUBST(MOZ_COMPOSER)
+AC_SUBST(SUITE_VERSION)
+
+dnl Optional parts of the build.
+AC_SUBST(MOZ_MORK)
+if test "$MOZ_MORK"; then
+  AC_DEFINE(MOZ_MORK)
+  MORK_COMPONENT=mork
+  MORK_MODULE="MODULE(nsMorkModule)"
+fi
+if test "$OS_ARCH" != "WINNT" -a "$OS_ARCH" != "OS2"; then
+  MOZ_MOVEMAIL=1
+fi
+AC_SUBST(MOZ_MOVEMAIL)
+
+dnl Get other versions (for the calendar plugin)
+if test "$COMM_BUILD" = "1"; then
+  commdir=$topsrcdir
+else
+  commdir=$topsrcdir/..
+fi
+SUNBIRD_VERSION=`cat $commdir/calendar/sunbird/config/version.txt`
+THUNDERBIRD_VERSION=`cat $commdir/mail/config/version.txt`
+AC_SUBST(SUNBIRD_VERSION)
+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)
+
+MOZ_ARG_ENABLE_BOOL(incomplete-external-linkage,
+[  --enable-incomplete-external-linkage Changes some comm-central code to be built with external linkage. Developer only option, incomplete broken builds will result - There are already existing bugs for this. ],
+    MOZ_INCOMPLETE_EXTERNAL_LINKAGE=1,
+    MOZ_INCOMPLETE_EXTERNAL_LINKAGE= )
+
+export MOZ_INCOMPLETE_EXTERNAL_LINKAGE
+AC_SUBST(MOZ_INCOMPLETE_EXTERNAL_LINKAGE)
+
+dnl =========================================================
+dnl = LDAP
+dnl =========================================================
+MOZ_ARG_DISABLE_BOOL(ldap,
+[  --disable-ldap          Disable LDAP support],
+    MOZ_LDAP_XPCOM=,
+    MOZ_LDAP_XPCOM=1)
+
+if test "$MOZ_LDAP_XPCOM"; then
+    MOZ_ARG_ENABLE_BOOL(incomplete-toolkit-ldap-autocomplete,
+    [  --enable-incomplete-toolkit-ldap-autocomplete Builds a JavaScript component that implements an LDAP autocomplete component using the toolkit interfaces rather than the C++ component using the obsolete XPFE interfaces. ],
+        MOZ_INCOMPLETE_TOOLKIT_LDAP_AUTOCOMPLETE=1,
+        MOZ_INCOMPLETE_TOOLKIT_LDAP_AUTOCOMPLETE= )
+
+    LDAP_CFLAGS='-I${DIST}/public/ldap'
+    if test "$OS_ARCH" = "WINNT"; then
+        if test -n "$GNU_CC"; then
+            LDAP_LIBS='-L$(DIST)/lib -lnsldap32v60 -lnsldappr32v60 -lnsldif32v60'
+        else
+            LDAP_LIBS='$(DIST)/lib/$(LIB_PREFIX)nsldap32v60.${IMPORT_LIB_SUFFIX} $(DIST)/lib/$(LIB_PREFIX)nsldappr32v60.${IMPORT_LIB_SUFFIX} $(DIST)/lib/$(LIB_PREFIX)nsldif32v60.${IMPORT_LIB_SUFFIX}'
+        fi
+    elif test "$OS_ARCH" = "OS2"; then
+            LDAP_LIBS='$(DIST)/lib/$(LIB_PREFIX)ldap60.${IMPORT_LIB_SUFFIX} $(DIST)/lib/$(LIB_PREFIX)prldap60.${IMPORT_LIB_SUFFIX} $(DIST)/lib/$(LIB_PREFIX)ldif60.${IMPORT_LIB_SUFFIX}'
+    else
+        LDAP_LIBS='-L${DIST}/bin -L${DIST}/lib -lldap60 -lprldap60 -lldif60'
+    fi
+
+    dnl export LDAP_LIBS so that confvars.sh can pick it up, so when we get to
+    dnl linking libxul in the mozilla-central build system, we'll have the LDAP
+    dnl LIBS
+    export LDAP_LIBS
+    LDAP_COMPONENT=mozldap
+    export LDAP_COMPONENT
+    LDAP_MODULE="MODULE(nsLDAPProtocolModule)"
+    export LDAP_MODULE
+fi
+AC_SUBST(MOZ_INCOMPLETE_TOOLKIT_LDAP_AUTOCOMPLETE)
+
+AC_SUBST(MOZ_LDAP_XPCOM)
+AC_SUBST(LDAP_CFLAGS)
+AC_SUBST(LDAP_LIBS)
+
+# Rerun the confvars, since we need to add to our components list.
+. "${srcdir}/${MOZ_BUILD_APP}/confvars.sh"
+
+# if we're building the LDAP XPCOM component, we need to build
+# the c-sdk first.
+if test -n "$COMPILE_ENVIRONMENT" -a -n "$MOZ_LDAP_XPCOM"; then
+    # Save configure args so we can restore them after configuring LDAP.
+    _save_ac_configure_args="$ac_configure_args"
+    ac_configure_args="$_SUBDIR_CONFIG_ARGS"
+
+    mkdir -p ../ldap/sdks/c-sdk/ldap
+    # these subdirs may not yet have been created in the build tree.
+    # don't use the "-p" switch to mkdir, since not all platforms have it
+    if test ! -d "ldap/sdks/c-sdk/ldap"; then
+        if test ! -d "ldap/sdks/c-sdk"; then
+            if test ! -d "ldap/sdks"; then
+                if test ! -d "ldap"; then
+                    mkdir "ldap"
+                fi
+                mkdir "ldap/sdks"
+            fi
+            mkdir "ldap/sdks/c-sdk"
+        fi
+        mkdir "ldap/sdks/c-sdk/ldap"
+    fi
+
+    ac_configure_args="$_SUBDIR_CONFIG_ARGS --prefix=$MOZ_BUILD_ROOT/dist --with-dist-prefix=$MOZ_BUILD_ROOT/dist --without-nss --with-mozilla"
+    if test -n "$HAVE_64BIT_OS"; then
+        dnl A 64-bit OS was (auto-)detected: (explicitly) enable 64-bit support.
+        ac_configure_args="$ac_configure_args --enable-64bit"
+    fi
+    if test -n "$LIBXUL_SDK"; then
+        ac_configure_args="$ac_configure_args --with-nspr=$LIBXUL_DIST"
+    fi
+
+    dnl The cache file needs to be an absolute path to work properly.
+    cache_file_base=`dirname $cache_file`
+    cache_file=`cd $cache_file_base && pwd`/`basename $cache_file`
+
+    AC_OUTPUT_SUBDIRS(../ldap/sdks/c-sdk)
+    ac_configure_args="$_save_ac_configure_args"
+fi # COMPILE_ENVIRONMENT && MOZ_LDAP_XPCOM
+
--- a/suite/confvars.sh
+++ b/suite/confvars.sh
@@ -2,19 +2,17 @@
 # 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/.
 
 MOZ_APP_BASENAME=SeaMonkey
 MOZ_APP_VENDOR=Mozilla
 MOZ_APP_NAME=seamonkey
 MOZ_APP_DISPLAYNAME=SeaMonkey
-if [ "$COMM_BUILD" ]; then
-  MOZ_LDAP_XPCOM=1
-fi
+MOZ_LDAP_XPCOM=1
 MOZ_CHROME_FILE_FORMAT=omni
 MOZ_COMPOSER=1
 MOZ_SUITE=1
 MOZ_BRANDING_DIRECTORY=suite/branding/nightly
 MOZ_OFFICIAL_BRANDING_DIRECTORY=suite/branding/nightly
 MOZ_EXTENSIONS_DEFAULT=" venkman inspector irc gnomevfs"
 MOZ_UPDATER=1
 # This should usually be the same as the value MAR_CHANNEL_ID.
@@ -22,16 +20,22 @@ MOZ_UPDATER=1
 # of values.
 ACCEPTED_MAR_CHANNEL_IDS=seamonkey-comm-central
 # The MAR_CHANNEL_ID must not contain the following 3 characters: ",\t "
 MAR_CHANNEL_ID=seamonkey-comm-central
 MOZ_HELP_VIEWER=1
 MOZ_MEDIA_NAVIGATOR=1
 MOZ_MORK=1
 MOZ_STATIC_BUILD_UNSUPPORTED=1
+MAIL_COMPONENT="mail msgsmime import"
+MAIL_MODULE="MODULE(nsMailModule) MODULE(nsMsgSMIMEModule) MODULE(nsImportServiceModule)"
+if test -n "$_WIN32_MSVC"; then
+  MAIL_COMPONENT="$MAIL_COMPONENT msgMapi"
+  MAIL_MODULE="$MAIL_MODULE MODULE(msgMapiModule)"
+fi
 if test -z "$MOZ_INCOMPLETE_EXTERNAL_LINKAGE"; then
 MOZ_APP_COMPONENT_LIBS="xpautocomplete $MAIL_COMPONENT $LDAP_COMPONENT $MORK_COMPONENT"
 MOZ_APP_COMPONENT_MODULES="MODULE(xpAutoComplete) $MAIL_MODULE $LDAP_MODULE $MORK_MODULE"
 MOZ_APP_EXTRA_LIBS="$LDAP_LIBS"
 fi
 MOZ_SERVICES_COMMON=1
 MOZ_SERVICES_CRYPTO=1
 MOZ_SERVICES_SYNC=1