egl: Move configure checks around and re-use for eglglessink plugin

This commit is contained in:
Sebastian Dröge 2013-02-21 14:40:02 +01:00
parent 4dd09a12dd
commit f9eccfe015
2 changed files with 157 additions and 115 deletions

View file

@ -425,25 +425,153 @@ else
fi
dnl *** gst-libs/gst/egl ***
PKG_CHECK_MODULES(EGL, egl, HAVE_EGL="yes", [
HAVE_EGL="no"
AC_ARG_WITH([egl-window-system],
AS_HELP_STRING([--with-egl-window-system],[EGL window system to use (x11, mali-fb, rpi, none)]),
[EGL_WINDOW_SYSTEM="$withval"],
[EGL_WINDOW_SYSTEM="auto"])
if test x"$EGL_WINDOW_SYSTEM" = x"auto"; then
dnl Mali
old_LIBS=$LIBS
old_CFLAGS=$CFLAGS
AC_CHECK_LIB([EGL], [eglGetProcAddress],
[
AC_CHECK_HEADER([EGL/egl.h],
[
HAVE_EGL="yes"
EGL_LIBS="-lEGL"
EGL_CFLAGS=""
]
)
]
)
LIBS="$LIBS -lUMP $EGL_LIBS"
CFLAGS="$CFLAGS $EGL_CFLAGS"
AC_CHECK_LIB([Mali], [mali_image_create], [EGL_WINDOW_SYSTEM="mali-fb"], [EGL_WINDOW_SYSTEM="auto"])
LIBS=$old_LIBS
CFLAGS=$old_CFLAGS
]
)
dnl RPi
if test x"$EGL_WINDOW_SYSTEM" = x"auto"; then
old_LIBS=$LIBS
old_CFLAGS=$CFLAGS
LIBS="$LIBS -lvcos -lvchiq_arm"
CFLAGS="$CFLAGS"
AC_CHECK_LIB([bcm_host], [bcm_host_init],
[
LIBS="$LIBS -lbcm_host"
AC_CHECK_HEADER([bcm_host.h], [EGL_WINDOW_SYSTEM="rpi"], [EGL_WINDOW_SYSTEM="auto"])
])
LIBS=$old_LIBS
CFLAGS=$old_CFLAGS
fi
if test x"$EGL_WINDOW_SYSTEM" = x"auto"; then
if test x"$HAVE_X11" = x"yes"; then
EGL_WINDOW_SYSTEM="x11"
fi
fi
if test x"$EGL_WINDOW_SYSTEM" = x"auto"; then
EGL_WINDOW_SYSTEM="none"
fi
fi
case "$EGL_WINDOW_SYSTEM" in
x11|none)
PKG_CHECK_MODULES(EGL, egl, HAVE_EGL="yes", [
HAVE_EGL="no"
old_LIBS=$LIBS
old_CFLAGS=$CFLAGS
AC_CHECK_LIB([EGL], [eglGetProcAddress],
[
AC_CHECK_HEADER([EGL/egl.h],
[
HAVE_EGL="yes"
EGL_LIBS="-lEGL"
EGL_CFLAGS=""
]
)
]
)
LIBS=$old_LIBS
CFLAGS=$old_CFLAGS
])
if test x"$HAVE_EGL" = x"yes" -a x"$EGL_WINDOW_SYSTEM" = x"x11"; then
if test x"$HAVE_X11" != x"yes"; then
AC_MSG_ERROR([libX11 not found and is required for EGL X11 window system])
else
AC_DEFINE(USE_EGL_X11, [1], [Use X11 EGL window system])
EGL_CFLAGS="$EGL_CFLAGS $X11_CFLAGS"
EGL_LIBS="$EGL_LIBS $X11_LIBS"
fi
fi
;;
mali-fb)
dnl FIXME: Mali EGL depends on GLESv1 or GLESv2
HAVE_EGL="no"
old_LIBS=$LIBS
old_CFLAGS=$CFLAGS
AC_CHECK_HEADER([EGL/fbdev_window.h],
[
LIBS="$LIBS -lUMP"
AC_CHECK_LIB([Mali], [mali_image_create],
[
LIBS="$LIBS -lMali"
AC_CHECK_LIB([GLESv2], [glEnable],
[
AC_CHECK_HEADER([GLES2/gl2.h],
[
AC_CHECK_LIB([EGL], [eglGetProcAddress],
[
AC_CHECK_HEADER([EGL/egl.h],
[
HAVE_EGL="yes"
EGL_LIBS="-lGLESv2 -lEGL -lMali -lUMP"
EGL_CFLAGS=""
AC_DEFINE(USE_EGL_MALI_FB, [1], [Use Mali FB EGL window system])
])
])
])
])
])
])
LIBS=$old_LIBS
CFLAGS=$old_CFLAGS
;;
rpi)
old_LIBS=$LIBS
old_CFLAGS=$CFLAGS
dnl FIXME: EGL of RPi depends on GLESv1 or GLESv2
dnl FIXME: GLESv2 of RPi depends on EGL... WTF!
LIBS="$LIBS -lvcos -lvchiq_arm"
AC_CHECK_LIB([bcm_host], [bcm_host_init],
[
LIBS="$LIBS -lbcm_host"
AC_CHECK_HEADER(bcm_host.h,
[
LIBS="$LIBS -lGLESv2"
AC_CHECK_LIB([EGL], [eglGetProcAddress],
[
LIBS="$LIBS -lEGL"
AC_CHECK_HEADER([EGL/egl.h],
[
AC_CHECK_LIB([GLESv2], [glEnable],
[
AC_CHECK_HEADER([GLES2/gl2.h],
[
HAVE_EGL="yes"
EGL_LIBS="-lGLESv2 -lEGL -lbcm_host -lvcos -lvchiq_arm"
EGL_CFLAGS=""
AC_DEFINE(USE_EGL_RPI, [1], [Use RPi EGL window system])
])
])
])
])
])
])
LIBS=$old_LIBS
CFLAGS=$old_CFLAGS
;;
*)
AC_MSG_ERROR([invalid EGL window system specified])
;;
esac
AC_SUBST(EGL_LIBS)
AC_SUBST(EGL_CFLAGS)
AM_CONDITIONAL(HAVE_EGL, test x"$HAVE_EGL" = x"yes")
@ -1658,120 +1786,31 @@ AG_GST_CHECK_FEATURE(RSVG, [rsvg decoder], rsvg, [
])
dnl *** eglgles ***
AC_ARG_WITH([egl-window-system],
AS_HELP_STRING([--with-egl-window-system],[EGL window system to use (x11, mali-fb, rpi, none)]),
[EGL_WINDOW_SYSTEM="$withval"],
[EGL_WINDOW_SYSTEM="none"])
translit(dnm, m, l) AM_CONDITIONAL(USE_EGLGLES, true)
AG_GST_CHECK_FEATURE(EGLGLES, [eglgles sink], eglgles, [
HAVE_EGLGLES="no"
case "$EGL_WINDOW_SYSTEM" in
x11|none)
if test x"$HAVE_EGL" = x"yes"; then
PKG_CHECK_MODULES(EGLGLES, egl glesv2, HAVE_EGLGLES="yes", [
HAVE_EGLGLES="no"
old_LIBS=$LIBS
old_CFLAGS=$CFLAGS
LIBS="$LIBS $EGL_LIBS"
CFLAGS="$CFLAGS $EGL_CFLAGS"
AC_CHECK_LIB([GLESv2], [glEnable],
[
AC_CHECK_HEADER([GLES2/gl2.h],
[
AC_CHECK_LIB([EGL], [eglGetProcAddress],
[
AC_CHECK_HEADER([EGL/egl.h],
[
HAVE_EGLGLES="yes"
EGLGLES_LIBS="-lGLESv2 -lEGL"
EGLGLES_CFLAGS=""
])
])
HAVE_EGLGLES="yes"
EGLGLES_LIBS="-lGLESv2"
EGLGLES_CFLAGS=""
])
])
LIBS=$old_LIBS
CFLAGS=$old_CFLAGS
])
if test x"$HAVE_EGLGLES" = x"yes" -a x"$EGL_WINDOW_SYSTEM" = x"x11"; then
if test x"$HAVE_X11" != x"yes"; then
AC_MSG_ERROR([libX11 not found and is required for EGL X11 window system])
else
AC_DEFINE(USE_EGL_X11, [1], [Use X11 EGL window system])
EGLGLES_CFLAGS="$EGLGLES_CFLAGS $X11_CFLAGS"
EGLGLES_LIBS="$EGLGLES_LIBS $X11_LIBS"
fi
fi
;;
mali-fb)
HAVE_EGLGLES="no"
AC_CHECK_HEADER([EGL/fbdev_window.h],
[
old_LIBS=$LIBS
old_CFLAGS=$CFLAGS
LIBS="$LIBS -lUMP"
AC_CHECK_LIB([Mali], [mali_image_create],
[
LIBS="$LIBS -lMali"
AC_CHECK_LIB([GLESv2], [glEnable],
[
AC_CHECK_HEADER([GLES2/gl2.h],
[
AC_CHECK_LIB([EGL], [eglGetProcAddress],
[
AC_CHECK_HEADER([EGL/egl.h],
[
HAVE_EGLGLES="yes"
EGLGLES_LIBS="-lGLESv2 -lEGL -lMali -lUMP"
EGLGLES_CFLAGS=""
AC_DEFINE(USE_EGL_MALI_FB, [1], [Use Mali FB EGL window system])
])
])
])
])
])
LIBS=$old_LIBS
CFLAGS=$old_CFLAGS
])
;;
rpi)
old_LIBS=$LIBS
old_CFLAGS=$CFLAGS
LIBS="$LIBS -lvcos -lvchiq_arm"
AC_CHECK_LIB([bcm_host], [bcm_host_init],
[
LIBS="$LIBS -lbcm_host"
AC_CHECK_HEADER(bcm_host.h,
[
LIBS="$LIBS -lGLESv2"
AC_CHECK_LIB([EGL], [eglGetProcAddress],
[
LIBS="$LIBS -lEGL"
AC_CHECK_HEADER([EGL/egl.h],
[
AC_CHECK_LIB([GLESv2], [glEnable],
[
AC_CHECK_HEADER([GLES2/gl2.h],
[
HAVE_EGLGLES="yes"
EGLGLES_LIBS="-lGLESv2 -lEGL -lbcm_host -lvcos -lvchiq_arm"
EGLGLES_CFLAGS=""
AC_DEFINE(USE_EGL_RPI, [1], [Use RPi EGL window system])
])
])
])
])
])
])
LIBS=$old_LIBS
CFLAGS=$old_CFLAGS
;;
*)
AC_MSG_ERROR([invalid EGL window system specified])
;;
esac
fi
AC_SUBST(EGLGLES_CFLAGS)
AC_SUBST(EGLGLES_LIBS)

