Blame SOURCES/pr1983-root.patch

2b939e
# HG changeset patch
2b939e
# User andrew
2b939e
# Date 1453863007 0
2b939e
#      Wed Jan 27 02:50:07 2016 +0000
2b939e
# Node ID f0635543beb309c4da1bb88c906a76ee4b75e16d
2b939e
# Parent  4a5a0d4e1ae0feec2f47d17be380d6fcd5eff126
2b939e
PR1983: Support using the system installation of NSS with the SunEC provider
2b939e
Summary: Add new configure option --enable-system-nss
2b939e
2b939e
diff -r 92af9369869f common/autoconf/jdk-options.m4
2b939e
--- openjdk/common/autoconf/jdk-options.m4	Thu Jan 21 22:17:02 2016 +0000
2b939e
+++ openjdk/common/autoconf/jdk-options.m4	Wed Jan 27 05:32:12 2016 +0000
2b939e
@@ -414,9 +414,10 @@
2b939e
   #
2b939e
   AC_DEFUN_ONCE([JDKOPT_DETECT_INTREE_EC],
2b939e
   [
2b939e
-    AC_MSG_CHECKING([if elliptic curve crypto implementation is present])
2b939e
+    AC_REQUIRE([LIB_SETUP_MISC_LIBS])
2b939e
+    AC_MSG_CHECKING([if the elliptic curve crypto implementation is present])
2b939e
 
2b939e
-    if test -d "${SRC_ROOT}/jdk/src/share/native/sun/security/ec/impl"; then
2b939e
+    if test "x${system_nss}" = "xyes" -o -d "${SRC_ROOT}/jdk/src/share/native/sun/security/ec/impl"; then
2b939e
       ENABLE_INTREE_EC=yes
2b939e
       AC_MSG_RESULT([yes])
2b939e
     else
2b939e
diff -r 92af9369869f common/autoconf/libraries.m4
2b939e
--- openjdk/common/autoconf/libraries.m4	Thu Jan 21 22:17:02 2016 +0000
2b939e
+++ openjdk/common/autoconf/libraries.m4	Wed Jan 27 05:32:12 2016 +0000
2b939e
@@ -731,6 +731,47 @@
2b939e
   LIBDL="$LIBS"
2b939e
   AC_SUBST(LIBDL)
2b939e
   LIBS="$save_LIBS"
2b939e
+
2b939e
+  ###############################################################################
2b939e
+  #
2b939e
+  # Check for the NSS libraries
2b939e
+  #
2b939e
+
2b939e
+  AC_MSG_CHECKING([whether to build the Sun EC provider against the system NSS libraries])
2b939e
+
2b939e
+  # default is bundled
2b939e
+  DEFAULT_SYSTEM_NSS=no
2b939e
+
2b939e
+  AC_ARG_ENABLE([system-nss], [AS_HELP_STRING([--enable-system-nss],
2b939e
+     [build the SunEC provider using the system NSS libraries @<:@disabled@:>@])],
2b939e
+  [
2b939e
+    case "${enableval}" in
2b939e
+      yes)
2b939e
+        system_nss=yes
2b939e
+        ;;
2b939e
+      *)
2b939e
+        system_nss=no
2b939e
+        ;;
2b939e
+    esac
2b939e
+  ],
2b939e
+  [
2b939e
+    system_nss=${DEFAULT_SYSTEM_NSS}
2b939e
+  ])
2b939e
+  AC_MSG_RESULT([$system_nss])
2b939e
+
2b939e
+  if test "x${system_nss}" = "xyes"; then
2b939e
+      PKG_CHECK_MODULES(NSS, nss-softokn >= 3.16.1, [NSS_SOFTOKN_FOUND=yes], [NSS_SOFTOKN_FOUND=no])
2b939e
+      if test "x${NSS_SOFTOKN_FOUND}" = "xyes"; then
2b939e
+          NSS_LIBS="$NSS_LIBS -lfreebl";
2b939e
+	  USE_EXTERNAL_NSS=true
2b939e
+      else
2b939e
+	  AC_MSG_ERROR([--enable-system-nss specified, but NSS not found.])
2b939e
+      fi
2b939e
+  else
2b939e
+      USE_EXTERNAL_NSS=false
2b939e
+  fi
2b939e
+  AC_SUBST(USE_EXTERNAL_NSS)
2b939e
+
2b939e
 ])
2b939e
 
2b939e
 AC_DEFUN_ONCE([LIB_SETUP_STATIC_LINK_LIBSTDCPP],
2b939e
diff -r 92af9369869f common/autoconf/spec.gmk.in
2b939e
--- openjdk/common/autoconf/spec.gmk.in	Thu Jan 21 22:17:02 2016 +0000
2b939e
+++ openjdk/common/autoconf/spec.gmk.in	Wed Jan 27 05:32:12 2016 +0000
2b939e
@@ -647,6 +647,9 @@
2b939e
 # Read-only single-machine data
2b939e
 INSTALL_SYSCONFDIR=@sysconfdir@
2b939e
 
2b939e
+USE_EXTERNAL_NSS:=@USE_EXTERNAL_NSS@
2b939e
+NSS_LIBS:=@NSS_LIBS@
2b939e
+NSS_CFLAGS:=@NSS_CFLAGS@
2b939e
 
2b939e
 ####################################################
2b939e
 #