Skip to content

Commit

Permalink
Bug 942043 - Straighten up zlib linkage wrt shared js and system zlib…
Browse files Browse the repository at this point in the history
…. r=gps,r=ted
  • Loading branch information
glandium committed Nov 28, 2013
1 parent 6b6c1c6 commit 6136ed5
Show file tree
Hide file tree
Showing 28 changed files with 58 additions and 36 deletions.
2 changes: 1 addition & 1 deletion browser/installer/package-manifest.in
Original file line number Diff line number Diff line change
Expand Up @@ -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@
Expand Down
2 changes: 1 addition & 1 deletion config/rules.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion config/system-headers
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
17 changes: 16 additions & 1 deletion configure.in
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion gfx/angle/moz.build
Original file line number Diff line number Diff line change
Expand Up @@ -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'
2 changes: 1 addition & 1 deletion gfx/graphite2/src/moz.build
Original file line number Diff line number Diff line change
Expand Up @@ -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'
2 changes: 1 addition & 1 deletion gfx/ots/src/moz.build
Original file line number Diff line number Diff line change
Expand Up @@ -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'
2 changes: 1 addition & 1 deletion js/src/config/rules.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion js/src/config/system-headers
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions js/src/configure.in
Original file line number Diff line number Diff line change
Expand Up @@ -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 ========================================================
Expand Down
2 changes: 1 addition & 1 deletion layout/media/moz.build
Original file line number Diff line number Diff line change
Expand Up @@ -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']:
Expand Down
2 changes: 1 addition & 1 deletion media/kiss_fft/moz.build
Original file line number Diff line number Diff line change
Expand Up @@ -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'
2 changes: 1 addition & 1 deletion media/libcubeb/src/moz.build
Original file line number Diff line number Diff line change
Expand Up @@ -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'
2 changes: 1 addition & 1 deletion media/libjpeg/moz.build
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
2 changes: 1 addition & 1 deletion media/libnestegg/src/moz.build
Original file line number Diff line number Diff line change
Expand Up @@ -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'
2 changes: 1 addition & 1 deletion media/libogg/moz.build
Original file line number Diff line number Diff line change
Expand Up @@ -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'
2 changes: 1 addition & 1 deletion media/libpng/moz.build
Original file line number Diff line number Diff line change
Expand Up @@ -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'
3 changes: 2 additions & 1 deletion media/libsoundtouch/src/moz.build
Original file line number Diff line number Diff line change
Expand Up @@ -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'
2 changes: 1 addition & 1 deletion media/libtheora/lib/moz.build
Original file line number Diff line number Diff line change
Expand Up @@ -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'
2 changes: 1 addition & 1 deletion media/libvorbis/moz.build
Original file line number Diff line number Diff line change
Expand Up @@ -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'
2 changes: 1 addition & 1 deletion media/libvpx/moz.build
Original file line number Diff line number Diff line change
Expand Up @@ -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'
2 changes: 1 addition & 1 deletion media/mtransport/build/moz.build
Original file line number Diff line number Diff line change
Expand Up @@ -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'
3 changes: 0 additions & 3 deletions media/mtransport/standalone/moz.build
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,3 @@ elif CONFIG['OS_TARGET'] == 'WINNT':
]

FORCE_STATIC_LIB = True

if CONFIG['OS_TARGET'] == 'WINNT':
NO_VISIBILITY_FLAGS = True
7 changes: 1 addition & 6 deletions media/webrtc/signaling/test/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions modules/zlib/src/moz.build
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,6 @@ SOURCES += [
'uncompr.c',
'zutil.c',
]

if CONFIG['ZLIB_IN_MOZGLUE']:
DEFINES['IMPL_MFBT'] = True
6 changes: 4 additions & 2 deletions modules/zlib/src/mozzconf.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down
11 changes: 8 additions & 3 deletions mozglue/build/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -41,7 +49,6 @@ endif


EXTRA_DSO_LDOPTS += \
$(MOZ_ZLIB_LIBS) \
version.lib \
$(NULL)

Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion toolkit/library/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 6136ed5

Please sign in to comment.