--- a/modules/libbz2/src/Makefile.in
+++ b/modules/libbz2/src/Makefile.in
@@ -40,16 +40,17 @@ DEPTH = ../../..
topsrcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@
include $(DEPTH)/config/autoconf.mk
MODULE = libbz2
LIBRARY_NAME = bz2
+HOST_LIBRARY_NAME = hostbz2
FORCE_STATIC_LIB= 1
ifeq ($(OS_ARCH),WINNT)
USE_STATIC_LIBS = 1
endif
# This is defined by the bzip2-1.0.3 Makefile. It appears to be used to
# configure GLIBC to support large files. This isn't something we care about
# at this stage, since we're only interested in the streaming API, but we
@@ -61,13 +62,26 @@ CSRCS = \
bzlib.c \
compress.c \
crctable.c \
decompress.c \
huffman.c \
randtable.c \
$(NULL)
+HOST_CSRCS = $(CSRCS)
+
EXPORTS = \
bzlib.h \
$(NULL)
include $(topsrcdir)/config/rules.mk
+
+ifdef CROSS_COMPILE
+ifdef HOST_NSPR_MDCPUCFG
+HOST_CFLAGS += -DMDCPUCFG=$(HOST_NSPR_MDCPUCFG)
+endif
+endif
+
+# The intermediate (.ii/.s) files for host and target can have the same name...
+# disable parallel builds
+.NOTPARALLEL:
+
--- a/other-licenses/bsdiff/Makefile.in
+++ b/other-licenses/bsdiff/Makefile.in
@@ -42,19 +42,24 @@ srcdir = @srcdir@
VPATH = @srcdir@
include $(DEPTH)/config/autoconf.mk
# This program is output to dist/host/bin because it is only needed by the
# build system and is not intended to be included in Mozilla distributions.
HOST_PROGRAM = mbsdiff$(BIN_SUFFIX)
HOST_CSRCS = bsdiff.c
-HOST_LIBS += $(BZ2_LIBS)
-ifeq (WINNT,$(OS_ARCH))
+ifdef CROSS_COMPILE
+HOST_LIBS += $(DIST)/host/lib/$(LIB_PREFIX)hostbz2.$(LIB_SUFFIX)
+else
+HOST_LIBS += $(BZ2_LIBS)
+endif
+
+ifneq (,$(filter WINCE WINNT,$(OS_ARCH)))
HOST_EXTRA_LIBS += $(call EXPAND_LIBNAME,Ws2_32)
endif
LOCAL_INCLUDES += -I$(topsrcdir)/toolkit/mozapps/update/updater
include $(topsrcdir)/config/rules.mk
CXXFLAGS += $(BZ2_CFLAGS)
--- a/toolkit/toolkit-tiers.mk
+++ b/toolkit/toolkit-tiers.mk
@@ -63,16 +63,17 @@ ifdef MOZ_INSTALLER
tier_external_dirs += modules/zlib/standalone
endif
ifdef MOZ_UPDATER
ifndef MOZ_NATIVE_BZ2
tier_external_dirs += modules/libbz2
endif
tier_external_dirs += modules/libmar
+tier_external_dirs += other-licenses/bsdiff
endif
tier_external_dirs += gfx/qcms
ifeq ($(OS_ARCH),WINCE)
tier_external_dirs += modules/lib7z
endif