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 AM_INIT_AUTOMAKE([dist-bzip2])
85 AM_CONFIG_HEADER([config.h])
86 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
88 VA_API_MAJOR_VERSION=va_api_major_version
89 VA_API_MINOR_VERSION=va_api_minor_version
90 VA_API_MICRO_VERSION=va_api_micro_version
91 VA_API_VERSION=va_api_version
92 AC_SUBST(VA_API_MAJOR_VERSION)
93 AC_SUBST(VA_API_MINOR_VERSION)
94 AC_SUBST(VA_API_MICRO_VERSION)
95 AC_SUBST(VA_API_VERSION)
97 LIBVA_MAJOR_VERSION=libva_major_version
98 LIBVA_MINOR_VERSION=libva_minor_version
99 LIBVA_MICRO_VERSION=libva_micro_version
100 LIBVA_VERSION=libva_version
101 AC_SUBST(LIBVA_MAJOR_VERSION)
102 AC_SUBST(LIBVA_MINOR_VERSION)
103 AC_SUBST(LIBVA_MICRO_VERSION)
104 AC_SUBST(LIBVA_VERSION)
106 LIBVA_LT_CURRENT=libva_lt_current
107 LIBVA_LT_REV=libva_lt_revision
108 LIBVA_LT_AGE=libva_lt_age
109 LIBVA_LT_VERSION="$LIBVA_LT_CURRENT:$LIBVA_LT_REV:$LIBVA_LT_AGE"
110 LIBVA_LT_LDFLAGS="-version-info $LIBVA_LT_VERSION"
111 AC_SUBST(LIBVA_LT_VERSION)
112 AC_SUBST(LIBVA_LT_LDFLAGS)
115 [AC_HELP_STRING([--enable-docs],
116 [build Doxygen documentation @<:@default=no@:>@])],
117 [], [enable_docs="no"])
120 [AC_HELP_STRING([--enable-glx],
121 [build with GLX support @<:@default=yes@:>@])],
122 [], [enable_glx="yes"])
125 [AC_HELP_STRING([--enable-egl],
126 [build with EGL support @<:@default=yes@:>@])],
127 [], [enable_egl="yes"])
129 AC_ARG_ENABLE(dummy-driver,
130 [AC_HELP_STRING([--enable-dummy-driver],
131 [build dummy video driver @<:@default=yes@:>@])],
132 [], [enable_dummy_driver="yes"])
133 AM_CONDITIONAL(BUILD_DUMMY_DRIVER, test x$enable_dummy_driver = xyes)
135 AC_ARG_ENABLE(dummy-backend,
136 [AC_HELP_STRING([--enable-dummy-backend],
137 [build dummy libva backend])],
138 [], [enable_dummy_backend="no"])
140 AC_ARG_WITH(drivers-path,
141 [AC_HELP_STRING([--with-drivers-path=[[path]]],
143 [], [with_drivers_path="$libdir/dri"])
145 LIBVA_DRIVERS_PATH="$with_drivers_path"
146 AC_SUBST(LIBVA_DRIVERS_PATH)
156 PKG_CHECK_MODULES([X11], [x11])
157 PKG_CHECK_MODULES([XEXT],[xext])
158 PKG_CHECK_MODULES([XFIXES], [xfixes])
161 if test "$enable_docs" = "yes"; then
162 AC_CHECK_TOOL([DOXYGEN], [doxygen], [enable_docs="no"])
164 AM_CONDITIONAL(ENABLE_DOCS, test "$enable_docs" = "yes")
166 # Check for recent enough DRM
167 LIBDRM_VERSION=libdrm_version
168 PKG_CHECK_MODULES([DRM], [libdrm >= $LIBDRM_VERSION])
169 AC_SUBST(LIBDRM_VERSION)
171 if test x$enable_dummy_backend = xyes; then
172 PKG_CHECK_MODULES([UDEV], [libudev], [libudev=yes], [libudev=no])
174 if test x$libudev = xno; then
175 enable_dummy_backend=no
177 AM_CONDITIONAL(BUILD_DUMMY_BACKEND, test x$enable_dummy_backend = xyes)
183 if test "$enable_glx" = "yes"; then
184 saved_CFLAGS="$CFLAGS"
186 PKG_CHECK_MODULES([GL_DEPS], [gl], [], [GL_DEPS_LIBS="-lX11 -lGL"])
187 CFLAGS="$CFLAGS $GL_DEPS_CFLAGS"
188 LIBS="$LIBS $GL_DEPS_LIBS"
189 AC_CHECK_HEADERS([GL/gl.h])
190 AC_CHECK_HEADERS([GL/glx.h])
191 AC_CHECK_LIB(GL, glXCreateContext, [USE_GLX="yes"])
192 CFLAGS="$saved_CFLAGS"
195 AC_SUBST(GL_DEPS_CFLAGS)
196 AC_SUBST(GL_DEPS_LIBS)
197 AM_CONDITIONAL(USE_GLX, test "$USE_GLX" = "yes")
203 if test "$enable_egl" = "yes"; then
204 saved_CFLAGS="$CFLAGS"
206 PKG_CHECK_MODULES([EGL_DEPS], [egl], [], [EGL_DEPS_LIBS="-lEGL"])
207 CFLAGS="$CFLAGS $EGL_DEPS_CFLAGS"
208 LIBS="$LIBS $EGL_DEPS_LIBS"
209 AC_CHECK_HEADERS([EGL/egl.h])
210 AC_CHECK_LIB(EGL, eglGetDisplay, [USE_EGL="yes"])
211 CFLAGS="$saved_CFLAGS"
215 PKG_CHECK_MODULES([GLESv1_CM], [glesv1_cm], [libglesv1_cm="yes"], [])
217 AC_SUBST(EGL_DEPS_CFLAGS)
218 AC_SUBST(EGL_DEPS_LIBS)
219 AM_CONDITIONAL(USE_EGL, test "$USE_EGL" = "yes")
220 AM_CONDITIONAL(BUILD_EGL_TEST, [test "x$libglesv1_cm" = "xyes"])
222 # We only need the headers, we don't link against the DRM libraries
223 LIBVA_CFLAGS="$DRM_CFLAGS"
224 AC_SUBST(LIBVA_CFLAGS)
227 pkgconfigdir=${libdir}/pkgconfig
228 AC_SUBST(pkgconfigdir)
231 libvacorelib=libva.la
232 libvabackendlib=libva-$LIBVA_DISPLAY.la
233 AC_SUBST([libvacorelib])
234 AC_SUBST([libvabackendlib])
238 debian.upstream/Makefile
240 dummy_drv_video/Makefile
242 pkgconfig/libva-egl.pc
243 pkgconfig/libva-glx.pc
244 pkgconfig/libva-tpi.pc
245 pkgconfig/libva-x11.pc
252 test/putsurface/Makefile
254 test/v4l_h264/Makefile
255 test/v4l_h264/encode/Makefile
256 test/v4l_h264/decode/Makefile
265 # Print a small summary
266 AS_IF([test x$USE_GLX = xyes], [BACKENDS="glx $BACKENDS"])
267 AS_IF([test x$USE_EGL = xyes], [BACKENDS="egl $BACKENDS"])
270 echo "libva - ${LIBVA_VERSION} (VA-API ${VA_API_VERSION})"
272 echo Installation prefix .............. : $prefix
273 echo Default driver path .............. : $LIBVA_DRIVERS_PATH
274 echo Extra window systems ............. : $BACKENDS
275 echo Build dummy driver ............... : $enable_dummy_driver
276 echo Build documentation .............. : $enable_docs