1) test/*: enable/refine the test/* for both X11 and Android
[platform/upstream/libva.git] / configure.ac
1 # Copyright (c) 2007 Intel Corporation. All Rights Reserved.
2 #
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:
10 #
11 # The above copyright notice and this permission notice (including the
12 # next paragraph) shall be included in all copies or substantial portions
13 # of the Software.
14 #
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.
22
23 # libva package version number, (as distinct from shared library version)
24 m4_define([libva_major_version], [0])
25 m4_define([libva_minor_version], [32])
26 m4_define([libva_micro_version], [0])
27
28 m4_define([libva_version],
29           [libva_major_version.libva_minor_version.libva_micro_version])
30
31 # if the library source code has changed, increment revision
32 m4_define([libva_lt_revision], [12])
33 # if any interface was added/removed/changed, then inc current, reset revision
34 m4_define([libva_lt_current], [1])
35 # if any interface was added since last public release, then increment age
36 # if any interface was removed since last public release, then set age to 0
37 m4_define([libva_lt_age], [0])
38
39 AC_PREREQ(2.57)
40 AC_INIT([libva], [libva_version], [waldo.bastian@intel.com], libva)
41 AC_CONFIG_SRCDIR([Makefile.am])
42 AM_INIT_AUTOMAKE([dist-bzip2])
43
44 AM_CONFIG_HEADER([config.h])
45 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
46
47 LIBVA_MAJOR_VERSION=libva_major_version
48 LIBVA_MINOR_VERSION=libva_minor_version
49 LIBVA_MICRO_VERSION=libva_micro_version
50 LIBVA_VERSION=libva_version
51 AC_SUBST(LIBVA_MAJOR_VERSION)
52 AC_SUBST(LIBVA_MINOR_VERSION)
53 AC_SUBST(LIBVA_MICRO_VERSION)
54 AC_SUBST(LIBVA_VERSION)
55
56 LIBVA_LT_CURRENT=libva_lt_current
57 LIBVA_LT_REV=libva_lt_revision
58 LIBVA_LT_AGE=libva_lt_age
59 LIBVA_LT_VERSION="$LIBVA_LT_CURRENT:$LIBVA_LT_REV:$LIBVA_LT_AGE"
60 LIBVA_LT_LDFLAGS="-version-info $LIBVA_LT_VERSION"
61 AC_SUBST(LIBVA_LT_VERSION)
62 AC_SUBST(LIBVA_LT_LDFLAGS)
63
64 AC_ARG_ENABLE(glx,
65               [AC_HELP_STRING([--enable-glx],
66                               [build with OpenGL for X11 support])],
67               [], [enable_glx=yes])
68
69 AC_ARG_ENABLE(dummy-driver,
70               [AC_HELP_STRING([--enable-dummy-driver],
71                               [build dummy video driver])],
72               [], [enable_dummy_driver=yes])
73 AM_CONDITIONAL(BUILD_DUMMY_DRIVER, test x$enable_dummy_driver = xyes)
74
75 AC_ARG_ENABLE(dummy-backend,
76               [AC_HELP_STRING([--enable-dummy-backend],
77                               [build dummy libva backend])],
78               [], [enable_dummy_backend=no])
79
80 AC_ARG_ENABLE(i965-driver,
81               [AC_HELP_STRING([--enable-i965-driver],
82                               [build i965 video driver])],
83               [], [enable_i965_driver=no])
84
85 AC_ARG_WITH(drivers-path,
86             [AC_HELP_STRING([--with-drivers-path=[[path]]], [drivers path])],,
87             [with_drivers_path="$libdir/dri"])
88
89 LIBVA_DRIVERS_PATH="$with_drivers_path"
90 AC_SUBST(LIBVA_DRIVERS_PATH)
91
92 AC_DISABLE_STATIC
93 AC_PROG_LIBTOOL
94 AC_PROG_CC
95 AC_PROG_CXX
96
97 AC_HEADER_STDC
98 AC_SYS_LARGEFILE
99
100 PKG_CHECK_MODULES([X11], [x11])
101 PKG_CHECK_MODULES([XEXT],[xext])
102 PKG_CHECK_MODULES([XFIXES], [xfixes])
103 PKG_CHECK_MODULES([DRM], [libdrm])
104
105 PKG_CHECK_MODULES(GEN4ASM, [intel-gen4asm >= 1.1], [gen4asm=yes], [gen4asm=no])
106 AM_CONDITIONAL(HAVE_GEN4ASM, test x$gen4asm = xyes)
107
108 # Check for libdrm >= 2.4.23 (needed for i965_drv_video.so)
109 if test x$enable_i965_driver = xyes && ! $PKG_CONFIG --atleast-version=2.4.23 libdrm; then
110     AC_MSG_WARN([libdrm < 2.4.23 found, disabling build of i965 video driver])
111     enable_i965_driver=no
112 fi
113 AM_CONDITIONAL(BUILD_I965_DRIVER, test x$enable_i965_driver = xyes)
114
115 if test x$enable_dummy_backend = xyes; then
116     PKG_CHECK_MODULES([UDEV], [libudev], [libudev=yes], [libudev=no])
117 fi
118 if test x$libudev = xno; then
119    enable_dummy_backend=no
120 fi
121 AM_CONDITIONAL(BUILD_DUMMY_BACKEND, test x$enable_dummy_backend = xyes)
122
123 # Check for OpenGL (X11)
124 USE_GLX="no"
125 GL_DEPS_CFLAGS=""
126 GL_DEPS_LIBS=""
127 if test x$enable_glx = xyes; then
128     AC_CHECK_HEADERS([GL/gl.h])
129     AC_CHECK_HEADERS([GL/glx.h])
130     AC_CHECK_LIB(GL, glXCreateContext, [
131         USE_GLX="yes"
132         GL_DEPS_LIBS="-lX11 -lGL"
133     ])
134 fi
135 AC_SUBST(GL_DEPS_CFLAGS)
136 AC_SUBST(GL_DEPS_LIBS)
137 AM_CONDITIONAL(USE_GLX, test "$USE_GLX" = "yes")
138
139 # TBD: Check for EGL
140 USE_EGL="yes"
141 AM_CONDITIONAL(USE_EGL, test "$USE_EGL" = "yes")
142
143
144 # Make sure drivers use the correctly versioned __vaDriverInit*() function name
145 VA_DRIVER_INIT_FUNC="__vaDriverInit_${LIBVA_MAJOR_VERSION}_${LIBVA_MINOR_VERSION}"
146 AC_DEFINE_UNQUOTED([VA_DRIVER_INIT_FUNC], [$VA_DRIVER_INIT_FUNC],
147     [Defined to the versioned __vaDriverInit function name])
148 AC_DEFINE_UNQUOTED([VA_DRIVER_INIT_FUNC_S], ["$VA_DRIVER_INIT_FUNC"],
149     [Defined to the versioned __vaDriverInit function name (in string form)])
150
151 # We only need the headers, we don't link against the DRM libraries
152 LIBVA_CFLAGS="$DRM_CFLAGS"
153 AC_SUBST(LIBVA_CFLAGS)
154 AC_SUBST(LIBVA_LIBS)
155
156 pkgconfigdir=${libdir}/pkgconfig
157 AC_SUBST(pkgconfigdir)
158
159 LIBVA_DISPLAY=x11
160 libvacorelib=libva.la
161 libvabackendlib=libva-$LIBVA_DISPLAY.la
162 AC_SUBST([libvacorelib])
163 AC_SUBST([libvabackendlib])
164
165 AC_OUTPUT([
166         Makefile
167         va/Makefile
168         va/va_version.h
169         va/x11/Makefile
170         va/glx/Makefile
171         va/egl/Makefile
172         va/dummy/Makefile
173         dummy_drv_video/Makefile
174         i965_drv_video/Makefile
175         i965_drv_video/shaders/Makefile
176         i965_drv_video/shaders/h264/Makefile
177         i965_drv_video/shaders/h264/mc/Makefile
178         i965_drv_video/shaders/mpeg2/Makefile
179         i965_drv_video/shaders/mpeg2/vld/Makefile
180         i965_drv_video/shaders/render/Makefile
181         i965_drv_video/shaders/post_processing/Makefile
182         i965_drv_video/shaders/vme/Makefile
183         test/Makefile
184         test/basic/Makefile
185         test/decode/Makefile
186         test/putsurface/Makefile
187         test/encode/Makefile
188         test/vainfo/Makefile
189         libva.pc
190         libva-x11.pc
191         libva-glx.pc
192         libva-egl.pc
193         libva-tpi.pc
194 ])
195
196 # Print a small summary
197
198 echo ""
199 echo "libva - ${LIBVA_VERSION}"
200 echo ""
201
202 echo " \95 Global :"
203 echo "     Prefix: ${prefix}"
204 echo ""
205
206 AS_IF([test x$enable_i965_driver = xyes], [DRIVERS="i965 $DRIVERS"]) 
207 AS_IF([test x$enable_dummy_driver = xyes], [DRIVERS="dummy $DRIVERS"])
208
209 echo " \95 Drivers: ${DRIVERS}"
210
211 AS_IF([test x$USE_GLX = xyes], [BACKENDS="glx $BACKENDS"])
212 AS_IF([test x$USE_EGL = xyes], [BACKENDS="egl $BACKENDS"])
213
214 BACKENDS="x11 $BACKENDS"
215 AS_IF([test x$enable_dummy_backend = xyes], [BACKENDS="dummy 
216 $BACKENDS"])
217
218 echo " \95 Winsys : ${BACKENDS}"
219