hardware/intel/common/libva
Revision | b9a72b9d8ca14e159a67c368d966ed6276f49bc9 (tree) |
---|---|
Zeit | 2017-06-20 14:42:51 |
Autor | Xiang, Haihao <haihao.xiang@inte...> |
Commiter | Xiang, Haihao |
configure fails if requirement can't be met for user's explicit request
Notify user an error if user provides --enable-x11/--enable-glx/--enable-egl/--enable-wayland
however the requirement can't be met. drm has been checked mandatorily
in the script
v2: Remove XEXT_CFLAGS/XFIXES_CFLAGS from va/x11/Makefile.am and use
$X11_PKG_ERRORS in the error message if the requirement is met for VA/X11
This fixes https://github.com/01org/libva/issues/68
Signed-off-by: Xiang, Haihao <haihao.xiang@intel.com>
Reviewed-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
@@ -136,23 +136,23 @@ AC_ARG_ENABLE(drm, | ||
136 | 136 | |
137 | 137 | AC_ARG_ENABLE(x11, |
138 | 138 | [AC_HELP_STRING([--enable-x11], |
139 | - [build with VA/X11 API support @<:@default=yes@:>@])], | |
140 | - [], [enable_x11="yes"]) | |
139 | + [build with VA/X11 API support @<:@default=auto@:>@])], | |
140 | + [], [enable_x11="auto"]) | |
141 | 141 | |
142 | 142 | AC_ARG_ENABLE(glx, |
143 | 143 | [AC_HELP_STRING([--enable-glx], |
144 | - [build with VA/GLX API support @<:@default=yes@:>@])], | |
145 | - [], [enable_glx="yes"]) | |
144 | + [build with VA/GLX API support @<:@default=auto@:>@])], | |
145 | + [], [enable_glx="auto"]) | |
146 | 146 | |
147 | 147 | AC_ARG_ENABLE(egl, |
148 | 148 | [AC_HELP_STRING([--enable-egl], |
149 | - [build with VA/EGL API support @<:@default=yes@:>@])], | |
150 | - [], [enable_egl="yes"]) | |
149 | + [build with VA/EGL API support @<:@default=auto@:>@])], | |
150 | + [], [enable_egl="auto"]) | |
151 | 151 | |
152 | 152 | AC_ARG_ENABLE([wayland], |
153 | 153 | [AC_HELP_STRING([--enable-wayland], |
154 | - [build with VA/Wayland API support @<:@default=yes@:>@])], | |
155 | - [], [enable_wayland="yes"]) | |
154 | + [build with VA/Wayland API support @<:@default=auto@:>@])], | |
155 | + [], [enable_wayland="auto"]) | |
156 | 156 | |
157 | 157 | AC_ARG_ENABLE([va-messaging], |
158 | 158 | [AC_HELP_STRING([--enable-va-messaging], |
@@ -228,11 +228,13 @@ AM_CONDITIONAL(USE_DRM, test "$USE_DRM" = "yes") | ||
228 | 228 | |
229 | 229 | # Check for X11 |
230 | 230 | USE_X11="no" |
231 | -if test "$enable_x11" = "yes"; then | |
232 | - USE_X11="yes" | |
233 | - PKG_CHECK_MODULES([X11], [x11], [:], [USE_X11="no"]) | |
234 | - PKG_CHECK_MODULES([XEXT], [xext], [:], [USE_X11="no"]) | |
235 | - PKG_CHECK_MODULES([XFIXES], [xfixes], [:], [USE_X11="no"]) | |
231 | +if test "x$enable_x11" != "xno"; then | |
232 | + PKG_CHECK_MODULES([X11], [x11 xext xfixes], [USE_X11="yes"], [:]) | |
233 | + | |
234 | + if test "x$USE_X11" = "xno" -a "x$enable_x11" = "xyes"; then | |
235 | + AC_MSG_ERROR([VA/X11 explicitly enabled, however $X11_PKG_ERRORS]) | |
236 | + fi | |
237 | + | |
236 | 238 | if test "$USE_X11" = "yes"; then |
237 | 239 | AC_DEFINE([HAVE_VA_X11], [1], [Defined to 1 if VA/X11 API is built]) |
238 | 240 | fi |
@@ -241,7 +243,12 @@ AM_CONDITIONAL(USE_X11, test "$USE_X11" = "yes") | ||
241 | 243 | |
242 | 244 | # Check for GLX |
243 | 245 | USE_GLX="no" |
244 | -if test "$USE_X11:$enable_glx" = "yes:yes"; then | |
246 | + | |
247 | +if test "$USE_X11:$enable_glx" = "no:yes"; then | |
248 | + AC_MSG_ERROR([VA/GLX explicitly enabled, but VA/X11 isn't built]) | |
249 | +fi | |
250 | + | |
251 | +if test "$USE_X11:$enable_glx" != "yes:no"; then | |
245 | 252 | PKG_CHECK_MODULES([GLX], [gl x11], [USE_GLX="yes"], [:]) |
246 | 253 | saved_CPPFLAGS="$CPPFLAGS" |
247 | 254 | saved_LIBS="$LIBS" |
@@ -251,6 +258,11 @@ if test "$USE_X11:$enable_glx" = "yes:yes"; then | ||
251 | 258 | AC_CHECK_LIB([GL], [glXCreateContext], [:] [USE_GLX="no"]) |
252 | 259 | CPPFLAGS="$saved_CPPFLAGS" |
253 | 260 | LIBS="$saved_LIBS" |
261 | + | |
262 | + if test "x$USE_GLX" = "xno" -a "x$enable_glx" = "xyes"; then | |
263 | + AC_MSG_ERROR([VA/GLX explicitly enabled, but libGL couldn't be found]) | |
264 | + fi | |
265 | + | |
254 | 266 | if test "$USE_GLX" = "yes"; then |
255 | 267 | AC_DEFINE([HAVE_VA_GLX], [1], [Defined to 1 if VA/GLX API is built]) |
256 | 268 | fi |
@@ -259,7 +271,7 @@ AM_CONDITIONAL(USE_GLX, test "$USE_GLX" = "yes") | ||
259 | 271 | |
260 | 272 | # Check for EGL |
261 | 273 | USE_EGL="no" |
262 | -if test "$enable_egl" = "yes"; then | |
274 | +if test "x$enable_egl" != "xno"; then | |
263 | 275 | PKG_CHECK_MODULES([EGL], [egl], [USE_EGL="yes"], [:]) |
264 | 276 | saved_CPPFLAGS="$CPPFLAGS" |
265 | 277 | saved_LIBS="$LIBS" |
@@ -269,6 +281,11 @@ if test "$enable_egl" = "yes"; then | ||
269 | 281 | AC_CHECK_LIB([EGL], [eglGetDisplay], [:], [USE_EGL="no"]) |
270 | 282 | CPPFLAGS="$saved_CPPFLAGS" |
271 | 283 | LIBS="$saved_LIBS" |
284 | + | |
285 | + if test "x$USE_EGL" = "xno" -a "x$enable_egl" = "xyes"; then | |
286 | + AC_MSG_ERROR([VA/EGL explicitly enabled, but libEGL couldn't be found]) | |
287 | + fi | |
288 | + | |
272 | 289 | if test "$USE_EGL" = "yes"; then |
273 | 290 | AC_DEFINE([HAVE_VA_EGL], [1], [Defined to 1 if VA/EGL API is built]) |
274 | 291 | fi |
@@ -280,9 +297,14 @@ WAYLAND_API_VERSION=wayland_api_version | ||
280 | 297 | AC_SUBST(WAYLAND_API_VERSION) |
281 | 298 | |
282 | 299 | USE_WAYLAND="no" |
283 | -if test "$enable_wayland" = "yes"; then | |
300 | +if test "x$enable_wayland" != "xno"; then | |
284 | 301 | PKG_CHECK_MODULES([WAYLAND], [wayland-client >= wayland_api_version], |
285 | 302 | [USE_WAYLAND="yes"], [:]) |
303 | + | |
304 | + if test "x$USE_WAYLAND" = "xno" -a "x$enable_wayland" = "xyes"; then | |
305 | + AC_MSG_ERROR([wayland explicitly enabled, however $WAYLAND_PKG_ERRORS]) | |
306 | + fi | |
307 | + | |
286 | 308 | if test "$USE_WAYLAND" = "yes"; then |
287 | 309 | |
288 | 310 | WAYLAND_PREFIX=`$PKG_CONFIG --variable=prefix wayland-client` |
@@ -25,8 +25,6 @@ AM_CPPFLAGS = \ | ||
25 | 25 | -I$(top_srcdir) \ |
26 | 26 | -I$(top_srcdir)/va \ |
27 | 27 | $(X11_CFLAGS) \ |
28 | - $(XEXT_CFLAGS) \ | |
29 | - $(XFIXES_CFLAGS) \ | |
30 | 28 | $(DRM_CFLAGS) \ |
31 | 29 | $(NULL) |
32 | 30 |