Bug 1146869 - Make AM_PATH_{NSPR,NSS} compatible with input version in the form of major.minor. r=glandium, a=NPOTB
authorHector Zhao <bzhao@mozilla.com>
Tue, 24 Mar 2015 06:45:38 +0800
changeset 258241 0fce0415d8b4
parent 258240 e65f5a19d0e4
child 258242 67259acf0c1e
push id4627
push userryanvm@gmail.com
push date2015-04-03 19:22 +0000
treeherdermozilla-beta@5f5a4c5a7e02 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersglandium, NPOTB
bugs1146869
milestone38.0
Bug 1146869 - Make AM_PATH_{NSPR,NSS} compatible with input version in the form of major.minor. r=glandium, a=NPOTB
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