hardware/intel/libva
Revision | bbc66c8772ee6000f9a2421922259ff39b71a272 (tree) |
---|---|
Zeit | 2012-09-26 18:49:51 |
Autor | Dmitry Ermilov <dmitry.ermilov@inte...> |
Commiter | Gwenole Beauchesne |
Allow build without VA/X11 API.
In this case, VA/GLX API is disabled and another backend shall be
built instead.
Signed-off-by: Dmitry Ermilov <dmitry.ermilov@intel.com>
Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
@@ -121,6 +121,11 @@ AC_ARG_ENABLE(drm, | ||
121 | 121 | [build with VA/DRM API support @<:@default=yes@:>@])], |
122 | 122 | [], [enable_drm="yes"]) |
123 | 123 | |
124 | +AC_ARG_ENABLE(x11, | |
125 | + [AC_HELP_STRING([--enable-x11], | |
126 | + [build with VA/X11 API support @<:@default=yes@:>@])], | |
127 | + [], [enable_x11="yes"]) | |
128 | + | |
124 | 129 | AC_ARG_ENABLE(glx, |
125 | 130 | [AC_HELP_STRING([--enable-glx], |
126 | 131 | [build with GLX support @<:@default=yes@:>@])], |
@@ -155,20 +160,28 @@ AC_PROG_LIBTOOL | ||
155 | 160 | AC_PROG_CC |
156 | 161 | AC_PROG_CXX |
157 | 162 | AM_PROG_CC_C_O |
163 | +PKG_PROG_PKG_CONFIG | |
158 | 164 | |
159 | 165 | AC_HEADER_STDC |
160 | 166 | AC_SYS_LARGEFILE |
161 | 167 | |
162 | -PKG_CHECK_MODULES([X11], [x11]) | |
163 | -PKG_CHECK_MODULES([XEXT],[xext]) | |
164 | -PKG_CHECK_MODULES([XFIXES], [xfixes]) | |
165 | - | |
166 | 168 | # Check for Doxygen |
167 | 169 | if test "$enable_docs" = "yes"; then |
168 | 170 | AC_CHECK_TOOL([DOXYGEN], [doxygen], [enable_docs="no"]) |
169 | 171 | fi |
170 | 172 | AM_CONDITIONAL(ENABLE_DOCS, test "$enable_docs" = "yes") |
171 | 173 | |
174 | +# Check for X11 | |
175 | +USE_X11="no" | |
176 | +if test "$enable_x11" = "yes"; then | |
177 | + PKG_CHECK_MODULES([X11], [x11]) | |
178 | + PKG_CHECK_MODULES([XEXT], [xext]) | |
179 | + PKG_CHECK_MODULES([XFIXES], [xfixes]) | |
180 | + USE_X11="yes" | |
181 | + AC_DEFINE([HAVE_VA_X11], [1], [Defined to 1 if VA/X11 API is built]) | |
182 | +fi | |
183 | +AM_CONDITIONAL(USE_X11, test "$USE_X11" = "yes") | |
184 | + | |
172 | 185 | # Check for DRM |
173 | 186 | LIBDRM_VERSION=libdrm_version |
174 | 187 | PKG_CHECK_MODULES([DRM], [libdrm >= $LIBDRM_VERSION]) |
@@ -193,7 +206,7 @@ AM_CONDITIONAL(USE_DRM, test "$USE_DRM" = "yes") | ||
193 | 206 | USE_GLX="no" |
194 | 207 | GL_DEPS_CFLAGS="" |
195 | 208 | GL_DEPS_LIBS="" |
196 | -if test "$enable_glx" = "yes"; then | |
209 | +if test "$USE_X11:$enable_glx" = "yes:yes"; then | |
197 | 210 | saved_CFLAGS="$CFLAGS" |
198 | 211 | saved_LIBS="$LIBS" |
199 | 212 | PKG_CHECK_MODULES([GL_DEPS], [gl], [], [GL_DEPS_LIBS="-lX11 -lGL"]) |
@@ -244,7 +257,15 @@ AC_SUBST(LIBVA_LIBS) | ||
244 | 257 | pkgconfigdir=${libdir}/pkgconfig |
245 | 258 | AC_SUBST(pkgconfigdir) |
246 | 259 | |
247 | -LIBVA_DISPLAY=x11 | |
260 | +# Check for builds without backend | |
261 | +if test "$USE_X11:$USE_DRM" = "no:no"; then | |
262 | + AC_MSG_ERROR([Please select at least VA/X11 or VA/DRM backend]) | |
263 | +fi | |
264 | + | |
265 | +LIBVA_DISPLAY="drm" | |
266 | +if test "$USE_X11" = "yes"; then | |
267 | + LIBVA_DISPLAY="x11" | |
268 | +fi | |
248 | 269 | libvacorelib=libva.la |
249 | 270 | libvabackendlib=libva-$LIBVA_DISPLAY.la |
250 | 271 | AC_SUBST([libvacorelib]) |
@@ -283,6 +304,7 @@ AC_OUTPUT([ | ||
283 | 304 | |
284 | 305 | # Print a small summary |
285 | 306 | AS_IF([test x$USE_DRM = xyes], [BACKENDS="drm $BACKENDS"]) |
307 | +AS_IF([test x$USE_X11 = xyes], [BACKENDS="x11 $BACKENDS"]) | |
286 | 308 | AS_IF([test x$USE_GLX = xyes], [BACKENDS="glx $BACKENDS"]) |
287 | 309 | AS_IF([test x$USE_EGL = xyes], [BACKENDS="egl $BACKENDS"]) |
288 | 310 |
@@ -25,7 +25,9 @@ pcfiles += libva-tpi.pc | ||
25 | 25 | if USE_DRM |
26 | 26 | pcfiles += libva-drm.pc |
27 | 27 | endif |
28 | +if USE_X11 | |
28 | 29 | pcfiles += libva-x11.pc |
30 | +endif | |
29 | 31 | if USE_GLX |
30 | 32 | pcfiles += libva-glx.pc |
31 | 33 | endif |
@@ -23,6 +23,10 @@ | ||
23 | 23 | |
24 | 24 | AM_CFLAGS = -I$(top_srcdir)/va -I$(top_srcdir)/test/basic -I$(top_srcdir)/src/x11 |
25 | 25 | |
26 | -SUBDIRS = common basic decode encode putsurface vainfo v4l_h264 | |
26 | +SUBDIRS = common decode encode vainfo | |
27 | + | |
28 | +if USE_X11 | |
29 | +SUBDIRS += basic putsurface v4l_h264 | |
30 | +endif | |
27 | 31 | |
28 | 32 | EXTRA_DIST = loadsurface.h loadsurface_yuv.h |
@@ -36,9 +36,11 @@ libva_display_libs = \ | ||
36 | 36 | source_c = va_display.c |
37 | 37 | source_h = va_display.h |
38 | 38 | |
39 | +if USE_X11 | |
39 | 40 | source_c += va_display_x11.c |
40 | 41 | libva_display_cflags += $(X11_CFLAGS) |
41 | 42 | libva_display_libs += $(X11_LIBS) |
43 | +endif | |
42 | 44 | |
43 | 45 | if USE_DRM |
44 | 46 | source_c += va_display_drm.c |
@@ -41,7 +41,9 @@ static const VADisplayHooks *g_display_hooks_available[] = { | ||
41 | 41 | #ifdef ANDROID |
42 | 42 | &va_display_hooks_android, |
43 | 43 | #else |
44 | +#ifdef HAVE_VA_X11 | |
44 | 45 | &va_display_hooks_x11, |
46 | +#endif | |
45 | 47 | #ifdef HAVE_VA_DRM |
46 | 48 | &va_display_hooks_drm, |
47 | 49 | #endif |
@@ -20,7 +20,10 @@ | ||
20 | 20 | # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE |
21 | 21 | # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
22 | 22 | |
23 | -bin_PROGRAMS = h264encode avcenc | |
23 | +bin_PROGRAMS = avcenc | |
24 | +if USE_X11 | |
25 | +bin_PROGRAMS += h264encode | |
26 | +endif | |
24 | 27 | |
25 | 28 | libva_helpers = \ |
26 | 29 | $(top_builddir)/test/common/libva-display.la \ |
@@ -46,7 +46,6 @@ libva_source_h = \ | ||
46 | 46 | va_dummy.h \ |
47 | 47 | va_tpi.h \ |
48 | 48 | va_version.h \ |
49 | - va_x11.h \ | |
50 | 49 | $(NULL) |
51 | 50 | |
52 | 51 | libva_source_h_priv = \ |
@@ -69,13 +68,16 @@ libva_tpi_la_LDFLAGS = $(LDADD) -no-undefined | ||
69 | 68 | libva_tpi_la_DEPENDENCIES = $(libvacorelib) |
70 | 69 | libva_tpi_la_LIBADD = $(libvacorelib) -ldl |
71 | 70 | |
71 | +if USE_X11 | |
72 | 72 | SUBDIRS += x11 |
73 | 73 | lib_LTLIBRARIES += libva-x11.la |
74 | +libva_source_h += va_x11.h | |
74 | 75 | libva_x11_la_SOURCES = |
75 | 76 | libva_x11_la_LDFLAGS = $(LDADD) |
76 | 77 | libva_x11_la_DEPENDENCIES = $(libvacorelib) x11/libva_x11.la |
77 | 78 | libva_x11_la_LIBADD = $(libvacorelib) x11/libva_x11.la \ |
78 | 79 | $(LIBVA_LIBS) $(X11_LIBS) $(XEXT_LIBS) $(DRM_LIBS) $(XFIXES_LIBS) -ldl |
80 | +endif | |
79 | 81 | |
80 | 82 | if USE_DRM |
81 | 83 | SUBDIRS += drm |