1AC_PREREQ(2.62)
2dnl initialize autoconf
3dnl when going to/from release please set the nano (fourth number) right !
4dnl releases only do Wall, cvs and prerelease does Werror too
5AC_INIT(Gst-Validate, 1.16.1,
6    http://bugzilla.gnome.org/enter_bug.cgi?product=GStreamer,
7    gst-validate)
8
9dnl This is the version of the testsuite to use with the current version
10dnl of gst-validate. During development it should be "master"
11dnl during release cycle it should be the release version (1.6 in the 1.6
12dnl branch, 1.5.90 for the 1.5.90 release)
13GST_VALIDATE_TESTSUITE_VERSION="master"
14AS_AC_EXPAND(GST_VALIDATE_TESTSUITE_VERSION, $GST_VALIDATE_TESTSUITE_VERSION)
15
16AG_GST_INIT
17
18dnl initialize automake
19AM_INIT_AUTOMAKE([-Wno-portability 1.11 no-dist-gzip dist-xz tar-ustar])
20
21dnl define PACKAGE_VERSION_* variables
22AS_VERSION
23
24dnl check if this is a release version
25AS_NANO(GST_GIT="no", GST_GIT="yes")
26
27dnl can autoconf find the source ?
28AC_CONFIG_SRCDIR([tools/gst-validate.c])
29
30dnl define the output header for config
31AC_CONFIG_HEADERS([config.h])
32
33dnl AM_MAINTAINER_MODE only provides the option to configure to enable it
34AM_MAINTAINER_MODE([enable])
35
36dnl sets host_* variables
37AC_CANONICAL_HOST
38
39dnl use pretty build output with automake >= 1.11
40m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])],
41  [AM_DEFAULT_VERBOSITY=1
42   AC_SUBST(AM_DEFAULT_VERBOSITY)])
43
44dnl our libraries and install dirs use major.minor as a version
45dnl GST_API_VERSION=$PACKAGE_VERSION_MAJOR.$PACKAGE_VERSION_MINOR
46dnl we override it here if we need to for the release candidate of new series
47GST_API_VERSION=1.0
48AC_SUBST(GST_API_VERSION)
49AC_DEFINE_UNQUOTED(GST_API_VERSION, "$GST_API_VERSION",
50      [GStreamer API Version])
51
52AS_LIBTOOL(GST, 1601, 0, 1601)
53
54dnl *** required versions of GStreamer stuff ***
55GST_REQ=1.16.1
56GSTPB_REQ=1.16.1
57
58dnl *** autotools stuff ****
59
60dnl allow for different autotools
61AS_AUTOTOOLS_ALTERNATE
62
63dnl Add parameters for aclocal
64AC_SUBST(ACLOCAL_AMFLAGS, "-I m4 -I common/m4")
65AC_CONFIG_MACRO_DIR([m4])
66
67dnl set up gettext
68dnl the version check needs to stay here because autopoint greps for it
69AM_GNU_GETTEXT_VERSION([0.17])
70AM_GNU_GETTEXT([external])
71AG_GST_GETTEXT([gst-validate-$GST_API_VERSION])
72
73dnl Check wether to build LDPRELOAD related code or not
74AC_CANONICAL_HOST
75case $host_os in
76  mingw* | msvc* | mks*)
77    BUILD_LDPRELOAD=no ;;
78  *)
79    BUILD_LDPRELOAD=yes ;;
80esac
81AM_CONDITIONAL(HAVE_LD_PRELOAD, test "x$BUILD_LDPRELOAD" = "xyes")
82
83dnl *** check for arguments to configure ***
84
85AG_GST_ARG_DEBUG
86AG_GST_ARG_VALGRIND
87AG_GST_ARG_GCOV
88AG_GST_ARG_WITH_PACKAGE_NAME
89AG_GST_ARG_WITH_PACKAGE_ORIGIN
90
91AG_GST_PKG_CONFIG_PATH
92
93dnl *** checks for platform ***
94
95dnl * hardware/architecture *
96
97dnl *** checks for programs ***
98
99dnl find a compiler
100AC_PROG_CC
101AM_PROG_CC_C_O
102
103AC_PATH_PROG(VALGRIND_PATH, valgrind, no)
104AM_CONDITIONAL(HAVE_VALGRIND, test ! "x$VALGRIND_PATH" = "xno")
105
106dnl check for gobject-introspection
107GOBJECT_INTROSPECTION_CHECK([0.6.3])
108
109dnl check for documentation tools
110AG_GST_DOCBOOK_CHECK
111GTK_DOC_CHECK([1.3])
112
113
114AC_CHECK_PROG(enable_sphinx_doc, sphinx-build, yes, no)
115AM_CONDITIONAL(HAVE_SPHINHX, test ! "x$enable_sphinx_doc" = "xno")
116
117dnl *** checks for libraries ***
118
119dnl *** checks for header files ***
120
121dnl *** checks for types/defines ***
122
123dnl *** checks for structures ***
124
125dnl *** checks for compiler characteristics ***
126
127dnl *** checks for library functions ***
128
129dnl *** checks for dependancy libraries ***
130
131dnl check for libm
132LT_LIB_M
133AC_SUBST(LIBM)
134
135dnl GLib is required
136GLIB_REQ=2.36.0
137AC_SUBST([GLIB_REQ])
138AG_GST_GLIB_CHECK([$GLIB_REQ])
139
140dnl checks for gstreamer
141dnl uninstalled is selected preferentially -- see pkg-config(1)
142AG_GST_CHECK_GST($GST_API_VERSION, [$GST_REQ], [yes])
143
144GST_TOOLS_DIR=`$PKG_CONFIG --variable=toolsdir gstreamer-$GST_API_VERSION`
145if test -z $GST_TOOLS_DIR; then
146  AC_MSG_ERROR([no tools dir defined in GStreamer pkg-config file; core upgrade needed.])
147fi
148AC_SUBST(GST_TOOLS_DIR)
149
150GST_PLUGINS_DIR=`$PKG_CONFIG gstreamer-$GST_API_VERSION --variable pluginsdir`
151AC_SUBST(GST_PLUGINS_DIR)
152AC_MSG_NOTICE(Using GStreamer Core Plugins in $GST_PLUGINS_DIR)
153
154AG_GST_CHECK_GST_BASE($GST_API_VERSION, [$GST_REQ], [yes])
155
156AG_GST_CHECK_GST_PLUGINS_BASE($GST_API_VERSION, [$GSTPB_REQ], [yes])
157GSTPB_PLUGINS_DIR=`$PKG_CONFIG gstreamer-plugins-base-$GST_API_VERSION --variable pluginsdir`
158AC_SUBST(GSTPB_PLUGINS_DIR)
159AC_MSG_NOTICE(Using GStreamer Base Plugins in $GSTPB_PLUGINS_DIR)
160
161dnl check for gstreamer-pbutils
162PKG_CHECK_MODULES(GST_PBUTILS, gstreamer-pbutils-$GST_API_VERSION, HAVE_GST_PBUTILS="yes", HAVE_GST_PBUTILS="no")
163if test "x$HAVE_GST_PBUTILS" != "xyes"; then
164  AC_ERROR([gst-pbutils is required])
165fi
166AC_SUBST(GST_PBUTILS_LIBS)
167AC_SUBST(GST_PBUTILS_CFLAGS)
168
169dnl check for gstreamer-video
170PKG_CHECK_MODULES(GST_VIDEO, gstreamer-video-$GST_API_VERSION >= 1.4, HAVE_GST_VIDEO="yes", HAVE_GST_VIDEO="no")
171if test "x$HAVE_GST_VIDEO" != "xyes"; then
172  AC_ERROR([gst-video is required])
173fi
174AC_SUBST(GST_VIDEO_LIBS)
175AC_SUBST(GST_VIDEO_CFLAGS)
176
177dnl needed for scenarios definition files
178GST_PREFIX="`$PKG_CONFIG --variable=prefix gstreamer-$GST_API_VERSION`"
179AC_SUBST(GST_PREFIX)
180GST_DATADIR="$GST_PREFIX/share"
181AC_DEFINE_UNQUOTED(GST_DATADIR, "$GST_DATADIR", [system wide data directory])
182
183PKG_CHECK_MODULES(GIO, gio-2.0, HAVE_GIO=yes, HAVE_GIO=no)
184AC_SUBST(GIO_CFLAGS)
185AC_SUBST(GIO_LIBS)
186
187PKG_CHECK_MODULES(GTK, gtk+-3.0, HAVE_GTK=yes, HAVE_GTK=no)
188AC_SUBST(GTK_CFLAGS)
189AC_SUBST(GTK_LIBS)
190AM_CONDITIONAL(HAVE_GTK, test "x$HAVE_GTK" = "xyes")
191
192PKG_CHECK_MODULES(GDK, gdk-3.0, HAVE_GDK=yes, HAVE_GDK=no)
193AC_SUBST(GDK_CFLAGS)
194AC_SUBST(GDK_LIBS)
195
196PKG_CHECK_MODULES(CAIRO, "cairo", HAVE_CAIRO=yes, HAVE_CAIRO=no)
197AC_SUBST(CAIRO_CFLAGS)
198AC_SUBST(CAIRO_LIBS)
199AM_CONDITIONAL(HAVE_CAIRO, test ! "x$HAVE_CAIRO" = "xno")
200if test "x$HAVE_CAIRO" != "xyes"; then
201  AC_MSG_NOTICE([Cairo is needed for the gst-validate-images-tool])
202fi
203
204PKG_CHECK_MODULES(GST_RTSP_SERVER, "gstreamer-rtsp-server-1.0", HAVE_GST_RTSP_SERVER=yes, HAVE_GST_RTSP_SERVER=no)
205AC_SUBST(GST_RTSP_SERVER_CFLAGS)
206AC_SUBST(GST_RTSP_SERVER_LIBS)
207AM_CONDITIONAL(HAVE_GST_RTSP_SERVER, test ! "x$HAVE_GST_RTSP_SERVER" = "xno")
208if test "x$HAVE_GST_RTSP_SERVER" != "xyes"; then
209  AC_MSG_NOTICE([GstRtspServer is needed for the gst-validate-rtsp-server])
210fi
211
212PKG_CHECK_MODULES(JSON_GLIB, json-glib-1.0)
213AC_SUBST(JSON_GLIB_LIBS)
214AC_SUBST(JSON_GLIB_CFLAGS)
215
216dnl checks for gstreamer
217
218AG_GST_CHECK_GST_CHECK($GST_API_VERSION, [$GST_REQ], no)
219AM_CONDITIONAL(HAVE_GST_CHECK, test "x$HAVE_GST_CHECK" = "xyes")
220
221dnl *** set variables based on configure arguments ***
222
223dnl set license and copyright notice
224GST_LICENSE="LGPL"
225AC_DEFINE_UNQUOTED(GST_LICENSE, "$GST_LICENSE", [GStreamer license])
226AC_SUBST(GST_LICENSE)
227
228dnl define location of plugin directory
229AS_AC_EXPAND(VALIDATEPLUGINDIR, ${libdir}/gstreamer-$GST_API_VERSION/validate)
230AC_DEFINE_UNQUOTED(VALIDATEPLUGINDIR, "$VALIDATEPLUGINDIR",
231[directory where GstValidate plugins are located])
232AC_MSG_NOTICE([Using $VALIDATEPLUGINDIR as the plugin install location for GstValidate])
233
234dnl plugin directory configure-time variable for use in Makefile.am
235validateplugindir="\$(libdir)/gstreamer-$GST_API_VERSION/validate"
236AC_SUBST(validateplugindir)
237
238dnl set location of plugin directory
239AG_GST_SET_PLUGINDIR
240
241# set by AG_GST_PARSE_SUBSYSTEM_DISABLES above
242dnl make sure it doesn't complain about unused variables if debugging is disabled
243NO_WARNINGS=""
244AG_GST_CHECK_GST_DEBUG_DISABLED([NO_WARNINGS="-Wno-unused"], [NO_WARNINGS=""])
245
246dnl define an ERROR_CFLAGS Makefile variable
247AG_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])
248
249dnl define correct level for debugging messages
250AG_GST_SET_LEVEL_DEFAULT($GST_GIT)
251
252dnl used in examples
253AG_GST_DEFAULT_ELEMENTS
254
255dnl *** finalize CFLAGS, LDFLAGS, LIBS
256
257dnl Overview:
258dnl GST_OPTION_CFLAGS:  common flags for profiling, debugging, errors, ...
259dnl GST_*:              flags shared by built objects to link against GStreamer
260dnl GST_ALL_LDFLAGS:    linker flags shared by all
261dnl GST_LIB_LDFLAGS:    additional linker flags for all libaries
262dnl GST_LT_LDFLAGS:     library versioning of our libraries
263dnl GST_PLUGIN_LDFLAGS: flags to be used for all plugins
264
265dnl GST_OPTION_CFLAGS
266if test "x$USE_DEBUG" = xyes; then
267   PROFILE_CFLAGS="-g"
268fi
269AC_SUBST(PROFILE_CFLAGS)
270
271DEPRECATED_CFLAGS="-DGST_DISABLE_DEPRECATED"
272AC_SUBST(DEPRECATED_CFLAGS)
273
274dnl every flag in GST_OPTION_CFLAGS can be overridden at make time
275GST_OPTION_CFLAGS="\$(WARNING_CFLAGS) \$(ERROR_CFLAGS) \$(DEBUG_CFLAGS) \$(PROFILE_CFLAGS) \$(GCOV_CFLAGS) \$(OPT_CFLAGS) \$(DEPRECATED_CFLAGS)"
276AC_SUBST(GST_OPTION_CFLAGS)
277
278dnl FIXME: do we want to rename to GST_ALL_* ?
279dnl prefer internal headers to already installed ones
280dnl add GST_OPTION_CFLAGS, but overridable
281GST_CFLAGS="$GST_CFLAGS \$(GST_OPTION_CFLAGS)"
282AC_SUBST(GST_CFLAGS)
283AC_SUBST(GST_LIBS)
284
285dnl GST_ALL_*
286dnl vars common to for all internal objects (core libs, elements, applications)
287dnl CFLAGS:
288dnl - src and build dirs need to be added because every piece that gets built
289dnl   will need the GStreamer source and generated headers
290GST_ALL_CFLAGS="-I\$(top_srcdir) -I\$(top_builddir) $GST_PLUGINS_BASE_CFLAGS $GST_CFLAGS \$(GST_OPTION_CFLAGS)"
291AC_SUBST([GST_ALL_CFLAGS])
292
293dnl FIXME: check if LTLIBINTL is needed everywhere
294dnl I presume it is given that it contains the symbols that _() stuff maps to
295GST_ALL_LIBS="$GST_LIBS $LTLIBINTL \$(GCOV_LIBS)"
296AC_SUBST([GST_ALL_LIBS])
297
298dnl LDFLAGS really should only contain flags, not libs - they get added before
299dnl whatevertarget_LIBS and -L flags here affect the rest of the linking
300GST_ALL_LDFLAGS="-no-undefined"
301AC_SUBST(GST_ALL_LDFLAGS)
302
303dnl GST_LIB_LDFLAGS
304dnl linker flags shared by all libraries
305dnl LDFLAGS modifier defining exported symbols from built libraries
306GST_LIB_LDFLAGS="-export-symbols-regex \^[_]?\(gst_\|Gst\|GST_\).*"
307AC_SUBST(GST_LIB_LDFLAGS)
308
309dnl this really should only contain flags, not libs - they get added before
310dnl whatevertarget_LIBS and -L flags here affect the rest of the linking
311GST_PLUGIN_LDFLAGS="-module -avoid-version -export-symbols-regex '^[_]*gst_plugin_.*' $GST_ALL_LDFLAGS"
312AC_SUBST(GST_PLUGIN_LDFLAGS)
313
314AM_PATH_PYTHON(2.7.0)
315AS_AC_EXPAND(LIBDIR, $libdir)
316AC_MSG_NOTICE(Storing library files in $LIBDIR)
317AC_CONFIG_FILES([tools/gst-validate-launcher], [chmod +x tools/gst-validate-launcher])
318AS_AC_EXPAND(DATADIR, $datadir)
319AC_CONFIG_FILES([launcher/config.py])
320
321dnl this really should only contain flags, not libs - they get added before
322dnl whatevertarget_LIBS and -L flags here affect the rest of the linking
323
324dnl *** output files ***
325
326dnl keep this alphabetic per directory, please
327AC_CONFIG_FILES([
328Makefile
329common/Makefile
330common/m4/Makefile
331data/Makefile
332data/scenarios/Makefile
333gst/Makefile
334gst/validate/Makefile
335gst/overrides/Makefile
336plugins/Makefile
337plugins/fault_injection/Makefile
338plugins/flow/Makefile
339plugins/gapplication/Makefile
340plugins/gtk/Makefile
341plugins/ssim/Makefile
342gst-libs/Makefile
343gst-libs/gst/Makefile
344gst-libs/gst/video/Makefile
345tests/Makefile
346tests/check/Makefile
347pkgconfig/Makefile
348pkgconfig/gst-validate-uninstalled.pc
349pkgconfig/gst-validate.pc
350po/Makefile.in
351tools/Makefile
352launcher/Makefile
353launcher/apps/Makefile
354launcher/testsuites/Makefile
355docs/Makefile
356docs/version.entities
357docs/validate/Makefile
358docs/plugins/Makefile
359docs/launcher/Makefile
360])
361AC_OUTPUT
362
363echo "
364
365Configuration
366	Version                    : ${VERSION}
367	Source code location       : ${srcdir}
368	Prefix                     : ${prefix}
369	Compiler                   : ${CC}
370
371gst-validate configured. Type 'make' to build.
372"
373