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