Add config check and thread safe wrappers for the XRender library.

diff --git a/configure.in b/configure.in
index 0f4e25f..c1d2f85 100644
--- a/configure.in
+++ b/configure.in
@@ -176,7 +176,7 @@
       ]
     )
 
-    dnl *** All three of the following tests require X11/Xlib.h
+    dnl *** All of the following tests require X11/Xlib.h
     AC_CHECK_HEADERS(X11/Xlib.h,
       [
         dnl *** Check for X keyboard extension
@@ -261,6 +261,19 @@
             AC_MSG_WARN([XVideo extension not found !!])
         )
 
+        dnl *** Check for XRender extension
+        AC_CHECK_HEADERS(X11/extensions/Xrender.h,
+            [ dnl *** If X11/extensions/Xrender.h exists...
+                AC_CHECK_LIB(Xrender, XRenderQueryExtension,
+                  [ AC_DEFINE(HAVE_LIBXRENDER, 1, [Define if you have the XRender extension library])
+                     X_PRE_LIBS="$X_PRE_LIBS -lXrender"
+                  ],,
+                  $X_LIBS -lXext -lX11 $X_EXTRA_LIBS
+                )
+            ],
+            AC_MSG_WARN([XRender extension not found !!])
+        )
+
       ]
     ) dnl *** End of X11/Xlib.h check