Browse Source

build: fix EGL library detection.

Sometimes libEGL.so can be available (provided as a symlink
by Debian diversion packages) while EGL/egl.h isn’t.
legacy
Sam Hocevar 5 years ago
parent
commit
0e8227aa71
2 changed files with 17 additions and 14 deletions
  1. +13
    -12
      build/autotools/m4/lol-conf.m4
  2. +4
    -2
      src/eglapp.cpp

+ 13
- 12
build/autotools/m4/lol-conf.m4 View File

@@ -119,18 +119,19 @@ if test "${enable_gl}" != "no"; then
AC_DEFINE(LOL_USE_EGL, 1, Define to 1 to use libegl)
EGL_LIBS="${EGL_LIBS} -lX11"
fi
AC_CHECK_LIB(EGL, main,
[ac_cv_my_have_egl="yes"
AC_DEFINE(LOL_USE_EGL, 1, Define to 1 to use libegl)
EGL_LIBS="-lEGL"])
dnl Raspberry Pi is different, check for it with extra libs; also we
dnl look for a different function to bypass autoconf caching
AC_CHECK_LIB(EGL, eglGetDisplay,
[ac_cv_my_have_egl="yes"
AC_DEFINE(LOL_USE_EGL, 1, Define to 1 to use libegl)
EGL_LIBS="-lEGL -lvcos -lvchiq_arm -lbcm_host -lGLESv2"],
[:],
[-lvcos -lvchiq_arm -lbcm_host -lGLESv2])
AC_CHECK_HEADERS(EGL/egl.h,
[AC_CHECK_LIB(EGL, eglInitialize,
[ac_cv_my_have_egl="yes"
AC_DEFINE(LOL_USE_EGL, 1, Define to 1 to use libegl)
EGL_LIBS="-lEGL"])
dnl Raspberry Pi is different, check for it with extra libs; also we
dnl look for a different function to bypass autoconf caching
AC_CHECK_LIB(EGL, eglGetDisplay,
[ac_cv_my_have_egl="yes"
AC_DEFINE(LOL_USE_EGL, 1, Define to 1 to use libegl)
EGL_LIBS="-lEGL -lvcos -lvchiq_arm -lbcm_host -lGLESv2"],
[:],
[-lvcos -lvchiq_arm -lbcm_host -lGLESv2])])
fi
AM_CONDITIONAL(LOL_USE_EGL, test "${ac_cv_my_have_egl}" != "no")



+ 4
- 2
src/eglapp.cpp View File

@@ -20,8 +20,10 @@
# include <X11/Xatom.h>
# include <X11/Xutil.h>
# endif
# include <EGL/egl.h>
# include <EGL/eglext.h>
# if defined HAVE_EGL_EGL_H
# include <EGL/egl.h>
# include <EGL/eglext.h>
# endif
#endif

#if LOL_USE_SDL


Loading…
Cancel
Save