diff options
author | Matthew Waters <ystreet00@gmail.com> | 2013-01-10 01:13:23 +1100 |
---|---|---|
committer | Sebastian Dröge <slomo@circular-chaos.org> | 2013-06-29 10:06:41 +0200 |
commit | bff8e223b228d7728c33bc6417cedc3e490f60a9 (patch) | |
tree | 544e8c2712b6a5a137b35b27fc0a09f2b8ef2415 /configure.ac | |
parent | 06022355483b7a5eff327f493d55b197c22a5371 (diff) |
add gstglconfig.h for apps to find out what our capabilites are
ie libgstgl can be compiled with any combination of opengl/gles2
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 70 |
1 files changed, 60 insertions, 10 deletions
diff --git a/configure.ac b/configure.ac index 479d3c2..3e45445 100644 --- a/configure.ac +++ b/configure.ac @@ -512,51 +512,62 @@ esac GL_PLATFORMS= GL_WINDOWS= GL_APIS= +GL_CONFIG_DEFINES= dnl API's if test "x$USE_OPENGL" = "xyes"; then GL_APIS="gl $GL_APIS" - AC_DEFINE(HAVE_OPENGL, [1] , [Use Desktop OpenGL]) + GL_CONFIG_DEFINES="$GL_CONFIG_DEFINES +#define GST_GL_HAVE_OPENGL 1" fi if test "x$USE_GLES2" = "xyes"; then GL_APIS="gles2 $GL_APIS" - AC_DEFINE(HAVE_GLES2, [1] , [Use OpenGL|ES 2.0]) + GL_CONFIG_DEFINES="$GL_CONFIG_DEFINES +#define GST_GL_HAVE_GLES2 1" fi dnl WINDOW's if test "x$HAVE_WINDOW_X11" = "xyes"; then GL_WINDOWS="x11 $GL_WINDOWS" - AC_DEFINE(HAVE_WINDOW_X11, [1], [Have X11 window libraries]) + GL_CONFIG_DEFINES="$GL_CONFIG_DEFINES +#define GST_GL_HAVE_WINDOW_X11 1" fi if test "x$HAVE_WINDOW_COCOA" = "xyes"; then GL_WINDOWS="cocoa $GL_WINDOWS" - AC_DEFINE(HAVE_WINDOW_COCOA, [1], [Have Cocoa window libraries]) + GL_CONFIG_DEFINES="$GL_CONFIG_DEFINES +#define GST_GL_HAVE_WINDOW_COCOA 1" fi if test "x$HAVE_WINDOW_WIN32" = "xyes"; then GL_WINDOWS="win32 $GL_WINDOWS" - AC_DEFINE(HAVE_WINDOW_WIN32, [1], [Have Win32 window libraries]) + GL_CONFIG_DEFINES="$GL_CONFIG_DEFINES +#define GST_GL_HAVE_WINDOW_WIN32 1" fi if test "x$HAVE_WINDOW_WAYLAND" = "xyes"; then GL_WINDOWS="wayland $GL_WINDOWS" - AC_DEFINE(HAVE_WINDOW_WAYLAND, [1], [Have Wayland window libraries]) + GL_CONFIG_DEFINES="$GL_CONFIG_DEFINES +#define GST_GL_HAVE_WINDOW_WAYLAND 1" fi dnl PLATFORM's if test "x$USE_EGL" = "xyes"; then GL_PLATFORMS="egl $GL_PLATFORMS" - AC_DEFINE(HAVE_EGL, [1], [Have EGL]) + GL_CONFIG_DEFINES="$GL_CONFIG_DEFINES +#define GST_GL_HAVE_PLATFORM_EGL 1" fi if test "x$USE_GLX" = "xyes"; then GL_PLATFORMS="glx $GL_PLATFORMS" - AC_DEFINE(HAVE_GLX, [1], [Have GLX]) + GL_CONFIG_DEFINES="$GL_CONFIG_DEFINES +#define GST_GL_HAVE_PLATFORM_GLX 1" fi if test "x$USE_WGL" = "xyes"; then GL_PLATFORMS="wgl $GL_PLATFORMS" - AC_DEFINE(HAVE_WGL, [1], [Have WGL]) + GL_CONFIG_DEFINES="$GL_CONFIG_DEFINES +#define GST_GL_HAVE_PLATFORM_WGL 1" fi if test "x$USE_COCOA" = "xyes"; then GL_PLATFORMS="cocoa $GL_PLATFORMS" - AC_DEFINE(HAVE_COCOA, [1], [Have Cocoa]) + GL_CONFIG_DEFINES="$GL_CONFIG_DEFINES +#define GST_GL_HAVE_PLATFORM_COCOA 1" fi dnl Check for no platforms/window systems @@ -587,6 +598,45 @@ AM_CONDITIONAL(USE_GLX, test "x$USE_GLX" = "xyes") AM_CONDITIONAL(USE_WGL, test "x$USE_WGL" = "xyes") AM_CONDITIONAL(USE_COCOA, test "x$USE_COCOA" = "xyes") +AC_CONFIG_COMMANDS([gst-libs/gst/gl/gstglconfig.h], [ + outfile=gstglconfig.h-tmp + cat > $outfile <<\_______EOF +/* gstglconfig.h + * + * This is a generated file. Please modify `configure.ac' + */ + +#ifndef __GST_GL_CONFIG_H__ +#define __GST_GL_CONFIG_H__ + +#include <gst/gst.h> + +G_BEGIN_DECLS + +_______EOF + + cat >>$outfile <<_______EOF +$gl_config_defines +_______EOF + + cat >>$outfile <<_______EOF + +G_END_DECLS + +#endif /* __GST_GL_CONFIG_H__ */ +_______EOF + + + if cmp -s $outfile gst-libs/gst/gl/gstglconfig.h; then + AC_MSG_NOTICE([gst-libs/gst/gl/gstglconfig.h is unchanged]) + rm -f $outfile + else + mv $outfile gst-libs/gst/gl/gstglconfig.h + fi +],[ +gl_config_defines='$GL_CONFIG_DEFINES' +]) + dnl checks for gstreamer dnl uninstalled is selected preferentially -- see pkg-config(1) AG_GST_CHECK_GST($GST_API_VERSION, [$GST_REQ], yes) |