/hg/icedtea6: Always attempt pkgconfig detection of NSS, only re...

andrew at icedtea.classpath.org andrew at icedtea.classpath.org
Thu Apr 8 17:26:51 PDT 2010


changeset 8bb5b3df3dc2 in /hg/icedtea6
details: http://icedtea.classpath.org/hg/icedtea6?cmd=changeset;node=8bb5b3df3dc2
author: Andrew John Hughes <ahughes at redhat.com>
date: Fri Apr 09 01:26:42 2010 +0100

	Always attempt pkgconfig detection of NSS, only resulting to the
	system library directory hack when necessary.

	2010-04-08 Andrew John Hughes <ahughes at redhat.com>

	 * configure.ac: Move NSS detection to macros in
	acinclude.m4.
		* acinclude.m4: (IT_OBTAIN_DEFAULT_LIBDIR): Attempts to
	discover the system library directory (e.g /usr/lib64)
	(IT_LOCATE_NSS): Always try and detect NSS and only resort
	to using the system library directory detection if NSS is
	not detected.


diffstat:

3 files changed, 52 insertions(+), 25 deletions(-)
ChangeLog    |   11 +++++++++++
acinclude.m4 |   40 ++++++++++++++++++++++++++++++++++++++++
configure.ac |   26 +-------------------------

diffs (101 lines):

diff -r a3cfc302306d -r 8bb5b3df3dc2 ChangeLog
--- a/ChangeLog	Thu Apr 08 18:35:34 2010 +0200
+++ b/ChangeLog	Fri Apr 09 01:26:42 2010 +0100
@@ -1,3 +1,14 @@ 2010-04-08  Matthias Klose  <doko at ubuntu
+2010-04-08  Andrew John Hughes  <ahughes at redhat.com>
+
+	* configure.ac: Move NSS detection to macros
+	in acinclude.m4.
+	* acinclude.m4:
+	(IT_OBTAIN_DEFAULT_LIBDIR): Attempts to discover the
+	system library directory (e.g /usr/lib64)
+	(IT_LOCATE_NSS): Always try and detect NSS
+	and only resort to using the system library directory
+	detection if NSS is not detected.
+
 2010-04-08  Matthias Klose  <doko at ubuntu.com>
 
 	* Makefile.am (stamps/icedtea.stamp, stamps/icedtea-debug.stamp):
diff -r a3cfc302306d -r 8bb5b3df3dc2 acinclude.m4
--- a/acinclude.m4	Thu Apr 08 18:35:34 2010 +0200
+++ b/acinclude.m4	Fri Apr 09 01:26:42 2010 +0100
@@ -1533,3 +1533,43 @@ fi
 fi
 ])
 
+AC_DEFUN_ONCE([IT_OBTAIN_DEFAULT_LIBDIR],
+[
+dnl find the system library directory
+AC_CACHE_CHECK([for system library directory], [it_cv_default_libdir],
+[
+if test "x$LDD" = x; then
+  it_cv_default_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};;
+    *) it_cv_default_libdir=/usr/lib
+  esac
+fi
+])
+AC_SUBST([DEFAULT_LIBDIR], $it_cv_default_libdir)
+])
+
+AC_DEFUN_ONCE([IT_LOCATE_NSS],
+[
+AC_REQUIRE([IT_OBTAIN_DEFAULT_LIBDIR])
+PKG_CHECK_MODULES(NSS, nss, [NSS_FOUND=yes], [NSS_FOUND=no])
+if test "x${NSS_FOUND}" = xno
+then
+  if test "x${ENABLE_NSS}" = "xyes"
+  then
+    AC_MSG_ERROR([Could not find NSS.  Either install it or configure using --disable-nss.])
+  else
+    AC_MSG_WARN([Could not find NSS; using $DEFAULT_LIBDIR as its location.])
+    NSS_LIBDIR=$DEFAULT_LIBDIR
+  fi
+else
+  NSS_LIBDIR=`$PKG_CONFIG --variable=libdir nss`
+fi
+AC_SUBST(NSS_LIBDIR)
+AC_CONFIG_FILES([nss.cfg])
+])
diff -r a3cfc302306d -r 8bb5b3df3dc2 configure.ac
--- a/configure.ac	Thu Apr 08 18:35:34 2010 +0200
+++ b/configure.ac	Fri Apr 09 01:26:42 2010 +0100
@@ -408,31 +408,7 @@ then
   AC_SUBST(LIBPULSE_LIBS)
 fi
 
-if test "x${ENABLE_NSS}" = "xyes"
-then
-  PKG_CHECK_MODULES(NSS, nss, [NSS_FOUND=yes], [NSS_FOUND=no])
-  if test "x${NSS_FOUND}" = xno
-  then
-    AC_MSG_ERROR([Could not find NSS.  Either install it or configure using --disable-nss.])
-  fi
-  NSS_LIBDIR=`$PKG_CONFIG --variable=libdir nss`
-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])
+IT_LOCATE_NSS
 
 if test "x${ZERO_BUILD_TRUE}" = x || test "x${ADD_ZERO_BUILD_TRUE}" = x; then
   dnl Check for libffi headers and libraries.



More information about the distro-pkg-dev mailing list