2013-10-24 00:23:06 -05:00
|
|
|
AC_DEFUN([SM_X11],
|
2003-09-18 22:28:19 +00:00
|
|
|
[
|
2011-07-07 11:37:22 -05:00
|
|
|
AC_PATH_X
|
2003-09-18 22:28:19 +00:00
|
|
|
|
2011-07-07 11:37:22 -05:00
|
|
|
XCFLAGS=
|
|
|
|
|
XLIBS=
|
|
|
|
|
|
|
|
|
|
if test "$no_x" != "yes"; then
|
2004-05-27 23:03:23 +00:00
|
|
|
if test -n "$x_includes"; then
|
2011-07-07 11:37:22 -05:00
|
|
|
XCFLAGS="-I$x_includes"
|
2004-05-27 23:03:23 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
if test -n "$x_libraries"; then
|
2011-07-07 11:37:22 -05:00
|
|
|
XLIBS="-L$x_libraries"
|
2004-05-27 23:03:23 +00:00
|
|
|
fi
|
|
|
|
|
|
2011-07-07 09:23:32 -04:00
|
|
|
XLIBS+="-lX11"
|
2011-07-07 00:49:26 -04:00
|
|
|
|
2004-05-27 23:03:23 +00:00
|
|
|
if test -n "$x_includes"; then
|
2011-07-07 11:37:22 -05:00
|
|
|
# See if we can compile X applications without using $XCFLAGS.
|
|
|
|
|
AC_MSG_CHECKING(if $XCFLAGS is really necessary)
|
|
|
|
|
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <X11/Xos.h>]], [[]])],[XCFLAGS=
|
2007-03-13 10:20:57 +00:00
|
|
|
AC_MSG_RESULT(no)],[AC_MSG_RESULT(yes)])
|
2004-05-27 23:03:23 +00:00
|
|
|
fi
|
2004-06-04 20:31:45 +00:00
|
|
|
|
|
|
|
|
# Check for libXtst.
|
|
|
|
|
AC_CHECK_LIB(Xtst, XTestQueryExtension,
|
2011-07-07 11:37:22 -05:00
|
|
|
XLIBS="$XLIBS -lXtst"
|
|
|
|
|
[AC_DEFINE(HAVE_LIBXTST, 1, [libXtst available])],
|
|
|
|
|
,
|
|
|
|
|
[$XLIBS])
|
2005-03-13 23:06:07 +00:00
|
|
|
AC_DEFINE(HAVE_X11, 1, [X11 libraries present])
|
2011-07-07 11:37:22 -05:00
|
|
|
fi
|
2005-12-02 21:17:36 +00:00
|
|
|
|
|
|
|
|
# Check for Xrandr
|
|
|
|
|
# Can someone fix this for me? This is producing bizarre warnings from
|
|
|
|
|
# configure... I have no clue what I'm doing -Ben
|
2006-01-04 18:59:45 +00:00
|
|
|
AC_CHECK_LIB(Xrandr, XRRSizes,
|
|
|
|
|
have_xrandr=yes,
|
|
|
|
|
have_xrandr=no,
|
|
|
|
|
[$XLIBS])
|
|
|
|
|
AC_CHECK_HEADER(X11/extensions/Xrandr.h, have_xrandr_header=yes, have_xrandr_header=no, [#include <X11/Xlib.h>])
|
2005-12-02 21:17:36 +00:00
|
|
|
|
|
|
|
|
if test "$have_xrandr_header" = "no"; then
|
|
|
|
|
have_xrandr=no
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
if test "$have_xrandr" = "no"; then
|
2013-10-25 01:47:06 -05:00
|
|
|
if test "$unix" = "yes"; then
|
|
|
|
|
AC_MSG_ERROR("Couldn't find X11 libraries.")
|
|
|
|
|
else
|
|
|
|
|
no_x=yes
|
|
|
|
|
fi
|
2005-12-02 21:17:36 +00:00
|
|
|
else
|
2006-01-04 18:59:45 +00:00
|
|
|
XLIBS="$XLIBS -lXrandr"
|
2005-12-02 21:17:36 +00:00
|
|
|
fi
|
|
|
|
|
|
2005-03-13 23:06:07 +00:00
|
|
|
AM_CONDITIONAL(HAVE_X11, test "$no_x" != "yes")
|
2004-05-27 23:03:23 +00:00
|
|
|
|
2011-07-07 11:37:22 -05:00
|
|
|
AC_SUBST(XCFLAGS)
|
|
|
|
|
AC_SUBST(XLIBS)
|
2003-09-18 22:28:19 +00:00
|
|
|
])
|