2 dnl initialize autoconf
3 dnl when going to/from release please set the nano (fourth number) right !
4 dnl releases only do Wall, cvs and prerelease does Werror too
5 AC_INIT(Gst-Validate, 1.5.2.1,
6 http://bugzilla.gnome.org/enter_bug.cgi?product=GStreamer,
10 dnl initialize automake
11 AM_INIT_AUTOMAKE([-Wno-portability 1.11 no-dist-gzip dist-xz tar-ustar])
13 dnl define PACKAGE_VERSION_* variables
16 dnl check if this is a release version
17 AS_NANO(GST_GIT="no", GST_GIT="yes")
19 dnl can autoconf find the source ?
20 AC_CONFIG_SRCDIR([tools/gst-validate.c])
22 dnl define the output header for config
23 AC_CONFIG_HEADERS([config.h])
25 dnl AM_MAINTAINER_MODE only provides the option to configure to enable it
26 AM_MAINTAINER_MODE([enable])
28 dnl sets host_* variables
31 dnl use pretty build output with automake >= 1.11
32 m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])],
33 [AM_DEFAULT_VERBOSITY=1
34 AC_SUBST(AM_DEFAULT_VERBOSITY)])
36 dnl our libraries and install dirs use major.minor as a version
37 dnl GST_API_VERSION=$PACKAGE_VERSION_MAJOR.$PACKAGE_VERSION_MINOR
38 dnl we override it here if we need to for the release candidate of new series
40 AC_SUBST(GST_API_VERSION)
41 AC_DEFINE_UNQUOTED(GST_API_VERSION, "$GST_API_VERSION",
42 [GStreamer API Version])
44 AS_LIBTOOL(GST, 0, 0, 0)
46 dnl *** required versions of GStreamer stuff ***
50 dnl *** autotools stuff ****
52 dnl allow for different autotools
53 AS_AUTOTOOLS_ALTERNATE
55 dnl Add parameters for aclocal
56 AC_SUBST(ACLOCAL_AMFLAGS, "-I m4 -I common/m4")
57 AC_CONFIG_MACRO_DIR([m4])
60 dnl the version check needs to stay here because autopoint greps for it
61 AM_GNU_GETTEXT_VERSION([0.17])
62 AM_GNU_GETTEXT([external])
63 AG_GST_GETTEXT([gst-validate-$GST_API_VERSION])
65 dnl Check wether to build LDPRELOAD related code or not
68 mingw* | msvc* | mks*)
71 BUILD_LDPRELOAD=yes ;;
73 AM_CONDITIONAL(HAVE_LD_PRELOAD, test "x$BUILD_LDPRELOAD" = "xyes")
75 dnl *** check for arguments to configure ***
80 AG_GST_ARG_WITH_PACKAGE_NAME
81 AG_GST_ARG_WITH_PACKAGE_ORIGIN
83 AG_GST_PKG_CONFIG_PATH
85 dnl *** checks for platform ***
87 dnl * hardware/architecture *
89 dnl *** checks for programs ***
95 AC_PATH_PROG(VALGRIND_PATH, valgrind, no)
96 AM_CONDITIONAL(HAVE_VALGRIND, test ! "x$VALGRIND_PATH" = "xno")
98 dnl check for gobject-introspection
99 GOBJECT_INTROSPECTION_CHECK([0.6.3])
101 dnl check for documentation tools
106 AC_CHECK_PROG(enable_sphinx_doc, sphinx-build, yes, no)
107 AM_CONDITIONAL(HAVE_SPHINHX, test ! "x$enable_sphinx_doc" = "xno")
109 dnl *** checks for libraries ***
111 dnl *** checks for header files ***
113 dnl *** checks for types/defines ***
115 dnl *** checks for structures ***
117 dnl *** checks for compiler characteristics ***
119 dnl *** checks for library functions ***
121 dnl *** checks for dependancy libraries ***
130 AG_GST_GLIB_CHECK([$GLIB_REQ])
132 dnl checks for gstreamer
133 dnl uninstalled is selected preferentially -- see pkg-config(1)
134 AG_GST_CHECK_GST($GST_API_VERSION, [$GST_REQ], [yes])
136 GST_TOOLS_DIR=`$PKG_CONFIG --variable=toolsdir gstreamer-$GST_API_VERSION`
137 if test -z $GST_TOOLS_DIR; then
138 AC_MSG_ERROR([no tools dir defined in GStreamer pkg-config file; core upgrade needed.])
140 AC_SUBST(GST_TOOLS_DIR)
142 GST_PLUGINS_DIR=`$PKG_CONFIG gstreamer-$GST_API_VERSION --variable pluginsdir`
143 AC_SUBST(GST_PLUGINS_DIR)
144 AC_MSG_NOTICE(Using GStreamer Core Plugins in $GST_PLUGINS_DIR)
146 AG_GST_CHECK_GST_BASE($GST_API_VERSION, [$GST_REQ], [yes])
148 AG_GST_CHECK_GST_PLUGINS_BASE($GST_API_VERSION, [$GSTPB_REQ], [yes])
149 GSTPB_PLUGINS_DIR=`$PKG_CONFIG gstreamer-plugins-base-$GST_API_VERSION --variable pluginsdir`
150 AC_SUBST(GSTPB_PLUGINS_DIR)
151 AC_MSG_NOTICE(Using GStreamer Base Plugins in $GSTPB_PLUGINS_DIR)
153 dnl check for gstreamer-pbutils
154 PKG_CHECK_MODULES(GST_PBUTILS, gstreamer-pbutils-$GST_API_VERSION, HAVE_GST_PBUTILS="yes", HAVE_GST_PBUTILS="no")
155 if test "x$HAVE_GST_PBUTILS" != "xyes"; then
156 AC_ERROR([gst-pbutils is required])
158 AC_SUBST(GST_PBUTILS_LIBS)
159 AC_SUBST(GST_PBUTILS_CFLAGS)
161 dnl check for gstreamer-video
162 PKG_CHECK_MODULES(GST_VIDEO, gstreamer-video-$GST_API_VERSION >= 1.4, HAVE_GST_VIDEO="yes", HAVE_GST_VIDEO="no")
163 if test "x$HAVE_GST_VIDEO" != "xyes"; then
164 AC_ERROR([gst-video is required])
166 AC_SUBST(GST_VIDEO_LIBS)
167 AC_SUBST(GST_VIDEO_CFLAGS)
169 dnl needed for scenarios definition files
170 GST_PREFIX="`$PKG_CONFIG --variable=prefix gstreamer-$GST_API_VERSION`"
172 GST_DATADIR="$GST_PREFIX/share"
173 AC_DEFINE_UNQUOTED(GST_DATADIR, "$GST_DATADIR", [system wide data directory])
175 PKG_CHECK_MODULES(GIO, gio-2.0, HAVE_GIO=yes, HAVE_GIO=no)
179 PKG_CHECK_MODULES(GTK, gtk+-3.0, HAVE_GTK=yes, HAVE_GTK=no)
182 AM_CONDITIONAL(HAVE_GTK, test "x$HAVE_GTK" = "xyes")
184 PKG_CHECK_MODULES(GDK, gdk-3.0, HAVE_GDK=yes, HAVE_GDK=no)
188 PKG_CHECK_MODULES(CAIRO, "cairo", HAVE_CAIRO=yes, HAVE_CAIRO=no)
189 AC_SUBST(CAIRO_CFLAGS)
191 AM_CONDITIONAL(HAVE_CAIRO, test ! "x$HAVE_CAIRO" = "xno")
192 if test "x$HAVE_CAIRO" != "xyes"; then
193 AC_MSG_NOTICE([Cairo is needed for the gst-validate-images-tool])
196 dnl checks for gstreamer
198 AG_GST_CHECK_GST_CHECK($GST_API_VERSION, [$GST_REQ], no)
199 AM_CONDITIONAL(HAVE_GST_CHECK, test "x$HAVE_GST_CHECK" = "xyes")
201 dnl *** set variables based on configure arguments ***
203 dnl set license and copyright notice
205 AC_DEFINE_UNQUOTED(GST_LICENSE, "$GST_LICENSE", [GStreamer license])
206 AC_SUBST(GST_LICENSE)
208 dnl define location of plugin directory
209 AS_AC_EXPAND(PLUGINDIR, ${libdir}/gstreamer-$GST_API_VERSION/validate)
210 AC_DEFINE_UNQUOTED(PLUGINDIR, "$PLUGINDIR",
211 [directory where GstValidate plugins are located])
212 AC_MSG_NOTICE([Using $PLUGINDIR as the plugin install location for GstValidate])
214 dnl plugin directory configure-time variable for use in Makefile.am
215 plugindir="\$(libdir)/gstreamer-$GST_API_VERSION/validate"
218 # set by AG_GST_PARSE_SUBSYSTEM_DISABLES above
219 dnl make sure it doesn't complain about unused variables if debugging is disabled
221 AG_GST_CHECK_GST_DEBUG_DISABLED([NO_WARNINGS="-Wno-unused"], [NO_WARNINGS=""])
223 dnl define an ERROR_CFLAGS Makefile variable
224 AG_GST_SET_ERROR_CFLAGS($GST_GIT, [-Wmissing-declarations -Wmissing-prototypes -Wredundant-decls -Wundef -Wwrite-strings -Wformat-security -Wold-style-definition -Winit-self -Wmissing-include-dirs -Waddress -Waggregate-return -Wno-multichar -Wnested-externs $NO_WARNINGS])
226 dnl define correct level for debugging messages
227 AG_GST_SET_LEVEL_DEFAULT($GST_GIT)
230 AG_GST_DEFAULT_ELEMENTS
232 dnl *** finalize CFLAGS, LDFLAGS, LIBS
235 dnl GST_OPTION_CFLAGS: common flags for profiling, debugging, errors, ...
236 dnl GST_*: flags shared by built objects to link against GStreamer
237 dnl GST_ALL_LDFLAGS: linker flags shared by all
238 dnl GST_LIB_LDFLAGS: additional linker flags for all libaries
239 dnl GST_LT_LDFLAGS: library versioning of our libraries
240 dnl GST_PLUGIN_LDFLAGS: flags to be used for all plugins
242 dnl GST_OPTION_CFLAGS
243 if test "x$USE_DEBUG" = xyes; then
246 AC_SUBST(PROFILE_CFLAGS)
248 DEPRECATED_CFLAGS="-DGST_DISABLE_DEPRECATED"
249 AC_SUBST(DEPRECATED_CFLAGS)
251 dnl every flag in GST_OPTION_CFLAGS can be overridden at make time
252 GST_OPTION_CFLAGS="\$(WARNING_CFLAGS) \$(ERROR_CFLAGS) \$(DEBUG_CFLAGS) \$(PROFILE_CFLAGS) \$(GCOV_CFLAGS) \$(OPT_CFLAGS) \$(DEPRECATED_CFLAGS)"
253 AC_SUBST(GST_OPTION_CFLAGS)
255 dnl FIXME: do we want to rename to GST_ALL_* ?
256 dnl prefer internal headers to already installed ones
257 dnl add GST_OPTION_CFLAGS, but overridable
258 GST_CFLAGS="$GST_CFLAGS \$(GST_OPTION_CFLAGS)"
263 dnl vars common to for all internal objects (core libs, elements, applications)
265 dnl - src and build dirs need to be added because every piece that gets built
266 dnl will need the GStreamer source and generated headers
267 GST_ALL_CFLAGS="-I\$(top_srcdir) -I\$(top_builddir) $GST_PLUGINS_BASE_CFLAGS $GST_CFLAGS \$(GST_OPTION_CFLAGS)"
268 AC_SUBST([GST_ALL_CFLAGS])
270 dnl FIXME: check if LTLIBINTL is needed everywhere
271 dnl I presume it is given that it contains the symbols that _() stuff maps to
272 GST_ALL_LIBS="$GST_LIBS $LTLIBINTL \$(GCOV_LIBS)"
273 AC_SUBST([GST_ALL_LIBS])
275 dnl LDFLAGS really should only contain flags, not libs - they get added before
276 dnl whatevertarget_LIBS and -L flags here affect the rest of the linking
277 GST_ALL_LDFLAGS="-no-undefined"
278 AC_SUBST(GST_ALL_LDFLAGS)
281 dnl linker flags shared by all libraries
282 dnl LDFLAGS modifier defining exported symbols from built libraries
283 GST_LIB_LDFLAGS="-export-symbols-regex \^[_]?\(gst_\|Gst\|GST_\).*"
284 AC_SUBST(GST_LIB_LDFLAGS)
286 dnl this really should only contain flags, not libs - they get added before
287 dnl whatevertarget_LIBS and -L flags here affect the rest of the linking
288 GST_PLUGIN_LDFLAGS="-module -avoid-version -export-symbols-regex '^[_]*gst_plugin_.*' $GST_ALL_LDFLAGS"
289 AC_SUBST(GST_PLUGIN_LDFLAGS)
291 AM_PATH_PYTHON(2.7.0)
292 AS_AC_EXPAND(LIBDIR, $libdir)
293 AC_MSG_NOTICE(Storing library files in $LIBDIR)
294 AC_CONFIG_FILES([tools/gst-validate-launcher], [chmod +x tools/gst-validate-launcher])
295 AS_AC_EXPAND(DATADIR, $datadir)
296 AC_CONFIG_FILES([launcher/config.py])
298 dnl this really should only contain flags, not libs - they get added before
299 dnl whatevertarget_LIBS and -L flags here affect the rest of the linking
301 dnl *** output files ***
303 dnl keep this alphabetic per directory, please
309 data/scenarios/Makefile
311 gst/validate/Makefile
313 gst/overrides/Makefile
315 plugins/fault_injection/Makefile
316 plugins/gapplication/Makefile
318 plugins/ssim/Makefile
320 gst-libs/gst/Makefile
321 gst-libs/gst/video/Makefile
325 pkgconfig/gst-validate-uninstalled.pc
326 pkgconfig/gst-validate.pc
330 launcher/apps/Makefile
332 docs/version.entities
333 docs/validate/Makefile
334 docs/plugins/Makefile
335 docs/launcher/Makefile
343 Source code location : ${srcdir}
347 gst-validate configured. Type 'make' to build.