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.0.0.1,
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 ***
70 AG_GST_ARG_WITH_PKG_CONFIG_PATH
71 AG_GST_ARG_WITH_PACKAGE_NAME
72 AG_GST_ARG_WITH_PACKAGE_ORIGIN
74 AG_GST_PKG_CONFIG_PATH
76 AG_GST_ARG_WITH_PLUGINS
78 AG_GST_ARG_ENABLE_EXPERIMENTAL
80 dnl *** checks for platform ***
82 dnl * hardware/architecture *
84 dnl common/m4/gst-arch.m4
88 dnl check for large file support
89 dnl affected plugins must include config.h
92 dnl *** checks for programs ***
98 dnl check if the compiler supports '-c' and '-o' options
101 AC_PATH_PROG(VALGRIND_PATH, valgrind, no)
102 AM_CONDITIONAL(HAVE_VALGRIND, test ! "x$VALGRIND_PATH" = "xno")
104 dnl check for documentation tools
106 AS_PATH_PYTHON([2.1])
107 AG_GST_PLUGIN_DOCS([1.3],[2.1])
109 dnl *** checks for libraries ***
111 dnl libm, for sin() etc.
115 dnl *** checks for header files ***
117 dnl check if we have ANSI C header files
122 dnl *** checks for functions ***
124 dnl *** checks for types/defines ***
126 dnl *** checks for structures ***
128 dnl *** checks for compiler characteristics ***
130 dnl *** checks for library functions ***
132 dnl Check for a way to display the function name in debug output
133 AG_GST_CHECK_FUNCTION
135 dnl *** checks for dependency libraries ***
138 AG_GST_GLIB_CHECK([2.32])
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])
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)
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")
160 AC_CHECK_DECLS([OMX_VIDEO_CodingVP8],
162 AC_DEFINE(HAVE_VP8, 1, [OpenMAX IL has VP8 support])
166 ], [[#include <OMX_Video.h>]])
167 AM_CONDITIONAL(HAVE_VP8, test "x$HAVE_VP8" = "xyes")
169 AC_CHECK_DECLS([OMX_VIDEO_CodingTheora],
171 AC_DEFINE(HAVE_THEORA, 1, [OpenMAX IL has Theora support])
175 ], [[#include <OMX_Video.h>]])
176 AM_CONDITIONAL(HAVE_THEORA, test "x$HAVE_THEORA" = "xyes")
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; }],
188 enable_Bsymbolic=yes,
191 LDFLAGS="${SAVED_LDFLAGS}"])
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"])
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
201 AC_DEFINE(USE_OMX_TARGET_GENERIC, 1, [Use generic OpenMAX IL target])
204 AC_DEFINE(USE_OMX_TARGET_RPI, 1, [Use RPi OpenMAX IL target])
205 ac_cv_omx_target_struct_packing=4
208 AC_DEFINE(USE_OMX_TARGET_BELLAGIO, 1, [Use Bellagio OpenMAX IL target])
211 AC_ERROR([invalid OpenMAX IL target])
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")
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"])
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])
230 dnl *** set variables based on configure arguments ***
232 dnl set license and copyright notice
234 AC_DEFINE_UNQUOTED(GST_LICENSE, "$GST_LICENSE", [GStreamer license])
235 AC_SUBST(GST_LICENSE)
237 dnl set location of plugin directory
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])
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 ])
252 dnl define correct level for debugging messages
253 AG_GST_SET_LEVEL_DEFAULT($GST_GIT)
256 AG_GST_DEFAULT_ELEMENTS
258 dnl *** plug-ins to include ***
260 dnl these are all the gst plug-ins, compilable without additional libs
261 AG_GST_CHECK_PLUGIN(omx)
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")
269 dnl *** finalize CFLAGS, LDFLAGS, LIBS
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
281 dnl GST_OPTION_CFLAGS
282 if test "x$USE_DEBUG" = xyes; then
285 AC_SUBST(PROFILE_CFLAGS)
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"
293 AC_SUBST(DEPRECATED_CFLAGS)
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)
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
304 AC_SUBST(GST_OMX_CFLAGS)
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)"
310 dnl add GCOV libs because libtool strips -fprofile-arcs -ftest-coverage
311 GST_LIBS="$GST_LIBS \$(GCOV_LIBS)"
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"
320 AC_SUBST(GST_ALL_LDFLAGS)
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)
327 dnl *** output files ***
336 config/bellagio/Makefile