Fix for X11 includes detection.

diff --git a/configure.in b/configure.in
index 3705dc7..08f9282 100644
--- a/configure.in
+++ b/configure.in
@@ -97,6 +97,8 @@
 if test "$have_x" = "yes"
 then
     XLIB="-lXext -lX11"
+    ac_save_CPPFLAGS="$CPPFLAGS"
+    CPPFLAGS="$CPPFLAGS $X_CFLAGS"
 
     dnl Check for -lXpm
     AC_CHECK_HEADERS(X11/xpm.h)
@@ -130,6 +132,8 @@
     then
         AC_CHECK_LIB(MesaGL,OSMesaCreateContext,AC_DEFINE(HAVE_LIBMESAGL) X_PRE_LIBS="$X_PRE_LIBS -lMesaGL",,$X_LIBS -lXext -lX11 -lm)
     fi
+
+    CPPFLAGS="$ac_save_CPPFLAGS"
 else
     XLIB=""
     X_CFLAGS=""
@@ -667,6 +671,12 @@
   echo "*** X support, which currently does not work, and would probably not be"
   echo "*** what you want anyway. You will need to install devel packages of"
   echo "*** Xlib/Xfree86 and Xpm at the very least."
+elif test "$ac_cv_lib_Xpm_XpmCreatePixmapFromData" = "no"
+then
+  echo
+  echo "*** Warning: Xpm development files not found. Wine will be built without"
+  echo "*** Xpm support, which currently does not work. You will need to install"
+  echo "*** devel packages of Xpm."
 fi
 
 if test "$ac_cv_lib_ncurses_resizeterm" = "no" -a "$ac_cv_lib_ncurses_waddch" = "yes"