From a2a5bc5879f7bd9d04fb346a4366534b62928f33 Mon Sep 17 00:00:00 2001 From: Chris Cooper Date: Fri, 19 Feb 2010 11:58:45 -0500 Subject: [PATCH] Bug535369 - Compile bsdiff for host OS rather than target - r=ted.mielczarek --- modules/libbz2/src/Makefile.in | 14 ++++++++++++++ other-licenses/bsdiff/Makefile.in | 9 +++++++-- toolkit/toolkit-tiers.mk | 1 + 3 files changed, 22 insertions(+), 2 deletions(-) diff --git a/modules/libbz2/src/Makefile.in b/modules/libbz2/src/Makefile.in index 094bb02cbdba..51241cefd019 100644 --- a/modules/libbz2/src/Makefile.in +++ b/modules/libbz2/src/Makefile.in @@ -45,6 +45,7 @@ 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 @@ -66,8 +67,21 @@ CSRCS = \ 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: + diff --git a/other-licenses/bsdiff/Makefile.in b/other-licenses/bsdiff/Makefile.in index 12801b696eee..ab5560b780cf 100644 --- a/other-licenses/bsdiff/Makefile.in +++ b/other-licenses/bsdiff/Makefile.in @@ -47,9 +47,14 @@ include $(DEPTH)/config/autoconf.mk # 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 diff --git a/toolkit/toolkit-tiers.mk b/toolkit/toolkit-tiers.mk index 012f9153033b..7bb43ca0faf5 100644 --- a/toolkit/toolkit-tiers.mk +++ b/toolkit/toolkit-tiers.mk @@ -68,6 +68,7 @@ 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