• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
Keine Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

hardware/intel/libva


Commit MetaInfo

Revisionbbc66c8772ee6000f9a2421922259ff39b71a272 (tree)
Zeit2012-09-26 18:49:51
AutorDmitry Ermilov <dmitry.ermilov@inte...>
CommiterGwenole Beauchesne

Log Message

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>

Ändern Zusammenfassung

Diff

--- a/configure.ac
+++ b/configure.ac
@@ -121,6 +121,11 @@ AC_ARG_ENABLE(drm,
121121 [build with VA/DRM API support @<:@default=yes@:>@])],
122122 [], [enable_drm="yes"])
123123
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+
124129 AC_ARG_ENABLE(glx,
125130 [AC_HELP_STRING([--enable-glx],
126131 [build with GLX support @<:@default=yes@:>@])],
@@ -155,20 +160,28 @@ AC_PROG_LIBTOOL
155160 AC_PROG_CC
156161 AC_PROG_CXX
157162 AM_PROG_CC_C_O
163+PKG_PROG_PKG_CONFIG
158164
159165 AC_HEADER_STDC
160166 AC_SYS_LARGEFILE
161167
162-PKG_CHECK_MODULES([X11], [x11])
163-PKG_CHECK_MODULES([XEXT],[xext])
164-PKG_CHECK_MODULES([XFIXES], [xfixes])
165-
166168 # Check for Doxygen
167169 if test "$enable_docs" = "yes"; then
168170 AC_CHECK_TOOL([DOXYGEN], [doxygen], [enable_docs="no"])
169171 fi
170172 AM_CONDITIONAL(ENABLE_DOCS, test "$enable_docs" = "yes")
171173
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+
172185 # Check for DRM
173186 LIBDRM_VERSION=libdrm_version
174187 PKG_CHECK_MODULES([DRM], [libdrm >= $LIBDRM_VERSION])
@@ -193,7 +206,7 @@ AM_CONDITIONAL(USE_DRM, test "$USE_DRM" = "yes")
193206 USE_GLX="no"
194207 GL_DEPS_CFLAGS=""
195208 GL_DEPS_LIBS=""
196-if test "$enable_glx" = "yes"; then
209+if test "$USE_X11:$enable_glx" = "yes:yes"; then
197210 saved_CFLAGS="$CFLAGS"
198211 saved_LIBS="$LIBS"
199212 PKG_CHECK_MODULES([GL_DEPS], [gl], [], [GL_DEPS_LIBS="-lX11 -lGL"])
@@ -244,7 +257,15 @@ AC_SUBST(LIBVA_LIBS)
244257 pkgconfigdir=${libdir}/pkgconfig
245258 AC_SUBST(pkgconfigdir)
246259
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
248269 libvacorelib=libva.la
249270 libvabackendlib=libva-$LIBVA_DISPLAY.la
250271 AC_SUBST([libvacorelib])
@@ -283,6 +304,7 @@ AC_OUTPUT([
283304
284305 # Print a small summary
285306 AS_IF([test x$USE_DRM = xyes], [BACKENDS="drm $BACKENDS"])
307+AS_IF([test x$USE_X11 = xyes], [BACKENDS="x11 $BACKENDS"])
286308 AS_IF([test x$USE_GLX = xyes], [BACKENDS="glx $BACKENDS"])
287309 AS_IF([test x$USE_EGL = xyes], [BACKENDS="egl $BACKENDS"])
288310
--- a/pkgconfig/Makefile.am
+++ b/pkgconfig/Makefile.am
@@ -25,7 +25,9 @@ pcfiles += libva-tpi.pc
2525 if USE_DRM
2626 pcfiles += libva-drm.pc
2727 endif
28+if USE_X11
2829 pcfiles += libva-x11.pc
30+endif
2931 if USE_GLX
3032 pcfiles += libva-glx.pc
3133 endif
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -23,6 +23,10 @@
2323
2424 AM_CFLAGS = -I$(top_srcdir)/va -I$(top_srcdir)/test/basic -I$(top_srcdir)/src/x11
2525
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
2731
2832 EXTRA_DIST = loadsurface.h loadsurface_yuv.h
--- a/test/common/Makefile.am
+++ b/test/common/Makefile.am
@@ -36,9 +36,11 @@ libva_display_libs = \
3636 source_c = va_display.c
3737 source_h = va_display.h
3838
39+if USE_X11
3940 source_c += va_display_x11.c
4041 libva_display_cflags += $(X11_CFLAGS)
4142 libva_display_libs += $(X11_LIBS)
43+endif
4244
4345 if USE_DRM
4446 source_c += va_display_drm.c
--- a/test/common/va_display.c
+++ b/test/common/va_display.c
@@ -41,7 +41,9 @@ static const VADisplayHooks *g_display_hooks_available[] = {
4141 #ifdef ANDROID
4242 &va_display_hooks_android,
4343 #else
44+#ifdef HAVE_VA_X11
4445 &va_display_hooks_x11,
46+#endif
4547 #ifdef HAVE_VA_DRM
4648 &va_display_hooks_drm,
4749 #endif
--- a/test/encode/Makefile.am
+++ b/test/encode/Makefile.am
@@ -20,7 +20,10 @@
2020 # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
2121 # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
2222
23-bin_PROGRAMS = h264encode avcenc
23+bin_PROGRAMS = avcenc
24+if USE_X11
25+bin_PROGRAMS += h264encode
26+endif
2427
2528 libva_helpers = \
2629 $(top_builddir)/test/common/libva-display.la \
--- a/va/Makefile.am
+++ b/va/Makefile.am
@@ -46,7 +46,6 @@ libva_source_h = \
4646 va_dummy.h \
4747 va_tpi.h \
4848 va_version.h \
49- va_x11.h \
5049 $(NULL)
5150
5251 libva_source_h_priv = \
@@ -69,13 +68,16 @@ libva_tpi_la_LDFLAGS = $(LDADD) -no-undefined
6968 libva_tpi_la_DEPENDENCIES = $(libvacorelib)
7069 libva_tpi_la_LIBADD = $(libvacorelib) -ldl
7170
71+if USE_X11
7272 SUBDIRS += x11
7373 lib_LTLIBRARIES += libva-x11.la
74+libva_source_h += va_x11.h
7475 libva_x11_la_SOURCES =
7576 libva_x11_la_LDFLAGS = $(LDADD)
7677 libva_x11_la_DEPENDENCIES = $(libvacorelib) x11/libva_x11.la
7778 libva_x11_la_LIBADD = $(libvacorelib) x11/libva_x11.la \
7879 $(LIBVA_LIBS) $(X11_LIBS) $(XEXT_LIBS) $(DRM_LIBS) $(XFIXES_LIBS) -ldl
80+endif
7981
8082 if USE_DRM
8183 SUBDIRS += drm