remove submodule created by mistake. This should be created as a normal folder
[platform/upstream/gst-devtools.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.5.2.1,
6     http://bugzilla.gnome.org/enter_bug.cgi?product=GStreamer,
7     gst-validate)
8 AG_GST_INIT
9
10 dnl initialize automake
11 AM_INIT_AUTOMAKE([-Wno-portability 1.11 no-dist-gzip dist-xz tar-ustar])
12
13 dnl define PACKAGE_VERSION_* variables
14 AS_VERSION
15
16 dnl check if this is a release version
17 AS_NANO(GST_GIT="no", GST_GIT="yes")
18
19 dnl can autoconf find the source ?
20 AC_CONFIG_SRCDIR([tools/gst-validate.c])
21
22 dnl define the output header for config
23 AC_CONFIG_HEADERS([config.h])
24
25 dnl AM_MAINTAINER_MODE only provides the option to configure to enable it
26 AM_MAINTAINER_MODE([enable])
27
28 dnl sets host_* variables
29 AC_CANONICAL_HOST
30
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)])
35
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
39 GST_API_VERSION=1.0
40 AC_SUBST(GST_API_VERSION)
41 AC_DEFINE_UNQUOTED(GST_API_VERSION, "$GST_API_VERSION",
42       [GStreamer API Version])
43
44 AS_LIBTOOL(GST, 0, 0, 0)
45
46 dnl *** required versions of GStreamer stuff ***
47 GST_REQ=1.0.0
48 GSTPB_REQ=1.0.0
49
50 dnl *** autotools stuff ****
51
52 dnl allow for different autotools
53 AS_AUTOTOOLS_ALTERNATE
54
55 dnl Add parameters for aclocal
56 AC_SUBST(ACLOCAL_AMFLAGS, "-I m4 -I common/m4")
57 AC_CONFIG_MACRO_DIR([m4])
58
59 dnl set up gettext
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])
64
65 dnl Check wether to build LDPRELOAD related code or not
66 AC_CANONICAL_HOST
67 case $host_os in
68   mingw* | msvc* | mks*)
69     BUILD_LDPRELOAD=no ;;
70   *)
71     BUILD_LDPRELOAD=yes ;;
72 esac
73 AM_CONDITIONAL(HAVE_LD_PRELOAD, test "x$BUILD_LDPRELOAD" = "xyes")
74
75 dnl *** check for arguments to configure ***
76
77 AG_GST_ARG_DEBUG
78 AG_GST_ARG_VALGRIND
79 AG_GST_ARG_GCOV
80 AG_GST_ARG_WITH_PACKAGE_NAME
81 AG_GST_ARG_WITH_PACKAGE_ORIGIN
82
83 AG_GST_PKG_CONFIG_PATH
84
85 dnl *** checks for platform ***
86
87 dnl * hardware/architecture *
88
89 dnl *** checks for programs ***
90
91 dnl find a compiler
92 AC_PROG_CC
93 AM_PROG_CC_C_O
94
95 AC_PATH_PROG(VALGRIND_PATH, valgrind, no)
96 AM_CONDITIONAL(HAVE_VALGRIND, test ! "x$VALGRIND_PATH" = "xno")
97
98 dnl check for gobject-introspection
99 GOBJECT_INTROSPECTION_CHECK([0.6.3])
100
101 dnl check for documentation tools
102 AG_GST_DOCBOOK_CHECK
103 GTK_DOC_CHECK([1.3])
104
105
106 AC_CHECK_PROG(enable_sphinx_doc, sphinx-build, yes, no)
107 AM_CONDITIONAL(HAVE_SPHINHX, test ! "x$enable_sphinx_doc" = "xno")
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 dnl checks for gstreamer
197
198 AG_GST_CHECK_GST_CHECK($GST_API_VERSION, [$GST_REQ], no)
199 AM_CONDITIONAL(HAVE_GST_CHECK, test "x$HAVE_GST_CHECK" = "xyes")
200
201 dnl *** set variables based on configure arguments ***
202
203 dnl set license and copyright notice
204 GST_LICENSE="LGPL"
205 AC_DEFINE_UNQUOTED(GST_LICENSE, "$GST_LICENSE", [GStreamer license])
206 AC_SUBST(GST_LICENSE)
207
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])
213
214 dnl plugin directory configure-time variable for use in Makefile.am
215 plugindir="\$(libdir)/gstreamer-$GST_API_VERSION/validate"
216 AC_SUBST(plugindir)
217
218 # set by AG_GST_PARSE_SUBSYSTEM_DISABLES above
219 dnl make sure it doesn't complain about unused variables if debugging is disabled
220 NO_WARNINGS=""
221 AG_GST_CHECK_GST_DEBUG_DISABLED([NO_WARNINGS="-Wno-unused"], [NO_WARNINGS=""])
222
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])
225
226 dnl define correct level for debugging messages
227 AG_GST_SET_LEVEL_DEFAULT($GST_GIT)
228
229 dnl used in examples
230 AG_GST_DEFAULT_ELEMENTS
231
232 dnl *** finalize CFLAGS, LDFLAGS, LIBS
233
234 dnl Overview:
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
241
242 dnl GST_OPTION_CFLAGS
243 if test "x$USE_DEBUG" = xyes; then
244    PROFILE_CFLAGS="-g"
245 fi
246 AC_SUBST(PROFILE_CFLAGS)
247
248 DEPRECATED_CFLAGS="-DGST_DISABLE_DEPRECATED"
249 AC_SUBST(DEPRECATED_CFLAGS)
250
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)
254
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)"
259 AC_SUBST(GST_CFLAGS)
260 AC_SUBST(GST_LIBS)
261
262 dnl GST_ALL_*
263 dnl vars common to for all internal objects (core libs, elements, applications)
264 dnl CFLAGS:
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])
269
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])
274
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)
279
280 dnl GST_LIB_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)
285
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)
290
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])
297
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
300
301 dnl *** output files ***
302
303 dnl keep this alphabetic per directory, please
304 AC_CONFIG_FILES([
305 Makefile
306 common/Makefile
307 common/m4/Makefile
308 data/Makefile
309 data/scenarios/Makefile
310 gst/Makefile
311 gst/validate/Makefile
312 gst/preload/Makefile
313 gst/overrides/Makefile
314 plugins/Makefile
315 plugins/fault_injection/Makefile
316 plugins/gapplication/Makefile
317 plugins/gtk/Makefile
318 plugins/ssim/Makefile
319 gst-libs/Makefile
320 gst-libs/gst/Makefile
321 gst-libs/gst/video/Makefile
322 tests/Makefile
323 tests/check/Makefile
324 pkgconfig/Makefile
325 pkgconfig/gst-validate-uninstalled.pc
326 pkgconfig/gst-validate.pc
327 po/Makefile.in
328 tools/Makefile
329 launcher/Makefile
330 launcher/apps/Makefile
331 docs/Makefile
332 docs/version.entities
333 docs/validate/Makefile
334 docs/plugins/Makefile
335 docs/launcher/Makefile
336 testsuites/Makefile
337 ])
338 AC_OUTPUT
339
340 echo "
341
342 Configuration
343         Version                    : ${VERSION}
344         Source code location       : ${srcdir}
345         Prefix                     : ${prefix}
346         Compiler                   : ${CC}
347
348 gst-validate configured. Type 'make' to build.
349 "