Generate upstream packages through make deb.upstream.
[vaapi:stormers-gstreamer-vaapi.git] / configure.ac
1 # gstreamer-vaapi package version number
2 m4_define([gst_vaapi_major_version], [0])
3 m4_define([gst_vaapi_minor_version], [1])
4 m4_define([gst_vaapi_micro_version], [2])
5 m4_define([gst_vaapi_version],
6           [gst_vaapi_major_version.gst_vaapi_minor_version.gst_vaapi_micro_version])
7
8 # gst version number
9 m4_define([gst_major_version], [0])
10 m4_define([gst_minor_version], [10])
11 m4_define([gst_micro_version], [0])
12 m4_define([gst_major_minor_version],
13           [gst_major_version.gst_minor_version])
14 m4_define([gst_version],
15           [gst_major_version.gst_minor_version.gst_micro_version])
16
17 # gst plugins-base version number
18 m4_define([gst_plugins_base_major_version], [0])
19 m4_define([gst_plugins_base_minor_version], [10])
20 m4_define([gst_plugins_base_micro_version], [16])
21 m4_define([gst_plugins_base_version],
22           [gst_plugins_base_major_version.gst_plugins_base_minor_version.gst_plugins_base_micro_version])
23
24 # libva package version number
25 m4_define([libva_sds_version_0_29], [8])
26 m4_define([libva_sds_package_version_0_29], [0.29-2+sds11])
27 m4_define([libva_sds_version_0_30], [1])
28 m4_define([libva_sds_package_version_0_30], [0.30-1+sds1])
29 m4_define([libva_glx_sds_version_0_30], [5])
30 m4_define([libva_glx_sds_package_version_0_30], [0.30.4-1+sds6])
31 m4_define([libva_glx_sds_version_0_31], [1])
32 m4_define([libva_glx_sds_package_version_0_31], [0.31.0-1+sds1])
33 m4_define([libva_sds_version], [libva_glx_sds_version_0_31])
34 m4_define([libva_sds_package_version], [libva_glx_sds_package_version_0_31])
35
36 # gtk-doc version number
37 # XXX: introspection annotations require gtk-doc >= 1.12
38 m4_define([gtkdoc_major_version], [1])
39 m4_define([gtkdoc_minor_version], [9])
40 m4_define([gtkdoc_version], [gtkdoc_major_version.gtkdoc_minor_version])
41
42 AC_PREREQ([2.57])
43 AC_INIT([gst_vaapi], [gst_vaapi_version],
44     [gbeauchesne@splitted-desktop.com],
45     [gstreamer-vaapi])
46 AC_CONFIG_SRCDIR([Makefile.am])
47 AC_CANONICAL_TARGET
48 AM_INIT_AUTOMAKE
49 AM_CONFIG_HEADER([config.h])
50
51 TODAY="`LC_ALL=C date +'%a, %d %b %Y %X %z'`"
52 AC_SUBST(TODAY)
53
54 GST_VAAPI_MAJOR_VERSION=gst_vaapi_major_version
55 AC_SUBST(GST_VAAPI_MAJOR_VERSION)
56
57 LIBVA_SDS_PACKAGE_VERSION=libva_sds_package_version
58 AC_SUBST(LIBVA_SDS_PACKAGE_VERSION)
59
60 dnl Check for __attribute__((visibility()))
61 AC_CACHE_CHECK([whether __attribute__((visibility())) is supported],
62   vaapi_cv_visibility_attribute,
63   [cat > conftest.c <<EOF
64 int foo __attribute__ ((visibility ("hidden"))) = 1;
65 int bar __attribute__ ((visibility ("protected"))) = 1;
66 EOF
67   vaapi_cv_visibility_attribute=no
68   if ${CC-cc} -Werror -S conftest.c -o conftest.s >/dev/null 2>&1; then
69     if grep '\.hidden.*foo' conftest.s >/dev/null; then
70       if grep '\.protected.*bar' conftest.s >/dev/null; then
71         vaapi_cv_visibility_attribute=yes
72       fi
73     fi
74   fi
75   rm -f conftest.[cs]
76 ])
77 if test $vaapi_cv_visibility_attribute = yes; then
78   vaapi_cv_visibility_attribute_hidden="__attribute__((visibility(\"hidden\")))"
79 else
80   vaapi_cv_visibility_attribute_hidden=""
81 fi
82 AC_DEFINE_UNQUOTED([attribute_hidden],
83                    [$vaapi_cv_visibility_attribute_hidden],
84                    [Define the "hidden" visibility attribute])
85
86 dnl Versions for GStreamer and plugins-base
87 GST_MAJORMINOR=gst_major_minor_version
88 GST_VERSION_REQUIRED=gst_version
89 GST_PLUGINS_BASE_VERSION_REQUIRED=gst_plugins_base_version
90 AC_SUBST(GST_MAJORMINOR)
91 AC_SUBST(GST_VERSION_REQUIRED)
92 AC_SUBST(GST_PLUGINS_BASE_VERSION_REQUIRED)
93
94 dnl Check for tools
95 AC_PROG_CC
96 AM_PROG_CC_C_O
97 AC_PROG_LIBTOOL
98
99 dnl Check for Gtk doc
100 GTKDOC_VERSION=gtkdoc_version
101 GTK_DOC_CHECK([$GTKDOC_VERSION])
102 AM_CONDITIONAL([BUILD_GTK_DOC], [test "x$enable_gtk_doc" = "xyes"])
103 AC_SUBST(GTKDOC_VERSION)
104
105 dnl Check for GLib
106 AC_PATH_PROG([GLIB_GENMARSHAL], [glib-genmarshal])
107 PKG_CHECK_MODULES([GLIB], [glib-2.0])
108 AC_SUBST(GLIB_CFLAGS)
109 AC_SUBST(GLIB_LIBS)
110
111 dnl Check for GStreamer
112 PKG_CHECK_MODULES([GST],
113     [gstreamer-$GST_MAJORMINOR >= $GST_VERSION_REQUIRED]
114 )
115 AC_SUBST(GST_CFLAGS)
116 AC_SUBST(GST_LIBS)
117
118 dnl Check for GStreamer plugins-base
119 PKG_CHECK_MODULES([GST_PLUGINS_BASE],
120     [gstreamer-plugins-base-$GST_MAJORMINOR >= $GST_PLUGINS_BASE_VERSION_REQUIRED]
121 )
122 AC_SUBST(GST_PLUGINS_BASE_CFLAGS)
123 AC_SUBST(GST_PLUGINS_BASE_LIBS)
124
125 dnl Check for GStreamer base
126 PKG_CHECK_MODULES([GST_BASE],
127     [gstreamer-base-$GST_MAJORMINOR >= $GST_VERSION_REQUIRED]
128 )
129 AC_SUBST(GST_BASE_CFLAGS)
130 AC_SUBST(GST_BASE_LIBS)
131
132 dnl Check for GStreamer video
133 PKG_CHECK_MODULES([GST_VIDEO],
134     [gstreamer-video-$GST_MAJORMINOR >= $GST_VERSION_REQUIRED]
135 )
136 AC_SUBST(GST_VIDEO_CFLAGS)
137 AC_SUBST(GST_VIDEO_LIBS)
138
139 dnl Check for the GStreamer plugins directory
140 AC_MSG_CHECKING([for GStreamer plugins directory])
141 GST_PLUGINS_DIR=`$PKG_CONFIG gstreamer-$GST_MAJORMINOR --variable pluginsdir`
142 if test -z "$GST_PLUGINS_DIR"; then
143     echo "FAIL FAIL FAIL"
144     GST_PLUGINS_DIR="\$(libdir)/gstreamer-$GST_MAJORMINOR"
145 fi
146 AC_MSG_RESULT([$GST_PLUGINS_DIR])
147 plugindir="$GST_PLUGINS_DIR"
148 AC_SUBST(plugindir)
149
150 dnl Check for VA-API
151 PKG_CHECK_MODULES(LIBVA, [libva])
152 PKG_CHECK_MODULES(X11, [x11])
153 PKG_CHECK_MODULES(LIBVA_X11, [libva-x11])
154
155 dnl Check for SDS extensions to VA-API
156 AC_CACHE_CHECK([for VA-API],
157   ac_cv_libva_sds_extensions, [
158   saved_CFLAGS="$CFLAGS"
159   CFLAGS="$CFLAGS $LIBVA_DEPS_CFLAGS"
160   AC_TRY_COMPILE([
161     #include <va/va_version.h>
162     #if VA_MAJOR_VERSION == 0 && VA_MINOR_VERSION == 29
163     # if !defined(VA_SDS_VERSION) || (VA_SDS_VERSION < $LIBVA_SDS_VERSION_0_29)
164     #  error "VA-API version >= 0.29.0-sds$LIBVA_SDS_VERSION_0_29 is required"
165     # endif
166     #elif VA_MAJOR_VERSION == 0 && VA_MINOR_VERSION == 30
167     # if !defined(VA_SDS_VERSION) || (VA_SDS_VERSION < $LIBVA_SDS_VERSION_0_30)
168     #  error "VA-API version >= 0.30.0-sds$LIBVA_SDS_VERSION_0_30 is required"
169     # endif
170     #elif !VA_CHECK_VERSION(0,31,0)
171     # error "VA-API version >= 0.31 is required"
172     #endif
173   ], [],
174   [ac_cv_libva_sds_extensions="yes"],
175   [ac_cv_libva_sds_extensions="no"])
176   CFLAGS="$saved_CFLAGS"
177 ])
178 VA_VERSION=`$PKG_CONFIG --modversion libva`
179 VA_MAJOR_VERSION=`echo "$VA_VERSION" | cut -d'.' -f1`
180 VA_MINOR_VERSION=`echo "$VA_VERSION" | cut -d'.' -f2`
181 VA_DRIVER_INIT_FUNC="__vaDriverInit_${VA_MAJOR_VERSION}_${VA_MINOR_VERSION}_sds"
182 if test "$ac_cv_libva_sds_extensions" = "yes"; then
183     AC_DEFINE_UNQUOTED([VA_DRIVER_INIT_FUNC], [$VA_DRIVER_INIT_FUNC], [Define driver entry-point])
184 else
185     AC_MSG_ERROR([Your VA-API SDK does not include SDS extensions])
186 fi
187
188 pkgconfigdir=${libdir}/pkgconfig
189 AC_SUBST(pkgconfigdir)
190
191 AC_OUTPUT([
192     Makefile
193     debian.upstream/Makefile
194     debian.upstream/changelog
195     debian.upstream/control
196     debian.upstream/gstreamer$GST_MAJORMINOR-vaapi.install:\
197 debian.upstream/gstreamer-vaapi.install.in
198     debian.upstream/gstreamer$GST_MAJORMINOR-vaapi-doc.install:\
199 debian.upstream/gstreamer-vaapi-doc.install.in
200     debian.upstream/libgstvaapi$GST_VAAPI_MAJOR_VERSION.install:\
201 debian.upstream/libgstvaapi.install.in
202     debian.upstream/libgstvaapi$GST_VAAPI_MAJOR_VERSION-dev.install:\
203 debian.upstream/libgstvaapi-dev.install.in
204     debian.upstream/libgstvaapi-x11-$GST_VAAPI_MAJOR_VERSION.install:\
205 debian.upstream/libgstvaapi-x11.install.in
206     docs/Makefile
207     docs/reference/Makefile
208     docs/reference/libs/Makefile
209     docs/reference/libs/libs-docs.xml
210     docs/reference/plugins/Makefile
211     docs/reference/plugins/plugins-docs.xml
212     gst-libs/Makefile
213     gst-libs/gst/Makefile
214     gst-libs/gst/vaapi/Makefile
215     pkgconfig/Makefile
216     pkgconfig/gstreamer-vaapi.pc
217     pkgconfig/gstreamer-vaapi-x11.pc
218     sys/Makefile
219     sys/vaapiconvert/Makefile
220     sys/vaapisink/Makefile
221     tests/Makefile
222 ])