Bug 804441: Put our NSPR and NSS header wrappers before OS_INCLUDES, r=ted
authorBrian Smith <bsmith@mozilla.com>
Wed, 24 Oct 2012 14:31:54 -0700
changeset 112961 9b205ad49020a40053f4e3d304c35de2c139c0eb
parent 112960 09c4b0d2158166af722863198ee2b598f7f64830
child 112962 4ed8af50dc10f98b29142c566b0abfdc40f46edd
push id23843
push userryanvm@gmail.com
push dateSun, 11 Nov 2012 12:00:20 +0000
treeherdermozilla-central@ba4903cc7523 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersted
bugs804441
milestone19.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 804441: Put our NSPR and NSS header wrappers before OS_INCLUDES, r=ted This allows inline functions in headers to call NSPR/NSS functions without causing linking errors.
config/config.mk
js/src/config/config.mk
security/manager/ssl/src/Makefile.in
testing/mochitest/ssltunnel/Makefile.in
--- a/config/config.mk
+++ b/config/config.mk
@@ -369,24 +369,27 @@ MY_RULES	:= $(DEPTH)/config/myrules.mk
 CCC = $(CXX)
 XPIDL_LINK = $(PYTHON) $(LIBXUL_DIST)/sdk/bin/xpt.py link
 
 # Java macros
 JAVA_GEN_DIR  = _javagen
 JAVA_DIST_DIR = $(DEPTH)/$(JAVA_GEN_DIR)
 JAVA_IFACES_PKG_NAME = org/mozilla/interfaces
 
-OS_INCLUDES += $(NSPR_CFLAGS) $(NSS_CFLAGS) $(MOZ_JPEG_CFLAGS) $(MOZ_PNG_CFLAGS) $(MOZ_ZLIB_CFLAGS)
+OS_INCLUDES += $(MOZ_JPEG_CFLAGS) $(MOZ_PNG_CFLAGS) $(MOZ_ZLIB_CFLAGS)
 
+# NSPR_CFLAGS and NSS_CFLAGS must appear ahead of OS_INCLUDES to avoid Linux
+# builds wrongly picking up system NSPR/NSS header files.
 INCLUDES = \
   $(LOCAL_INCLUDES) \
   -I$(srcdir) \
   -I. \
   -I$(DIST)/include \
   $(if $(LIBXUL_SDK),-I$(LIBXUL_SDK)/include) \
+  $(NSPR_CFLAGS) $(NSS_CFLAGS) \
   $(OS_INCLUDES) \
   $(NULL)
 
 include $(topsrcdir)/config/static-checking-config.mk
 
 CFLAGS		= $(OS_CPPFLAGS) $(OS_CFLAGS)
 CXXFLAGS	= $(OS_CPPFLAGS) $(OS_CXXFLAGS)
 LDFLAGS		= $(OS_LDFLAGS) $(MOZ_FIX_LINK_PATHS)
--- a/js/src/config/config.mk
+++ b/js/src/config/config.mk
@@ -369,24 +369,27 @@ MY_RULES	:= $(DEPTH)/config/myrules.mk
 CCC = $(CXX)
 XPIDL_LINK = $(PYTHON) $(LIBXUL_DIST)/sdk/bin/xpt.py link
 
 # Java macros
 JAVA_GEN_DIR  = _javagen
 JAVA_DIST_DIR = $(DEPTH)/$(JAVA_GEN_DIR)
 JAVA_IFACES_PKG_NAME = org/mozilla/interfaces
 
-OS_INCLUDES += $(NSPR_CFLAGS) $(NSS_CFLAGS) $(MOZ_JPEG_CFLAGS) $(MOZ_PNG_CFLAGS) $(MOZ_ZLIB_CFLAGS)
+OS_INCLUDES += $(MOZ_JPEG_CFLAGS) $(MOZ_PNG_CFLAGS) $(MOZ_ZLIB_CFLAGS)
 
+# NSPR_CFLAGS and NSS_CFLAGS must appear ahead of OS_INCLUDES to avoid Linux
+# builds wrongly picking up system NSPR/NSS header files.
 INCLUDES = \
   $(LOCAL_INCLUDES) \
   -I$(srcdir) \
   -I. \
   -I$(DIST)/include \
   $(if $(LIBXUL_SDK),-I$(LIBXUL_SDK)/include) \
+  $(NSPR_CFLAGS) $(NSS_CFLAGS) \
   $(OS_INCLUDES) \
   $(NULL)
 
 include $(topsrcdir)/config/static-checking-config.mk
 
 CFLAGS		= $(OS_CPPFLAGS) $(OS_CFLAGS)
 CXXFLAGS	= $(OS_CPPFLAGS) $(OS_CXXFLAGS)
 LDFLAGS		= $(OS_LDFLAGS) $(MOZ_FIX_LINK_PATHS)
--- a/security/manager/ssl/src/Makefile.in
+++ b/security/manager/ssl/src/Makefile.in
@@ -90,14 +90,10 @@ DEFINES += \
   -DDLL_SUFFIX=\"$(DLL_SUFFIX)\" \
   $(NULL)
 
 EXPORTS += \
   nsNSSShutDown.h \
   ScopedNSSTypes.h \
   $(NULL)
 
-# Use local includes because they are inserted before INCLUDES
-# so that Mozilla's nss.h is used, not glibc's
-LOCAL_INCLUDES += $(NSS_CFLAGS)
-
 include $(topsrcdir)/config/rules.mk
 
--- a/testing/mochitest/ssltunnel/Makefile.in
+++ b/testing/mochitest/ssltunnel/Makefile.in
@@ -13,19 +13,15 @@ include $(DEPTH)/config/autoconf.mk
 # This isn't XPCOM code, but it wants to use STL, so disable the STL
 # wrappers
 STL_FLAGS =
 
 PROGRAM = ssltunnel$(BIN_SUFFIX)
 
 CPPSRCS = ssltunnel.cpp
 
-# Use local includes because they are inserted before INCLUDES
-# so that Mozilla's nss.h is used, not glibc's
-LOCAL_INCLUDES += $(NSPR_CFLAGS) $(NSS_CFLAGS)
-
 LIBS = \
   $(NSPR_LIBS) \
   $(NSS_LIBS) \
   $(MOZALLOC_LIB) \
   $(NULL)
 
 include $(topsrcdir)/config/rules.mk