diff --git a/stepmania/autoconf/m4/opengl.m4 b/stepmania/autoconf/m4/opengl.m4 index d83ef00825..b306485355 100644 --- a/stepmania/autoconf/m4/opengl.m4 +++ b/stepmania/autoconf/m4/opengl.m4 @@ -1,16 +1,31 @@ AC_DEFUN(SM_X_WITH_OPENGL, [ 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 ], [], - [X_CFLAGS= - AC_MSG_RESULT(no)], - [AC_MSG_RESULT(yes)]) + XCFLAGS= + XLIBS= - XLIBS="$X_LIBS $X_EXTRA_LIBS $X_PRE_LIBS -lX11" + 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 ], [], + [XCFLAGS= + AC_MSG_RESULT(no)], + [AC_MSG_RESULT(yes)]) + fi + fi + + AC_SUBST(XCFLAGS) + AC_SUBST(XLIBS) # Check for libXtst. AC_CHECK_LIB(Xtst, XTestQueryExtension, diff --git a/stepmania/src/Makefile.am b/stepmania/src/Makefile.am index f8c2bb2c99..df23438de8 100644 --- a/stepmania/src/Makefile.am +++ b/stepmania/src/Makefile.am @@ -13,7 +13,7 @@ AM_CFLAGS = # generates enormous output. AM_CXXFLAGS += -finline-limit=300 -AM_CXXFLAGS += $(X_CFLAGS) +AM_CXXFLAGS += $(XCFLAGS) LDADD = $(SDL_LIBS)