changeset 2224:ae060fedf818

Always install nss.cfg, just disable the provider when not requested. 2010-04-08 Matthias Klose <doko@ubuntu.com> * Makefile.am (stamps/icedtea.stamp, stamps/icedtea-debug.stamp): Always install nss.cfg. * configure.ac: Always make nss.cfg a config file, always substitute NSS_LIBDIR.
author Matthias Klose <doko@ubuntu.com>
date Fri, 04 Jun 2010 20:39:48 +0100
parents 69c8a2f36bb0
children 3977ba007dc7
files ChangeLog Makefile.am configure.ac
diffstat 3 files changed, 24 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Wed Apr 07 14:49:04 2010 -0400
+++ b/ChangeLog	Fri Jun 04 20:39:48 2010 +0100
@@ -1,3 +1,10 @@
+2010-04-08  Matthias Klose  <doko@ubuntu.com>
+
+	* Makefile.am (stamps/icedtea.stamp, stamps/icedtea-debug.stamp):
+	Always install nss.cfg.
+	* configure.ac: Always make nss.cfg a config file, always
+	substitute NSS_LIBDIR.
+
 2010-04-07  Deepak Bhole <dbhole@redhat.com>
 
 	* plugin/icedteanp/IcedTeaNPPlugin.cc: ReplaceAll "GCJ" with "ITNP", and
--- a/Makefile.am	Wed Apr 07 14:49:04 2010 -0400
+++ b/Makefile.am	Fri Jun 04 20:39:48 2010 +0100
@@ -1847,10 +1847,8 @@
 	cp $(abs_top_builddir)/tapset/jstack.stp \
 	  $(BUILD_OUTPUT_DIR)/j2sdk-image/tapset/jstack.stp
 endif
-if ENABLE_NSS
 	cp $(abs_top_builddir)/nss.cfg \
 	  $(BUILD_OUTPUT_DIR)/j2sdk-image/jre/lib/security;
-endif
 if WITH_TZDATA_DIR
 	cp $(abs_top_builddir)/tz.properties \
 	  $(BUILD_OUTPUT_DIR)/j2sdk-image/jre/lib;
@@ -1921,10 +1919,8 @@
 	cp $(abs_top_builddir)/tapset/jstack.stp \
 	  $(DEBUG_BUILD_OUTPUT_DIR)/j2sdk-image/tapset/jstack.stp
 endif
-if ENABLE_NSS
 	cp $(abs_top_builddir)/nss.cfg \
 	  $(DEBUG_BUILD_OUTPUT_DIR)/j2sdk-image/jre/lib/security;
-endif
 if WITH_TZDATA_DIR
 	cp $(abs_top_builddir)/tz.properties \
 	  $(DEBUG_BUILD_OUTPUT_DIR)/j2sdk-image/jre/lib;
--- a/configure.ac	Wed Apr 07 14:49:04 2010 -0400
+++ b/configure.ac	Fri Jun 04 20:39:48 2010 +0100
@@ -36,6 +36,7 @@
 	AC_MSG_ERROR([Can't find fastjar or jar])
 fi
 AC_SUBST([FASTJAR])
+AC_CHECK_TOOL([LDD], [ldd])
 dnl OpenJDK's README-builds.html lists gawk as a build dependency so we
 dnl check for it explicitly rather than using AC_PROG_AWK.
 FIND_TOOL([GAWK], [gawk])
@@ -422,9 +423,23 @@
     AC_MSG_ERROR([Could not find NSS.  Either install it or configure using --disable-nss.])
   fi
   NSS_LIBDIR=`$PKG_CONFIG --variable=libdir nss`
-  AC_SUBST(NSS_LIBDIR)
-  AC_CONFIG_FILES([nss.cfg])
+else
+  dnl set it to the system library directory
+  if test "x$LDD" = x; then
+    NSS_LIBDIR=/usr/lib
+  else
+    AC_LANG_CONFTEST([AC_LANG_PROGRAM([[]], [[]])])
+    $CC conftest.c
+    syslibdir=`$LDD a.out | sed -n '/libc\.so./s,.*=> */\(@<:@^/@:>@*\)/.*,\1,p'`
+    rm -f a.out
+    case x${syslibdir} in
+      xlib|xlib64|xlib32|xlibn32) NSS_LIBDIR=/usr/${syslibdir};;
+      *) NSS_LIBDIR=/usr/lib
+    esac
+  fi
 fi
+AC_SUBST(NSS_LIBDIR)
+AC_CONFIG_FILES([nss.cfg])
 
 if test "x${ZERO_BUILD_TRUE}" = x || test "x${ADD_ZERO_BUILD_TRUE}" = x; then
   dnl Check for libffi headers and libraries.