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
+21 -38
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
# 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_X
AC_PATH_XTRA AC_PATH_XTRA
oldLIBS=$LIBS # See if we can compile X applications without using X_CFLAGS.
EXTRALIBS="$X_LIBS $X_EXTRA_LIBS $X_PRE_LIBS -lX11" AC_MSG_CHECKING(if $X_CFLAGS is really necessary)
LIBS="$LIBS $EXTRALIBS" AC_TRY_COMPILE( [#include <X11/Xos.h>], [],
[X_CFLAGS=
AC_MSG_RESULT(no)],
[AC_MSG_RESULT(yes)])
if test "$GL_LIBS" = ""; then XLIBS="$X_LIBS $X_EXTRA_LIBS $X_PRE_LIBS -lX11"
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
if test "$GL_LIBS" != ""; then # Check for libXtst.
GL_LIBS="$GL_LIBS $EXTRALIBS" AC_CHECK_LIB(Xtst, XTestQueryExtension,
fi XLIBS="$XLIBS -lXtst"
LIBS=$oldLIBS [AC_DEFINE(HAVE_LIBXTST, 1, [libXtst available])],
oldLIBS= ,
EXTRALIBS= [$XLIBS])
fi
if test "$GL_LIBS" = ""; then # Check for libGL and libGLU.
if test "$have_gl" != "yes"; then AC_CHECK_LIB(GL, glPushMatrix, XLIBS="$XLIBS -lGL",
AC_MSG_ERROR([No OpenGL library could be found.]) AC_MSG_ERROR([No OpenGL library could be found.]), [$XLIBS])
else AC_CHECK_LIB(GLU, gluGetString, XLIBS="$XLIBS -lGLU",
AC_MSG_ERROR([No GLU library could be found.]) AC_MSG_ERROR([No GLU library could be found.]), [$XLIBS])
fi
fi AC_SUBST(XLIBS)
AC_SUBST(GL_LIBS)
]) ])
+1 -1
View File
@@ -52,7 +52,7 @@ if test "$with_prof" = "yes"; then
test "$DEFAULT_LDFLAGS" = "yes" && LDFLAGS="$LDFLAGS -pg" test "$DEFAULT_LDFLAGS" = "yes" && LDFLAGS="$LDFLAGS -pg"
fi fi
SM_OPENGL SM_X_WITH_OPENGL
AM_PATH_SDL(1.2.6,enable_sdl=yes,enable_sdl=no) AM_PATH_SDL(1.2.6,enable_sdl=yes,enable_sdl=no)
AM_CONDITIONAL(NHAVE_SDL, test "$enable_sdl" = "no" ) AM_CONDITIONAL(NHAVE_SDL, test "$enable_sdl" = "no" )
+4 -2
View File
@@ -13,6 +13,8 @@ AM_CFLAGS =
# generates enormous output. # generates enormous output.
AM_CXXFLAGS += -finline-limit=300 AM_CXXFLAGS += -finline-limit=300
AM_CXXFLAGS += $(X_CFLAGS)
if NHAVE_SDL if NHAVE_SDL
# We use our own copy of SDL if the one on the system isn't new enough. (Most # 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 # 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 \ arch/Sound/ALSA9Dynamic.cpp arch/Sound/ALSA9Dynamic.h \
ALSA9Functions.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. # several sources to be built. We link to this at runtime, so don't add ALSA_LDFLAGS.
AM_CXXFLAGS += $(ALSA_CFLAGS) AM_CXXFLAGS += $(ALSA_CFLAGS)
endif endif
@@ -233,7 +235,7 @@ stepmania_SOURCES = $(Screens) $(DataStructures) $(FileTypes) $(StepMania) $(Arc
$(Rage) $(Actors) $(GlobalSingletons) $(crypto) $(Rage) $(Actors) $(GlobalSingletons) $(crypto)
stepmania_LDADD = \ stepmania_LDADD = \
$(GL_LIBS) \ $(XLIBS) \
$(USE_SDL_LIBS) -lSDL_image \ $(USE_SDL_LIBS) -lSDL_image \
$(LUA_LIBS) \ $(LUA_LIBS) \
$(AUDIO_LIBS) \ $(AUDIO_LIBS) \