configure: enforce build against VA-API 0.34.
[profile/ivi/vaapi-intel-driver.git] / configure.ac
1 # intel-driver package version number
2 m4_define([intel_driver_major_version], [1])
3 m4_define([intel_driver_minor_version], [0])
4 m4_define([intel_driver_micro_version], [16])
5 m4_define([intel_driver_pre_version],   [1])
6 m4_define([intel_driver_version],
7           [intel_driver_major_version.intel_driver_minor_version.intel_driver_micro_version])
8 m4_if(intel_driver_pre_version, [0], [], [
9 m4_append([intel_driver_version], intel_driver_pre_version, [.pre])
10 ])
11
12 # libva minimum version requirement
13 m4_define([libva_version], [0.34])
14 m4_define([libva_package_version], [1.2.0])
15
16 # libdrm minimum version requirement
17 m4_define([libdrm_version], [2.4.23])
18
19 AC_PREREQ([2.57])
20 AC_INIT([intel_driver], [intel_driver_version], [haihao.xiang@intel.com],
21         [libva-driver-intel])
22 AC_CONFIG_SRCDIR([Makefile.am])
23 AM_INIT_AUTOMAKE
24
25 AM_CONFIG_HEADER([src/config.h])
26
27 INTEL_DRIVER_MAJOR_VERSION=intel_driver_major_version
28 INTEL_DRIVER_MINOR_VERSION=intel_driver_minor_version
29 INTEL_DRIVER_MICRO_VERSION=intel_driver_micro_version
30 AC_DEFINE([INTEL_DRIVER_MAJOR_VERSION], [intel_driver_major_version], [Major version of the driver])
31 AC_DEFINE([INTEL_DRIVER_MINOR_VERSION], [intel_driver_minor_version], [Minor version of the driver])
32 AC_DEFINE([INTEL_DRIVER_MICRO_VERSION], [intel_driver_micro_version], [Micro version of the driver])
33 AC_DEFINE([INTEL_DRIVER_PRE_VERSION], [intel_driver_pre_version], [Preversion of the driver])
34
35 INTEL_DRIVER_LT_LDFLAGS="-avoid-version"
36 AC_SUBST(INTEL_DRIVER_LT_LDFLAGS)
37
38 dnl Use pretty build output with automake >= 1.11
39 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])], [
40     AM_DEFAULT_VERBOSITY=1
41     AC_SUBST(AM_DEFAULT_VERBOSITY)
42 ])
43
44 AC_DISABLE_STATIC
45 AC_PROG_LIBTOOL
46 AC_PROG_CC
47 AM_PROG_CC_C_O
48
49 AC_C_BIGENDIAN
50 AC_HEADER_STDC
51 AC_SYS_LARGEFILE
52
53 LIBVA_PACKAGE_VERSION=libva_package_version
54 AC_SUBST(LIBVA_PACKAGE_VERSION)
55
56 dnl Check for recent enough DRM
57 LIBDRM_VERSION=libdrm_version
58 PKG_CHECK_MODULES([DRM], [libdrm >= $LIBDRM_VERSION])
59 AC_SUBST(LIBDRM_VERSION)
60
61 dnl Check for gen4asm
62 PKG_CHECK_MODULES(GEN4ASM, [intel-gen4asm >= 1.2], [gen4asm=yes], [gen4asm=no])
63 AM_CONDITIONAL(HAVE_GEN4ASM, test x$gen4asm = xyes)
64 AC_PATH_PROG([GEN4ASM], [intel-gen4asm])
65
66 dnl Check for VA-API
67 PKG_CHECK_MODULES(LIBVA_DEPS,     [libva >= libva_version])
68 PKG_CHECK_MODULES(LIBVA_X11_DEPS, [libva-x11])
69
70 VA_VERSION=`$PKG_CONFIG --modversion libva`
71 VA_MAJOR_VERSION=`echo "$VA_VERSION" | cut -d'.' -f1`
72 VA_MINOR_VERSION=`echo "$VA_VERSION" | cut -d'.' -f2`
73 VA_MICRO_VERSION=`echo "$VA_VERSION" | cut -d'.' -f3`
74 VA_VERSION_STR="$VA_VERSION"
75
76 va_full_version_int=`expr ${VA_MAJOR_VERSION:-0} "*" 1000000 + \
77                           ${VA_MINOR_VERSION:-0} "*" 10000   + \
78                           ${VA_MICRO_VERSION:-0} "*" 100     + \
79                           0`
80 VA_DRIVER_INIT_FUNC="__vaDriverInit_${VA_MAJOR_VERSION}_${VA_MINOR_VERSION}"
81 AC_DEFINE_UNQUOTED([VA_DRIVER_INIT_FUNC], [$VA_DRIVER_INIT_FUNC],
82     [Define driver entry-point])
83
84 dnl Check for VA-API drivers path
85 AC_MSG_CHECKING([for VA drivers path])
86 LIBVA_DRIVERS_PATH=`$PKG_CONFIG libva --variable driverdir`
87 if test -z "$LIBVA_DRIVERS_PATH"; then
88     LIBVA_DRIVERS_PATH="/usr/lib/xorg/modules/drivers"
89 fi
90 AC_MSG_RESULT([$LIBVA_DRIVERS_PATH])
91 AC_SUBST(LIBVA_DRIVERS_PATH)
92
93 dnl Check for JPEG decoding API
94 AC_CACHE_CHECK([for JPEG decoding API], ac_cv_have_jpeg_decoding_api, [
95     saved_CFLAGS="$CFLAGS"
96     CFLAGS="$CFLAGS $LIBVA_DEPS_CFLAGS"
97     saved_LIBS="$LIBS"
98     LIBS="$CFLAGS $LIBVA_DEPS_LIBS"
99     AC_TRY_COMPILE(
100         [#include <va/va.h>],
101         [VAPictureParameterBufferJPEG pic_param;
102          VASliceParameterBufferJPEG slice_param;
103          VAIQMatrixBufferJPEG iq_matrix;],
104         [ac_cv_have_jpeg_decoding_api="yes"],
105         [ac_cv_have_jpeg_decoding_api="no"]
106     )
107     CFLAGS="$saved_CFLAGS"
108     LIBS="$saved_LIBS"
109 ])
110 if test "$ac_cv_have_jpeg_decoding_api" = "yes"; then
111     AC_DEFINE(HAVE_JPEG_DECODING, 1,
112         [Defined to 1 if VA-API exposes JPEG decoding])
113 fi
114
115 AC_OUTPUT([
116     Makefile
117     debian.upstream/Makefile 
118     src/Makefile
119     src/shaders/Makefile
120     src/shaders/h264/Makefile
121     src/shaders/h264/ildb/Makefile
122     src/shaders/h264/mc/Makefile
123     src/shaders/mpeg2/Makefile
124     src/shaders/mpeg2/vld/Makefile
125     src/shaders/post_processing/Makefile
126     src/shaders/post_processing/gen5_6/Makefile
127     src/shaders/post_processing/gen7/Makefile
128     src/shaders/render/Makefile
129     src/shaders/utils/Makefile
130     src/shaders/vme/Makefile
131 ])
132
133 dnl Print summary
134 echo
135 echo $PACKAGE configuration summary:
136 echo
137 echo VA-API version ................... : $VA_VERSION_STR
138 echo VA-API drivers path .............. : $LIBVA_DRIVERS_PATH
139 echo