--- a/configure.ac
+++ b/configure.ac
@@ -28,7 +28,7 @@
 dnl
 dnl Checks for X11
 dnl
-AC_PATH_XTRA
+PKG_CHECK_MODULES([X], [x11], , [AC_PATH_XTRA])
 if test x"$no_x" != x"yes"; then
   AC_DEFINE(HAVE_X11,,[Define this if you have X11R6 installed])
 fi
@@ -73,6 +73,8 @@
 AC_SUBST(CFLAGS)
 DEBUG_CFLAGS="$CFLAGS -DLOG -O -g3 -finstrument-functions"
 AC_SUBST(DEBUG_CFLAGS)
+
+dnl AC_TRY_LDFLAGS([-Wl,-z,defs], [LDFLAGS="$LDFLAGS -Wl,-z,defs"])
 
 dnl
 dnl Whether to enable scriptability