add libXtst check

simplify
This commit is contained in:
Glenn Maynard
2004-03-15 02:26:34 +00:00
parent 7acf97c224
commit eca7863cf4
3 changed files with 28 additions and 43 deletions
+23 -40
View File
@@ -1,47 +1,30 @@
AC_DEFUN(SM_OPENGL,
AC_DEFUN(SM_X_WITH_OPENGL,
[
GL_LIBS=
if test "$GL_LIBS" = ""; then
AC_CHECK_LIB(GL, glPushMatrix, have_gl=yes)
AC_CHECK_LIB(GLU, gluGetString, have_glu=yes, , [-lGL])
if test "$have_gl" = "yes" -a "$have_glu" = "yes"; then
GL_LIBS="-lGL -lGLU"
fi
fi
AC_PATH_X
AC_PATH_XTRA
# See if we can compile X applications without using X_CFLAGS.
AC_MSG_CHECKING(if $X_CFLAGS is really necessary)
AC_TRY_COMPILE( [#include <X11/Xos.h>], [],
[X_CFLAGS=
AC_MSG_RESULT(no)],
[AC_MSG_RESULT(yes)])
# Some broken systems need us to link to X explicitly because
# the GL library needs it, instead of doing it automatically.
if test "$GL_LIBS" = ""; then
AC_PATH_X
AC_PATH_XTRA
XLIBS="$X_LIBS $X_EXTRA_LIBS $X_PRE_LIBS -lX11"
oldLIBS=$LIBS
EXTRALIBS="$X_LIBS $X_EXTRA_LIBS $X_PRE_LIBS -lX11"
LIBS="$LIBS $EXTRALIBS"
# Check for libXtst.
AC_CHECK_LIB(Xtst, XTestQueryExtension,
XLIBS="$XLIBS -lXtst"
[AC_DEFINE(HAVE_LIBXTST, 1, [libXtst available])],
,
[$XLIBS])
if test "$GL_LIBS" = ""; then
AC_CHECK_LIB(GL, glPushMatrix, have_gl=yes)
AC_CHECK_LIB(GLU, gluGetString, have_glu=yes, , [-lGL])
if test "$have_gl" = "yes" -a "$have_glu" = "yes"; then
GL_LIBS="-lGL -lGLU"
fi
fi
# 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])
if test "$GL_LIBS" != ""; then
GL_LIBS="$GL_LIBS $EXTRALIBS"
fi
LIBS=$oldLIBS
oldLIBS=
EXTRALIBS=
fi
if test "$GL_LIBS" = ""; then
if test "$have_gl" != "yes"; then
AC_MSG_ERROR([No OpenGL library could be found.])
else
AC_MSG_ERROR([No GLU library could be found.])
fi
fi
AC_SUBST(GL_LIBS)
AC_SUBST(XLIBS)
])
+1 -1
View File
@@ -52,7 +52,7 @@ if test "$with_prof" = "yes"; then
test "$DEFAULT_LDFLAGS" = "yes" && LDFLAGS="$LDFLAGS -pg"
fi
SM_OPENGL
SM_X_WITH_OPENGL
AM_PATH_SDL(1.2.6,enable_sdl=yes,enable_sdl=no)
AM_CONDITIONAL(NHAVE_SDL, test "$enable_sdl" = "no" )
+4 -2
View File
@@ -13,6 +13,8 @@ AM_CFLAGS =
# generates enormous output.
AM_CXXFLAGS += -finline-limit=300
AM_CXXFLAGS += $(X_CFLAGS)
if NHAVE_SDL
# We use our own copy of SDL if the one on the system isn't new enough. (Most
# systems have 1.2.5; we need 1.2.6.) We still end up linking dynamically to
@@ -103,7 +105,7 @@ Sound += arch/Sound/RageSoundDriver_ALSA9.cpp arch/Sound/RageSoundDriver_ALSA9.h
arch/Sound/ALSA9Dynamic.cpp arch/Sound/ALSA9Dynamic.h \
ALSA9Functions.h
# Add this to CPPFLAGS, not stepmania_CPPFLAGS: that'll cause multiple copies of
# Add this to AM_CXXFLAGS, not stepmania_CXXFLAGS: that'll cause multiple copies of
# several sources to be built. We link to this at runtime, so don't add ALSA_LDFLAGS.
AM_CXXFLAGS += $(ALSA_CFLAGS)
endif
@@ -233,7 +235,7 @@ stepmania_SOURCES = $(Screens) $(DataStructures) $(FileTypes) $(StepMania) $(Arc
$(Rage) $(Actors) $(GlobalSingletons) $(crypto)
stepmania_LDADD = \
$(GL_LIBS) \
$(XLIBS) \
$(USE_SDL_LIBS) -lSDL_image \
$(LUA_LIBS) \
$(AUDIO_LIBS) \