Bug 942043 - Straighten up zlib linkage wrt shared js and system zlib. r=gps,r=ted

This commit is contained in:
Mike Hommey 2013-11-28 12:49:43 +09:00
parent 526ca4f8d7
commit 59b2136630
28 changed files with 58 additions and 36 deletions

View File

@ -52,7 +52,7 @@
[xpcom]
@BINPATH@/dependentlibs.list
#ifdef XP_WIN32
#ifdef GKMEDIAS_SHARED_LIBRARY
@BINPATH@/@DLL_PREFIX@gkmedias@DLL_SUFFIX@
#endif
@BINPATH@/@DLL_PREFIX@mozalloc@DLL_SUFFIX@

View File

@ -117,7 +117,7 @@ CPPSRCS += $(CPP_UNIT_TESTS)
CPP_UNIT_TEST_BINS := $(CPP_UNIT_TESTS:.cpp=$(BIN_SUFFIX))
SIMPLE_PROGRAMS += $(CPP_UNIT_TEST_BINS)
INCLUDES += -I$(DIST)/include/testing
LIBS += $(XPCOM_GLUE_LDOPTS) $(NSPR_LIBS) $(if $(JS_SHARED_LIBRARY),,$(MOZ_ZLIB_LIBS))
LIBS += $(XPCOM_GLUE_LDOPTS) $(NSPR_LIBS)
ifndef MOZ_PROFILE_GENERATE
libs:: $(CPP_UNIT_TEST_BINS) $(call mkdir_deps,$(DIST)/cppunittests)

View File

@ -1092,7 +1092,7 @@ vpx/vpx_encoder.h
vpx/vp8cx.h
vpx/vp8dx.h
#endif
#ifdef XP_WIN
#ifdef GKMEDIAS_SHARED_LIBRARY
vpx/vpx_codec.h
vpx/vpx_decoder.h
vpx/vpx_encoder.h

View File

@ -7770,6 +7770,20 @@ AC_SUBST(JS_SHARED_LIBRARY)
AC_SUBST(LIBXUL_LIBS)
XPCOM_LIBS="$LIBXUL_LIBS"
if test "$OS_ARCH" = "WINNT"; then
GKMEDIAS_SHARED_LIBRARY=1
fi
AC_SUBST(GKMEDIAS_SHARED_LIBRARY)
if test -z "$MOZ_NATIVE_ZLIB"; then
if test -n "$JS_SHARED_LIBRARY" -o "$GKMEDIAS_SHARED_LIBRARY"; then
ZLIB_IN_MOZGLUE=1
AC_DEFINE(ZLIB_IN_MOZGLUE)
fi
fi
AC_SUBST(ZLIB_IN_MOZGLUE)
dnl ========================================================
dnl =
dnl = Standalone module options
@ -9217,7 +9231,7 @@ 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
if test -n "$ZLIB_IN_MOZGLUE"; then
MOZ_ZLIB_LIBS=
fi
export MOZ_NATIVE_ZLIB
@ -9232,6 +9246,7 @@ export STLPORT_LDFLAGS
export STLPORT_LIBS
export JS_STANDALONE=no
export MOZ_LINKER
export ZLIB_IN_MOZGLUE
if ! test -e js; then
mkdir js

View File

@ -119,7 +119,7 @@ UNIFIED_SOURCES += ['src/compiler/' + src for src in [
]]
MSVC_ENABLE_PGO = True
if CONFIG['OS_TARGET'] == 'WINNT':
if CONFIG['GKMEDIAS_SHARED_LIBRARY']:
NO_VISIBILITY_FLAGS = True
FINAL_LIBRARY = 'gkmedias'

View File

