1 # Copyright (c) 2007 Intel Corporation. All Rights Reserved.
3 # Permission is hereby granted, free of charge, to any person obtaining a
4 # copy of this software and associated documentation files (the
5 # "Software"), to deal in the Software without restriction, including
6 # without limitation the rights to use, copy, modify, merge, publish,
7 # distribute, sub license, and/or sell copies of the Software, and to
8 # permit persons to whom the Software is furnished to do so, subject to
9 # the following conditions:
11 # The above copyright notice and this permission notice (including the
12 # next paragraph) shall be included in all copies or substantial portions
15 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
16 # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
17 # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
18 # IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
19 # ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
20 # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
21 # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
24 # - increment major for any ABI change (which shall not occur!)
25 # - increment minor for any interface change (e.g. new/modified function)
26 # - increment micro for any other change (new flag, new codec definition, etc.)
27 # - reset micro version to zero when minor version is incremented
28 # - reset minor version to zero when major version is incremented
29 m4_define([va_api_major_version], [0])
30 m4_define([va_api_minor_version], [33])
31 m4_define([va_api_micro_version], [0])
33 m4_define([va_api_version],
34 [va_api_major_version.va_api_minor_version.va_api_micro_version])
36 # libva package version number, (as distinct from shared library version)
37 # XXX: we want the package version to remain at 1.0.x for VA-API 0.32.y
39 # - major version is automatically generated from VA-API major version
40 # - minor version is automatically generated from VA-API minor version
41 # - increment micro for any library release
42 # - reset micro version to zero when VA-API major or minor version is changed
43 m4_define([libva_major_version], [m4_eval(va_api_major_version + 1)])
44 m4_define([libva_minor_version], [m4_eval(va_api_minor_version - 32)])
45 m4_define([libva_micro_version], [0])
46 m4_define([libva_pre_version], [1])
48 m4_define([libva_version],
49 [libva_major_version.libva_minor_version.libva_micro_version])
50 m4_if(libva_pre_version, [0], [], [
51 m4_append([libva_version], libva_pre_version, [.pre])
54 # libva library version number (generated, do not change)
55 # XXX: we want the SONAME to remain at libva.so.1 for VA-API major == 0
57 # The library name is generated libva.<x>.<y>.0 where
58 # <x> = VA-API major version + 1
59 # <y> = 100 * VA-API minor version + VA-API micro version
62 # VA-API 0.32.0 generates libva.so.1.3200.0
63 # VA-API 0.34.1 generates libva.so.1.3401.0
64 # VA-API 1.2.13 generates libva.so.2.213.0
65 m4_define([libva_interface_bias], [m4_eval(va_api_major_version + 1)])
66 m4_define([libva_interface_age], [0])
67 m4_define([libva_binary_age],
68 [m4_eval(100 * va_api_minor_version + va_api_micro_version - libva_interface_age)])
70 m4_define([libva_lt_current],
71 [m4_eval(100 * va_api_minor_version + va_api_micro_version + libva_interface_bias)])
72 m4_define([libva_lt_revision],
73 [m4_eval(libva_interface_age)])
74 m4_define([libva_lt_age],
75 [m4_eval(libva_binary_age - libva_interface_age)])
77 # libdrm minimun version requirement
78 m4_define([libdrm_version], [2.4])
81 AC_INIT([libva], [libva_version], [waldo.bastian@intel.com], libva)
82 AC_CONFIG_SRCDIR([Makefile.am])
83 AC_CONFIG_MACRO_DIR([m4])
84 AM_INIT_AUTOMAKE([dist-bzip2])
86 AM_CONFIG_HEADER([config.h])
87 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
89 VA_API_MAJOR_VERSION=va_api_major_version
90 VA_API_MINOR_VERSION=va_api_minor_version
91 VA_API_MICRO_VERSION=va_api_micro_version
92 VA_API_VERSION=va_api_version
93 AC_SUBST(VA_API_MAJOR_VERSION)
94 AC_SUBST(VA_API_MINOR_VERSION)
95 AC_SUBST(VA_API_MICRO_VERSION)
96 AC_SUBST(VA_API_VERSION)
98 LIBVA_MAJOR_VERSION=libva_major_version
99 LIBVA_MINOR_VERSION=libva_minor_version
100 LIBVA_MICRO_VERSION=libva_micro_version
101 LIBVA_VERSION=libva_version
102 AC_SUBST(LIBVA_MAJOR_VERSION)
103 AC_SUBST(LIBVA_MINOR_VERSION)
104 AC_SUBST(LIBVA_MICRO_VERSION)
105 AC_SUBST(LIBVA_VERSION)
107 LIBVA_LT_CURRENT=libva_lt_current
108 LIBVA_LT_REV=libva_lt_revision
109 LIBVA_LT_AGE=libva_lt_age
110 LIBVA_LT_VERSION="$LIBVA_LT_CURRENT:$LIBVA_LT_REV:$LIBVA_LT_AGE"
111 LIBVA_LT_LDFLAGS="-version-info $LIBVA_LT_VERSION"
112 AC_SUBST(LIBVA_LT_VERSION)
113 AC_SUBST(LIBVA_LT_LDFLAGS)
116 [AC_HELP_STRING([--enable-docs],
117 [build Doxygen documentation @<:@default=no@:>@])],
118 [], [enable_docs="no"])
121 [AC_HELP_STRING([--enable-drm],
122 [build with VA/DRM API support @<:@default=yes@:>@])],
123 [], [enable_drm="yes"])
126 [AC_HELP_STRING([--enable-x11],
127 [build with VA/X11 API support @<:@default=yes@:>@])],
128 [], [enable_x11="yes"])
131 [AC_HELP_STRING([--enable-glx],
132 [build with VA/GLX API support @<:@default=yes@:>@])],
133 [], [enable_glx="yes"])
136 [AC_HELP_STRING([--enable-egl],
137 [build with VA/EGL API support @<:@default=yes@:>@])],
138 [], [enable_egl="yes"])
140 AC_ARG_ENABLE([wayland],
141 [AC_HELP_STRING([--enable-wayland],
142 [build with VA/Wayland API support @<:@default=yes@:>@])],
143 [], [enable_wayland="yes"])
145 AC_ARG_ENABLE(dummy-driver,
146 [AC_HELP_STRING([--enable-dummy-driver],
147 [build dummy video driver @<:@default=yes@:>@])],
148 [], [enable_dummy_driver="yes"])
149 AM_CONDITIONAL(BUILD_DUMMY_DRIVER, test x$enable_dummy_driver = xyes)
151 AC_ARG_WITH(drivers-path,
152 [AC_HELP_STRING([--with-drivers-path=[[path]]],
154 [], [with_drivers_path="$libdir/dri"])
156 LIBVA_DRIVERS_PATH="$with_drivers_path"
157 AC_SUBST(LIBVA_DRIVERS_PATH)
170 if test "$enable_docs" = "yes"; then
171 AC_CHECK_TOOL([DOXYGEN], [doxygen], [enable_docs="no"])
173 AM_CONDITIONAL(ENABLE_DOCS, test "$enable_docs" = "yes")
175 # Check for __attribute__((visibility()))
176 AC_CACHE_CHECK([whether __attribute__((visibility())) is supported],
177 ac_cv_have_gnuc_visibility_attribute,
178 [cat > conftest.c <<EOF
179 int foo __attribute__ ((visibility ("hidden"))) = 1;
180 int bar __attribute__ ((visibility ("protected"))) = 1;
182 ac_cv_have_gnuc_visibility_attribute="no"
183 if ${CC-cc} -Werror -S conftest.c -o conftest.s >/dev/null 2>&1; then
184 if grep '\.hidden.*foo' conftest.s >/dev/null; then
185 if grep '\.protected.*bar' conftest.s >/dev/null; then
186 ac_cv_have_gnuc_visibility_attribute="yes"
192 if test "$ac_cv_have_gnuc_visibility_attribute" = "yes"; then
193 AC_DEFINE([HAVE_GNUC_VISIBILITY_ATTRIBUTE], [1],
194 [Defined to 1 if GCC visibility attribute is supported])
197 # Check for DRM (mandatory)
198 LIBDRM_VERSION=libdrm_version
199 PKG_CHECK_MODULES([DRM], [libdrm >= $LIBDRM_VERSION])
200 AC_SUBST(LIBDRM_VERSION)
203 if test "$enable_drm" = "yes"; then
205 AC_DEFINE([HAVE_VA_DRM], [1], [Defined to 1 if VA/DRM API is built])
207 AM_CONDITIONAL(USE_DRM, test "$USE_DRM" = "yes")
211 if test "$enable_x11" = "yes"; then
213 PKG_CHECK_MODULES([X11], [x11], [:], [USE_X11="no"])
214 PKG_CHECK_MODULES([XEXT], [xext], [:], [USE_X11="no"])
215 PKG_CHECK_MODULES([XFIXES], [xfixes], [:], [USE_X11="no"])
216 if test "$USE_X11" = "yes"; then
217 AC_DEFINE([HAVE_VA_X11], [1], [Defined to 1 if VA/X11 API is built])
220 AM_CONDITIONAL(USE_X11, test "$USE_X11" = "yes")
224 if test "$USE_X11:$enable_glx" = "yes:yes"; then
225 PKG_CHECK_MODULES([GLX], [gl x11], [USE_GLX="yes"], [:])
226 saved_CPPFLAGS="$CPPFLAGS"
228 CPPFLAGS="$CPPFLAGS $GLX_CFLAGS"
229 LIBS="$LIBS $GLX_LIBS"
230 AC_CHECK_HEADERS([GL/gl.h GL/glx.h], [:], [USE_GLX="no"])
231 AC_CHECK_LIB([GL], [glXCreateContext], [:] [USE_GLX="no"])
232 CPPFLAGS="$saved_CPPFLAGS"
234 if test "$USE_GLX" = "yes"; then
235 AC_DEFINE([HAVE_VA_GLX], [1], [Defined to 1 if VA/GLX API is built])
238 AM_CONDITIONAL(USE_GLX, test "$USE_GLX" = "yes")
242 if test "$enable_egl" = "yes"; then
243 PKG_CHECK_MODULES([EGL], [egl], [USE_EGL="yes"], [:])
244 saved_CPPFLAGS="$CPPFLAGS"
246 CPPFLAGS="$CPPFLAGS $EGL_CFLAGS"
247 LIBS="$LIBS $EGL_LIBS"
248 AC_CHECK_HEADERS([EGL/egl.h], [:], [USE_EGL="no"])
249 AC_CHECK_LIB([EGL], [eglGetDisplay], [:], [USE_EGL="no"])
250 CPPFLAGS="$saved_CPPFLAGS"
252 if test "$USE_EGL" = "yes"; then
253 AC_DEFINE([HAVE_VA_EGL], [1], [Defined to 1 if VA/EGL API is built])
256 AM_CONDITIONAL(USE_EGL, test "$USE_EGL" = "yes")
260 if test "$enable_wayland" = "yes"; then
261 PKG_CHECK_MODULES([WAYLAND], [wayland-client], [USE_WAYLAND="yes"], [:])
262 if test "$USE_WAYLAND" = "yes"; then
263 AC_DEFINE([HAVE_VA_WAYLAND], [1],
264 [Defined to 1 if VA/Wayland API is built])
267 AM_CONDITIONAL(USE_WAYLAND, test "$USE_WAYLAND" = "yes")
269 m4_ifdef([WAYLAND_SCANNER_RULES],
270 [WAYLAND_SCANNER_RULES(['$(top_srcdir)/va/wayland/protocol'])],
271 [wayland_scanner_rules=""; AC_SUBST(wayland_scanner_rules)])
273 pkgconfigdir=${libdir}/pkgconfig
274 AC_SUBST(pkgconfigdir)
276 # Check for builds without backend
277 if test "$USE_DRM:$USE_X11:$USE_WAYLAND" = "no:no:no"; then
278 AC_MSG_ERROR([Please select at least one backend (DRM, X11, Wayland)])
283 debian.upstream/Makefile
285 dummy_drv_video/Makefile
287 pkgconfig/libva-drm.pc
288 pkgconfig/libva-egl.pc
289 pkgconfig/libva-glx.pc
290 pkgconfig/libva-tpi.pc
291 pkgconfig/libva-wayland.pc
292 pkgconfig/libva-x11.pc
299 test/putsurface/Makefile
301 test/v4l_h264/Makefile
302 test/v4l_h264/encode/Makefile
303 test/v4l_h264/decode/Makefile
310 va/wayland/protocol/Makefile
314 # Print a small summary
316 AS_IF([test x$USE_DRM = xyes], [BACKENDS="$BACKENDS drm"])
317 AS_IF([test x$USE_X11 = xyes], [BACKENDS="$BACKENDS x11"])
318 AS_IF([test x$USE_GLX = xyes], [BACKENDS="$BACKENDS glx"])
319 AS_IF([test x$USE_EGL = xyes], [BACKENDS="$BACKENDS egl"])
320 AS_IF([test x$USE_WAYLAND = xyes], [BACKENDS="$BACKENDS wayland"])
323 echo "libva - ${LIBVA_VERSION} (VA-API ${VA_API_VERSION})"
325 echo Installation prefix .............. : $prefix
326 echo Default driver path .............. : $LIBVA_DRIVERS_PATH
327 echo Extra window systems ............. : $BACKENDS
328 echo Build dummy driver ............... : $enable_dummy_driver
329 echo Build documentation .............. : $enable_docs