omxvideodec: use the correct printf format in a debug message
[platform/upstream/gstreamer.git] / configure.ac
1 AC_PREREQ(2.62)
2
3 dnl please read gstreamer/docs/random/autotools before changing this file
4
5 dnl initialize autoconf
6 dnl releases only do -Wall, git and prerelease does -Werror too
7 dnl use a three digit version number for releases, and four for git/prerelease
8 AC_INIT(GStreamer OpenMAX Plug-ins, 1.0.0.1,
9     http://bugzilla.gnome.org/enter_bug.cgi?product=GStreamer,
10     gst-omx)
11
12 AG_GST_INIT
13
14 dnl initialize automake
15 AM_INIT_AUTOMAKE([-Wno-portability 1.11 no-dist-gzip dist-xz tar-ustar])
16
17 dnl define PACKAGE_VERSION_* variables
18 AS_VERSION
19
20 dnl check if this is a release version
21 AS_NANO(GST_GIT="no", GST_GIT="yes")
22
23 dnl can autoconf find the source ?
24 AC_CONFIG_SRCDIR([omx/gstomx.c])
25
26 dnl define the output header for config
27 AC_CONFIG_HEADERS([config.h])
28
29 dnl AM_MAINTAINER_MODE only provides the option to configure to enable it
30 AM_MAINTAINER_MODE([enable])
31
32 dnl sets host_* variables
33 AC_CANONICAL_HOST
34
35 dnl use pretty build output with automake >= 1.11
36 m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])],
37   [AM_DEFAULT_VERBOSITY=1
38    AC_SUBST(AM_DEFAULT_VERBOSITY)])
39
40 dnl our libraries and install dirs use GST_API_VERSION in the filename
41 dnl to allow side-by-side installation of different API versions
42 GST_API_VERSION=1.0
43 AC_SUBST(GST_API_VERSION)
44 AC_DEFINE_UNQUOTED(GST_API_VERSION, "$GST_API_VERSION",
45   [GStreamer API Version])
46
47 AG_GST_LIBTOOL_PREPARE
48 AS_LIBTOOL(GST, 0, 0, 0)
49
50 dnl *** required versions of GStreamer stuff ***
51 GST_REQ=1.0.0
52
53 dnl *** autotools stuff ****
54
55 dnl allow for different autotools
56 AS_AUTOTOOLS_ALTERNATE
57
58 dnl Add parameters for aclocal
59 AC_SUBST(ACLOCAL_AMFLAGS, "-I m4 -I common/m4")
60
61 dnl *** check for arguments to configure ***
62
63 AG_GST_ARG_DEBUG
64 AG_GST_ARG_PROFILING
65 AG_GST_ARG_VALGRIND
66 AG_GST_ARG_GCOV
67
68 AG_GST_ARG_EXAMPLES
69
70 AG_GST_ARG_WITH_PKG_CONFIG_PATH
71 AG_GST_ARG_WITH_PACKAGE_NAME
72 AG_GST_ARG_WITH_PACKAGE_ORIGIN
73
74 AG_GST_PKG_CONFIG_PATH
75
76 AG_GST_ARG_WITH_PLUGINS
77
78 AG_GST_ARG_ENABLE_EXPERIMENTAL
79
80 dnl *** checks for platform ***
81
82 dnl * hardware/architecture *
83
84 dnl common/m4/gst-arch.m4
85 dnl check CPU type
86 AG_GST_ARCH
87
88 dnl check for large file support
89 dnl affected plugins must include config.h
90 AC_SYS_LARGEFILE
91
92 dnl *** checks for programs ***
93
94 dnl find a compiler
95 AC_PROG_CC
96 AC_PROG_CC_STDC
97
98 dnl check if the compiler supports '-c' and '-o' options
99 AM_PROG_CC_C_O
100
101 AC_PATH_PROG(VALGRIND_PATH, valgrind, no)
102 AM_CONDITIONAL(HAVE_VALGRIND, test ! "x$VALGRIND_PATH" = "xno")
103
104 dnl check for documentation tools
105 GTK_DOC_CHECK([1.3])
106 AS_PATH_PYTHON([2.1])
107 AG_GST_PLUGIN_DOCS([1.3],[2.1])
108
109 dnl *** checks for libraries ***
110
111 dnl libm, for sin() etc.
112 LT_LIB_M
113 AC_SUBST(LIBM)
114
115 dnl *** checks for header files ***
116
117 dnl check if we have ANSI C header files
118 AC_HEADER_STDC
119
120 AX_CREATE_STDINT_H
121
122 dnl *** checks for functions ***
123
124 dnl *** checks for types/defines ***
125
126 dnl *** checks for structures ***
127
128 dnl *** checks for compiler characteristics ***
129
130 dnl *** checks for library functions ***
131
132 dnl Check for a way to display the function name in debug output
133 AG_GST_CHECK_FUNCTION
134
135 dnl *** checks for dependency libraries ***
136
137 dnl GLib is required
138 AG_GST_GLIB_CHECK([2.32])
139
140 dnl checks for gstreamer
141 dnl uninstalled is selected preferentially -- see pkg-config(1)
142 AG_GST_CHECK_GST($GST_API_VERSION, [$GST_REQ], yes)
143 AG_GST_CHECK_GST_BASE($GST_API_VERSION, [$GST_REQ], yes)
144 AG_GST_CHECK_GST_CONTROLLER($GST_API_VERSION, [$GST_REQ], yes)
145 AG_GST_CHECK_GST_CHECK($GST_API_VERSION, [$GST_REQ], no)
146 AG_GST_CHECK_GST_PLUGINS_BASE($GST_API_VERSION, [$GST_REQ], yes)
147 AM_CONDITIONAL(HAVE_GST_CHECK, test "x$HAVE_GST_CHECK" = "xyes")
148 PKG_CHECK_MODULES([GST_PLUGINS_BAD], [gstreamer-plugins-bad-1.0])
149
150 dnl Check for documentation xrefs
151 GLIB_PREFIX="`$PKG_CONFIG --variable=prefix glib-2.0`"
152 GST_PREFIX="`$PKG_CONFIG --variable=prefix gstreamer-$GST_API_VERSION`"
153 AC_SUBST(GLIB_PREFIX)
154 AC_SUBST(GST_PREFIX)
155
156 dnl Check for external OpenMAX IL headers
157 AC_CHECK_HEADER([OMX_Core.h], [HAVE_EXTERNAL_OMX=yes], [HAVE_EXTERNAL_OMX=no], [AC_INCLUDES_DEFAULT])
158 AM_CONDITIONAL(HAVE_EXTERNAL_OMX, test "x$HAVE_EXTERNAL_OMX" = "xyes")
159
160 AC_CHECK_DECLS([OMX_VIDEO_CodingVP8],
161   [
162     AC_DEFINE(HAVE_VP8, 1, [OpenMAX IL has VP8 support])
163     HAVE_VP8=yes
164   ], [
165     HAVE_VP8=no
166   ], [[#include <OMX_Video.h>]])
167 AM_CONDITIONAL(HAVE_VP8, test "x$HAVE_VP8" = "xyes")
168
169 AC_CHECK_DECLS([OMX_VIDEO_CodingTheora],
170   [
171     AC_DEFINE(HAVE_THEORA, 1, [OpenMAX IL has Theora support])
172     HAVE_THEORA=yes
173   ], [
174     HAVE_THEORA=no
175   ], [[#include <OMX_Video.h>]])
176 AM_CONDITIONAL(HAVE_THEORA, test "x$HAVE_THEORA" = "xyes")
177
178 dnl Check for -Bsymbolic-functions linker flag used to avoid
179 dnl intra-library PLT jumps, if available.
180 AC_ARG_ENABLE(Bsymbolic,
181               [AC_HELP_STRING([--disable-Bsymbolic],
182                               [avoid linking with -Bsymbolic])],,
183               [SAVED_LDFLAGS="${LDFLAGS}"
184                AC_MSG_CHECKING([for -Bsymbolic-functions linker flag])
185                LDFLAGS=-Wl,-Bsymbolic-functions
186                AC_TRY_LINK([], [int main (void) { return 0; }],
187                            AC_MSG_RESULT(yes)
188                            enable_Bsymbolic=yes,
189                            AC_MSG_RESULT(no)
190                            enable_Bsymbolic=no)
191                LDFLAGS="${SAVED_LDFLAGS}"])
192
193 AC_ARG_WITH([omx-target],
194         AS_HELP_STRING([--with-omx-target],[Use this OpenMAX IL target (generic, bellagio, rpi)]),
195         [ac_cv_omx_target="$withval"], [ac_cv_omx_target="generic"])
196
197 ac_cv_omx_target_struct_packing="none"
198 AC_MSG_NOTICE([Using $ac_cv_omx_target as OpenMAX IL target])
199 case "${ac_cv_omx_target}" in
200   generic)
201     AC_DEFINE(USE_OMX_TARGET_GENERIC, 1, [Use generic OpenMAX IL target])
202     ;;
203   rpi)
204     AC_DEFINE(USE_OMX_TARGET_RPI, 1, [Use RPi OpenMAX IL target])
205     ac_cv_omx_target_struct_packing=4
206     ;;
207   bellagio)
208     AC_DEFINE(USE_OMX_TARGET_BELLAGIO, 1, [Use Bellagio OpenMAX IL target])
209     ;;
210   *)
211     AC_ERROR([invalid OpenMAX IL target])
212     ;;
213 esac
214 AM_CONDITIONAL(USE_OMX_TARGET_GENERIC, test "x$ac_cv_omx_target" = "xgeneric")
215 AM_CONDITIONAL(USE_OMX_TARGET_BELLAGIO, test "x$ac_cv_omx_target" = "xbellagio")
216 AM_CONDITIONAL(USE_OMX_TARGET_RPI, test "x$ac_cv_omx_target" = "xrpi")
217
218 AC_ARG_WITH([omx-struct-packing],
219         AS_HELP_STRING([--with-omx-struct-packing],[Force OpenMAX struct packing, (default is none)]),
220         [ac_cv_omx_struct_packing="$withval"], [ac_cv_omx_struct_packing="none"])
221
222 if test x"$ac_cv_omx_struct_packing" != x"none"; then
223   AC_MSG_NOTICE([Using $ac_cv_omx_struct_packing as OpenMAX struct packing])
224   AC_DEFINE_UNQUOTED(GST_OMX_STRUCT_PACKING, $ac_cv_omx_struct_packing, [The struct packing used for OpenMAX structures])
225 elif test x"$ac_cv_omx_target_struct_packing" != x"none"; then
226   AC_MSG_NOTICE([Using $ac_cv_omx_target_struct_packing as OpenMAX struct packing])
227   AC_DEFINE_UNQUOTED(GST_OMX_STRUCT_PACKING, $ac_cv_omx_target_struct_packing, [The struct packing used for OpenMAX structures])
228 fi
229
230 dnl *** set variables based on configure arguments ***
231
232 dnl set license and copyright notice
233 GST_LICENSE="LGPL"
234 AC_DEFINE_UNQUOTED(GST_LICENSE, "$GST_LICENSE", [GStreamer license])
235 AC_SUBST(GST_LICENSE)
236
237 dnl set location of plugin directory
238 AG_GST_SET_PLUGINDIR
239
240 dnl set release date/time
241 AG_GST_SET_PACKAGE_RELEASE_DATETIME_WITH_NANO([$PACKAGE_VERSION_NANO],
242   ["${srcdir}/gst-omx.doap"],
243   [$PACKAGE_VERSION_MAJOR.$PACKAGE_VERSION_MINOR.$PACKAGE_VERSION_MICRO])
244
245 dnl define an ERROR_CFLAGS Makefile variable
246 AG_GST_SET_ERROR_CFLAGS($GST_GIT, [
247     -Wmissing-declarations -Wmissing-prototypes -Wredundant-decls -Wundef
248     -Wwrite-strings -Wformat-nonliteral -Wformat-security -Wformat-nonliteral
249     -Winit-self -Wmissing-include-dirs -Waddress -Waggregate-return
250     -Wno-multichar -Wnested-externs ])
251
252 dnl define correct level for debugging messages
253 AG_GST_SET_LEVEL_DEFAULT($GST_GIT)
254
255 dnl used in examples
256 AG_GST_DEFAULT_ELEMENTS
257
258 dnl *** plug-ins to include ***
259
260 dnl these are all the gst plug-ins, compilable without additional libs
261 AG_GST_CHECK_PLUGIN(omx)
262
263 dnl check for gstreamer core features (subsystems)
264 dnl FIXME: this assumes srcdir == builddir for uninstalled setups
265 GST_CONFIGPATH=`$PKG_CONFIG --variable=includedir gstreamer-$GST_API_VERSION`"/gst/gstconfig.h"
266 AG_GST_PARSE_SUBSYSTEM_DISABLES($GST_CONFIGPATH)
267 dnl AM_CONDITIONAL(USE_FOO, test $GST_DISABLE_FOO != "1")
268
269 dnl *** finalize CFLAGS, LDFLAGS, LIBS
270
271 dnl Overview:
272 dnl GST_OPTION_CFLAGS:  common flags for profiling, debugging, errors, ...
273 dnl GST_*:              flags shared by built objects to link against GStreamer
274 dnl GST_PLUGINS_BASE_CFLAGS: to link internally against the plugins base libs
275 dnl                          (compare to other modules) or for i18n
276 dnl GST_ALL_LDFLAGS:    linker flags shared by all
277 dnl GST_LIB_LDFLAGS:    additional linker flags for all libaries
278 dnl GST_LT_LDFLAGS:     library versioning of our libraries
279 dnl GST_PLUGIN_LDFLAGS: flags to be used for all plugins
280
281 dnl GST_OPTION_CFLAGS
282 if test "x$USE_DEBUG" = xyes; then
283    PROFILE_CFLAGS="-g"
284 fi
285 AC_SUBST(PROFILE_CFLAGS)
286
287 if test "x$PACKAGE_VERSION_NANO" = "x1"; then
288   dnl Define _only_ when compiling a git version (not pre-releases or releases)
289   DEPRECATED_CFLAGS="-DGST_DISABLE_DEPRECATED"
290 else
291   DEPRECATED_CFLAGS=""
292 fi
293 AC_SUBST(DEPRECATED_CFLAGS)
294
295 dnl every flag in GST_OPTION_CFLAGS and GST_OPTION_CXXFLAGS can be overridden
296 dnl at make time with e.g. make ERROR_CFLAGS=""
297 GST_OPTION_CFLAGS="\$(WARNING_CFLAGS) \$(ERROR_CFLAGS) \$(DEBUG_CFLAGS) \$(PROFILE_CFLAGS) \$(GCOV_CFLAGS) \$(OPT_CFLAGS) \$(DEPRECATED_CFLAGS)"
298 AC_SUBST(GST_OPTION_CFLAGS)
299
300 dnl GST_PLUGINS_BASE_CFLAGS
301 dnl prefer internal headers to already installed ones
302 dnl also add builddir include for enumtypes and marshal
303 GST_OMX_CFLAGS=""
304 AC_SUBST(GST_OMX_CFLAGS)
305
306 dnl FIXME: do we want to rename to GST_ALL_* ?
307 dnl add GST_OPTION_CFLAGS, but overridable
308 GST_CFLAGS="$GLIB_CFLAGS $GST_CFLAGS $GLIB_EXTRA_CFLAGS \$(GST_OPTION_CFLAGS)"
309 AC_SUBST(GST_CFLAGS)
310 dnl add GCOV libs because libtool strips -fprofile-arcs -ftest-coverage
311 GST_LIBS="$GST_LIBS \$(GCOV_LIBS)"
312 AC_SUBST(GST_LIBS)
313
314 dnl LDFLAGS really should only contain flags, not libs - they get added before
315 dnl whatevertarget_LIBS and -L flags here affect the rest of the linking
316 GST_ALL_LDFLAGS="-no-undefined"
317 if test "x${enable_Bsymbolic}" = "xyes"; then
318   GST_ALL_LDFLAGS="$GST_ALL_LDFLAGS -Wl,-Bsymbolic-functions"
319 fi
320 AC_SUBST(GST_ALL_LDFLAGS)
321
322 dnl this really should only contain flags, not libs - they get added before
323 dnl whatevertarget_LIBS and -L flags here affect the rest of the linking
324 GST_PLUGIN_LDFLAGS="-module -avoid-version -export-symbols-regex '^[_]*gst_plugin_desc.*' $GST_ALL_LDFLAGS"
325 AC_SUBST(GST_PLUGIN_LDFLAGS)
326
327 dnl *** output files ***
328
329 AC_CONFIG_FILES(
330 Makefile
331 omx/Makefile
332 common/Makefile
333 common/m4/Makefile
334 tools/Makefile
335 config/Makefile
336 config/bellagio/Makefile
337 config/rpi/Makefile
338 )
339
340 AC_OUTPUT
341