зеркало из https://github.com/mozilla/gecko-dev.git
Bug 763651 - Link the javascript engine against zlib. r=khuey
This commit is contained in:
Родитель
7c181001da
Коммит
125aebf06d
|
@ -53,6 +53,9 @@ tier_base_dirs += memory/jemalloc
|
|||
endif
|
||||
tier_base_dirs += memory/build
|
||||
endif
|
||||
ifndef MOZ_NATIVE_ZLIB
|
||||
tier_base_dirs += modules/zlib
|
||||
endif
|
||||
tier_base_dirs += \
|
||||
mozglue \
|
||||
memory/mozalloc \
|
||||
|
|
|
@ -19,6 +19,7 @@ builtin(include, build/autoconf/compiler-opts.m4)dnl
|
|||
builtin(include, build/autoconf/expandlibs.m4)dnl
|
||||
builtin(include, build/autoconf/arch.m4)dnl
|
||||
builtin(include, build/autoconf/android.m4)dnl
|
||||
builtin(include, build/autoconf/zlib.m4)dnl
|
||||
|
||||
MOZ_PROG_CHECKMSYS()
|
||||
|
||||
|
|
|
@ -0,0 +1,54 @@
|
|||
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 Usage: MOZ_ZLIB_CHECK([version])
|
||||
|
||||
AC_DEFUN([MOZ_ZLIB_CHECK],
|
||||
[
|
||||
|
||||
MOZZLIB=$1
|
||||
|
||||
MOZ_ARG_WITH_STRING(system-zlib,
|
||||
[ --with-system-zlib[=PFX]
|
||||
Use system libz [installed at prefix PFX]],
|
||||
ZLIB_DIR=$withval)
|
||||
|
||||
if test -z "$MOZ_ZLIB_LIBS$MOZ_ZLIB_CFLAGS$SKIP_LIBRARY_CHECKS"; then
|
||||
_SAVE_CFLAGS=$CFLAGS
|
||||
_SAVE_LDFLAGS=$LDFLAGS
|
||||
_SAVE_LIBS=$LIBS
|
||||
|
||||
if test -n "${ZLIB_DIR}" -a "${ZLIB_DIR}" != "yes"; then
|
||||
MOZ_ZLIB_CFLAGS="-I${ZLIB_DIR}/include"
|
||||
MOZ_ZLIB_LIBS="-L${ZLIB_DIR}/lib"
|
||||
CFLAGS="$MOZ_ZLIB_CFLAGS $CFLAGS"
|
||||
LDFLAGS="$MOZ_ZLIB_LIBS $LDFLAGS"
|
||||
fi
|
||||
if test -z "$ZLIB_DIR" -o "$ZLIB_DIR" = no; then
|
||||
MOZ_NATIVE_ZLIB=
|
||||
else
|
||||
AC_CHECK_LIB(z, gzread, [MOZ_NATIVE_ZLIB=1 MOZ_ZLIB_LIBS="$MOZ_ZLIB_LIBS -lz"],
|
||||
[MOZ_NATIVE_ZLIB=])
|
||||
if test "$MOZ_NATIVE_ZLIB" = 1; then
|
||||
MOZZLIBNUM=`echo $MOZZLIB | awk -F. changequote(<<, >>)'{printf "0x%x\n", (((<<$>>1 * 16 + <<$>>2) * 16) + <<$>>3) * 16 + <<$>>4}'changequote([, ])`
|
||||
AC_TRY_COMPILE([ #include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <zlib.h> ],
|
||||
[ #if ZLIB_VERNUM < $MOZZLIBNUM
|
||||
#error "Insufficient zlib version ($MOZZLIBNUM required)."
|
||||
#endif ],
|
||||
MOZ_NATIVE_ZLIB=1,
|
||||
AC_MSG_ERROR([Insufficient zlib version for --with-system-zlib ($MOZZLIB required)]))
|
||||
fi
|
||||
fi
|
||||
CFLAGS=$_SAVE_CFLAGS
|
||||
LDFLAGS=$_SAVE_LDFLAGS
|
||||
LIBS=$_SAVE_LIBS
|
||||
fi
|
||||
|
||||
AC_SUBST(MOZ_ZLIB_CFLAGS)
|
||||
AC_SUBST(MOZ_ZLIB_LIBS)
|
||||
AC_SUBST(MOZ_NATIVE_ZLIB)
|
||||
|
||||
])
|
53
configure.in
53
configure.in
|
@ -54,7 +54,6 @@ dnl Set the version number of the libs included with mozilla
|
|||
dnl ========================================================
|
||||
MOZJPEG=62
|
||||
MOZPNG=10511
|
||||
MOZZLIB=1.2.3
|
||||
NSPR_VERSION=4
|
||||
NSS_VERSION=3
|
||||
|
||||
|
@ -1085,8 +1084,6 @@ MOZ_USER_DIR=".mozilla"
|
|||
|
||||
MOZ_JPEG_CFLAGS=
|
||||
MOZ_JPEG_LIBS='$(call EXPAND_LIBNAME_PATH,mozjpeg,$(DEPTH)/media/libjpeg)'
|
||||
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=
|
||||
|
@ -4034,51 +4031,22 @@ if test -n "${JPEG_DIR}" -a -d "${JPEG_DIR}" -a "$MOZ_NATIVE_JPEG" = 1; then
|
|||
MOZ_JPEG_CFLAGS="-I${JPEG_DIR}/include"
|
||||
MOZ_JPEG_LIBS="-L${JPEG_DIR}/lib ${MOZ_JPEG_LIBS}"
|
||||
fi
|
||||
fi # SKIP_LIBRARY_CHECKS
|
||||
|
||||
dnl system ZLIB support
|
||||
dnl ========================================================
|
||||
MOZ_ARG_WITH_STRING(system-zlib,
|
||||
[ --with-system-zlib[=PFX]
|
||||
Use system libz [installed at prefix PFX]],
|
||||
ZLIB_DIR=$withval)
|
||||
MOZ_ZLIB_CHECK([1.2.3])
|
||||
|
||||
_SAVE_CFLAGS=$CFLAGS
|
||||
_SAVE_LDFLAGS=$LDFLAGS
|
||||
_SAVE_LIBS=$LIBS
|
||||
if test -n "${ZLIB_DIR}" -a "${ZLIB_DIR}" != "yes"; then
|
||||
CFLAGS="-I${ZLIB_DIR}/include $CFLAGS"
|
||||
LDFLAGS="-L${ZLIB_DIR}/lib $LDFLAGS"
|
||||
fi
|
||||
if test -z "$ZLIB_DIR" -o "$ZLIB_DIR" = no; then
|
||||
MOZ_NATIVE_ZLIB=
|
||||
else
|
||||
AC_CHECK_LIB(z, gzread, [MOZ_NATIVE_ZLIB=1 MOZ_ZLIB_LIBS="-lz"],
|
||||
[MOZ_NATIVE_ZLIB=])
|
||||
fi
|
||||
if test "$MOZ_NATIVE_ZLIB" = 1; then
|
||||
MOZZLIBNUM=`echo $MOZZLIB | awk -F. '{printf "0x%x\n", ((($1 * 16 + $2) * 16) + $3) * 16 + $4}'`
|
||||
AC_TRY_COMPILE([ #include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <zlib.h> ],
|
||||
[ #if ZLIB_VERNUM < $MOZZLIBNUM
|
||||
#error "Insufficient zlib version ($MOZZLIBNUM required)."
|
||||
#endif ],
|
||||
MOZ_NATIVE_ZLIB=1,
|
||||
AC_MSG_ERROR([Insufficient zlib version for --with-system-zlib ($MOZZLIB required)]))
|
||||
fi
|
||||
CFLAGS=$_SAVE_CFLAGS
|
||||
LDFLAGS=$_SAVE_LDFLAGS
|
||||
LIBS=$_SAVE_LIBS
|
||||
|
||||
if test "${ZLIB_DIR}" -a -d "${ZLIB_DIR}" -a "$MOZ_NATIVE_ZLIB" = 1; then
|
||||
MOZ_ZLIB_CFLAGS="-I${ZLIB_DIR}/include"
|
||||
MOZ_ZLIB_LIBS="-L${ZLIB_DIR}/lib ${ZLIB_LIBS}"
|
||||
if test "$MOZ_NATIVE_ZLIB" != 1; then
|
||||
MOZ_ZLIB_CFLAGS=
|
||||
MOZ_ZLIB_LIBS='$(call EXPAND_LIBNAME_PATH,mozz,'"$_objdir"'/modules/zlib/src)'
|
||||
fi
|
||||
|
||||
if test "$MOZ_LINKER" = 1 -a "$MOZ_NATIVE_ZLIB" != 1; then
|
||||
AC_MSG_ERROR([Custom dynamic linker requires --with-system-zlib])
|
||||
fi
|
||||
|
||||
if test -z "$SKIP_LIBRARY_CHECKS"; then
|
||||
dnl system BZIP2 Support
|
||||
dnl ========================================================
|
||||
MOZ_ARG_WITH_STRING(system-bz2,
|
||||
|
@ -8524,14 +8492,11 @@ AC_SUBST(MOZ_NATIVE_MAKEDEPEND)
|
|||
AC_SUBST(SYSTEM_LIBXUL)
|
||||
AC_SUBST(MOZ_NATIVE_JPEG)
|
||||
AC_SUBST(MOZ_NATIVE_PNG)
|
||||
AC_SUBST(MOZ_NATIVE_ZLIB)
|
||||
AC_SUBST(MOZ_NATIVE_BZ2)
|
||||
|
||||
AC_SUBST(MOZ_FLEXBOX)
|
||||
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)
|
||||
|
@ -9187,6 +9152,12 @@ fi
|
|||
if test -n "$MOZ_GLUE_PROGRAM_LDFLAGS"; then
|
||||
export MOZ_GLUE_PROGRAM_LDFLAGS
|
||||
fi
|
||||
if test "$MOZ_NATIVE_ZLIB" != 1 -a "$OS_ARCH" = "WINNT"; then
|
||||
MOZ_ZLIB_LIBS=
|
||||
fi
|
||||
export MOZ_NATIVE_ZLIB
|
||||
export MOZ_ZLIB_CFLAGS
|
||||
export MOZ_ZLIB_LIBS
|
||||
export MOZ_APP_NAME
|
||||
export STLPORT_CPPFLAGS
|
||||
export STLPORT_LDFLAGS
|
||||
|
|
|
@ -665,6 +665,9 @@ ifeq (,$(filter HP-UX WINNT OS2,$(OS_ARCH)))
|
|||
EXTRA_LIBS += -lm
|
||||
endif
|
||||
|
||||
CFLAGS += $(MOZ_ZLIB_CFLAGS)
|
||||
EXTRA_LIBS += $(MOZ_ZLIB_LIBS)
|
||||
|
||||
# Prevent floating point errors caused by VC++ optimizations
|
||||
ifdef _MSC_VER
|
||||
# XXX We should add this to CXXFLAGS, too?
|
||||
|
|
|
@ -18,5 +18,6 @@ builtin(include, build/autoconf/compiler-opts.m4)dnl
|
|||
builtin(include, build/autoconf/expandlibs.m4)dnl
|
||||
builtin(include, build/autoconf/arch.m4)dnl
|
||||
builtin(include, build/autoconf/android.m4)dnl
|
||||
builtin(include, build/autoconf/zlib.m4)dnl
|
||||
|
||||
MOZ_PROG_CHECKMSYS()
|
||||
|
|
|
@ -0,0 +1,54 @@
|
|||
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 Usage: MOZ_ZLIB_CHECK([version])
|
||||
|
||||
AC_DEFUN([MOZ_ZLIB_CHECK],
|
||||
[
|
||||
|
||||
MOZZLIB=$1
|
||||
|
||||
MOZ_ARG_WITH_STRING(system-zlib,
|
||||
[ --with-system-zlib[=PFX]
|
||||
Use system libz [installed at prefix PFX]],
|
||||
ZLIB_DIR=$withval)
|
||||
|
||||
if test -z "$MOZ_ZLIB_LIBS$MOZ_ZLIB_CFLAGS$SKIP_LIBRARY_CHECKS"; then
|
||||
_SAVE_CFLAGS=$CFLAGS
|
||||
_SAVE_LDFLAGS=$LDFLAGS
|
||||
_SAVE_LIBS=$LIBS
|
||||
|
||||
if test -n "${ZLIB_DIR}" -a "${ZLIB_DIR}" != "yes"; then
|
||||
MOZ_ZLIB_CFLAGS="-I${ZLIB_DIR}/include"
|
||||
MOZ_ZLIB_LIBS="-L${ZLIB_DIR}/lib"
|
||||
CFLAGS="$MOZ_ZLIB_CFLAGS $CFLAGS"
|
||||
LDFLAGS="$MOZ_ZLIB_LIBS $LDFLAGS"
|
||||
fi
|
||||
if test -z "$ZLIB_DIR" -o "$ZLIB_DIR" = no; then
|
||||
MOZ_NATIVE_ZLIB=
|
||||
else
|
||||
AC_CHECK_LIB(z, gzread, [MOZ_NATIVE_ZLIB=1 MOZ_ZLIB_LIBS="$MOZ_ZLIB_LIBS -lz"],
|
||||
[MOZ_NATIVE_ZLIB=])
|
||||
if test "$MOZ_NATIVE_ZLIB" = 1; then
|
||||
MOZZLIBNUM=`echo $MOZZLIB | awk -F. changequote(<<, >>)'{printf "0x%x\n", (((<<$>>1 * 16 + <<$>>2) * 16) + <<$>>3) * 16 + <<$>>4}'changequote([, ])`
|
||||
AC_TRY_COMPILE([ #include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <zlib.h> ],
|
||||
[ #if ZLIB_VERNUM < $MOZZLIBNUM
|
||||
#error "Insufficient zlib version ($MOZZLIBNUM required)."
|
||||
#endif ],
|
||||
MOZ_NATIVE_ZLIB=1,
|
||||
AC_MSG_ERROR([Insufficient zlib version for --with-system-zlib ($MOZZLIB required)]))
|
||||
fi
|
||||
fi
|
||||
CFLAGS=$_SAVE_CFLAGS
|
||||
LDFLAGS=$_SAVE_LDFLAGS
|
||||
LIBS=$_SAVE_LIBS
|
||||
fi
|
||||
|
||||
AC_SUBST(MOZ_ZLIB_CFLAGS)
|
||||
AC_SUBST(MOZ_ZLIB_LIBS)
|
||||
AC_SUBST(MOZ_NATIVE_ZLIB)
|
||||
|
||||
])
|
|
@ -42,6 +42,11 @@ include $(topsrcdir)/config/config.mk
|
|||
# Do not install util programs
|
||||
NO_INSTALL=1
|
||||
|
||||
# Force wrap zlib system header if building js as a shared library.
|
||||
ifdef JS_SHARED_LIBRARY
|
||||
DEFINES += -DMOZ_NATIVE_ZLIB=1
|
||||
endif
|
||||
|
||||
include $(topsrcdir)/config/rules.mk
|
||||
|
||||
HOST_CFLAGS += -DUNICODE -D_UNICODE
|
||||
|
|
|
@ -192,6 +192,9 @@ NSPR_CONFIG = @NSPR_CONFIG@
|
|||
NSPR_CFLAGS = @NSPR_CFLAGS@
|
||||
NSPR_LIBS = @NSPR_LIBS@
|
||||
|
||||
MOZ_ZLIB_LIBS = @MOZ_ZLIB_LIBS@
|
||||
MOZ_ZLIB_CFLAGS = @MOZ_ZLIB_CFLAGS@
|
||||
|
||||
MOZ_NATIVE_FFI = @MOZ_NATIVE_FFI@
|
||||
MOZ_FFI_LIBS = @MOZ_FFI_LIBS@
|
||||
MOZ_FFI_CFLAGS = @MOZ_FFI_CFLAGS@
|
||||
|
|
|
@ -3324,6 +3324,14 @@ if test -n "$MOZ_NATIVE_NSPR"; then
|
|||
CFLAGS=$_SAVE_CFLAGS
|
||||
fi
|
||||
|
||||
dnl ========================================================
|
||||
dnl system zlib Support
|
||||
dnl ========================================================
|
||||
dnl Standalone js defaults to system zlib
|
||||
ZLIB_DIR=yes
|
||||
|
||||
MOZ_ZLIB_CHECK([1.2.3])
|
||||
|
||||
dnl ========================================================
|
||||
dnl system libffi Support
|
||||
dnl ========================================================
|
||||
|
|
|
@ -82,7 +82,7 @@ DEFINES += -DEXPORT_JS_API
|
|||
# on its behalf.
|
||||
DEFINES += -DIMPL_MFBT
|
||||
|
||||
LIBS = $(DEPTH)/$(LIB_PREFIX)js_static.$(LIB_SUFFIX) $(NSPR_LIBS)
|
||||
LIBS = $(DEPTH)/$(LIB_PREFIX)js_static.$(LIB_SUFFIX) $(NSPR_LIBS) $(MOZ_ZLIB_LIBS)
|
||||
|
||||
LOCAL_INCLUDES += -I$(topsrcdir) -I..
|
||||
|
||||
|
|
|
@ -23,7 +23,7 @@ DEFINES += -DEXPORT_JS_API
|
|||
# on its behalf.
|
||||
DEFINES += -DIMPL_MFBT
|
||||
|
||||
LIBS = $(NSPR_LIBS) $(EDITLINE_LIBS) $(DEPTH)/$(LIB_PREFIX)js_static.$(LIB_SUFFIX)
|
||||
LIBS = $(NSPR_LIBS) $(EDITLINE_LIBS) $(DEPTH)/$(LIB_PREFIX)js_static.$(LIB_SUFFIX) $(MOZ_ZLIB_LIBS)
|
||||
ifdef MOZ_NATIVE_FFI
|
||||
EXTRA_LIBS += $(MOZ_FFI_LIBS)
|
||||
endif
|
||||
|
|
|
@ -126,9 +126,6 @@ ifeq (WINNT,$(OS_TARGET))
|
|||
EXTRA_DSO_LDOPTS = $(MOZALLOC_LIB) $(NSPR_LIBS)
|
||||
OS_LIBS += $(call EXPAND_LIBNAME,usp10 ole32)
|
||||
|
||||
# OTS uses uncompress2() from libz, so we need to link with this
|
||||
EXTRA_DSO_LDOPTS += $(MOZ_ZLIB_LIBS)
|
||||
|
||||
ifdef MOZ_WEBRTC
|
||||
EXTRA_DSO_LDOPTS += \
|
||||
-LIBPATH:"$(MOZ_DIRECTX_SDK_PATH)/lib/$(MOZ_DIRECTX_SDK_CPU_SUFFIX)" \
|
||||
|
|
|
@ -52,7 +52,6 @@ FORCE_STATIC_LIB = 1
|
|||
include $(topsrcdir)/config/rules.mk
|
||||
|
||||
ifeq ($(OS_ARCH),WINNT)
|
||||
DEFINES += -DZLIB_DLL
|
||||
ifdef BUILD_DEBUG_GC
|
||||
DEFINES += -DDEBUG_GC
|
||||
endif
|
||||
|
|
|
@ -38,7 +38,3 @@ XPIDLSRCS = $(MODULES_LIBJAR_LXPIDLSRCS)
|
|||
EXPORTS = $(MODULES_LIBJAR_LEXPORTS)
|
||||
|
||||
include $(topsrcdir)/config/rules.mk
|
||||
|
||||
ifeq ($(OS_ARCH),WINNT)
|
||||
DEFINES += -DZLIB_DLL=1
|
||||
endif
|
||||
|
|
|
@ -13,13 +13,6 @@ include $(srcdir)/objs.mk
|
|||
|
||||
MODULE = zlib
|
||||
LIBRARY_NAME = mozz
|
||||
GRE_MODULE = 1
|
||||
LIBXUL_LIBRARY = 1
|
||||
DIST_INSTALL = 1
|
||||
|
||||
ifeq (,$(filter-out WINNT OS2,$(OS_ARCH)))
|
||||
DEFINES += -DZLIB_DLL=1
|
||||
endif
|
||||
|
||||
CSRCS = $(MODULES_ZLIB_SRC_LCSRCS)
|
||||
|
||||
|
|
|
@ -6,8 +6,8 @@
|
|||
#ifndef MOZZCONF_H
|
||||
#define MOZZCONF_H
|
||||
|
||||
#if defined(XP_WIN) && defined(ZLIB_DLL)
|
||||
#undef ZLIB_DLL
|
||||
#if defined(XP_WIN)
|
||||
#define ZLIB_DLL 1
|
||||
#endif
|
||||
|
||||
/* Exported Symbols */
|
||||
|
|
|
@ -56,6 +56,8 @@ ifneq (,$(filter -DEFAULTLIB:mozcrt,$(MOZ_GLUE_LDFLAGS)))
|
|||
# Don't install the import library if we use mozcrt
|
||||
NO_INSTALL_IMPORT_LIBRARY = 1
|
||||
endif
|
||||
|
||||
EXTRA_DSO_LDOPTS += $(MOZ_ZLIB_LIBS)
|
||||
endif
|
||||
|
||||
ifeq (Android,$(OS_TARGET))
|
||||
|
|
|
@ -51,8 +51,4 @@ LOCAL_INCLUDES = \
|
|||
|
||||
include $(topsrcdir)/config/rules.mk
|
||||
|
||||
ifeq ($(OS_ARCH),WINNT)
|
||||
DEFINES += -DZLIB_DLL
|
||||
endif
|
||||
|
||||
DEFINES += -DIMPL_NS_NET
|
||||
|
|
|
@ -79,10 +79,6 @@ LOCAL_INCLUDES += -I$(topsrcdir)/widget/windows
|
|||
LOCAL_INCLUDES += -I$(topsrcdir)/xpcom/base
|
||||
endif
|
||||
|
||||
ifneq (,$(filter WINNT OS2,$(OS_ARCH)))
|
||||
DEFINES += -DZLIB_DLL=1
|
||||
endif
|
||||
|
||||
ifeq ($(OS_ARCH),OS2)
|
||||
|
||||
CPPSRCS += \
|
||||
|
@ -356,7 +352,9 @@ ifdef MOZ_NATIVE_PNG
|
|||
EXTRA_DSO_LDOPTS += $(MOZ_PNG_LIBS)
|
||||
endif
|
||||
|
||||
ifneq (WINNT,$(OS_ARCH))
|
||||
EXTRA_DSO_LDOPTS += $(MOZ_ZLIB_LIBS)
|
||||
endif
|
||||
|
||||
ifdef MOZ_NATIVE_HUNSPELL
|
||||
EXTRA_DSO_LDOPTS += $(MOZ_HUNSPELL_LIBS)
|
||||
|
|
|
@ -21,10 +21,6 @@ endif
|
|||
|
||||
tier_platform_dirs += xpcom
|
||||
|
||||
ifndef MOZ_NATIVE_ZLIB
|
||||
tier_platform_dirs += modules/zlib
|
||||
endif
|
||||
|
||||
tier_platform_dirs += \
|
||||
modules/libpref \
|
||||
intl \
|
||||
|
|
Загрузка…
Ссылка в новой задаче