@ -57,7 +57,7 @@ UNIFIED_SOURCES += [
MSVC_ENABLE_PGO = True
if CONFIG['OS_TARGET'] == 'WINNT':
if CONFIG['GKMEDIAS_SHARED_LIBRARY']:
NO_VISIBILITY_FLAGS = True
FINAL_LIBRARY = 'gkmedias'

View File

@ -49,7 +49,7 @@ UNIFIED_SOURCES += [
MSVC_ENABLE_PGO = True
if CONFIG['OS_TARGET'] == 'WINNT':
if CONFIG['GKMEDIAS_SHARED_LIBRARY']:
NO_VISIBILITY_FLAGS = True
FINAL_LIBRARY = 'gkmedias'

View File

@ -117,7 +117,7 @@ CPPSRCS += $(CPP_UNIT_TESTS)
CPP_UNIT_TEST_BINS := $(CPP_UNIT_TESTS:.cpp=$(BIN_SUFFIX))
SIMPLE_PROGRAMS += $(CPP_UNIT_TEST_BINS)
INCLUDES += -I$(DIST)/include/testing
LIBS += $(XPCOM_GLUE_LDOPTS) $(NSPR_LIBS) $(if $(JS_SHARED_LIBRARY),,$(MOZ_ZLIB_LIBS))
LIBS += $(XPCOM_GLUE_LDOPTS) $(NSPR_LIBS)
ifndef MOZ_PROFILE_GENERATE
libs:: $(CPP_UNIT_TEST_BINS) $(call mkdir_deps,$(DIST)/cppunittests)

View File

@ -1092,7 +1092,7 @@ vpx/vpx_encoder.h
vpx/vp8cx.h
vpx/vp8dx.h
#endif
#ifdef XP_WIN
#ifdef GKMEDIAS_SHARED_LIBRARY
vpx/vpx_codec.h
vpx/vpx_decoder.h
vpx/vpx_encoder.h

View File

@ -2992,6 +2992,10 @@ ZLIB_DIR=yes
MOZ_ZLIB_CHECK([1.2.3])
if test -n "$ZLIB_IN_MOZGLUE"; then
AC_DEFINE(ZLIB_IN_MOZGLUE)
fi
dnl ========================================================
dnl system libffi Support
dnl ========================================================

View File

@ -6,7 +6,7 @@
LIBRARY_NAME = 'gkmedias'
if CONFIG['OS_TARGET'] == 'WINNT':
if CONFIG['GKMEDIAS_SHARED_LIBRARY']:
FORCE_SHARED_LIB = True
if CONFIG['MOZ_WEBRTC']:

View File

@ -14,7 +14,7 @@ SOURCES += [
'kiss_fftr.c',
]
if CONFIG['OS_TARGET'] == 'WINNT':
if CONFIG['GKMEDIAS_SHARED_LIBRARY']:
NO_VISIBILITY_FLAGS = True
FINAL_LIBRARY = 'xul'

View File

@ -47,7 +47,7 @@ if CONFIG['OS_TARGET'] == 'Android':
MSVC_ENABLE_PGO = True
if CONFIG['OS_TARGET'] == 'WINNT':
if CONFIG['GKMEDIAS_SHARED_LIBRARY']:
NO_VISIBILITY_FLAGS = True
FINAL_LIBRARY = 'gkmedias'

View File

@ -146,7 +146,7 @@ else: # No SIMD support?
MSVC_ENABLE_PGO = True
if CONFIG['OS_TARGET'] == 'WINNT':
if CONFIG['GKMEDIAS_SHARED_LIBRARY']:
NO_VISIBILITY_FLAGS = True
FINAL_LIBRARY = 'gkmedias'

View File

@ -11,7 +11,7 @@ UNIFIED_SOURCES += [
MSVC_ENABLE_PGO = True
if CONFIG['OS_TARGET'] == 'WINNT':
if CONFIG['GKMEDIAS_SHARED_LIBRARY']:
NO_VISIBILITY_FLAGS = True
FINAL_LIBRARY = 'gkmedias'

View File

@ -17,7 +17,7 @@ UNIFIED_SOURCES += [
MSVC_ENABLE_PGO = True
if CONFIG['OS_TARGET'] == 'WINNT':
if CONFIG['GKMEDIAS_SHARED_LIBRARY']:
NO_VISIBILITY_FLAGS = True
FINAL_LIBRARY = 'gkmedias'

View File

@ -47,7 +47,7 @@ LIBRARY_NAME = 'mozpng'
MSVC_ENABLE_PGO = True
if CONFIG['OS_TARGET'] == 'WINNT':
if CONFIG['GKMEDIAS_SHARED_LIBRARY']:
NO_VISIBILITY_FLAGS = True
FINAL_LIBRARY = 'gkmedias'

View File

@ -32,6 +32,7 @@ if CONFIG['INTEL_ARCHITECTURE']:
]
MSVC_ENABLE_PGO = True
NO_VISIBILITY_FLAGS = True
if CONFIG['GKMEDIAS_SHARED_LIBRARY']:
NO_VISIBILITY_FLAGS = True
FINAL_LIBRARY = 'gkmedias'

View File

@ -57,7 +57,7 @@ if CONFIG['GNU_AS']:
MSVC_ENABLE_PGO = True
if CONFIG['OS_TARGET'] == 'WINNT':
if CONFIG['GKMEDIAS_SHARED_LIBRARY']:
NO_VISIBILITY_FLAGS = True
FINAL_LIBRARY = 'gkmedias'

View File

@ -43,7 +43,7 @@ if CONFIG['OS_ARCH'] == 'SunOS':
MSVC_ENABLE_PGO = True
if CONFIG['OS_TARGET'] == 'WINNT':
if CONFIG['GKMEDIAS_SHARED_LIBRARY']:
NO_VISIBILITY_FLAGS = True
FINAL_LIBRARY = 'gkmedias'

View File

@ -90,7 +90,7 @@ SOURCES += [
MSVC_ENABLE_PGO = True
if CONFIG['OS_TARGET'] == 'WINNT':
if CONFIG['GKMEDIAS_SHARED_LIBRARY']:
NO_VISIBILITY_FLAGS = True
FINAL_LIBRARY = 'gkmedias'

View File

@ -71,7 +71,7 @@ elif CONFIG['OS_TARGET'] == 'WINNT':
'/media/mtransport/third_party/nrappkit/src/port/win32/include',
]
if CONFIG['OS_TARGET'] == 'WINNT':
if CONFIG['GKMEDIAS_SHARED_LIBRARY']:
NO_VISIBILITY_FLAGS = True
FINAL_LIBRARY = 'xul'

View File

@ -50,6 +50,3 @@ elif CONFIG['OS_TARGET'] == 'WINNT':
]
FORCE_STATIC_LIB = True
if CONFIG['OS_TARGET'] == 'WINNT':
NO_VISIBILITY_FLAGS = True

View File

@ -169,14 +169,9 @@ ifeq ($(OS_TARGET), Android)
LOCAL_INCLUDES += -I$(topsrcdir)/media/mtransport/third_party/nrappkit/src/port/android/include
endif
ifneq ($(OS_TARGET),WINNT)
ifneq (gonk,$(MOZ_WIDGET_TOOLKIT))
ifdef JS_SHARED_LIBRARY
ifndef ZLIB_IN_MOZGLUE
LIBS += $(MOZ_ZLIB_LIBS)
endif
endif
endif
include $(topsrcdir)/config/config.mk
include $(topsrcdir)/media/webrtc/webrtc-config.mk

View File

@ -29,3 +29,6 @@ SOURCES += [
'uncompr.c',
'zutil.c',
]
if CONFIG['ZLIB_IN_MOZGLUE']:
DEFINES['IMPL_MFBT'] = True

View File

@ -6,8 +6,10 @@
#ifndef MOZZCONF_H
#define MOZZCONF_H
#if defined(XP_WIN)
#define ZLIB_DLL 1
#include "mozilla/Types.h"
#if defined(ZLIB_IN_MOZGLUE)
#define ZEXTERN MFBT_API
#endif
/* Exported Symbols */

View File

@ -26,6 +26,14 @@ MOZ_GLUE_LDFLAGS = # Don't link against ourselves
DEFINES += -DIMPL_MFBT
ifneq (,$(ZLIB_IN_MOZGLUE)$(MOZ_LINKER))
ifdef MOZ_NATIVE_ZLIB
EXTRA_DSO_LDOPTS += $(MOZ_ZLIB_LIBS)
else
SHARED_LIBRARY_LIBS += $(MOZ_ZLIB_LIBS)
endif
endif
ifeq (WINNT,$(OS_TARGET))
DEFFILE = mozglue.def
@ -41,7 +49,6 @@ endif
EXTRA_DSO_LDOPTS += \
$(MOZ_ZLIB_LIBS) \
version.lib \
$(NULL)
@ -76,8 +83,6 @@ endif
endif
ifeq (android, $(MOZ_WIDGET_TOOLKIT))
# Add Android specific code
EXTRA_DSO_LDOPTS += $(MOZ_ZLIB_LIBS)
# To properly wrap jemalloc's pthread_atfork call.
EXTRA_DSO_LDOPTS += -Wl,--wrap=pthread_atfork
endif

View File

@ -137,7 +137,7 @@ ifdef MOZ_NATIVE_PNG
EXTRA_DSO_LDOPTS += $(MOZ_PNG_LIBS)
endif
ifneq (WINNT,$(OS_ARCH))
ifndef ZLIB_IN_MOZGLUE
EXTRA_DSO_LDOPTS += $(MOZ_ZLIB_LIBS)
endif