From 72d86d47e3140244c925fa23761f978c8b749e81 Mon Sep 17 00:00:00 2001 From: Sam Hocevar Date: Tue, 2 Aug 2011 00:27:09 +0000 Subject: [PATCH] build: fix an error causing -lopengl32 to be used on Linux; use AC_TRY_LINK instead of AC_TRY_COMPILE. --- configure.ac | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/configure.ac b/configure.ac index 67911f62..64a1b2f1 100644 --- a/configure.ac +++ b/configure.ac @@ -86,14 +86,20 @@ PKG_CHECK_MODULES(GLES2, glesv2, [:]) AC_CHECK_LIB(GL, glLoadIdentity, [ac_cv_my_have_gl="yes" - AC_DEFINE(HAVE_GL_2X, 1, Define to 1 if GL 2.x is available) - GL_LIBS="-lGL"]) # FIXME: hackish + AC_DEFINE(HAVE_GL_2X, 1, Define to 1 if GL 2.x is available) # FIXME: hackish + GL_LIBS="-lGL"]) AC_CHECK_HEADER(GL/gl.h, - [AC_TRY_COMPILE([#include ], + [LIBS_save="$LIBS" + LIBS="$LIBS -lopengl32" + AC_MSG_CHECKING(for glLoadIdentity in -lopengl32) + AC_TRY_LINK([#include ], [glLoadIdentity();], [ac_cv_my_have_gl="yes" - AC_DEFINE(HAVE_GL_2X, 1, Define to 1 if GL 2.x is available) - GL_LIBS="-lopengl32"])]) # FIXME: hackish + AC_DEFINE(HAVE_GL_2X, 1, Define to 1 if GL 2.x is available) # FIXME: hacky + AC_MSG_RESULT("yes") + GL_LIBS="-lopengl32"], + [AC_MSG_RESULT("no")]) + LIBS="$LIBS_save"]) if test "${ac_cv_my_have_gl}" = "no"; then AC_MSG_ERROR([[No OpenGL or OpenGL ES implementation found]]) fi