From 499b2873944530396cc8aecbc7bdd1a2a2c66caa Mon Sep 17 00:00:00 2001 From: wolfbeast Date: Thu, 30 Jan 2020 18:15:38 +0100 Subject: Issue #1342 - Remove support for system NSPR/NSS --- build/autoconf/nspr-build.m4 | 34 ++----------------------------- build/directive4.py | 2 -- config/external/nss/Makefile.in | 3 --- config/external/nss/crmf/moz.build | 19 ++++++++--------- config/external/nss/moz.build | 5 +---- config/recurse.mk | 2 +- js/src/old-configure.in | 1 - old-configure.in | 29 +++----------------------- toolkit/modules/AppConstants.jsm | 7 ------- toolkit/modules/moz.build | 1 - toolkit/mozapps/installer/upload-files.mk | 20 ++++++++---------- 11 files changed, 24 insertions(+), 99 deletions(-) diff --git a/build/autoconf/nspr-build.m4 b/build/autoconf/nspr-build.m4 index b733579c2..b53fb4d37 100644 --- a/build/autoconf/nspr-build.m4 +++ b/build/autoconf/nspr-build.m4 @@ -42,15 +42,6 @@ if test "$MOZ_BUILD_APP" != js || test -n "$JS_STANDALONE"; then _IS_OUTER_CONFIGURE=1 fi -MOZ_ARG_WITH_BOOL(system-nspr, -[ --with-system-nspr Use an NSPR that is already built and installed. - Use the 'nspr-config' script in the current path, - or look for the script in the directories given with - --with-nspr-exec-prefix or --with-nspr-prefix. - (Those flags are only checked if you specify - --with-system-nspr.)], - _USE_SYSTEM_NSPR=1 ) - JS_POSIX_NSPR=unset ifdef([CONFIGURING_JS],[ if test -n "$JS_STANDALONE"; then @@ -71,7 +62,6 @@ ifdef([CONFIGURING_JS],[ ]) dnl Pass at most one of -dnl --with-system-nspr dnl --with-nspr-cflags/libs dnl --enable-nspr-build dnl --enable-posix-nspr-emulation @@ -79,10 +69,6 @@ dnl --enable-posix-nspr-emulation AC_MSG_CHECKING([NSPR selection]) nspr_opts= which_nspr=default -if test -n "$_USE_SYSTEM_NSPR"; then - nspr_opts="x$nspr_opts" - which_nspr="system" -fi if test -n "$NSPR_CFLAGS" -o -n "$NSPR_LIBS"; then nspr_opts="x$nspr_opts" which_nspr="command-line" @@ -136,11 +122,7 @@ fi # anything itself. if test -n "$_IS_OUTER_CONFIGURE"; then -if test -n "$_USE_SYSTEM_NSPR"; then - AM_PATH_NSPR($NSPR_MINVER, [MOZ_SYSTEM_NSPR=1], [AC_MSG_ERROR([you do not have NSPR installed or your version is older than $NSPR_MINVER.])]) -fi - -if test -n "$MOZ_SYSTEM_NSPR" -o -n "$NSPR_CFLAGS" -o -n "$NSPR_LIBS"; then +if test -n "$NSPR_CFLAGS" -o -n "$NSPR_LIBS"; then _SAVE_CFLAGS=$CFLAGS CFLAGS="$CFLAGS $NSPR_CFLAGS" AC_TRY_COMPILE([#include "prtypes.h"], @@ -178,19 +160,7 @@ AC_SUBST(NSPR_INCLUDE_DIR) AC_SUBST(NSPR_LIB_DIR) PKGCONF_REQUIRES_PRIVATE="Requires.private: nspr" -if test -n "$MOZ_SYSTEM_NSPR"; then - _SAVE_CFLAGS=$CFLAGS - CFLAGS="$CFLAGS $NSPR_CFLAGS" - AC_TRY_COMPILE([#include "prlog.h"], - [#ifndef PR_STATIC_ASSERT - #error PR_STATIC_ASSERT not defined - #endif], - , - AC_MSG_ERROR([system NSPR does not support PR_STATIC_ASSERT])) - CFLAGS=$_SAVE_CFLAGS - # piggy back on $MOZ_SYSTEM_NSPR to set a variable for the nspr check for js.pc - PKGCONF_REQUIRES_PRIVATE="Requires.private: nspr >= $NSPR_MINVER" -elif test -n "$JS_POSIX_NSPR"; then +if test -n "$JS_POSIX_NSPR"; then PKGCONF_REQUIRES_PRIVATE= fi AC_SUBST([PKGCONF_REQUIRES_PRIVATE]) diff --git a/build/directive4.py b/build/directive4.py index bb832f6b7..38465628b 100644 --- a/build/directive4.py +++ b/build/directive4.py @@ -33,8 +33,6 @@ if ('MOZ_OFFICIAL_BRANDING' in listConfig) or (strBrandingDirectory.endswith("br # Applies to Pale Moon and Basilisk if ('MC_BASILISK' in listConfig) or ('MC_PALEMOON' in listConfig): listViolations += [ - 'MOZ_SYSTEM_NSS', - 'MOZ_SYSTEM_NSPR', 'MOZ_SYSTEM_JPEG', 'MOZ_SYSTEM_ZLIB', 'MOZ_SYSTEM_BZ2', diff --git a/config/external/nss/Makefile.in b/config/external/nss/Makefile.in index 71954b403..eff80cd32 100644 --- a/config/external/nss/Makefile.in +++ b/config/external/nss/Makefile.in @@ -3,8 +3,6 @@ # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. -ifndef MOZ_SYSTEM_NSS - CC_WRAPPER = CXX_WRAPPER = @@ -475,4 +473,3 @@ endif # MOZ_FOLD_LIBS # security/nss/lib/ckfw/builtins. See bug #836220. libs-nss/lib$(if $(MOZ_FOLD_LIBS),/ckfw): $(call mkdir_deps,$(DEPTH)/security/nss/lib/ckfw/builtins) -endif diff --git a/config/external/nss/crmf/moz.build b/config/external/nss/crmf/moz.build index 04d985d74..8b5434a49 100644 --- a/config/external/nss/crmf/moz.build +++ b/config/external/nss/crmf/moz.build @@ -6,14 +6,11 @@ Library('crmf') -if CONFIG['MOZ_SYSTEM_NSS']: - OS_LIBS += [l for l in CONFIG['NSS_LIBS'] if l.startswith('-L')] -else: - USE_LIBS += [ - # The dependency on nss is not real, but is required to force the - # parent directory being built before this one. This has no - # practical effect on linkage, since the only thing linking crmf - # will need nss anyways. - 'nss', - 'static:/security/nss/lib/crmf/crmf', - ] +USE_LIBS += [ + # The dependency on nss is not real, but is required to force the + # parent directory being built before this one. This has no + # practical effect on linkage, since the only thing linking crmf + # will need nss anyways. + 'nss', + 'static:/security/nss/lib/crmf/crmf', +] diff --git a/config/external/nss/moz.build b/config/external/nss/moz.build index 1c61b28fd..dbf19ff50 100644 --- a/config/external/nss/moz.build +++ b/config/external/nss/moz.build @@ -6,10 +6,7 @@ DIRS += ['crmf'] -if CONFIG['MOZ_SYSTEM_NSS']: - Library('nss') - OS_LIBS += CONFIG['NSS_LIBS'] -elif CONFIG['MOZ_FOLD_LIBS']: +if CONFIG['MOZ_FOLD_LIBS']: GeckoSharedLibrary('nss', linkage=None) # TODO: The library name can be changed when bug 845217 is fixed. SHARED_LIBRARY_NAME = 'nss3' diff --git a/config/recurse.mk b/config/recurse.mk index 0b469c1c3..6bf5670b5 100644 --- a/config/recurse.mk +++ b/config/recurse.mk @@ -172,7 +172,7 @@ ifeq ($(MOZ_REPLACE_MALLOC_LINKAGE),dummy library) mozglue/build/target memory/replace/logalloc/replay/target: memory/replace/dummy/target endif endif -ifeq (,$(MOZ_SYSTEM_NSPR)$(MOZ_SYSTEM_NSS)$(MOZ_FOLD_LIBS)) +ifeq (,$(MOZ_FOLD_LIBS)) config/external/nss/target: config/external/nspr/pr/target config/external/nspr/ds/target config/external/nspr/libc/target endif # Most things are built during compile (target/host), but some things happen during export diff --git a/js/src/old-configure.in b/js/src/old-configure.in index 6566ce05e..856d7aeb4 100644 --- a/js/src/old-configure.in +++ b/js/src/old-configure.in @@ -2157,7 +2157,6 @@ HOST_CXXFLAGS=`echo \ $HOST_CXXFLAGS` AC_SUBST(_DEPEND_CFLAGS) -AC_SUBST(MOZ_SYSTEM_NSPR) OS_CFLAGS="$CFLAGS" OS_CXXFLAGS="$CXXFLAGS" diff --git a/old-configure.in b/old-configure.in index a98951937..530a70471 100644 --- a/old-configure.in +++ b/old-configure.in @@ -2005,26 +2005,9 @@ esac MOZ_CONFIG_NSPR() -dnl ======================================================== -dnl = If NSS was not detected in the system, -dnl = use the one in the source tree (mozilla/security/nss) -dnl ======================================================== - -MOZ_ARG_WITH_BOOL(system-nss, -[ --with-system-nss Use system installed NSS], - _USE_SYSTEM_NSS=1 ) - -if test -n "$_USE_SYSTEM_NSS"; then - AC_MSG_ERROR([Building with system NSS is currently not supported.]) -fi - -if test -n "$_USE_SYSTEM_NSS"; then - AM_PATH_NSS(3.41, [MOZ_SYSTEM_NSS=1], [AC_MSG_ERROR([you don't have NSS installed or your version is too old])]) -fi - -if test -z "$MOZ_SYSTEM_NSS"; then - NSS_CFLAGS="-I${DIST}/include/nss" -fi +# TODO: We need to find a better place to define this include +NSS_CFLAGS="-I${DIST}/include/nss" +AC_SUBST(NSS_CFLAGS) if test -z "$SKIP_LIBRARY_CHECKS"; then dnl system JPEG support @@ -5403,10 +5386,6 @@ AC_SUBST_LIST(MOZ_BZ2_LIBS) AC_SUBST_LIST(MOZ_PNG_CFLAGS) AC_SUBST_LIST(MOZ_PNG_LIBS) -AC_SUBST(MOZ_SYSTEM_NSPR) - -AC_SUBST(MOZ_SYSTEM_NSS) - HOST_CMFLAGS=-fobjc-exceptions HOST_CMMFLAGS=-fobjc-exceptions OS_COMPILE_CMFLAGS=-fobjc-exceptions @@ -5586,8 +5565,6 @@ MC_BASILISK=$MC_BASILISK MC_PALEMOON=$MC_PALEMOON MOZ_EME=$MOZ_EME MOZ_WEBRTC=$MOZ_WEBRTC -MOZ_SYSTEM_NSS=$MOZ_SYSTEM_NSS -MOZ_SYSTEM_NSPR=$MOZ_SYSTEM_NSPR MOZ_SYSTEM_JPEG=$MOZ_SYSTEM_JPEG MOZ_SYSTEM_ZLIB=$MOZ_SYSTEM_ZLIB MOZ_SYSTEM_BZ2=$MOZ_SYSTEM_BZ2 diff --git a/toolkit/modules/AppConstants.jsm b/toolkit/modules/AppConstants.jsm index 40ceb15ba..41b398efc 100644 --- a/toolkit/modules/AppConstants.jsm +++ b/toolkit/modules/AppConstants.jsm @@ -187,13 +187,6 @@ MOZ_SAFE_BROWSING: false, #endif - MOZ_SYSTEM_NSS: -#ifdef MOZ_SYSTEM_NSS - true, -#else - false, -#endif - MOZ_PLACES: #ifdef MOZ_PLACES true, diff --git a/toolkit/modules/moz.build b/toolkit/modules/moz.build index 4e647bd7f..6b181b6aa 100644 --- a/toolkit/modules/moz.build +++ b/toolkit/modules/moz.build @@ -148,7 +148,6 @@ for var in ('ANDROID_PACKAGE_NAME', DEFINES[var] = CONFIG[var] for var in ('MOZ_TOOLKIT_SEARCH', - 'MOZ_SYSTEM_NSS', 'MOZ_UPDATER', 'MOZ_SWITCHBOARD'): if CONFIG[var]: diff --git a/toolkit/mozapps/installer/upload-files.mk b/toolkit/mozapps/installer/upload-files.mk index 40af34a59..82b550fb4 100644 --- a/toolkit/mozapps/installer/upload-files.mk +++ b/toolkit/mozapps/installer/upload-files.mk @@ -63,17 +63,15 @@ JSSHELL_BINS = \ $(DLL_PREFIX)mozglue$(DLL_SUFFIX) \ $(NULL) -ifndef MOZ_SYSTEM_NSPR - ifdef MOZ_FOLD_LIBS - JSSHELL_BINS += $(DLL_PREFIX)nss3$(DLL_SUFFIX) - else - JSSHELL_BINS += \ - $(DLL_PREFIX)nspr4$(DLL_SUFFIX) \ - $(DLL_PREFIX)plds4$(DLL_SUFFIX) \ - $(DLL_PREFIX)plc4$(DLL_SUFFIX) \ - $(NULL) - endif # MOZ_FOLD_LIBS -endif # MOZ_SYSTEM_NSPR +ifdef MOZ_FOLD_LIBS + JSSHELL_BINS += $(DLL_PREFIX)nss3$(DLL_SUFFIX) +else + JSSHELL_BINS += \ + $(DLL_PREFIX)nspr4$(DLL_SUFFIX) \ + $(DLL_PREFIX)plds4$(DLL_SUFFIX) \ + $(DLL_PREFIX)plc4$(DLL_SUFFIX) \ + $(NULL) +endif # MOZ_FOLD_LIBS ifdef MSVC_C_RUNTIME_DLL JSSHELL_BINS += $(MSVC_C_RUNTIME_DLL) -- cgit v1.2.3