Skip to content

Commit

Permalink
Make sure we can link with OpenGL libraries in the OpenGL configure test
Browse files Browse the repository at this point in the history
  • Loading branch information
slouken committed Jan 28, 2017
1 parent 0c56db4 commit 200901a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
10 changes: 7 additions & 3 deletions configure
Expand Up @@ -12954,6 +12954,8 @@ esac
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for OpenGL support" >&5
$as_echo_n "checking for OpenGL support... " >&6; }
have_opengl=no
save_LIBS="$LIBS"
LIBS="$LIBS $SYS_GL_LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
Expand All @@ -12963,20 +12965,22 @@ int
main ()
{
GLuint texture;
glOrtho( -2.0, 2.0, -2.0, 2.0, -20.0, 20.0 );
;
return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
if ac_fn_c_try_link "$LINENO"; then :

have_opengl=yes

fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_opengl" >&5
$as_echo "$have_opengl" >&6; }
LIBS="$save_LIBS"
if test x$have_opengl = xyes; then
CFLAGS="$CFLAGS -DHAVE_OPENGL"
GL_LIBS="$SYS_GL_LIBS"
Expand Down
7 changes: 5 additions & 2 deletions configure.in
Expand Up @@ -164,14 +164,17 @@ case "$host" in
esac
AC_MSG_CHECKING(for OpenGL support)
have_opengl=no
AC_TRY_COMPILE([
save_LIBS="$LIBS"
LIBS="$LIBS $SYS_GL_LIBS"
AC_TRY_LINK([
#include "SDL_opengl.h"
],[
GLuint texture;
glOrtho( -2.0, 2.0, -2.0, 2.0, -20.0, 20.0 );
],[
have_opengl=yes
])
AC_MSG_RESULT($have_opengl)
LIBS="$save_LIBS"
if test x$have_opengl = xyes; then
CFLAGS="$CFLAGS -DHAVE_OPENGL"
GL_LIBS="$SYS_GL_LIBS"
Expand Down

0 comments on commit 200901a

Please sign in to comment.