bug 1243349 - fix NSPR link paths for NSS. r=mshal
authorTed Mielczarek <ted@mielczarek.org>
Wed, 27 Jan 2016 09:28:40 -0500
changeset 282137 94a70f108d118a9a22ea6719e1c37867fedf49c7
parent 282136 a34e325a174690ec1632eb15938b70927aaf9820
child 282138 42ee56af794cd2d490e67d0bc07a1e9bf0b07d3a
push id17288
push userkwierso@gmail.com
push dateFri, 29 Jan 2016 01:50:54 +0000
treeherderfx-team@2229629e3bf2 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmshal
bugs1243349
milestone47.0a1
bug 1243349 - fix NSPR link paths for NSS. r=mshal
build/autoconf/nspr-build.m4
config/external/nss/Makefile.in
configure.in
--- a/build/autoconf/nspr-build.m4
+++ b/build/autoconf/nspr-build.m4
@@ -152,25 +152,35 @@ if test -n "$MOZ_NATIVE_NSPR" -o -n "$NS
     AC_TRY_COMPILE([#include "prtypes.h"],
                 [#ifndef PR_UINT64
                  #error PR_UINT64 not defined or requires including prtypes.h
                  #endif],
                 ,
                 AC_MSG_ERROR([system NSPR does not support PR_UINT64 or including prtypes.h does not provide it]))
     CFLAGS=$_SAVE_CFLAGS
 elif test -z "$JS_POSIX_NSPR"; then
-    NSPR_CFLAGS="-I${DIST}/include/nspr"
+    NSPR_INCLUDE_DIR="${DIST}/include/nspr"
+    NSPR_CFLAGS="-I${NSPR_INCLUDE_DIR}"
     if test -n "$GNU_CC"; then
-        NSPR_LIBS="-L${DIST}/lib -lnspr${NSPR_VERSION} -lplc${NSPR_VERSION} -lplds${NSPR_VERSION}"
+        if test -n "$MOZ_FOLD_LIBS"; then
+           NSPR_LIB_DIR=${DIST}/lib
+        else
+           NSPR_LIB_DIR=${DIST}/bin
+        fi
+        NSPR_LIBS="-L${NSPR_LIB_DIR} -lnspr${NSPR_VERSION} -lplc${NSPR_VERSION} -lplds${NSPR_VERSION}"
     else
+        # NSS needs actual static libs to link to, and this is where they are.
         NSPR_LIBS="${DIST}/lib/nspr${NSPR_VERSION}.lib ${DIST}/lib/plc${NSPR_VERSION}.lib ${DIST}/lib/plds${NSPR_VERSION}.lib "
+        NSPR_LIB_DIR="${DIST}/lib"
     fi
 fi
 
 AC_SUBST_LIST(NSPR_CFLAGS)
+AC_SUBST(NSPR_INCLUDE_DIR)
+AC_SUBST(NSPR_LIB_DIR)
 
 NSPR_PKGCONF_CHECK="nspr"
 if test -n "$MOZ_NATIVE_NSPR"; then
     # piggy back on $MOZ_NATIVE_NSPR to set a variable for the nspr check for js.pc
     NSPR_PKGCONF_CHECK="nspr >= $NSPR_MINVER"
 
     _SAVE_CFLAGS=$CFLAGS
     CFLAGS="$CFLAGS $NSPR_CFLAGS"
--- a/config/external/nss/Makefile.in
+++ b/config/external/nss/Makefile.in
@@ -82,27 +82,30 @@ NSS_EXTRA_DLLS += freebl_32int64_3
 endif
 ifdef HAVE_FREEBL_LIBS_64
 NSS_EXTRA_DLLS += freebl_64int_3
 NSS_EXTRA_DLLS += freebl_64fpu_3
 endif
 
 # For all variables such as DLLFLAGS, that may contain $(DIST)
 DIST := $(ABS_DIST)
+# TODO: move this all to configure, but in Python
+ifndef MOZ_BUILD_NSPR
 NSPR_INCLUDE_DIR = $(firstword $(filter -I%,$(NSPR_CFLAGS)))
 ifneq (,$(strip $(NSPR_INCLUDE_DIR)))
 NSPR_INCLUDE_DIR := $(subst -I,,$(subst -I$(DIST),-I$(ABS_DIST),$(NSPR_INCLUDE_DIR)))
 else
-NSPR_INCLUDE_DIR = $(ABS_DIST)/include/nspr
+$(error Your NSPR CFLAGS are broken!)
 endif
 NSPR_LIB_DIR = $(firstword $(filter -L%,$(NSPR_LIBS)))
 ifneq (,$(strip $(NSPR_LIB_DIR)))
 NSPR_LIB_DIR := $(subst -L,,$(subst -L$(DIST),-L$(ABS_DIST),$(NSPR_LIB_DIR)))
 else
-NSPR_LIB_DIR = $(ABS_DIST)/lib
+$(error Your NSPR LDFLAGS are broken!)
+endif
 endif
 
 # To get debug symbols from NSS
 export MOZ_DEBUG_SYMBOLS
 
 DEFAULT_GMAKE_FLAGS =
 DEFAULT_GMAKE_FLAGS += CC='$(CC)'
 DEFAULT_GMAKE_FLAGS += SOURCE_MD_DIR=$(ABS_DIST)
--- a/configure.in
+++ b/configure.in
@@ -3403,16 +3403,25 @@ dnl = Check for external package depende
 dnl =
 dnl ========================================================
 MOZ_ARG_HEADER(External Packages)
 
 MOZ_ARG_WITH_STRING(libxul-sdk,
 [  --with-libxul-sdk=PFX   Use the libXUL SDK at <PFX>],
   AC_MSG_ERROR([--with-libxul-sdk is not supported anymore.]))
 
+case "$OS_TARGET" in
+WINNT|Darwin|Android)
+  MOZ_FOLD_LIBS=1
+  ;;
+*)
+  MOZ_FOLD_LIBS=
+  ;;
+esac
+
 MOZ_CONFIG_NSPR()
 
 dnl set GRE_MILESTONE
 dnl ========================================================
 GRE_MILESTONE=`tail -n 1 "$_topsrcdir"/config/milestone.txt 2>/dev/null || tail -1 "$_topsrcdir"/config/milestone.txt`
 AC_SUBST(GRE_MILESTONE)
 
 # set RELEASE_BUILD and NIGHTLY_BUILD variables depending on the cycle we're in
@@ -4091,25 +4100,16 @@ AC_SUBST(MOZ_PHOENIX)
 AC_SUBST(MOZ_XULRUNNER)
 AC_SUBST(MOZ_B2G)
 AC_SUBST(MOZ_MULET)
 AC_SUBST(MOZ_B2G_VERSION)
 AC_SUBST(MOZ_B2GDROID)
 
 AC_DEFINE_UNQUOTED(MOZ_BUILD_APP,$MOZ_BUILD_APP)
 
-case "$OS_TARGET" in
-WINNT|Darwin|Android)
-  MOZ_FOLD_LIBS=1
-  ;;
-*)
-  MOZ_FOLD_LIBS=
-  ;;
-esac
-
 dnl ========================================================
 dnl Ensure Android SDK and build-tools versions depending on
 dnl mobile target.
 dnl ========================================================
 
 if test -z "$gonkdir" ; then
     case "$MOZ_BUILD_APP" in
     mobile/android | mobile/android/b2gdroid)