Commit 4079d49a authored by Mike Hommey's avatar Mike Hommey
Browse files

Bug 736564 - Ship mozglue and jemalloc libraries in the SDK. r=bsmedberg,r=ted

As one import library on Windows, as one shared library on OSX and Android,
and as two separate static libraries on systems where mozglue is a static
library.
parent 79a33df6
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -7187,7 +7187,13 @@ elif test "${OS_TARGET}" = "WINNT" -o "${OS_TARGET}" = "Darwin" -o "${OS_TARGET}
  fi
else
  dnl On other Unix systems, we only want to link executables against mozglue
  MOZ_GLUE_PROGRAM_LDFLAGS='$(MKSHLIB_FORCE_ALL) $(call EXPAND_LIBNAME_PATH,mozglue,$(LIBXUL_DIST)/lib) $(MKSHLIB_UNFORCE_ALL)'
  MOZ_GLUE_PROGRAM_LDFLAGS='$(MKSHLIB_FORCE_ALL) $(call EXPAND_LIBNAME_PATH,mozglue,$(LIBXUL_DIST)/lib)'
  dnl On other Unix systems, where mozglue is a static library, jemalloc is
  dnl separated for the SDK, so we need to add it here.
  if test "$MOZ_MEMORY" = 1; then
    MOZ_GLUE_PROGRAM_LDFLAGS="$MOZ_GLUE_PROGRAM_LDFLAGS "'$(call EXPAND_LIBNAME_PATH,jemalloc,$(LIBXUL_DIST)/lib)'
  fi
  MOZ_GLUE_PROGRAM_LDFLAGS="$MOZ_GLUE_PROGRAM_LDFLAGS "'$(MKSHLIB_UNFORCE_ALL)'
  if test -n "$GNU_CC"; then
    dnl And we need mozglue symbols to be exported.
    MOZ_GLUE_PROGRAM_LDFLAGS="$MOZ_GLUE_PROGRAM_LDFLAGS -rdynamic"
+4 −0
Original line number Diff line number Diff line
@@ -53,6 +53,10 @@ CSRCS = jemalloc.c
EXPORTS = jemalloc.h jemalloc_types.h
LIBRARY_NAME = jemalloc
FORCE_STATIC_LIB= 1
ifdef MOZ_GLUE_PROGRAM_LDFLAGS
SDK_LIBRARY = $(REAL_LIBRARY)
DIST_INSTALL = 1
endif

ifeq ($(OS_ARCH),SunOS)
ifndef GNU_CC
+20 −8
Original line number Diff line number Diff line
@@ -47,21 +47,33 @@ MODULE = mozglue
LIBRARY_NAME = mozglue
DIST_INSTALL = 1

ifdef MOZ_MEMORY
# Build mozglue as a shared lib on Windows, OSX and Android.
# If this is ever changed, update MOZ_SHARED_MOZGLUE in browser/installer/Makefile.in
ifneq (,$(filter WINNT Darwin Android,$(OS_TARGET)))
FORCE_SHARED_LIB = 1
else
FORCE_STATIC_LIB = 1
endif

# Keep jemalloc separated when mozglue is statically linked
ifeq (1_1,$(MOZ_MEMORY)_$(FORCE_SHARED_LIB))
SHARED_LIBRARY_LIBS = $(call EXPAND_LIBNAME_PATH,memory,$(DEPTH)/memory/build)
SHARED_LIBRARY_LIBS += $(call EXPAND_LIBNAME_PATH,jemalloc,$(DEPTH)/memory/jemalloc)
else
# Temporary, until bug 662814 lands
VISIBILITY_FLAGS =
CPPSRCS = dummy.cpp
endif

# Build mozglue as a shared lib on Windows, OSX and Android.
# If this is ever changed, update MOZ_SHARED_MOZGLUE in browser/installer/Makefile.in
ifneq (,$(filter WINNT Darwin Android,$(OS_TARGET)))
FORCE_SHARED_LIB = 1
ifneq (,$(filter OS2 WINNT,$(OS_ARCH)))
SDK_LIBRARY = $(IMPORT_LIBRARY)
else
FORCE_STATIC_LIB = 1
ifdef FORCE_SHARED_LIB
SDK_LIBRARY = $(SHARED_LIBRARY)
else
SDK_LIBRARY = $(REAL_LIBRARY)
endif
endif

endif
 
MOZ_GLUE_LDFLAGS = # Don't link against ourselves