Fix a sed script that doesn't correctly detect i586-mingw32-gcc-3.4
authorCody Russell <bratsche@gnome.org>
Wed, 30 May 2007 02:45:22 +0000 (02:45 +0000)
committerCody Russell <bratsche@src.gnome.org>
Wed, 30 May 2007 02:45:22 +0000 (02:45 +0000)
2007-05-29  Cody Russell  <bratsche@gnome.org>

* configure.in: Fix a sed script that doesn't correctly detect
i586-mingw32-gcc-3.4 compiler, and was causing -Wno-pointer-sign
errors when building with that compiler. (#440896, Yevgen Muntyan)

svn path=/trunk/; revision=5520

ChangeLog
configure.in

index 03c753478a1bcc4ef7649914fc865e7889db57d8..584d89e72777310d3a8ce2b45c1091a27174b37a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2007-05-29  Cody Russell  <bratsche@gnome.org>
+
+       * configure.in: Fix a sed script that doesn't correctly detect
+       i586-mingw32-gcc-3.4 compiler, and was causing -Wno-pointer-sign
+       errors when building with that compiler. (#440896, Yevgen Muntyan)
+
 2007-05-29  Marco Barisione <marco@barisione.org>
 
        * glib/gregex.c: Fix g_regex_fetch_named() and
index 0a10e98dc655a04c8b57096817ba4cb4806c4cfb..68b45dce37eb4af9483e05be1769093a387d2c7f 100644 (file)
@@ -2201,13 +2201,12 @@ if test x$enable_regex = xtrue; then
   else
     # If using gcc 4 pass -Wno-pointer-sign when compiling the internal PCRE
     if test x"$GCC" = xyes; then
-      AC_MSG_CHECKING([whether gcc understands -Wno-pointer-sign])
-      if test [`$CC --version | sed -e 's/[^0-9]*\([0-9]\).*/\1/' -e q`] -ge 4; then
-        PCRE_WARN_CFLAGS="$PCRE_WARN_CFLAGS -Wno-pointer-sign"
-        AC_MSG_RESULT([yes]) 
-      else
-        AC_MSG_RESULT([no]) 
-      fi
+      AC_MSG_CHECKING([whether compiler understands -Wno-pointer-sign])
+      save_CFLAGS="$CFLAGS"
+      CFLAGS="$CFLAGS -Wno-pointer-sign"
+      AC_TRY_COMPILE([],[],[PCRE_WARN_CFLAGS="$PCRE_WARN_CFLAGS -Wno-pointer-sign"
+                           AC_MSG_RESULT(yes)],[AC_MSG_RESULT(no)])
+      CFLAGS="$save_CFLAGS"
     fi
   fi
   AC_SUBST(PCRE_WARN_CFLAGS)