wayland: ship with wayland-drm protocol.
[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([1.9 tar-ustar])
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_ARG_ENABLE(drm,
45     [AC_HELP_STRING([--enable-drm],
46                     [build with VA/DRM API support @<:@default=yes@:>@])],
47     [], [enable_drm="yes"])
48
49 AC_ARG_ENABLE(x11,
50     [AC_HELP_STRING([--enable-x11],
51                     [build with VA/X11 API support @<:@default=yes@:>@])],
52     [], [enable_x11="yes"])
53
54 AC_ARG_ENABLE([wayland],
55     [AC_HELP_STRING([--enable-wayland],
56                     [build with VA/Wayland API support @<:@default=yes@:>@])],
57     [], [enable_wayland="yes"])
58
59 AC_DISABLE_STATIC
60 AC_PROG_LIBTOOL
61 AC_PROG_CC
62 AM_PROG_CC_C_O
63
64 AC_C_BIGENDIAN
65 AC_HEADER_STDC
66 AC_SYS_LARGEFILE
67
68 LIBVA_PACKAGE_VERSION=libva_package_version
69 AC_SUBST(LIBVA_PACKAGE_VERSION)
70
71 dnl Check for recent enough DRM
72 LIBDRM_VERSION=libdrm_version
73 PKG_CHECK_MODULES([DRM], [libdrm >= $LIBDRM_VERSION])
74 AC_SUBST(LIBDRM_VERSION)
75
76 dnl Check for gen4asm
77 PKG_CHECK_MODULES(GEN4ASM, [intel-gen4asm >= 1.2], [gen4asm=yes], [gen4asm=no])
78 AM_CONDITIONAL(HAVE_GEN4ASM, test x$gen4asm = xyes)
79 AC_PATH_PROG([GEN4ASM], [intel-gen4asm])
80
81 dnl Check for VA-API
82 PKG_CHECK_MODULES(LIBVA_DEPS,     [libva >= libva_version])
83
84 dnl Check for VA/DRM API
85 USE_DRM="$enable_drm"
86 if test "$USE_DRM" = "yes"; then
87     PKG_CHECK_MODULES(LIBVA_DRM_DEPS, [libva-drm],
88       [AC_DEFINE([HAVE_VA_DRM], [1], [Defined to 1 if VA/DRM API is enabled])],
89       [USE_DRM="no"])
90
91     # Check for <drm_fourcc.h>
92     if test "$USE_DRM" = "yes"; then
93         saved_CPPFLAGS="$CPPFLAGS"
94         CPPFLAGS="$CPPFLAGS $DRM_CFLAGS"
95         AC_CHECK_HEADERS([drm_fourcc.h], [:], [USE_DRM="no"])
96         CPPFLAGS="$saved_CPPFLAGS"
97     fi
98 fi
99 AM_CONDITIONAL(USE_DRM, test "$USE_DRM" = "yes")
100
101 VA_VERSION=`$PKG_CONFIG --modversion libva`
102 VA_MAJOR_VERSION=`echo "$VA_VERSION" | cut -d'.' -f1`
103 VA_MINOR_VERSION=`echo "$VA_VERSION" | cut -d'.' -f2`
104 VA_MICRO_VERSION=`echo "$VA_VERSION" | cut -d'.' -f3`
105 VA_VERSION_STR="$VA_VERSION"
106
107 va_full_version_int=`expr ${VA_MAJOR_VERSION:-0} "*" 1000000 + \
108                           ${VA_MINOR_VERSION:-0} "*" 10000   + \
109                           ${VA_MICRO_VERSION:-0} "*" 100     + \
110                           0`
111 VA_DRIVER_INIT_FUNC="__vaDriverInit_${VA_MAJOR_VERSION}_${VA_MINOR_VERSION}"
112 AC_DEFINE_UNQUOTED([VA_DRIVER_INIT_FUNC], [$VA_DRIVER_INIT_FUNC],
113     [Define driver entry-point])
114
115 dnl Check for VA/DRM API
116 USE_X11="$enable_x11"
117 if test "$USE_X11" = "yes"; then
118     PKG_CHECK_MODULES(LIBVA_X11_DEPS, [libva-x11],
119       [AC_DEFINE([HAVE_VA_X11], [1], [Defined to 1 if VA/X11 API is enabled])],
120       [USE_X11="no"])
121 fi
122 AM_CONDITIONAL(USE_X11, test "$USE_X11" = "yes")
123
124 dnl Check for VA-API drivers path
125 AC_MSG_CHECKING([for VA drivers path])
126 LIBVA_DRIVERS_PATH=`$PKG_CONFIG libva --variable driverdir`
127 if test -z "$LIBVA_DRIVERS_PATH"; then
128     LIBVA_DRIVERS_PATH="/usr/lib/xorg/modules/drivers"
129 fi
130 AC_MSG_RESULT([$LIBVA_DRIVERS_PATH])
131 AC_SUBST(LIBVA_DRIVERS_PATH)
132
133 # Check for EGL
134 if test "$enable_wayland" = "yes"; then
135     enable_egl="yes"
136 fi
137
138 USE_EGL="no"
139 if test "$enable_egl" = "yes"; then
140     PKG_CHECK_MODULES([EGL], [egl], [USE_EGL="yes"], [USE_EGL="no"])
141     saved_CPPFLAGS="$CPPFLAGS"
142     saved_LIBS="$LIBS"
143     CPPFLAGS="$CPPFLAGS $EGL_CFLAGS"
144     LIBS="$LIBS $EGL_LIBS"
145     AC_CHECK_HEADERS([EGL/egl.h], [:], [USE_EGL="no"])
146     AC_CHECK_LIB([EGL], [eglGetDisplay], [:], [USE_EGL="no"])
147     CPPFLAGS="$saved_CPPFLAGS"
148     LIBS="$saved_LIBS"
149 fi
150 AM_CONDITIONAL(USE_EGL, test "$USE_EGL" = "yes")
151
152 # Check for Wayland
153 USE_WAYLAND="no"
154 WAYLAND_DRM_CFLAGS=""
155 WAYLAND_DRM_LIBS=""
156 if test "$enable_wayland" = "yes"; then
157     PKG_CHECK_MODULES([WAYLAND], [wayland-client], [USE_WAYLAND="yes"], [:])
158     PKG_CHECK_MODULES([LIBVA_WAYLAND_DEPS], [libva-wayland],
159         [AC_DEFINE([HAVE_VA_WAYLAND], [1], [Defined to 1 if VA/Wayland API is enabled])],
160         [USE_WAYLAND="no"])
161     if test "$USE_EGL" = "yes"; then
162         WAYLAND_DRM_CFLAGS="$DRM_CFLAGS"
163         WAYLAND_DRM_LIBS="$DRM_LIBS $EGL_LIBS"
164     fi
165 fi
166 AM_CONDITIONAL(USE_WAYLAND, test "$USE_WAYLAND" = "yes")
167 AC_SUBST([WAYLAND_DRM_CFLAGS])
168 AC_SUBST([WAYLAND_DRM_LIBS])
169
170 m4_ifdef([WAYLAND_SCANNER_RULES],
171     [WAYLAND_SCANNER_RULES(['$(top_srcdir)/src/wayland'])],
172     [wayland_scanner_rules=""; AC_SUBST(wayland_scanner_rules)])
173
174 AC_OUTPUT([
175     Makefile
176     debian.upstream/Makefile 
177     src/Makefile
178     src/shaders/Makefile
179     src/shaders/h264/Makefile
180     src/shaders/h264/ildb/Makefile
181     src/shaders/h264/mc/Makefile
182     src/shaders/mpeg2/Makefile
183     src/shaders/mpeg2/vld/Makefile
184     src/shaders/post_processing/Makefile
185     src/shaders/post_processing/gen5_6/Makefile
186     src/shaders/post_processing/gen7/Makefile
187     src/shaders/render/Makefile
188     src/shaders/utils/Makefile
189     src/shaders/vme/Makefile
190     src/wayland/Makefile
191 ])
192
193 dnl Print summary
194 BACKENDS=""
195 AS_IF([test "$USE_DRM" = "yes"], [BACKENDS="$BACKENDS drm"])
196 AS_IF([test "$USE_X11" = "yes"], [BACKENDS="$BACKENDS x11"])
197 AS_IF([test "$USE_WAYLAND" = "yes"], [BACKENDS="$BACKENDS wayland"])
198
199 echo
200 echo $PACKAGE configuration summary:
201 echo
202 echo VA-API version ................... : $VA_VERSION_STR
203 echo VA-API drivers path .............. : $LIBVA_DRIVERS_PATH
204 echo Windowing systems ................ : $BACKENDS
205 echo