зеркало из https://github.com/mozilla/pjs.git
Bug 305782 - "Please allow to use system bzip2 library" [p=mh+mozilla@glandium.org (Mike Hommey) r=bsmedberg a1.9=beltzner]
This commit is contained in:
Родитель
071ab96184
Коммит
21433d47b7
|
@ -122,6 +122,7 @@ export::
|
|||
-DMOZ_TREE_CAIRO=$(MOZ_TREE_CAIRO) \
|
||||
-DMOZ_ENABLE_LIBXUL=$(MOZ_ENABLE_LIBXUL) \
|
||||
-DMOZ_NATIVE_HUNSPELL=$(MOZ_NATIVE_HUNSPELL) \
|
||||
-DMOZ_NATIVE_BZ2=$(MOZ_NATIVE_BZ2) \
|
||||
-DMOZ_NATIVE_ZLIB=$(MOZ_NATIVE_ZLIB) \
|
||||
-DMOZ_NATIVE_PNG=$(MOZ_NATIVE_PNG) \
|
||||
-DMOZ_NATIVE_JPEG=$(MOZ_NATIVE_JPEG) \
|
||||
|
|
|
@ -212,6 +212,7 @@ MOZ_HUNSPELL_LIBS = @MOZ_HUNSPELL_LIBS@
|
|||
MOZ_HUNSPELL_CFLAGS = @MOZ_HUNSPELL_CFLAGS@
|
||||
|
||||
MOZ_NATIVE_ZLIB = @SYSTEM_ZLIB@
|
||||
MOZ_NATIVE_BZ2 = @SYSTEM_BZ2@
|
||||
MOZ_NATIVE_JPEG = @SYSTEM_JPEG@
|
||||
MOZ_NATIVE_PNG = @SYSTEM_PNG@
|
||||
MOZ_TREE_CAIRO = @MOZ_TREE_CAIRO@
|
||||
|
@ -409,6 +410,16 @@ endif
|
|||
ZLIB_REQUIRES = zlib
|
||||
endif
|
||||
|
||||
ifdef MOZ_NATIVE_BZ2
|
||||
BZ2_CFLAGS = @BZ2_CFLAGS@
|
||||
BZ2_LIBS = @BZ2_LIBS@
|
||||
BZ2_REQUIRES =
|
||||
else
|
||||
BZ2_CFLAGS = @MOZ_BZ2_CFLAGS@
|
||||
BZ2_LIBS = @MOZ_BZ2_LIBS@
|
||||
BZ2_REQUIRES = libbz2
|
||||
endif
|
||||
|
||||
ifdef MOZ_NATIVE_PNG
|
||||
PNG_CFLAGS = @PNG_CFLAGS@
|
||||
PNG_LIBS = @PNG_LIBS@
|
||||
|
|
|
@ -971,3 +971,6 @@ libsn/sn-util.h
|
|||
#if MOZ_NATIVE_HUNSPELL==1
|
||||
hunspell.hxx
|
||||
#endif
|
||||
#if MOZ_NATIVE_BZ2==1
|
||||
bzlib.h
|
||||
#endif
|
||||
|
|
36
configure.in
36
configure.in
|
@ -921,6 +921,8 @@ MOZ_JPEG_CFLAGS=
|
|||
MOZ_JPEG_LIBS='$(call EXPAND_LIBNAME_PATH,mozjpeg,$(DEPTH)/jpeg)'
|
||||
MOZ_ZLIB_CFLAGS=
|
||||
MOZ_ZLIB_LIBS='$(call EXPAND_LIBNAME_PATH,mozz,$(DEPTH)/modules/zlib/src)'
|
||||
MOZ_BZ2_CFLAGS=
|
||||
MOZ_BZ2_LIBS='$(call EXPAND_LIBNAME_PATH,bz2,$(DEPTH)/modules/libbz2/src)'
|
||||
MOZ_PNG_CFLAGS=
|
||||
MOZ_PNG_LIBS='$(call EXPAND_LIBNAME_PATH,mozpng,$(DEPTH)/modules/libimg/png)'
|
||||
|
||||
|
@ -4061,6 +4063,35 @@ if test "${ZLIB_DIR}" -a -d "${ZLIB_DIR}" -a "$SYSTEM_ZLIB" = 1; then
|
|||
ZLIB_LIBS="-L${ZLIB_DIR}/lib ${ZLIB_LIBS}"
|
||||
fi
|
||||
|
||||
dnl system BZIP2 Support
|
||||
dnl ========================================================
|
||||
MOZ_ARG_WITH_STRING(system-bz2,
|
||||
[ --with-system-bz2[=PFX]
|
||||
Use system libbz2 [installed at prefix PFX]],
|
||||
BZ2_DIR=$withval)
|
||||
|
||||
_SAVE_CFLAGS=$CFLAGS
|
||||
_SAVE_LDFLAGS=$LDFLAGS
|
||||
_SAVE_LIBS=$LIBS
|
||||
if test -n "${BZ2_DIR}" -a "${BZ2_DIR}" != "yes"; then
|
||||
CFLAGS="-I${BZ2_DIR}/include $CFLAGS"
|
||||
LDFLAGS="-L${BZ2_DIR}/lib $LDFLAGS"
|
||||
fi
|
||||
if test -z "$BZ2_DIR" -o "$BZ2_DIR" = no; then
|
||||
SYSTEM_BZ2=
|
||||
else
|
||||
AC_CHECK_LIB(bz2, BZ2_bzread, [SYSTEM_BZ2=1 BZ2_LIBS="-lbz2"],
|
||||
[SYSTEM_BZ2= BZ2_CFLAGS= BZ2_LIBS=], $BZ2_LIBS)
|
||||
fi
|
||||
CFLAGS=$_SAVE_CFLAGS
|
||||
LDFLAGS=$_SAVE_LDFLAGS
|
||||
LIBS=$_SAVE_LIBS
|
||||
|
||||
if test "${BZ2_DIR}" -a -d "${BZ2_DIR}" -a "$SYSTEM_BZ2" = 1; then
|
||||
BZ2_CFLAGS="-I${BZ2_DIR}/include"
|
||||
BZ2_LIBS="-L${BZ2_DIR}/lib ${MOZ_BZ2_LIBS}"
|
||||
fi
|
||||
|
||||
dnl system PNG Support
|
||||
dnl ========================================================
|
||||
MOZ_ARG_WITH_STRING(system-png,
|
||||
|
@ -7685,11 +7716,14 @@ AC_SUBST(SYSTEM_MAKEDEPEND)
|
|||
AC_SUBST(SYSTEM_JPEG)
|
||||
AC_SUBST(SYSTEM_PNG)
|
||||
AC_SUBST(SYSTEM_ZLIB)
|
||||
AC_SUBST(SYSTEM_BZ2)
|
||||
|
||||
AC_SUBST(JPEG_CFLAGS)
|
||||
AC_SUBST(JPEG_LIBS)
|
||||
AC_SUBST(ZLIB_CFLAGS)
|
||||
AC_SUBST(ZLIB_LIBS)
|
||||
AC_SUBST(BZ2_CFLAGS)
|
||||
AC_SUBST(BZ2_LIBS)
|
||||
AC_SUBST(PNG_CFLAGS)
|
||||
AC_SUBST(PNG_LIBS)
|
||||
|
||||
|
@ -7697,6 +7731,8 @@ AC_SUBST(MOZ_JPEG_CFLAGS)
|
|||
AC_SUBST(MOZ_JPEG_LIBS)
|
||||
AC_SUBST(MOZ_ZLIB_CFLAGS)
|
||||
AC_SUBST(MOZ_ZLIB_LIBS)
|
||||
AC_SUBST(MOZ_BZ2_CFLAGS)
|
||||
AC_SUBST(MOZ_BZ2_LIBS)
|
||||
AC_SUBST(MOZ_PNG_CFLAGS)
|
||||
AC_SUBST(MOZ_PNG_LIBS)
|
||||
|
||||
|
|
|
@ -61,11 +61,11 @@ CPPSRCS = \
|
|||
|
||||
SHARED_LIBRARY_LIBS = \
|
||||
../src/$(LIB_PREFIX)metrics_s.$(LIB_SUFFIX) \
|
||||
$(DEPTH)/modules/libbz2/src/$(LIB_PREFIX)bz2.$(LIB_SUFFIX) \
|
||||
$(NULL)
|
||||
|
||||
EXTRA_DSO_LDOPTS = $(XPCOM_GLUE_LDOPTS) \
|
||||
$(NSPR_LIBS) \
|
||||
$(BZ2_LIBS) \
|
||||
$(NULL)
|
||||
|
||||
LOCAL_INCLUDES = \
|
||||
|
@ -80,4 +80,4 @@ ifeq ($(OS_ARCH)_$(GNU_CC), WINNT_)
|
|||
LDFLAGS += -NODEFAULTLIB:MSVCRT
|
||||
endif
|
||||
|
||||
|
||||
CXXFLAGS += $(BZ2_CFLAGS)
|
||||
|
|
|
@ -57,7 +57,7 @@ REQUIRES = xpcom \
|
|||
docshell \
|
||||
layout \
|
||||
widget \
|
||||
libbz2 \
|
||||
$(BZ2_REQUIRES) \
|
||||
xulapp \
|
||||
extensions \
|
||||
rdf \
|
||||
|
|
|
@ -67,7 +67,7 @@ LOCAL_INCLUDES = \
|
|||
|
||||
LIBS = \
|
||||
../src/$(LIB_PREFIX)metrics_s.$(LIB_SUFFIX) \
|
||||
$(DEPTH)/modules/libbz2/src/$(LIB_PREFIX)bz2.$(LIB_SUFFIX) \
|
||||
$(BZ2_LIBS) \
|
||||
$(XPCOM_GLUE_LDOPTS) \
|
||||
$(NSPR_LIBS) \
|
||||
$(NULL)
|
||||
|
@ -76,6 +76,8 @@ XPCSHELL_TESTS = unit
|
|||
|
||||
include $(topsrcdir)/config/rules.mk
|
||||
|
||||
CXXFLAGS += $(BZ2_CFLAGS)
|
||||
|
||||
# Give the unit tests absolute paths to the data and temp directories.
|
||||
# For cygwin, we need to convert the paths to native Windows paths.
|
||||
ifdef CYGWIN_WRAPPER
|
||||
|
|
|
@ -47,7 +47,7 @@ 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 += $(DEPTH)/modules/libbz2/src/$(LIB_PREFIX)bz2.$(LIB_SUFFIX)
|
||||
HOST_LIBS += $(BZ2_LIBS)
|
||||
|
||||
ifeq (WINNT,$(OS_ARCH))
|
||||
HOST_EXTRA_LIBS += $(call EXPAND_LIBNAME,Ws2_32)
|
||||
|
@ -56,3 +56,5 @@ endif
|
|||
LOCAL_INCLUDES += -I$(topsrcdir)/toolkit/mozapps/update/src/updater
|
||||
|
||||
include $(topsrcdir)/config/rules.mk
|
||||
|
||||
CXXFLAGS += $(BZ2_CFLAGS)
|
||||
|
|
|
@ -54,12 +54,12 @@ PROGRAM = updater$(BIN_SUFFIX)
|
|||
|
||||
REQUIRES = \
|
||||
libmar \
|
||||
libbz2 \
|
||||
$(BZ2_REQUIRES) \
|
||||
$(NULL)
|
||||
|
||||
LIBS += \
|
||||
$(DEPTH)/modules/libmar/src/$(LIB_PREFIX)mar.$(LIB_SUFFIX) \
|
||||
$(DEPTH)/modules/libbz2/src/$(LIB_PREFIX)bz2.$(LIB_SUFFIX) \
|
||||
$(BZ2_LIBS) \
|
||||
$(NULL)
|
||||
|
||||
ifeq ($(OS_ARCH),WINNT)
|
||||
|
@ -130,3 +130,5 @@ ifeq ($(OS_ARCH),WINNT)
|
|||
LOCAL_INCLUDES += -I$(topsrcdir)/toolkit/xre
|
||||
REQUIRES += string
|
||||
endif
|
||||
|
||||
CXXFLAGS += $(BZ2_CFLAGS)
|
||||
|
|
|
@ -138,7 +138,11 @@ void LaunchChild(int argc, char **argv);
|
|||
|
||||
// This variable lives in libbz2. It's declared in bzlib_private.h, so we just
|
||||
// declare it here to avoid including that entire header file.
|
||||
#if (__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 3)
|
||||
extern "C" __attribute__((visibility("default"))) unsigned int BZ2_crc32Table[256];
|
||||
#else
|
||||
extern "C" unsigned int BZ2_crc32Table[256];
|
||||
#endif
|
||||
|
||||
static unsigned int
|
||||
crc32(const unsigned char *buf, unsigned int len)
|
||||
|
|
|
@ -748,15 +748,11 @@ MAKEFILES_accessible="
|
|||
accessible/src/mac/Makefile
|
||||
accessible/build/Makefile
|
||||
"
|
||||
|
||||
MAKEFILES_zlib="
|
||||
modules/zlib/standalone/Makefile
|
||||
"
|
||||
|
||||
MAKEFILES_libbz2="
|
||||
modules/libbz2/Makefile
|
||||
modules/libbz2/src/Makefile
|
||||
"
|
||||
|
||||
MAKEFILES_libmar="
|
||||
modules/libmar/Makefile
|
||||
modules/libmar/src/Makefile
|
||||
|
@ -805,7 +801,6 @@ add_makefiles "
|
|||
$MAKEFILES_libpr0n
|
||||
$MAKEFILES_accessible
|
||||
$MAKEFILES_zlib
|
||||
$MAKEFILES_libbz2
|
||||
$MAKEFILES_libmar
|
||||
"
|
||||
|
||||
|
@ -979,6 +974,13 @@ if [ ! "$SYSTEM_ZLIB" ]; then
|
|||
"
|
||||
fi
|
||||
|
||||
if [ ! "$SYSTEM_BZ2" ]; then
|
||||
add_makefiles "
|
||||
modules/libbz2/Makefile
|
||||
modules/libbz2/src/Makefile
|
||||
"
|
||||
fi
|
||||
|
||||
if test -n "$MOZ_UPDATE_PACKAGING"; then
|
||||
add_makefiles "
|
||||
tools/update-packaging/Makefile
|
||||
|
|
|
@ -64,7 +64,9 @@ 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
|
||||
endif
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче