Meet AX_CHECK_LIB_USING_HEADER. Also threw X11 back in because why the hell not. configure actually completes successfully now.
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
dnl AX_CHECK_LIB_USING_HEADER(lib, function, header, [action-if-found], [action-if-not-found])
|
||||
dnl As AC_CHECK_LIB except "function" must be a fully valid function call and "header" the header file in which that function is defined. The benefit is that this can find functions whose symbols have been decorated, e.g. a lot of MinGW stuff.
|
||||
|
||||
AC_DEFUN([AX_CHECK_LIB_USING_HEADER],
|
||||
[
|
||||
dnl # On Windows OpenGL functions' library symbols don't match their function names. So we have to do it the hard way.
|
||||
|
||||
AC_MSG_CHECKING(for $2 in $1 using $3)
|
||||
|
||||
AC_LANG_PUSH(C)
|
||||
|
||||
LIBS_SAVE=$LIBS
|
||||
LIBS="$LIBS -l$1"
|
||||
AC_LINK_IFELSE(
|
||||
[AC_LANG_PROGRAM([#include <$3>], [$2])],
|
||||
[AC_MSG_RESULT(yes)
|
||||
$4],
|
||||
[AC_MSG_RESULT(no)
|
||||
$5]
|
||||
)
|
||||
LIBS=$LIBS_SAVE
|
||||
|
||||
AC_LANG_POP(C)
|
||||
])
|
||||
+4
-5
@@ -2,11 +2,10 @@ AC_DEFUN([SM_BZIP],
|
||||
[
|
||||
AC_REQUIRE([SM_STATIC])
|
||||
|
||||
dnl # XXX: AC_CHECK_LIB doesn't work correctly on MinGW for BZip.
|
||||
dnl # Hardcoding it because I'm so fed up with this shit.
|
||||
if test "$host_os" != "mingw32"; then
|
||||
AC_CHECK_LIB(bz2, BZ2_bzCompressInit, have_bzip=yes, have_bzip=no)
|
||||
fi
|
||||
AX_CHECK_LIB_USING_HEADER(bz2,
|
||||
'BZ2_bzCompressInit((bz_stream*) NULL, 0, 0, 0)',
|
||||
bzlib.h, have_bzip=yes, have_bzip=no)
|
||||
|
||||
AC_CHECK_HEADER(bzlib.h, have_bzip_header=yes, have_bzip_header=no)
|
||||
AC_ARG_WITH(static-bzip, AS_HELP_STRING([--with-static-bzip],[Statically link bzip]), with_static_bzip=$withval, with_static_bzip=no)
|
||||
|
||||
|
||||
+2
-22
@@ -1,23 +1,3 @@
|
||||
AC_DEFUN([SM_OPENGL_TRY_LIB],
|
||||
[
|
||||
dnl # On Windows OpenGL functions' library symbols don't match their function names. So we have to do it the hard way.
|
||||
|
||||
AC_MSG_CHECKING(for glBegin in $1)
|
||||
|
||||
AC_LANG_PUSH(C)
|
||||
|
||||
LIBS_SAVE=$LIBS
|
||||
LIBS="$LIBS $1"
|
||||
AC_LINK_IFELSE(
|
||||
[AC_LANG_PROGRAM([#include <GL/gl.h>], [glBegin(GL_POINTS)])],
|
||||
[AC_MSG_RESULT(yes)
|
||||
$2],
|
||||
AC_MSG_RESULT(no)
|
||||
)
|
||||
LIBS=$LIBS_SAVE
|
||||
|
||||
AC_LANG_POP(C)
|
||||
])
|
||||
|
||||
AC_DEFUN([SM_OPENGL],
|
||||
[
|
||||
@@ -28,10 +8,10 @@ AC_DEFUN([SM_OPENGL],
|
||||
|
||||
GL_LIBS=""
|
||||
|
||||
SM_OPENGL_TRY_LIB(-lGL, [GL_LIBS="-lGL"])
|
||||
AX_CHECK_LIB_USING_HEADER(GL, 'glBegin(GL_POINTS)', GL/gl.h, [GL_LIBS="-lGL"])
|
||||
|
||||
if test x$GL_LIBS = "x"; then
|
||||
SM_OPENGL_TRY_LIB(-lopengl32, [GL_LIBS="-lopengl32"])
|
||||
AX_CHECK_LIB_USING_HEADER(opengl32, 'glBegin(GL_POINTS)', GL/gl.h, [GL_LIBS="-lopengl32"])
|
||||
fi
|
||||
if test x$GL_LIBS = "x"; then
|
||||
AC_MSG_ERROR("No usable OpenGL library found.")
|
||||
|
||||
+19
-7
@@ -183,12 +183,9 @@ if test "$with_prof" = "yes"; then
|
||||
fi
|
||||
|
||||
SM_OPENGL
|
||||
if test "$host_os" != "mingw32"; then
|
||||
SM_X11
|
||||
GL_CFLAGS="$GL_CFLAGS $XCFLAGS"
|
||||
GL_LIBS="$GL_LIBS $XLIBS"
|
||||
# XXX Actually use GL_* (probably should replace $X* for the most part)
|
||||
fi
|
||||
SM_X11
|
||||
GL_CFLAGS="$GL_CFLAGS $XCFLAGS"
|
||||
GL_LIBS="$GL_LIBS $XLIBS"
|
||||
|
||||
have_libpng=yes
|
||||
SM_STATIC
|
||||
@@ -333,7 +330,22 @@ AC_CHECK_DECL(strtof, , AC_DEFINE([NEED_STRTOF],1,[Need strtof]), [#include <std
|
||||
|
||||
AC_CHECK_DECLS([SIGPWR, SIGUSR1],,,[#include <signal.h>])
|
||||
|
||||
PKG_CHECK_MODULES( [GLEW], [glew >= 1.3.5], LIBS="$LIBS -lGLEW" )
|
||||
have_glew="no"
|
||||
AX_CHECK_LIB_USING_HEADER(GLEW, 'glewInit()', GL/glew.h,
|
||||
have_glew="yes"
|
||||
LIBS="$LIBS -lGLEW",
|
||||
,
|
||||
[$LIBS])
|
||||
|
||||
test $have_glew = "no" && { AX_CHECK_LIB_USING_HEADER(glew32, 'glewInit()', GL/glew.h,
|
||||
have_glew="yes"
|
||||
LIBS="$LIBS -lglew32",
|
||||
,
|
||||
[$LIBS]) }
|
||||
|
||||
test $have_glew = "no" && AC_MSG_ERROR("Could not find GLEW.")
|
||||
|
||||
AC_CHECK_DECL(GLEW_VERSION_2_1, , AC_MSG_ERROR("GLEW 1.3.5 or newer is required."), [#include <GL/glew.h>])
|
||||
|
||||
AC_ARG_ENABLE(tests, AS_HELP_STRING([--enable-tests],[Build test programs]), enable_tests=$enableval, enable_tests=no)
|
||||
AM_CONDITIONAL(BUILD_TESTS, test "$enable_tests" = "yes" )
|
||||
|
||||
+2
-2
@@ -21,7 +21,7 @@ AM_CXXFLAGS += -fno-exceptions
|
||||
# generates enormous output.
|
||||
AM_CXXFLAGS += -finline-limit=300
|
||||
|
||||
AM_CXXFLAGS += $(XCFLAGS)
|
||||
AM_CXXFLAGS += $(GL_CFLAGS)
|
||||
|
||||
LIBS +=
|
||||
LIBS += -lpthread -lrt
|
||||
@@ -637,7 +637,7 @@ endif
|
||||
main_LDADD = \
|
||||
$(VIDEO_LIBS) \
|
||||
$(AUDIO_LIBS) \
|
||||
$(XLIBS) \
|
||||
$(GL_LIBS) \
|
||||
libtomcrypt.a libtommath.a
|
||||
|
||||
nodist_stepmania_SOURCES = ver.cpp
|
||||
|
||||
Reference in New Issue
Block a user