Bug 544191: Use system zlib on Mac OS X. When using system zlib, -lz has
authorwtc%google.com
Thu, 04 Feb 2010 18:59:11 +0000
changeset 9538 981bd2eebe2f65a6f86cf24c0a12ba975c9ee135
parent 9537 c4539761e1a94b860be2c760d399018c86391c96
child 9539 503e10cc623480285a805fb50e1b37e5e539d9e1
child 9540 7fb62ba52b745bf08df10feda2965ba9085f0f45
child 9541 bce3aa63c58be9dd24015cf9ce42567ec758e591
push idunknown
push userunknown
push dateunknown
bugs544191
Bug 544191: Use system zlib on Mac OS X. When using system zlib, -lz has to be added to OS_LIBS instead of EXTRA_LIBS because $(PROGRAM) depends on $(EXTRA_LIBS). r=rrelyea. Modified Files: coreconf/Darwin.mk nss/cmd/platlibs.mk nss/cmd/modutil/Makefile nss/cmd/signtool/Makefile
security/coreconf/Darwin.mk
security/nss/cmd/modutil/Makefile
security/nss/cmd/platlibs.mk
security/nss/cmd/signtool/Makefile
--- a/security/coreconf/Darwin.mk
+++ b/security/coreconf/Darwin.mk
@@ -126,9 +126,10 @@ DARWIN_DYLIB_VERSIONS = -compatibility_v
 # May override this with -bundle to create a loadable module.
 DSO_LDOPTS	= -dynamiclib $(DARWIN_DYLIB_VERSIONS) -install_name @executable_path/$(notdir $@) -headerpad_max_install_names
 
 MKSHLIB		= $(CC) $(DSO_LDOPTS) $(DARWIN_SDK_SHLIBFLAGS)
 DLL_SUFFIX	= dylib
 PROCESS_MAP_FILE = grep -v ';+' $< | grep -v ';-' | \
                 sed -e 's; DATA ;;' -e 's,;;,,' -e 's,;.*,,' -e 's,^,_,' > $@
 
-G++INCLUDES	= -I/usr/include/g++
+USE_SYSTEM_ZLIB = 1
+ZLIB_LIBS	= -lz
--- a/security/nss/cmd/modutil/Makefile
+++ b/security/nss/cmd/modutil/Makefile
@@ -52,16 +52,22 @@ include $(CORE_DEPTH)/coreconf/config.mk
 # (3) Include "component" configuration information. (OPTIONAL)       #
 #######################################################################
 
 #######################################################################
 # (4) Include "local" platform-dependent assignments (OPTIONAL).      #
 #######################################################################
 include ../platlibs.mk
 
+ifdef USE_SYSTEM_ZLIB
+OS_LIBS += $(ZLIB_LIBS)
+else
+EXTRA_LIBS += $(ZLIB_LIBS)
+endif
+
 #######################################################################
 # (5) Execute "global" rules. (OPTIONAL)                              #
 #######################################################################
 
 include $(CORE_DEPTH)/coreconf/rules.mk
 
 #######################################################################
 # (6) Execute "component" rules. (OPTIONAL)                           #
--- a/security/nss/cmd/platlibs.mk
+++ b/security/nss/cmd/platlibs.mk
@@ -245,11 +245,9 @@ endif # USE_STATIC_LIBS
 
 # If a platform has a system zlib, set USE_SYSTEM_ZLIB to 1 and
 # ZLIB_LIBS to the linker command-line arguments for the system zlib
 # (for example, -lz) in the platform's config file in coreconf.
 ifndef USE_SYSTEM_ZLIB
 ZLIB_LIBS = $(DIST)/lib/$(LIB_PREFIX)zlib.$(LIB_SUFFIX)
 endif
 
-JAR_LIBS = $(DIST)/lib/$(LIB_PREFIX)jar.$(LIB_SUFFIX) \
-	$(ZLIB_LIBS) \
-	$(NULL)
+JAR_LIBS = $(DIST)/lib/$(LIB_PREFIX)jar.$(LIB_SUFFIX)
--- a/security/nss/cmd/signtool/Makefile
+++ b/security/nss/cmd/signtool/Makefile
@@ -53,16 +53,22 @@ include $(CORE_DEPTH)/coreconf/config.mk
 #######################################################################
 
 #######################################################################
 # (4) Include "local" platform-dependent assignments (OPTIONAL).      #
 #######################################################################
 
 include ../platlibs.mk
 
+ifdef USE_SYSTEM_ZLIB
+OS_LIBS += $(ZLIB_LIBS)
+else
+EXTRA_LIBS += $(ZLIB_LIBS)
+endif
+
 #######################################################################
 # (5) Execute "global" rules. (OPTIONAL)                              #
 #######################################################################
 
 include $(CORE_DEPTH)/coreconf/rules.mk
 
 #######################################################################
 # (6) Execute "component" rules. (OPTIONAL)                           #