Bug 1146869 - Make AM_PATH_{NSPR,NSS} compatible with input version in the form of major.minor. r=glandium
authorHector Zhao <bzhao@mozilla.com>
Tue, 24 Mar 2015 06:45:38 +0800
changeset 264977 9b2d059dffc9313ca582be18bb2ec7a04f6b8dd3
parent 264976 b3abbecbd3c1b145b743db740df70f6c87b2beaa
child 264978 7e4aab7d129f8c122885c6e7ba729c56b2245811
push id4718
push userraliiev@mozilla.com
push dateMon, 11 May 2015 18:39:53 +0000
treeherdermozilla-beta@c20c4ef55f08 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersglandium
bugs1146869
milestone39.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1146869 - Make AM_PATH_{NSPR,NSS} compatible with input version in the form of major.minor. r=glandium
build/autoconf/nspr.m4
build/autoconf/nss.m4
--- a/build/autoconf/nspr.m4
+++ b/build/autoconf/nspr.m4
@@ -59,27 +59,35 @@ AC_ARG_WITH(nspr-exec-prefix,
 		NSPR_LIBS="${NO_NSPR_CONFIG_SYSTEM_LDFLAGS}"
 		NSPR_VERSION_STRING="$NO_NSPR_CONFIG_SYSTEM_VERSION"
 	else
 	    no_nspr="yes"
 	fi
 
 	if test -z "$no_nspr"; then
 		nspr_config_major_version=`echo $NSPR_VERSION_STRING | \
-			sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
+			sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\(\.\([[0-9]]*\)\)\{0,1\}/\1/'`
 		nspr_config_minor_version=`echo $NSPR_VERSION_STRING | \
-			sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
+			sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\(\.\([[0-9]]*\)\)\{0,1\}/\2/'`
 		nspr_config_micro_version=`echo $NSPR_VERSION_STRING | \
-			sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
+			sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\(\.\([[0-9]]*\)\)\{0,1\}/\4/'`
+		if test -z "$nspr_config_micro_version"; then
+			nspr_config_micro_version="0"
+		fi
+
 		min_nspr_major_version=`echo $min_nspr_version | \
-			sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
+			sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\(\.\([[0-9]]*\)\)\{0,1\}/\1/'`
 		min_nspr_minor_version=`echo $min_nspr_version | \
-			sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
+			sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\(\.\([[0-9]]*\)\)\{0,1\}/\2/'`
 		min_nspr_micro_version=`echo $min_nspr_version | \
-			sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
+			sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\(\.\([[0-9]]*\)\)\{0,1\}/\4/'`
+		if test -z "$min_nspr_micro_version"; then
+			min_nspr_micro_version="0"
+		fi
+
 		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
--- a/build/autoconf/nss.m4
+++ b/build/autoconf/nss.m4
@@ -40,27 +40,35 @@ AC_ARG_WITH(nss-exec-prefix,
 	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`
 
 		nss_config_major_version=`$NSS_CONFIG $nss_config_args --version | \
-			sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
+			sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\(\.\([[0-9]]*\)\)\{0,1\}/\1/'`
 		nss_config_minor_version=`$NSS_CONFIG $nss_config_args --version | \
-			sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
+			sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\(\.\([[0-9]]*\)\)\{0,1\}/\2/'`
 		nss_config_micro_version=`$NSS_CONFIG $nss_config_args --version | \
-			sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
+			sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\(\.\([[0-9]]*\)\)\{0,1\}/\4/'`
+		if test -z "$nss_config_micro_version"; then
+			nss_config_micro_version="0"
+		fi
+
 		min_nss_major_version=`echo $min_nss_version | \
-			sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
+			sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\(\.\([[0-9]]*\)\)\{0,1\}/\1/'`
 		min_nss_minor_version=`echo $min_nss_version | \
-			sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
+			sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\(\.\([[0-9]]*\)\)\{0,1\}/\2/'`
 		min_nss_micro_version=`echo $min_nss_version | \
-			sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
+			sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\(\.\([[0-9]]*\)\)\{0,1\}/\4/'`
+		if test -z "$min_nss_micro_version"; then
+			min_nss_micro_version="0"
+		fi
+
 		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