Skip to content

Commit a0d47aa

Browse files
committed
Merge remote-tracking branch 'upstream/master' into upstr_sync_2
2 parents ddc8a21 + 0cc460a commit a0d47aa

File tree

1 file changed

+31
-14
lines changed

1 file changed

+31
-14
lines changed

configure.ac

Lines changed: 31 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -313,20 +313,37 @@ AC_CHECK_LIB(SDL2,SDL_Init, have_sdl=yes, have_sdl=no)
313313
[do not include support for output with sdl_glsl])
314314
)
315315
AS_IF([test "x$enable_output_sdl_glsl" != "xno"], [
316-
m4_ifdef([AX_CHECK_GL], [
317-
AX_CHECK_GL(have_opengl=yes, have_opengl=no)
318-
], [
319-
AC_MSG_NOTICE([You need to install the autoconf archives to check for opengl. Remember to re-run autogen.sh.])
320-
have_opengl=no
321-
])
322-
if [[ $have_opengl = "yes" ]] ; then
323-
LIBS="$LIBS $GL_LIBS"
324-
CPPFLAGS="$CPPFLAGS -DSDL_GLSL $GL_CFLAGS"
325-
fi
326-
327-
if [[ $have_opengl = "no" ]] ; then
328-
AC_MSG_NOTICE([INFO: building without sdl_glsl (opengl) support])
329-
fi
316+
have_opengl=no
317+
GL_LIBS=""
318+
GL_CFLAGS=""
319+
AC_MSG_CHECKING([for OpenGL])
320+
321+
case $host_os in
322+
darwin*)
323+
AC_CHECK_HEADER([OpenGL/gl.h],
324+
[GL_LIBS="-framework OpenGL"
325+
have_opengl=yes],
326+
[have_opengl=no])
327+
;;
328+
*)
329+
AC_CHECK_HEADER([GL/gl.h],
330+
[AC_SEARCH_LIBS([glBegin], [GL],
331+
[have_opengl=yes
332+
AS_IF([test "x$ac_cv_search_glBegin" != "xnone required"],
333+
[GL_LIBS="$ac_cv_search_glBegin"])],
334+
[have_opengl=no])],
335+
[have_opengl=no])
336+
;;
337+
esac
338+
339+
if test "x$have_opengl" = "xyes"; then
340+
AC_MSG_RESULT([yes])
341+
LIBS="$LIBS $GL_LIBS"
342+
CPPFLAGS="$CPPFLAGS -DSDL_GLSL $GL_CFLAGS"
343+
else
344+
AC_MSG_RESULT([no])
345+
AC_MSG_NOTICE([INFO: building without sdl_glsl (opengl) support])
346+
fi
330347
],
331348
[have_opengl=no]
332349
)

0 commit comments

Comments
 (0)