examples: add an example aplication based OpenGL ES + EGL
[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_DISABLE_FATAL_WARNINGS
64
65 AG_GST_ARG_DEBUG
66 AG_GST_ARG_PROFILING
67 AG_GST_ARG_VALGRIND
68 AG_GST_ARG_GCOV
69
70 AG_GST_ARG_EXAMPLES
71
72 AG_GST_ARG_WITH_PKG_CONFIG_PATH
73 AG_GST_ARG_WITH_PACKAGE_NAME
74 AG_GST_ARG_WITH_PACKAGE_ORIGIN
75
76 AG_GST_PKG_CONFIG_PATH
77
78 AG_GST_ARG_WITH_PLUGINS
79
80 AG_GST_ARG_ENABLE_EXPERIMENTAL
81
82 dnl *** checks for platform ***
83
84 dnl * hardware/architecture *
85
86 dnl common/m4/gst-arch.m4
87 dnl check CPU type
88 AG_GST_ARCH
89
90 dnl check for large file support
91 dnl affected plugins must include config.h
92 AC_SYS_LARGEFILE
93
94 dnl *** checks for programs ***
95
96 dnl find a compiler
97 AC_PROG_CC
98 AC_PROG_CC_STDC
99
100 dnl check if the compiler supports '-c' and '-o' options
101 AM_PROG_CC_C_O
102
103 AC_PATH_PROG(VALGRIND_PATH, valgrind, no)
104 AM_CONDITIONAL(HAVE_VALGRIND, test ! "x$VALGRIND_PATH" = "xno")
105
106 dnl check for documentation tools
107 GTK_DOC_CHECK([1.3])
108 AS_PATH_PYTHON([2.1])
109 AG_GST_PLUGIN_DOCS([1.3],[2.1])
110
111 dnl *** checks for libraries ***
112
113 dnl libm, for sin() etc.
114 LT_LIB_M
115 AC_SUBST(LIBM)
116
117 dnl *** checks for header files ***
118
119 dnl check if we have ANSI C header files
120 AC_HEADER_STDC
121
122 AX_CREATE_STDINT_H
123
124 dnl *** checks for functions ***
125
126 dnl *** checks for types/defines ***
127
128 dnl *** checks for structures ***
129
130 dnl *** checks for compiler characteristics ***
131
132 dnl *** checks for library functions ***
133
134 dnl Check for a way to display the function name in debug output
135 AG_GST_CHECK_FUNCTION
136
137 dnl *** checks for dependency libraries ***
138
139 dnl GLib is required
140 AG_GST_GLIB_CHECK([2.32])
141
142 dnl checks for gstreamer
143 dnl uninstalled is selected preferentially -- see pkg-config(1)
144 AG_GST_CHECK_GST($GST_API_VERSION, [$GST_REQ], yes)
145 AG_GST_CHECK_GST_BASE($GST_API_VERSION, [$GST_REQ], yes)
146 AG_GST_CHECK_GST_CONTROLLER($GST_API_VERSION, [$GST_REQ], yes)
147 AG_GST_CHECK_GST_CHECK($GST_API_VERSION, [$GST_REQ], no)
148 AG_GST_CHECK_GST_PLUGINS_BASE($GST_API_VERSION, [$GST_REQ], yes)
149 AM_CONDITIONAL(HAVE_GST_CHECK, test "x$HAVE_GST_CHECK" = "xyes")
150 PKG_CHECK_MODULES([GST_EGL], [gstreamer-egl-1.0], [
151   AC_DEFINE(HAVE_GST_EGL, 1, [Have gstreamer-egl])
152   GST_EGL=yes
153 ])
154 AM_CONDITIONAL(HAVE_GST_EGL, test "x$GST_EGL" = "xyes")
155
156 dnl Check for documentation xrefs
157 GLIB_PREFIX="`$PKG_CONFIG --variable=prefix glib-2.0`"
158 GST_PREFIX="`$PKG_CONFIG --variable=prefix gstreamer-$GST_API_VERSION`"
159 AC_SUBST(GLIB_PREFIX)
160 AC_SUBST(GST_PREFIX)
161
162 dnl Check for external OpenMAX IL headers
163 AC_CHECK_HEADER([OMX_Core.h], [HAVE_EXTERNAL_OMX=yes], [HAVE_EXTERNAL_OMX=no], [AC_INCLUDES_DEFAULT])
164 AM_CONDITIONAL(HAVE_EXTERNAL_OMX, test "x$HAVE_EXTERNAL_OMX" = "xyes")
165
166 AC_CHECK_DECLS([OMX_VIDEO_CodingVP8],
167   [
168     AC_DEFINE(HAVE_VP8, 1, [OpenMAX IL has VP8 support])
169     HAVE_VP8=yes
170   ], [
171     HAVE_VP8=no
172   ], [[#include <OMX_Video.h>]])
173 AM_CONDITIONAL(HAVE_VP8, test "x$HAVE_VP8" = "xyes")
174
175 AC_CHECK_DECLS([OMX_VIDEO_CodingTheora],
176   [
177     AC_DEFINE(HAVE_THEORA, 1, [OpenMAX IL has Theora support])
178     HAVE_THEORA=yes
179   ], [
180     HAVE_THEORA=no
181   ], [[#include <OMX_Video.h>]])
182 AM_CONDITIONAL(HAVE_THEORA, test "x$HAVE_THEORA" = "xyes")
183
184 dnl Check for -Bsymbolic-functions linker flag used to avoid
185 dnl intra-library PLT jumps, if available.
186 AC_ARG_ENABLE(Bsymbolic,
187               [AC_HELP_STRING([--disable-Bsymbolic],
188                               [avoid linking with -Bsymbolic])],,
189               [SAVED_LDFLAGS="${LDFLAGS}"
190                AC_MSG_CHECKING([for -Bsymbolic-functions linker flag])
191                LDFLAGS=-Wl,-Bsymbolic-functions
192                AC_TRY_LINK([], [int main (void) { return 0; }],
193                            AC_MSG_RESULT(yes)
194                            enable_Bsymbolic=yes,
195                            AC_MSG_RESULT(no)
196                            enable_Bsymbolic=no)
197                LDFLAGS="${SAVED_LDFLAGS}"])
198
199 AC_ARG_WITH([omx-target],
200         AS_HELP_STRING([--with-omx-target],[Use this OpenMAX IL target (generic, bellagio, rpi)]),
201         [ac_cv_omx_target="$withval"], [ac_cv_omx_target="none"])
202
203 ac_cv_omx_target_struct_packing="none"
204 AC_MSG_NOTICE([Using $ac_cv_omx_target as OpenMAX IL target])
205 case "${ac_cv_omx_target}" in
206   generic)
207     AC_DEFINE(USE_OMX_TARGET_GENERIC, 1, [Use generic OpenMAX IL target])
208     ;;
209   rpi)
210     AC_DEFINE(USE_OMX_TARGET_RPI, 1, [Use RPi OpenMAX IL target])
211     ac_cv_omx_target_struct_packing=4
212     ;;
213   bellagio)
214     AC_DEFINE(USE_OMX_TARGET_BELLAGIO, 1, [Use Bellagio OpenMAX IL target])
215     ;;
216   none|*)
217     AC_ERROR([invalid OpenMAX IL target, you must specify one of --with-omx-target={generic,rpi,bellagio}])
218     ;;
219 esac
220 AM_CONDITIONAL(USE_OMX_TARGET_GENERIC, test "x$ac_cv_omx_target" = "xgeneric")
221 AM_CONDITIONAL(USE_OMX_TARGET_BELLAGIO, test "x$ac_cv_omx_target" = "xbellagio")
222 AM_CONDITIONAL(USE_OMX_TARGET_RPI, test "x$ac_cv_omx_target" = "xrpi")
223
224 AC_ARG_WITH([omx-struct-packing],
225         AS_HELP_STRING([--with-omx-struct-packing],[Force OpenMAX struct packing, (default is none)]),
226         [ac_cv_omx_struct_packing="$withval"], [ac_cv_omx_struct_packing="none"])
227
228 if test x"$ac_cv_omx_struct_packing" != x"none"; then
229   AC_MSG_NOTICE([Using $ac_cv_omx_struct_packing as OpenMAX struct packing])
230   AC_DEFINE_UNQUOTED(GST_OMX_STRUCT_PACKING, $ac_cv_omx_struct_packing, [The struct packing used for OpenMAX structures])
231 elif test x"$ac_cv_omx_target_struct_packing" != x"none"; then
232   AC_MSG_NOTICE([Using $ac_cv_omx_target_struct_packing as OpenMAX struct packing])
233   AC_DEFINE_UNQUOTED(GST_OMX_STRUCT_PACKING, $ac_cv_omx_target_struct_packing, [The struct packing used for OpenMAX structures])
234 fi
235
236 dnl *** set variables based on configure arguments ***
237
238 dnl set license and copyright notice
239 GST_LICENSE="LGPL"
240 AC_DEFINE_UNQUOTED(GST_LICENSE, "$GST_LICENSE", [GStreamer license])
241 AC_SUBST(GST_LICENSE)
242
243 dnl set location of plugin directory
244 AG_GST_SET_PLUGINDIR
245
246 dnl set release date/time
247 AG_GST_SET_PACKAGE_RELEASE_DATETIME_WITH_NANO([$PACKAGE_VERSION_NANO],
248   ["${srcdir}/gst-omx.doap"],
249   [$PACKAGE_VERSION_MAJOR.$PACKAGE_VERSION_MINOR.$PACKAGE_VERSION_MICRO])
250
251 dnl build static plugins or not
252 AC_MSG_CHECKING([whether to build static plugins or not])
253 AC_ARG_ENABLE(
254   static-plugins,
255   AC_HELP_STRING(
256     [--enable-static-plugins],
257     [build static plugins @<:@default=no@:>@]),
258   [AS_CASE(
259     [$enableval], [no], [], [yes], [],
260     [AC_MSG_ERROR([bad value "$enableval" for --enable-static-plugins])])],
261   [enable_static_plugins=no])
262 AC_MSG_RESULT([$enable_static_plugins])
263 if test "x$enable_static_plugins" = xyes; then
264   AC_DEFINE(GST_PLUGIN_BUILD_STATIC, 1,
265     [Define if static plugins should be built])
266   GST_PLUGIN_LIBTOOLFLAGS=""
267 else
268   GST_PLUGIN_LIBTOOLFLAGS="--tag=disable-static"
269 fi
270 AC_SUBST(GST_PLUGIN_LIBTOOLFLAGS)
271 AM_CONDITIONAL(GST_PLUGIN_BUILD_STATIC, test "x$enable_static_plugins" = "xyes")
272
273 dnl define an ERROR_CFLAGS Makefile variable
274 AG_GST_SET_ERROR_CFLAGS($FATAL_WARNINGS, [
275     -Wmissing-declarations -Wmissing-prototypes -Wredundant-decls -Wundef
276     -Wwrite-strings -Wformat-nonliteral -Wformat-security -Wformat-nonliteral
277     -Winit-self -Wmissing-include-dirs -Waddress -Waggregate-return
278     -Wno-multichar -Wnested-externs ])
279
280 dnl define correct level for debugging messages
281 AG_GST_SET_LEVEL_DEFAULT($GST_GIT)
282
283 dnl used in examples
284 AG_GST_DEFAULT_ELEMENTS
285
286 dnl *** plug-ins to include ***
287
288 dnl these are all the gst plug-ins, compilable without additional libs
289 AG_GST_CHECK_PLUGIN(omx)
290
291 dnl check for gstreamer core features (subsystems)
292 dnl FIXME: this assumes srcdir == builddir for uninstalled setups
293 GST_CONFIGPATH=`$PKG_CONFIG --variable=includedir gstreamer-$GST_API_VERSION`"/gst/gstconfig.h"
294 AG_GST_PARSE_SUBSYSTEM_DISABLES($GST_CONFIGPATH)
295 dnl AM_CONDITIONAL(USE_FOO, test $GST_DISABLE_FOO != "1")
296
297 dnl *** finalize CFLAGS, LDFLAGS, LIBS
298
299 dnl Overview:
300 dnl GST_OPTION_CFLAGS:  common flags for profiling, debugging, errors, ...
301 dnl GST_*:              flags shared by built objects to link against GStreamer
302 dnl GST_PLUGINS_BASE_CFLAGS: to link internally against the plugins base libs
303 dnl                          (compare to other modules) or for i18n
304 dnl GST_ALL_LDFLAGS:    linker flags shared by all
305 dnl GST_LIB_LDFLAGS:    additional linker flags for all libaries
306 dnl GST_LT_LDFLAGS:     library versioning of our libraries
307 dnl GST_PLUGIN_LDFLAGS: flags to be used for all plugins
308
309 dnl GST_OPTION_CFLAGS
310 if test "x$USE_DEBUG" = xyes; then
311    PROFILE_CFLAGS="-g"
312 fi
313 AC_SUBST(PROFILE_CFLAGS)
314
315 if test "x$PACKAGE_VERSION_NANO" = "x1"; then
316   dnl Define _only_ when compiling a git version (not pre-releases or releases)
317   DEPRECATED_CFLAGS="-DGST_DISABLE_DEPRECATED"
318 else
319   DEPRECATED_CFLAGS=""
320 fi
321 AC_SUBST(DEPRECATED_CFLAGS)
322
323 dnl every flag in GST_OPTION_CFLAGS and GST_OPTION_CXXFLAGS can be overridden
324 dnl at make time with e.g. make ERROR_CFLAGS=""
325 GST_OPTION_CFLAGS="\$(WARNING_CFLAGS) \$(ERROR_CFLAGS) \$(DEBUG_CFLAGS) \$(PROFILE_CFLAGS) \$(GCOV_CFLAGS) \$(OPT_CFLAGS) \$(DEPRECATED_CFLAGS)"
326 AC_SUBST(GST_OPTION_CFLAGS)
327
328 dnl GST_PLUGINS_BASE_CFLAGS
329 dnl prefer internal headers to already installed ones
330 dnl also add builddir include for enumtypes and marshal
331 GST_OMX_CFLAGS=""
332 AC_SUBST(GST_OMX_CFLAGS)
333
334 dnl FIXME: do we want to rename to GST_ALL_* ?
335 dnl add GST_OPTION_CFLAGS, but overridable
336 GST_CFLAGS="$GLIB_CFLAGS $GST_CFLAGS $GLIB_EXTRA_CFLAGS \$(GST_OPTION_CFLAGS)"
337 AC_SUBST(GST_CFLAGS)
338 dnl add GCOV libs because libtool strips -fprofile-arcs -ftest-coverage
339 GST_LIBS="$GST_LIBS \$(GCOV_LIBS)"
340 AC_SUBST(GST_LIBS)
341
342 dnl LDFLAGS really should only contain flags, not libs - they get added before
343 dnl whatevertarget_LIBS and -L flags here affect the rest of the linking
344 GST_ALL_LDFLAGS="-no-undefined"
345 if test "x${enable_Bsymbolic}" = "xyes"; then
346   GST_ALL_LDFLAGS="$GST_ALL_LDFLAGS -Wl,-Bsymbolic-functions"
347 fi
348 AC_SUBST(GST_ALL_LDFLAGS)
349
350 dnl this really should only contain flags, not libs - they get added before
351 dnl whatevertarget_LIBS and -L flags here affect the rest of the linking
352 GST_PLUGIN_LDFLAGS="-module -avoid-version -export-symbols-regex '^[_]*gst_plugin_.*' $GST_ALL_LDFLAGS"
353 AC_SUBST(GST_PLUGIN_LDFLAGS)
354
355 dnl *** output files ***
356
357 AC_CONFIG_FILES(
358 Makefile
359 omx/Makefile
360 common/Makefile
361 common/m4/Makefile
362 tools/Makefile
363 config/Makefile
364 config/bellagio/Makefile
365 config/rpi/Makefile
366 examples/Makefile
367 examples/egl/Makefile
368 )
369
370 AC_OUTPUT
371