Bug 471451 - configure outputs garbage while figuring out arguments for midl if midl is missing, r=ted
authortimeless@mozdev.org
Wed, 07 Jan 2009 20:42:15 -0800
changeset 23433 978be7d51a258470748ad18ce2f26d05870f2105
parent 23432 9a4bf340c1e3c44b678c1108f56be33f21f6a213
child 23434 aefbb338fdc2a42e4d30dcdc3f2b205691a69e31
push idunknown
push userunknown
push dateunknown
reviewersted
bugs471451
milestone1.9.2a1pre
Bug 471451 - configure outputs garbage while figuring out arguments for midl if midl is missing, r=ted
configure.in
--- a/configure.in
+++ b/configure.in
@@ -563,30 +563,35 @@ case "$target" in
         fi
         INCREMENTAL_LINKER=1
 
         # Check midl version
         _MIDL_FULL_VERSION=`"${MIDL}" -v 2>&1 | sed -nre "$_MSVC_VER_FILTER"`
         _MIDL_MAJOR_VERSION=`echo ${_MIDL_FULL_VERSION} | $AWK -F\. '{ print $1 }'`
         _MIDL_MINOR_VERSION=`echo ${_MIDL_FULL_VERSION} | $AWK -F\. '{ print $2 }'`
         _MIDL_REV_VERSION=`echo ${_MIDL_FULL_VERSION} | $AWK -F\. '{ print $3 }'`
-         # Add flags if necessary
-         AC_MSG_CHECKING([for midl flags])
-         if test \( "$_MIDL_MAJOR_VERSION" -gt "6" \) -o \( "$_MIDL_MAJOR_VERSION" = "6" -a "$_MIDL_MINOR_VERSION" -gt "0" \) -o \( "$_MIDL_MAJOR_VERSION" = "6" -a "$_MIDL_MINOR_VERSION" = "00" -a "$_MIDL_REV_VERSION" -gt "359" \); then
-             # Starting with MIDL version 6.0.359, the MIDL compiler
-             # generates /Oicf /robust stubs by default, which is not
-             # compatible with versions of Windows older than Win2k.
-             # This switches us back to the old behaviour. When we drop
-             # support for Windows older than Win2k, we should remove
-             # this.
-             MIDL_FLAGS="${MIDL_FLAGS} -no_robust"
-             AC_MSG_RESULT([need -no_robust])
-         else
-             MIDL_FLAGS="${MIDL_FLAGS}"
-             AC_MSG_RESULT([none needed])
+        # Add flags if necessary
+        AC_MSG_CHECKING([for midl flags])
+        if test -n "$_MIDL_MAJOR_VERSION"; then
+            if test \( "$_MIDL_MAJOR_VERSION" -gt "6" \) -o \( "$_MIDL_MAJOR_VERSION" = "6" -a "$_MIDL_MINOR_VERSION" -gt "0" \) -o \( "$_MIDL_MAJOR_VERSION" = "6" -a "$_MIDL_MINOR_VERSION" = "00" -a "$_MIDL_REV_VERSION" -gt "359" \); then
+                # Starting with MIDL version 6.0.359, the MIDL compiler
+                # generates /Oicf /robust stubs by default, which is not
+                # compatible with versions of Windows older than Win2k.
+                # This switches us back to the old behaviour. When we drop
+                # support for Windows older than Win2k, we should remove
+                # this.
+                MIDL_FLAGS="${MIDL_FLAGS} -no_robust"
+                AC_MSG_RESULT([need -no_robust])
+            else
+                MIDL_FLAGS="${MIDL_FLAGS}"
+                AC_MSG_RESULT([none needed])
+            fi
+        else
+            MIDL_FLAGS="${MIDL_FLAGS}"
+            AC_MSG_RESULT([none needed])
         fi
         
         unset _MSVC_VER_FILTER
         
     else
         # Check w32api version
         _W32API_MAJOR_VERSION=`echo $W32API_VERSION | $AWK -F\. '{ print $1 }'`
         _W32API_MINOR_VERSION=`echo $W32API_VERSION | $AWK -F\. '{ print $2 }'`