Added some #ifdefs HAVE_X11_XLIB_H where appropriate.