Skip to content

Commit

Permalink
make it so AX_PKG supports requiring specific functions, and use that to
Browse files Browse the repository at this point in the history
require a libGL with glsl support. the mesa on obelix is full of lies, and
claims opengl 2.0 support in the header without support in the lib.
  • Loading branch information
novas0x2a committed Dec 17, 2008
1 parent 46a4759 commit 949a2eb
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 6 deletions.
33 changes: 29 additions & 4 deletions m4/ax_pkg.m4
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
dnl Usage: AX_PKG(<name>, <dependencies>, <libraries>, <headers>[, <relative include path>])
dnl Usage: AX_PKG(<name>, <dependencies>, <libraries>, <headers>[, <relative include path>, <required-functions>])
AC_DEFUN([AX_PKG],
[
AC_ARG_WITH(translit($1,`A-Z',`a-z'),
Expand All @@ -7,9 +7,17 @@ AC_DEFUN([AX_PKG],
)
if test x"$ENABLE_VERBOSE" = "xyes"; then
AC_MSG_CHECKING([for package $1 in current paths])
if test -z "$6"; then
AC_MSG_CHECKING([for package $1 in current paths])
else
AC_MSG_CHECKING([for package $1 in current paths with functions ($6)])
fi
else
AC_MSG_CHECKING([for package $1])
if test -z "$6"; then
AC_MSG_CHECKING([for package $1])
else
AC_MSG_CHECKING([for package $1 with functions ($6)])
fi
fi
AC_LANG_ASSERT(C++)
Expand Down Expand Up @@ -121,9 +129,26 @@ AC_DEFUN([AX_PKG],
CPPFLAGS="$CPPFLAGS $OTHER_CPPFLAGS"
LDFLAGS="$LDFLAGS $OTHER_LDFLAGS"
fi
dnl check for the headers and libs. if found, keep going.
dnl otherwise, check next path
AC_LINK_IFELSE(
AC_LANG_PROGRAM([#include "conftest.h"],[]),
[ HAVE_PKG_$1=yes ; AC_MSG_RESULT([yes]) ; break ] )
[ HAVE_PKG_$1=yes ], [continue] )
for func in $6; do
echo "Checking package $1 for function $func" >&AS_MESSAGE_LOG_FD
AC_LINK_IFELSE(
AC_LANG_CALL([],[$func]),
[], [ HAVE_PKG_$1=no; echo "package $1 did not have function $func" >&AS_MESSAGE_LOG_FD ] )
done
if test x"$HAVE_PKG_$1" = x"yes"; then
AC_MSG_RESULT([yes])
break
fi
TRY_ADD_CPPFLAGS=""
TRY_ADD_LDFLAGS=""
if test x"$ENABLE_VERBOSE" = "xyes"; then
Expand Down
3 changes: 1 addition & 2 deletions m4/ax_pkg_gl.m4
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ AC_DEFUN([AX_PKG_GL],
# For all other platforms, we search for static GL libraries
# in the conventional manner.
else
AX_PKG(GL, [X11], [-lGL -lGLU -lglut], [GL/gl.h GL/glu.h GL/glut.h])
AX_PKG(GL, [X11], [-lGL -lGLU -lglut], [GL/gl.h GL/glu.h GL/glut.h], [], [glCreateShader])
fi
])

0 comments on commit 949a2eb

Please sign in to comment.