Bug 707305 Make --enable-incomplete-external-linkage work without --with-libxul-sdk r=Callek
--- a/Makefile.in
+++ b/Makefile.in
@@ -55,23 +55,16 @@ default::
ifdef COMPILE_ENVIRONMENT
include $(topsrcdir)/$(MOZ_BUILD_APP)/build.mk
endif
include $(topsrcdir)/config/config.mk
default alldep all:: $(topsrcdir)/configure config.status
-ifndef INCLUDED_BRIDGE_MK
-include $(topsrcdir)/bridge/bridge.mk
-endif
-
-# workaround Bug 599809 by making these makefiles be generated here
-SUBMAKEFILES += $(addsuffix /Makefile, $(APP_LIBXUL_DIRS) $(APP_LIBXUL_STATICDIRS))
-
$(topsrcdir)/configure: $(topsrcdir)/configure.in
@echo "STOP! configure.in has changed, and your configure is out of date."
@echo "Please rerun autoconf and configure."
@echo "To ignore this message, touch 'configure' in the source directory."
@exit 1
config.status: $(topsrcdir)/configure
@echo "STOP! configure has changed and needs to be run in this build directory."
--- a/bridge/bridge.mk
+++ b/bridge/bridge.mk
@@ -29,26 +29,24 @@
# use your version of this file under the terms of the MPL, indicate your
# decision by deleting the provisions above and replace them with the notice
# and other provisions required by the GPL or the LGPL. If you do not delete
# the provisions above, a recipient may use your version of this file under
# the terms of any one of the MPL, the GPL or the LGPL.
#
# ***** END LICENSE BLOCK *****
-INCLUDED_BRIDGE_MK = 1
-
APP_LIBXUL_DIRS += $(DEPTH)$(SUBDIR)/mozilla/xpfe/components/autocomplete
-#ifdef MOZ_LDAP_XPCOM
+ifneq (,$(MOZ_LDAP_XPCOM)$(filter mozldap,$(MOZ_APP_COMPONENT_LIBS)))
APP_LIBXUL_STATICDIRS += $(DEPTH)$(SUBDIR)/ldap/sdks/c-sdk
APP_LIBXUL_DIRS += $(DEPTH)$(SUBDIR)/ldap/xpcom
-#endif
+endif
-#ifdef MOZ_MORK
+ifneq (,$(MOZ_MORK)$(filter mork,$(MOZ_APP_COMPONENT_LIBS)))
APP_LIBXUL_DIRS += $(DEPTH)$(SUBDIR)/db/mork
-#endif
+endif
APP_LIBXUL_DIRS += \
$(DEPTH)$(SUBDIR)/mailnews/base \
$(DEPTH)$(SUBDIR)/mailnews/mime/public \
$(DEPTH)$(SUBDIR)/mailnews \
$(NULL)
--- a/configure.in
+++ b/configure.in
@@ -6501,16 +6501,17 @@ 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))
--- a/mail/Makefile.in
+++ b/mail/Makefile.in
@@ -40,16 +40,21 @@ topsrcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@
include $(topsrcdir)/config/config.mk
# app is always last as it packages up the built files on mac
DIRS += base locales extensions steel themes jquery app
+# add components for external linkage build
+ifdef MOZ_INCOMPLETE_EXTERNAL_LINKAGE
+DIRS += components
+endif
+
ifeq ($(OS_ARCH),WINNT)
# though some lasts are more last than others
DIRS += installer/windows
endif
ifdef ENABLE_TESTS
DIRS += test/mozmill
endif
--- a/mail/build.mk
+++ b/mail/build.mk
@@ -32,39 +32,47 @@
# and other provisions required by the GPL or the LGPL. If you do not delete
# the provisions above, a recipient may use your version of this file under
# the terms of any one of the MPL, the GPL or the LGPL.
#
# ***** END LICENSE BLOCK *****
ifndef COMM_BUILD # Mozilla Makefile
+ifdef MOZ_APP_COMPONENT_LIBS
SUBDIR=/..
include $(topsrcdir)/../bridge/bridge.mk
# For libxul builds this gets linked into libxul. For non-libxul
# builds, the build of components is controlled in mail/Makefile.in
APP_LIBXUL_DIRS += $(DEPTH)/../mail/components
+endif
ifndef LIBXUL_SDK
include $(topsrcdir)/toolkit/toolkit-tiers.mk
-else
-tier_app_staticdirs += $(APP_LIBXUL_STATICDIRS)
-tier_app_dirs += $(APP_LIBXUL_DIRS)
endif
TIERS += app
ifdef MOZ_EXTENSIONS
tier_app_dirs += extensions
endif
else # toplevel Makefile
TIERS += app
+include $(topsrcdir)/bridge/bridge.mk
+ifdef MOZ_INCOMPLETE_EXTERNAL_LINKAGE
+tier_app_staticdirs += $(APP_LIBXUL_STATICDIRS:./%=%)
+tier_app_dirs += $(APP_LIBXUL_DIRS:./%=%)
+else
+# workaround Bug 599809 by making these makefiles be generated here
+SUBMAKEFILES += $(addsuffix /Makefile, $(APP_LIBXUL_DIRS) $(APP_LIBXUL_STATICDIRS))
+endif
+
ifdef MOZ_COMPOSER
tier_app_dirs += editor/ui
endif
tier_app_dirs += $(MOZ_BRANDING_DIRECTORY)
ifdef MOZ_CALENDAR
tier_app_dirs += calendar/lightning
--- a/mail/confvars.sh
+++ b/mail/confvars.sh
@@ -43,18 +43,20 @@ MOZ_CHROME_FILE_FORMAT=omni
MOZ_NO_ACTIVEX_SUPPORT=1
MOZ_ACTIVEX_SCRIPTING_SUPPORT=
if [ "$COMM_BUILD" ]; then
MOZ_LDAP_XPCOM=1
fi
MOZ_COMPOSER=1
MOZ_SAFE_BROWSING=1
MOZ_MORK=1
+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`
THUNDERBIRD_VERSION=$MOZ_APP_VERSION
MOZ_BRANDING_DIRECTORY=mail/branding/nightly
MOZ_OFFICIAL_BRANDING_DIRECTORY=other-licenses/branding/thunderbird
--- a/suite/build.mk
+++ b/suite/build.mk
@@ -32,18 +32,20 @@
# and other provisions required by the GPL or the LGPL. If you do not delete
# the provisions above, a recipient may use your version of this file under
# the terms of any one of the MPL, the GPL or the LGPL.
#
# ***** END LICENSE BLOCK *****
ifndef COMM_BUILD # Mozilla Makefile
+ifdef MOZ_APP_COMPONENT_LIBS
SUBDIR=/..
include $(topsrcdir)/../bridge/bridge.mk
+endif
ifndef LIBXUL_SDK
include $(topsrcdir)/toolkit/toolkit-tiers.mk
endif
TIERS += app
ifdef MOZ_EXTENSIONS
@@ -51,16 +53,25 @@ tier_app_dirs += extensions
endif
tier_app_dirs += services
else # toplevel Makefile
TIERS += app
+include $(topsrcdir)/bridge/bridge.mk
+ifdef MOZ_INCOMPLETE_EXTERNAL_LINKAGE
+tier_app_staticdirs += $(APP_LIBXUL_STATICDIRS:./%=%)
+tier_app_dirs += $(APP_LIBXUL_DIRS:./%=%)
+else
+# workaround Bug 599809 by making these makefiles be generated here
+SUBMAKEFILES += $(addsuffix /Makefile, $(APP_LIBXUL_DIRS) $(APP_LIBXUL_STATICDIRS))
+endif
+
ifdef MOZ_COMPOSER
tier_app_dirs += editor/ui
endif
tier_app_dirs += $(MOZ_BRANDING_DIRECTORY)
ifdef MOZ_CALENDAR
tier_app_dirs += calendar/lightning
--- a/suite/confvars.sh
+++ b/suite/confvars.sh
@@ -54,19 +54,21 @@ MOZ_UPDATER=1
# If more than one ID is needed, then you should use a comma separated list
# 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_MORK=1
MOZ_STATIC_BUILD_UNSUPPORTED=1
+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_SYNC=1
MOZ_URL_CLASSIFIER=1
MOZ_APP_VERSION_TXT=${_topsrcdir}/$MOZ_BUILD_APP/config/version.txt
MOZ_APP_VERSION=`cat $MOZ_APP_VERSION_TXT`
SEAMONKEY_VERSION=$MOZ_APP_VERSION
MOZ_APP_ID={92650c4d-4b8e-4d2a-b7eb-24ecf4f6b63a}