--- configure.in_orig	2012-02-07 17:32:15.403344140 +0530
+++ configure.in	2012-02-07 17:33:39.271389519 +0530
@@ -2271,13 +2271,13 @@
     dnl include directory is a MUCH better guess (Linux, HP-UX 10.20).
     dnl This is a workaround for idiot (esp. HP) system vendors, who
     dnl provide a /usr/include/X11, but DON'T FULLY POPULATE IT.
-    for dir in "/usr/X11" "/usr/X11R6"; do
+    for dir in "/usr/X11" "/usr/X11R7"; do
       if test -d "$dir/include/X11"; then x_includes="$dir/include"; break; fi
     done
   fi
 
   if test "$x_libraries" = "NONE"; then
-    for dir in "/usr/X11/lib" "/usr/X11R6/lib" "/usr/lib/X11R6"; do
+    for dir in "/usr/X11/lib" "/usr/X11R7/lib" "/usr/lib/X11R7"; do
       if test -r "$dir/libX11.a"; then x_libraries="$dir"; break; fi
     done
   fi
@@ -2317,7 +2317,7 @@
   done
 
   dnl Contrib X libs/includes do NOT take precedence, so AP-pend
-  for rel in "X11R6" "X11R5" "X11R4"; do
+  for rel in "X11R7" "X11R6" "X11R5" "X11R4"; do
     lib_dir="/usr/contrib/$rel/lib" inc_dir="/usr/contrib/$rel/include"
     if test -d "$lib_dir" -a -d "$inc_dir"; then
       case "$x_libraries" in *"$lib_dir"* ) ;; *)
@@ -2436,7 +2436,7 @@
   if test -d "/usr/X386/include" -o \
           -f "/etc/XF86Config"    -o \
 	  -f "/etc/X11/XF86Config" -o \
-	  -f "/usr/X11R6/lib/X11/XF86Config"; then
+	  -f "/usr/X11R7/lib/X11/XF86Config"; then
     AC_MSG_RESULT(yes)
     AC_DEFINE(HAVE_XFREE386)
   else
@@ -2458,7 +2458,7 @@
   AC_CHECK_LIB(Xbsd, main, XE_PREPEND(-lXbsd, libs_x))
 
   dnl Problem with the MIT distribution of X on AIX
-  if test "$unexec" = "unexaix.o" -a "$x11_release" = "6"; then
+  if test "$unexec" = "unexaix.o" -a "$x11_release" = "7"; then
     dnl X11R6 requires thread-safe code on AIX for some reason
     if test "$GCC" = "yes"; then
       XE_PREPEND(-mthreads, X_CFLAGS)
