Files
itgmania212121/stepmania/autoconf/m4/opengl.m4
T

70 lines
1.7 KiB
Plaintext
Raw Normal View History

2005-01-17 17:51:18 +00:00
AC_DEFUN([SM_X_WITH_OPENGL],
2003-09-18 22:28:19 +00:00
[
2004-03-15 02:26:34 +00:00
AC_PATH_X
2004-05-27 23:03:23 +00:00
XCFLAGS=
XLIBS=
2003-09-18 22:28:19 +00:00
2004-05-27 23:03:23 +00:00
if test "$no_x" != "yes"; then
if test -n "$x_includes"; then
XCFLAGS="-I$x_includes"
fi
if test -n "$x_libraries"; then
XLIBS="-L$x_libraries -lX11"
fi
if test -n "$x_includes"; then
# See if we can compile X applications without using $XCFLAGS.
AC_MSG_CHECKING(if $XCFLAGS is really necessary)
AC_TRY_COMPILE( [#include <X11/Xos.h>], [],
[XCFLAGS=
AC_MSG_RESULT(no)],
[AC_MSG_RESULT(yes)])
fi
2004-06-04 20:31:45 +00:00
# Check for libXtst.
AC_CHECK_LIB(Xtst, XTestQueryExtension,
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])
2004-05-27 23:03:23 +00:00
fi
# 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>])
if test "$have_xrandr_header" = "no"; then
have_xrandr=no
fi
if test "$have_xrandr" = "no"; then
echo "*** Direct X11 support needs Xrandr libraries and headers."
echo "*** Couldn't find needed headers. Continuing without X11 backend."
2006-06-28 00:56:00 +00:00
no_x = yes
else
2006-01-04 18:59:45 +00:00
XLIBS="$XLIBS -lXrandr"
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
AC_SUBST(XCFLAGS)
AC_SUBST(XLIBS)
2004-03-15 02:26:34 +00:00
# Check for libGL and libGLU.
AC_CHECK_LIB(GL, glPushMatrix, XLIBS="$XLIBS -lGL",
AC_MSG_ERROR([No OpenGL library could be found.]), [$XLIBS])
AC_CHECK_LIB(GLU, gluGetString, XLIBS="$XLIBS -lGLU",
AC_MSG_ERROR([No GLU library could be found.]), [$XLIBS])
2004-01-27 06:09:27 +00:00
2004-03-15 02:26:34 +00:00
AC_SUBST(XLIBS)
2003-09-18 22:28:19 +00:00
])