3 dnl please read gstreamer/docs/random/autotools before changing this file
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.2.0,
9 http://bugzilla.gnome.org/enter_bug.cgi?product=GStreamer,
14 dnl initialize automake
15 AM_INIT_AUTOMAKE([-Wno-portability 1.11 no-dist-gzip dist-xz tar-ustar])
17 dnl define PACKAGE_VERSION_* variables
20 dnl check if this is a release version
21 AS_NANO(GST_GIT="no", GST_GIT="yes")
23 dnl can autoconf find the source ?
24 AC_CONFIG_SRCDIR([omx/gstomx.c])
26 dnl define the output header for config
27 AC_CONFIG_HEADERS([config.h])
29 dnl AM_MAINTAINER_MODE only provides the option to configure to enable it
30 AM_MAINTAINER_MODE([enable])
32 dnl sets host_* variables
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)])
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
43 AC_SUBST(GST_API_VERSION)
44 AC_DEFINE_UNQUOTED(GST_API_VERSION, "$GST_API_VERSION",
45 [GStreamer API Version])
47 AG_GST_LIBTOOL_PREPARE
48 AS_LIBTOOL(GST, 0, 0, 0)
50 dnl *** required versions of GStreamer stuff ***
53 dnl *** autotools stuff ****
55 dnl allow for different autotools
56 AS_AUTOTOOLS_ALTERNATE
58 dnl Add parameters for aclocal
59 AC_SUBST(ACLOCAL_AMFLAGS, "-I m4 -I common/m4")
61 dnl *** check for arguments to configure ***
63 AG_GST_ARG_DISABLE_FATAL_WARNINGS
72 AG_GST_ARG_WITH_PKG_CONFIG_PATH
73 AG_GST_ARG_WITH_PACKAGE_NAME
74 AG_GST_ARG_WITH_PACKAGE_ORIGIN
76 AG_GST_PKG_CONFIG_PATH
78 AG_GST_ARG_WITH_PLUGINS
80 AG_GST_ARG_ENABLE_EXPERIMENTAL
82 dnl *** checks for platform ***
84 dnl * hardware/architecture *
86 dnl common/m4/gst-arch.m4
90 dnl check for large file support
91 dnl affected plugins must include config.h
94 dnl *** checks for programs ***
100 dnl check if the compiler supports '-c' and '-o' options
103 AC_PATH_PROG(VALGRIND_PATH, valgrind, no)
104 AM_CONDITIONAL(HAVE_VALGRIND, test ! "x$VALGRIND_PATH" = "xno")
106 dnl check for documentation tools
108 AS_PATH_PYTHON([2.1])
109 AG_GST_PLUGIN_DOCS([1.3],[2.1])
111 dnl *** checks for libraries ***
113 dnl libm, for sin() etc.
117 dnl *** checks for header files ***
119 dnl check if we have ANSI C header files
124 dnl *** checks for functions ***
126 dnl *** checks for types/defines ***
128 dnl *** checks for structures ***
130 dnl *** checks for compiler characteristics ***
132 dnl *** checks for library functions ***
134 dnl Check for a way to display the function name in debug output
135 AG_GST_CHECK_FUNCTION
137 dnl *** checks for dependency libraries ***
140 AG_GST_GLIB_CHECK([2.32])
142 dnl Needed by plugins that use g_module_*() API
143 PKG_CHECK_MODULES(GMODULE_NO_EXPORT, gmodule-no-export-2.0)
145 dnl checks for gstreamer
146 dnl uninstalled is selected preferentially -- see pkg-config(1)
147 AG_GST_CHECK_GST($GST_API_VERSION, [$GST_REQ], yes)
148 AG_GST_CHECK_GST_BASE($GST_API_VERSION, [$GST_REQ], yes)
149 AG_GST_CHECK_GST_CONTROLLER($GST_API_VERSION, [$GST_REQ], yes)
150 AG_GST_CHECK_GST_CHECK($GST_API_VERSION, [$GST_REQ], no)
151 AG_GST_CHECK_GST_PLUGINS_BASE($GST_API_VERSION, [$GST_REQ], yes)
152 AM_CONDITIONAL(HAVE_GST_CHECK, test "x$HAVE_GST_CHECK" = "xyes")
153 PKG_CHECK_MODULES([GST_GL], [gstreamer-gl-1.0 >= 1.4.0], [
154 AC_DEFINE(HAVE_GST_GL, 1, [Have gstreamer-gl])
157 AM_CONDITIONAL(HAVE_GST_GL, test "x$GST_GL" = "xyes")
159 dnl Check for documentation xrefs
160 GLIB_PREFIX="`$PKG_CONFIG --variable=prefix glib-2.0`"
161 GST_PREFIX="`$PKG_CONFIG --variable=prefix gstreamer-$GST_API_VERSION`"
162 AC_SUBST(GLIB_PREFIX)
165 AC_ARG_WITH([omx-header-path],
166 AS_HELP_STRING([--with-omx-header-path],[path of external OpenMAX IL header files]),
167 [omx_header_path="$withval"], [omx_header_path="none"])
169 if test x"$omx_header_path" != x"none"; then
170 CPPFLAGS="$CPPFLAGS -I$omx_header_path"
172 dnl Check for external OpenMAX IL headers
173 AC_CHECK_HEADER([OMX_Core.h], [HAVE_EXTERNAL_OMX=yes], [HAVE_EXTERNAL_OMX=no], [AC_INCLUDES_DEFAULT])
174 AM_CONDITIONAL(HAVE_EXTERNAL_OMX, test "x$HAVE_EXTERNAL_OMX" = "xyes")
176 dnl Our internal OpenMAX IL headers have OMX_VideoExt.h
178 if test "x$HAVE_EXTERNAL_OMX" = "xyes"; then
179 AC_CHECK_HEADER([OMX_VideoExt.h], [HAVE_VIDEO_EXT=yes], [HAVE_VIDEO_EXT=no], [AC_INCLUDES_DEFAULT])
182 VIDEO_HEADERS="#include <OMX_Video.h>"
183 if test "x$HAVE_VIDEO_EXT" = "xyes"; then
184 AC_DEFINE(HAVE_VIDEO_EXT, 1, [OpenMAX IL has OMX_VideoExt.h header])
185 VIDEO_HEADERS="$VIDEO_HEADERS
186 #include <OMX_VideoExt.h>
190 dnl check for supporting vp8
191 AC_MSG_CHECKING([for supporting vp8])
192 AC_ARG_ENABLE(vp8, AC_HELP_STRING([--enable-vp8], [OpenMAX IL has VP8 support]),
194 case "${enableval}" in
197 *) AC_MSG_ERROR(bad value ${enableval} for --enable-vp8) ;;
201 AM_CONDITIONAL(HAVE_VP8, test "x$HAVE_VP8" = "xyes")
202 AC_MSG_RESULT([$HAVE_VP8])
203 if test "x$HAVE_VP8" = "xyes"; then
204 AC_DEFINE(HAVE_VP8, 1, [OpenMAX IL has VP8 support])
207 dnl check for supporting vp9
208 AC_MSG_CHECKING([for supporting vp9])
209 AC_ARG_ENABLE(vp9, AC_HELP_STRING([--enable-vp9], [OpenMAX IL has VP9 support]),
211 case "${enableval}" in
214 *) AC_MSG_ERROR(bad value ${enableval} for --enable-vp9) ;;
218 AM_CONDITIONAL(HAVE_VP9, test "x$HAVE_VP9" = "xyes")
219 AC_MSG_RESULT([$HAVE_VP9])
220 if test "x$HAVE_VP9" = "xyes"; then
221 AC_DEFINE(HAVE_VP9, 1, [OpenMAX IL has VP9 support])
224 dnl check for supporting theora
225 AC_MSG_CHECKING([for supporting theora])
226 AC_ARG_ENABLE(theora, AC_HELP_STRING([--enable-theora], [OpenMAX IL has Theora support]),
228 case "${enableval}" in
229 yes) HAVE_THEORA=yes ;;
230 no) HAVE_THEORA=no ;;
231 *) AC_MSG_ERROR(bad value ${enableval} for --enable-theora) ;;
235 AM_CONDITIONAL(HAVE_THEORA, test "x$HAVE_THEORA" = "xyes")
236 AC_MSG_RESULT([$HAVE_THEORA])
237 if test "x$HAVE_THEORA" = "xyes"; then
238 AC_DEFINE(HAVE_THEORA, 1, [OpenMAX IL has Theora support])
241 dnl check for supporting hevc
242 AC_MSG_CHECKING([for supporting hevc])
243 AC_ARG_ENABLE(hevc, AC_HELP_STRING([--enable-hevc], [OpenMAX IL has HEVC support]),
245 case "${enableval}" in
246 yes) HAVE_HEVC=yes ;;
248 *) AC_MSG_ERROR(bad value ${enableval} for --enable-hevc) ;;
252 AM_CONDITIONAL(HAVE_HEVC, test "x$HAVE_HEVC" = "xyes")
253 AC_MSG_RESULT([$HAVE_HEVC])
254 if test "x$HAVE_HEVC" = "xyes"; then
255 AC_DEFINE(HAVE_HEVC, 1, [OpenMAX IL has HEVC support])
258 dnl Check for -Bsymbolic-functions linker flag used to avoid
259 dnl intra-library PLT jumps, if available.
260 AC_ARG_ENABLE(Bsymbolic,
261 [AC_HELP_STRING([--disable-Bsymbolic],
262 [avoid linking with -Bsymbolic])],,
263 [SAVED_LDFLAGS="${LDFLAGS}"
264 AC_MSG_CHECKING([for -Bsymbolic-functions linker flag])
265 LDFLAGS=-Wl,-Bsymbolic-functions
266 AC_TRY_LINK([], [int main (void) { return 0; }],
268 enable_Bsymbolic=yes,
271 LDFLAGS="${SAVED_LDFLAGS}"])
273 AC_ARG_WITH([omx-target],
274 AS_HELP_STRING([--with-omx-target],[Use this OpenMAX IL target (generic, bellagio, rpi, exynos, exynos64)]),
275 [ac_cv_omx_target="$withval"], [ac_cv_omx_target="generic"])
277 ac_cv_omx_target_struct_packing="none"
278 AC_MSG_NOTICE([Using $ac_cv_omx_target as OpenMAX IL target])
279 case "${ac_cv_omx_target}" in
281 AC_DEFINE(USE_OMX_TARGET_GENERIC, 1, [Use generic OpenMAX IL target])
284 AC_DEFINE(USE_OMX_TARGET_RPI, 1, [Use RPi OpenMAX IL target])
285 ac_cv_omx_target_struct_packing=4
288 AC_DEFINE(USE_OMX_TARGET_BELLAGIO, 1, [Use Bellagio OpenMAX IL target])
291 AC_DEFINE(USE_OMX_TARGET_EXYNOS, 1, [Use Exynos OpenMAX IL target])
294 AC_DEFINE(USE_OMX_TARGET_EXYNOS64, 1, [Use Exynos64 OpenMAX IL target])
297 AC_ERROR([invalid OpenMAX IL target])
300 AM_CONDITIONAL(USE_OMX_TARGET_GENERIC, test "x$ac_cv_omx_target" = "xgeneric")
301 AM_CONDITIONAL(USE_OMX_TARGET_BELLAGIO, test "x$ac_cv_omx_target" = "xbellagio")
302 AM_CONDITIONAL(USE_OMX_TARGET_RPI, test "x$ac_cv_omx_target" = "xrpi")
303 AM_CONDITIONAL(USE_OMX_TARGET_EXYNOS, test "x$ac_cv_omx_target" = "xexynos")
304 AM_CONDITIONAL(USE_OMX_TARGET_EXYNOS64, test "x$ac_cv_omx_target" = "xexynos64")
306 AC_ARG_WITH([omx-struct-packing],
307 AS_HELP_STRING([--with-omx-struct-packing],[Force OpenMAX struct packing, (default is none)]),
308 [ac_cv_omx_struct_packing="$withval"], [ac_cv_omx_struct_packing="none"])
310 if test x"$ac_cv_omx_struct_packing" != x"none"; then
311 AC_MSG_NOTICE([Using $ac_cv_omx_struct_packing as OpenMAX struct packing])
312 AC_DEFINE_UNQUOTED(GST_OMX_STRUCT_PACKING, $ac_cv_omx_struct_packing, [The struct packing used for OpenMAX structures])
313 elif test x"$ac_cv_omx_target_struct_packing" != x"none"; then
314 AC_MSG_NOTICE([Using $ac_cv_omx_target_struct_packing as OpenMAX struct packing])
315 AC_DEFINE_UNQUOTED(GST_OMX_STRUCT_PACKING, $ac_cv_omx_target_struct_packing, [The struct packing used for OpenMAX structures])
318 dnl *** set variables based on configure arguments ***
320 dnl set license and copyright notice
322 AC_DEFINE_UNQUOTED(GST_LICENSE, "$GST_LICENSE", [GStreamer license])
323 AC_SUBST(GST_LICENSE)
325 dnl set location of plugin directory
328 dnl set release date/time
329 AG_GST_SET_PACKAGE_RELEASE_DATETIME_WITH_NANO([$PACKAGE_VERSION_NANO],
330 ["${srcdir}/gst-omx.doap"],
331 [$PACKAGE_VERSION_MAJOR.$PACKAGE_VERSION_MINOR.$PACKAGE_VERSION_MICRO])
333 dnl build static plugins or not
334 AC_MSG_CHECKING([whether to build static plugins or not])
338 [--enable-static-plugins],
339 [build static plugins @<:@default=no@:>@]),
341 [$enableval], [no], [], [yes], [],
342 [AC_MSG_ERROR([bad value "$enableval" for --enable-static-plugins])])],
343 [enable_static_plugins=no])
344 AC_MSG_RESULT([$enable_static_plugins])
345 if test "x$enable_static_plugins" = xyes; then
346 AC_DEFINE(GST_PLUGIN_BUILD_STATIC, 1,
347 [Define if static plugins should be built])
348 GST_PLUGIN_LIBTOOLFLAGS=""
350 GST_PLUGIN_LIBTOOLFLAGS="--tag=disable-static"
352 AC_SUBST(GST_PLUGIN_LIBTOOLFLAGS)
353 AM_CONDITIONAL(GST_PLUGIN_BUILD_STATIC, test "x$enable_static_plugins" = "xyes")
355 dnl define an ERROR_CFLAGS Makefile variable
356 AG_GST_SET_ERROR_CFLAGS($FATAL_WARNINGS, [
357 -Wmissing-declarations -Wmissing-prototypes -Wredundant-decls -Wundef
358 -Wwrite-strings -Wformat-nonliteral -Wformat-security -Wformat-nonliteral
359 -Winit-self -Wmissing-include-dirs -Waddress
360 -Wno-multichar -Wnested-externs ])
362 dnl define correct level for debugging messages
363 AG_GST_SET_LEVEL_DEFAULT($GST_GIT)
366 AG_GST_DEFAULT_ELEMENTS
368 dnl *** plug-ins to include ***
370 dnl these are all the gst plug-ins, compilable without additional libs
371 AG_GST_CHECK_PLUGIN(omx)
373 dnl check for gstreamer core features (subsystems)
374 dnl FIXME: this assumes srcdir == builddir for uninstalled setups
375 GST_CONFIGPATH=`$PKG_CONFIG --variable=includedir gstreamer-$GST_API_VERSION`"/gst/gstconfig.h"
376 AG_GST_PARSE_SUBSYSTEM_DISABLES($GST_CONFIGPATH)
377 dnl AM_CONDITIONAL(USE_FOO, test $GST_DISABLE_FOO != "1")
379 dnl *** finalize CFLAGS, LDFLAGS, LIBS
382 dnl GST_OPTION_CFLAGS: common flags for profiling, debugging, errors, ...
383 dnl GST_*: flags shared by built objects to link against GStreamer
384 dnl GST_PLUGINS_BASE_CFLAGS: to link internally against the plugins base libs
385 dnl (compare to other modules) or for i18n
386 dnl GST_ALL_LDFLAGS: linker flags shared by all
387 dnl GST_LIB_LDFLAGS: additional linker flags for all libaries
388 dnl GST_LT_LDFLAGS: library versioning of our libraries
389 dnl GST_PLUGIN_LDFLAGS: flags to be used for all plugins
391 dnl GST_OPTION_CFLAGS
392 if test "x$USE_DEBUG" = xyes; then
395 AC_SUBST(PROFILE_CFLAGS)
397 if test "x$PACKAGE_VERSION_NANO" = "x1"; then
398 dnl Define _only_ when compiling a git version (not pre-releases or releases)
399 DEPRECATED_CFLAGS="-DGST_DISABLE_DEPRECATED"
403 AC_SUBST(DEPRECATED_CFLAGS)
405 dnl every flag in GST_OPTION_CFLAGS and GST_OPTION_CXXFLAGS can be overridden
406 dnl at make time with e.g. make ERROR_CFLAGS=""
407 GST_OPTION_CFLAGS="\$(WARNING_CFLAGS) \$(ERROR_CFLAGS) \$(DEBUG_CFLAGS) \$(PROFILE_CFLAGS) \$(GCOV_CFLAGS) \$(OPT_CFLAGS) \$(DEPRECATED_CFLAGS)"
408 AC_SUBST(GST_OPTION_CFLAGS)
410 dnl GST_PLUGINS_BASE_CFLAGS
411 dnl prefer internal headers to already installed ones
412 dnl also add builddir include for enumtypes and marshal
414 AC_SUBST(GST_OMX_CFLAGS)
416 dnl FIXME: do we want to rename to GST_ALL_* ?
417 dnl add GST_OPTION_CFLAGS, but overridable
418 GST_CFLAGS="$GST_CFLAGS $GLIB_EXTRA_CFLAGS \$(GST_OPTION_CFLAGS)"
420 dnl add GCOV libs because libtool strips -fprofile-arcs -ftest-coverage
421 GST_LIBS="$GST_LIBS \$(GCOV_LIBS)"
424 dnl LDFLAGS really should only contain flags, not libs - they get added before
425 dnl whatevertarget_LIBS and -L flags here affect the rest of the linking
426 GST_ALL_LDFLAGS="-no-undefined"
427 if test "x${enable_Bsymbolic}" = "xyes"; then
428 GST_ALL_LDFLAGS="$GST_ALL_LDFLAGS -Wl,-Bsymbolic-functions"
430 AC_SUBST(GST_ALL_LDFLAGS)
432 dnl this really should only contain flags, not libs - they get added before
433 dnl whatevertarget_LIBS and -L flags here affect the rest of the linking
434 GST_PLUGIN_LDFLAGS="-module -avoid-version -export-symbols-regex '^[_]*gst_plugin_.*' $GST_ALL_LDFLAGS"
435 AC_SUBST(GST_PLUGIN_LDFLAGS)
437 dnl *** output files ***
442 PKG_CHECK_MODULES(TBM, libtbm)
446 PKG_CHECK_MODULES(MM_COMMON, mm-common)
447 AC_SUBST(MM_COMMON_CFLAGS)
448 AC_SUBST(MM_COMMON_LIBS)
457 examples/egl/Makefile