diff -r -u CMakeLists.txt.old CMakeLists.txt
--- CMakeLists.txt.old	2010-05-16 00:37:39.000000000 -0700
+++ CMakeLists.txt	2010-06-20 14:48:01.000000000 -0700
@@ -43,6 +43,11 @@
 
 		IF(IMLIB_FOUND)
 			SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DHAVE_IMLIB")
+
+			INCLUDE(FindX11)
+			IF(NOT X11_FOUND)
+				ADD_DEFINITIONS(-DX_DISPLAY_MISSING)
+			ENDIF(NOT X11_FOUND)
 		ELSE(IMLIB_FOUND)
 			MESSAGE(FATAL_ERROR "Unable to find the imlib2 library. To disable use of imlib2, run 'make ENABLE_IMLIB=OFF'")
 		ENDIF(IMLIB_FOUND)