View file

@ -2,14 +2,17 @@ plugin_LTLIBRARIES = libgsteglglessink.la
libgsteglglessink_la_SOURCES = gsteglglessink.c video_platform_wrapper.c
libgsteglglessink_la_CFLAGS = $(GST_PLUGINS_BASE_CFLAGS) \
libgsteglglessink_la_CFLAGS = $(GST_PLUGINS_BAD_CFLAGS) \
$(GST_PLUGINS_BASE_CFLAGS) \
$(GST_BASE_CFLAGS) \
$(GST_CFLAGS) \
$(EGL_CFLAGS) \
$(EGLGLES_CFLAGS)
libgsteglglessink_la_LIBADD = $(GST_LIBS) $(GST_BASE_LIBS) \
$(GST_PLUGINS_BASE_LIBS) $(EGLGLES_LIBS) \
-lgstvideo-$(GST_API_VERSION)
$(GST_PLUGINS_BASE_LIBS) $(EGL_LIBS) $(EGLGLES_LIBS) \
-lgstvideo-$(GST_API_VERSION) \
$(top_builddir)/gst-libs/gst/egl/libgstegl-$(GST_API_VERSION).la
libgsteglglessink_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS)
libgsteglglessink_la_LIBTOOLFLAGS = $(GST_PLUGIN_LIBTOOLFLAGS)