bug 378469 - fix some configure tests in MSMANIFEST_TOOL checking. r=bsmedberg
authorted.mielczarek@gmail.com
Mon, 23 Apr 2007 09:32:52 -0700
changeset 735 2079444238835a595e15cfe11e59d7e863130840
parent 734 17aa4a9b44299548355e031ad6658d2bd71c2671
child 736 f04db18b1bc7b9c7bb9366bd93484ceedced7e43
push idunknown
push userunknown
push dateunknown
reviewersbsmedberg
bugs378469
milestone1.9a4pre
bug 378469 - fix some configure tests in MSMANIFEST_TOOL checking. r=bsmedberg
configure.in
--- a/configure.in
+++ b/configure.in
@@ -477,20 +477,24 @@ case "$target" in
 
         if test -n "$WIN32_REDIST_DIR"; then
             WIN32_REDIST_DIR=`cd "$WIN32_REDIST_DIR" && pwd`
         fi
 	
         # bug #249782
         # ensure that mt.exe is Microsoft (R) Manifest Tool and not magnetic tape manipulation utility (or something else)
         if test "$_CC_SUITE" -ge "8"; then
+                changequote(,)
+                _MSMT_VER_FILTER='s|.* \([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\).*|\1|p'
+                changequote([,])
+
                 MSMT_TOOL=`mt 2>&1|grep 'Microsoft (R) Manifest Tool'`
-                if test -n "MSMT_TOOL"; then
-                        MSMANIFEST_TOOL_VERSION=`echo ${MSMANIFEST_TOOL}|grep -Po "(^|\s)[0-9]+\.[0-9]+\.[0-9]+(\.[0-9]+)?(\s|$)"`
-                        if test -z "MSMANIFEST_TOOL_VERSION"; then
+                if test -n "$MSMT_TOOL"; then
+                        MSMANIFEST_TOOL_VERSION=`echo ${MSMT_TOOL}|sed -ne "$_MSMT_VER_FILTER"`
+                        if test -z "$MSMANIFEST_TOOL_VERSION"; then
                                 AC_MSG_WARN([Unknown version of the Microsoft (R) Manifest Tool.])
                         fi
                         MSMANIFEST_TOOL=1
                         unset MSMT_TOOL
                 else
                         AC_MSG_ERROR([Microsoft (R) Manifest Tool must be in your \$PATH.])
                 fi
         fi