Bug 405290 - "Implement version checking for nspr and nss" (build/autoconf part) [p=mh+mozilla@glandium.org (Mike Hommey) r=bsmedberg a1.9=schrep]
authorreed@reedloden.com
Tue, 11 Dec 2007 02:21:59 -0800
changeset 8894 121927fc848a623bccef4945088ad0e166768d79
parent 8893 3cc18e881a439411e957930818b6b94ba931a2e1
child 8895 ecd08f15f752caab415e474cfa1d9f3ffabaa1d9
push id1
push userbsmedberg@mozilla.com
push dateThu, 20 Mar 2008 16:49:24 +0000
treeherdermozilla-central@61007906a1f8 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbsmedberg
bugs405290
milestone1.9b2pre
Bug 405290 - "Implement version checking for nspr and nss" (build/autoconf part) [p=mh+mozilla@glandium.org (Mike Hommey) r=bsmedberg a1.9=schrep]
build/autoconf/nspr.m4
build/autoconf/nss.m4
--- a/build/autoconf/nspr.m4
+++ b/build/autoconf/nspr.m4
@@ -30,32 +30,47 @@ AC_ARG_WITH(nspr-exec-prefix,
 		if test -z "$NSPR_CONFIG"; then
 			NSPR_CONFIG=$nspr_config_prefix/bin/nspr-config
 		fi
 	fi
 
 	unset ac_cv_path_NSPR_CONFIG
 	AC_PATH_PROG(NSPR_CONFIG, nspr-config, no)
 	min_nspr_version=ifelse([$1], ,4.0.0,$1)
-	AC_MSG_CHECKING(for NSPR - version >= $min_nspr_version (skipping))
+	AC_MSG_CHECKING(for NSPR - version >= $min_nspr_version)
 
 	no_nspr=""
 	if test "$NSPR_CONFIG" = "no"; then
 		no_nspr="yes"
 	else
 		NSPR_CFLAGS=`$NSPR_CONFIG $nspr_config_args --cflags`
 		NSPR_LIBS=`$NSPR_CONFIG $nspr_config_args --libs`
 
-		dnl Skip version check for now
 		nspr_config_major_version=`$NSPR_CONFIG $nspr_config_args --version | \
 			sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
 		nspr_config_minor_version=`$NSPR_CONFIG $nspr_config_args --version | \
 			sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
 		nspr_config_micro_version=`$NSPR_CONFIG $nspr_config_args --version | \
 			sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
+		min_nspr_major_version=`echo $min_nspr_version | \
+			sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
+		min_nspr_minor_version=`echo $min_nspr_version | \
+			sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
+		min_nspr_micro_version=`echo $min_nspr_version | \
+			sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
+		if test "$nspr_config_major_version" -ne "$min_nspr_major_version"; then
+			no_nspr="yes"
+		elif test "$nspr_config_major_version" -eq "$min_nspr_major_version" &&
+		     test "$nspr_config_minor_version" -lt "$min_nspr_minor_version"; then
+			no_nspr="yes"
+		elif test "$nspr_config_major_version" -eq "$min_nspr_major_version" &&
+		     test "$nspr_config_minor_version" -eq "$min_nspr_minor_version" &&
+		     test "$nspr_config_micro_version" -lt "$min_nspr_micro_version"; then
+			no_nspr="yes"
+		fi
 	fi
 
 	if test -z "$no_nspr"; then
 		AC_MSG_RESULT(yes)
 		ifelse([$2], , :, [$2])     
 	else
 		AC_MSG_RESULT(no)
 	fi
--- a/build/autoconf/nss.m4
+++ b/build/autoconf/nss.m4
@@ -30,32 +30,47 @@ AC_ARG_WITH(nss-exec-prefix,
 		if test -z "$NSS_CONFIG"; then
 			NSS_CONFIG=$nss_config_prefix/bin/nss-config
 		fi
 	fi
 
 	unset ac_cv_path_NSS_CONFIG
 	AC_PATH_PROG(NSS_CONFIG, nss-config, no)
 	min_nss_version=ifelse([$1], ,3.0.0,$1)
-	AC_MSG_CHECKING(for NSS - version >= $min_nss_version (skipping))
+	AC_MSG_CHECKING(for NSS - version >= $min_nss_version)
 
 	no_nss=""
 	if test "$NSS_CONFIG" = "no"; then
 		no_nss="yes"
 	else
 		NSS_CFLAGS=`$NSS_CONFIG $nss_config_args --cflags`
 		NSS_LIBS=`$NSS_CONFIG $nss_config_args --libs`
 
-		dnl Skip version check for now
 		nss_config_major_version=`$NSS_CONFIG $nss_config_args --version | \
 			sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
 		nss_config_minor_version=`$NSS_CONFIG $nss_config_args --version | \
 			sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
 		nss_config_micro_version=`$NSS_CONFIG $nss_config_args --version | \
 			sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
+		min_nss_major_version=`echo $min_nss_version | \
+			sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
+		min_nss_minor_version=`echo $min_nss_version | \
+			sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
+		min_nss_micro_version=`echo $min_nss_version | \
+			sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
+		if test "$nss_config_major_version" -lt "$min_nss_major_version"; then
+			no_nss="yes"
+		elif test "$nss_config_major_version" -eq "$min_nss_major_version" &&
+		     test "$nss_config_minor_version" -lt "$min_nss_minor_version"; then
+			no_nss="yes"
+		elif test "$nss_config_major_version" -eq "$min_nss_major_version" &&
+		     test "$nss_config_minor_version" -eq "$min_nss_minor_version" &&
+		     test "$nss_config_micro_version" -lt "$min_nss_micro_version"; then
+			no_nss="yes"
+		fi
 	fi
 
 	if test -z "$no_nss"; then
 		AC_MSG_RESULT(yes)
 		ifelse([$2], , :, [$2])     
 	else
 		AC_MSG_RESULT(no)
 	fi