Remove generated .spec file
[platform/upstream/gst-editing-services.git] / configure.ac
1 AC_PREREQ(2.62)
2
3 dnl initialize autoconf
4 dnl when going to/from release please set the nano (fourth number) right !
5 dnl releases only do Wall, cvs and prerelease does Werror too
6 AC_INIT(GStreamer Editing Services, 1.11.0.1,
7     http://bugzilla.gnome.org/enter_bug.cgi?product=GStreamer,
8     gstreamer-editing-services)
9
10 AG_GST_INIT
11
12 dnl initialize automake
13 AM_INIT_AUTOMAKE([-Wno-portability 1.11 no-dist-gzip dist-xz tar-ustar subdir-objects])
14
15 dnl define PACKAGE_VERSION_* variables
16 AS_VERSION
17
18 dnl check if this is a release version
19 AS_NANO(GST_GIT="no", GST_GIT="yes")
20
21 dnl can autoconf find the source ?
22 AC_CONFIG_SRCDIR([ges/ges-timeline.c])
23
24 dnl define the output header for config
25 AC_CONFIG_HEADERS([config.h])
26
27 dnl AM_MAINTAINER_MODE only provides the option to configure to enable it
28 AM_MAINTAINER_MODE([enable])
29
30 dnl sets host_* variables
31 AC_CANONICAL_HOST
32
33 dnl use pretty build output with automake >= 1.11
34 m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])],
35  [AM_DEFAULT_VERBOSITY=1
36  AC_SUBST(AM_DEFAULT_VERBOSITY)])
37
38 dnl GES versioning, this is mostly informational
39 GES_VERSION_MAJOR=$PACKAGE_VERSION_MAJOR
40 GES_VERSION_MINOR=$PACKAGE_VERSION_MINOR
41 GES_VERSION_MICRO=$PACKAGE_VERSION_MICRO
42 GES_VERSION_NANO=$PACKAGE_VERSION_NANO
43 AC_SUBST(GES_VERSION_MAJOR)
44 AC_SUBST(GES_VERSION_MINOR)
45 AC_SUBST(GES_VERSION_MICRO)
46 AC_SUBST(GES_VERSION_NANO)
47
48 dnl our libraries and install dirs use major.minor as a version
49 GST_API_VERSION=$GST_EDITING_SERVICES_VERSION_MAJOR.$GST_EDITING_SERVICES_VERSION_MINOR
50 dnl we override it here if we need to for the release candidate of new series
51 GST_API_VERSION=1.0
52 AC_SUBST(GST_API_VERSION)
53
54 AS_LIBTOOL(GST, 1100, 0, 1100)
55
56 dnl *** required versions of GStreamer stuff ***
57 GST_REQ=1.11.0.1
58 GSTPB_REQ=1.11.0.1
59
60 dnl *** autotools stuff ****
61
62 dnl allow for different autotools
63 AS_AUTOTOOLS_ALTERNATE
64
65 dnl Add parameters for aclocal
66 AC_SUBST(ACLOCAL_AMFLAGS, "-I m4 -I common/m4")
67 AC_CONFIG_MACRO_DIR([m4])
68
69 dnl *** check for arguments to configure ***
70
71 AG_GST_ARG_DISABLE_FATAL_WARNINGS
72 AG_GST_ARG_ENABLE_EXTRA_CHECKS
73
74 AG_GST_ARG_DEBUG
75 AG_GST_ARG_PROFILING
76 AG_GST_ARG_VALGRIND
77 AG_GST_ARG_GCOV
78
79 AG_GST_ARG_EXAMPLES
80
81 AG_GST_ARG_WITH_PKG_CONFIG_PATH
82 AG_GST_ARG_WITH_PACKAGE_NAME
83 AG_GST_ARG_WITH_PACKAGE_ORIGIN
84
85 AG_GST_PKG_CONFIG_PATH
86
87 AG_GST_FLEX_CHECK
88
89 dnl *** checks for platform ***
90
91 dnl * hardware/architecture *
92
93 dnl common/m4/gst-arch.m4
94 dnl check CPU type
95 AG_GST_ARCH
96
97 dnl Determine endianness
98 AC_C_BIGENDIAN
99
100 dnl *** checks for programs ***
101
102 dnl find a compiler
103 AC_PROG_CC
104
105 dnl determine c++ compiler
106 AC_PROG_CXX
107 dnl determine if c++ is available on this system
108 AC_CHECK_PROG(HAVE_CXX, $CXX, yes, no)
109
110 dnl check if the compiler supports '-c' and '-o' options
111 AM_PROG_CC_C_O
112
113 dnl check if the compiler supports do while(0) macros
114 AG_GST_CHECK_DOWHILE_MACROS
115
116 AC_PATH_PROG(VALGRIND_PATH, valgrind, no)
117 AM_CONDITIONAL(HAVE_VALGRIND, test ! "x$VALGRIND_PATH" = "xno")
118
119 dnl check for gobject-introspection
120 GOBJECT_INTROSPECTION_CHECK([0.9.6])
121
122 dnl check for documentation tools
123 AG_GST_DOCBOOK_CHECK
124 GTK_DOC_CHECK([1.3])
125 AS_PATH_PYTHON([2.1])
126 AG_GST_PLUGIN_DOCS([1.3],[2.1])
127
128 dnl check for pygobject
129 AC_SUBST(PYGOBJECT_REQ, 3.0)
130 PKG_CHECK_MODULES(PYGOBJECT, pygobject-3.0 >= $PYGOBJECT_REQ,
131   [
132     HAVE_PYGOBJECT=yes
133   ], HAVE_PYGOBJECT=no)
134
135 AM_CONDITIONAL(WITH_PYTHON, [test "x$HAVE_PYGOBJECT" = "xyes"])
136
137 dnl check for gst-validate
138 PKG_CHECK_MODULES(GST_VALIDATE, gst-validate-1.0 >= 1.5.90,
139   [
140     HAVE_GST_VALIDATE=yes
141     AC_DEFINE(HAVE_GST_VALIDATE, 1, [Define if build with gst-validate support])
142   ], HAVE_GST_VALIDATE=no)
143
144 AC_SUBST(GST_VALIDATE_CFLAGS)
145 AC_SUBST(GST_VALIDATE_LIBS)
146 AM_CONDITIONAL(HAVE_GST_VALIDATE, [test "x$HAVE_GST_VALIDATE" = "xyes"])
147
148 dnl needed for scenarios definition files
149 GST_PREFIX="`$PKG_CONFIG --variable=prefix gstreamer-$GST_API_VERSION`"
150 AC_SUBST(GST_PREFIX)
151 GST_DATADIR="$GST_PREFIX/share"
152 AC_DEFINE_UNQUOTED(GST_DATADIR, "$GST_DATADIR", [system wide data directory])
153
154 dnl check for bash completion
155 AC_ARG_WITH([bash-completion-dir],
156     AS_HELP_STRING([--with-bash-completion-dir[=PATH]],
157         [Install the bash auto-completion script in this directory. @<:@default=yes@:>@]),
158     [],
159     [with_bash_completion_dir=yes])
160
161 if test "x$with_bash_completion_dir" = "xyes"; then
162     PKG_CHECK_MODULES([BASH_COMPLETION], [bash-completion >= 2.0],
163         [BASH_COMPLETION_DIR="`pkg-config --variable=completionsdir bash-completion`"],
164         [BASH_COMPLETION_DIR="$datadir/bash-completion/completions"])
165 else
166     BASH_COMPLETION_DIR="$with_bash_completion_dir"
167 fi
168
169 AC_SUBST([BASH_COMPLETION_DIR])
170 AM_CONDITIONAL([ENABLE_BASH_COMPLETION],[test "x$with_bash_completion_dir" != "xno"])
171
172 dnl *** checks for libraries ***
173
174 dnl check for libm, for sin() etc.
175 # LT_LIB_M
176 # AC_SUBST(LIBM)
177
178 dnl *** checks for header files ***
179
180 AC_CHECK_HEADERS([unistd.h], HAVE_UNISTD_H=yes)
181 AM_CONDITIONAL(HAVE_UNISTD_H, test "x$HAVE_UNISTD_H" = "xyes")
182
183 if test "x$HAVE_UNISTD_H" != "xyes"; then
184   GST_PLUGINS_SELECTED=`echo $GST_PLUGINS_SELECTED | $SED -e s/festival//`
185 fi
186
187 dnl *** checks for nose2 ***
188
189 AC_MSG_CHECKING(for nose2)
190 NOSE2=nose2
191 if $NOSE2 1>&AC_FD_CC 2>&AC_FD_CC
192 then
193   HAVE_NOSE2=yes
194   AC_MSG_RESULT(yes)
195 else
196   HAVE_NOSE2=no
197   AC_MSG_RESULT(no nose2)
198 fi
199 AC_SUBST([NOSE2])
200 AM_CONDITIONAL(HAVE_NOSE2, test "x$HAVE_NOSE2" = "xyes")
201
202 dnl *** checks for types/defines ***
203
204 dnl *** checks for structures ***
205
206 dnl *** checks for compiler characteristics ***
207
208 dnl *** checks for library functions ***
209
210 dnl *** checks for headers ***
211
212 dnl *** checks for dependency libraries ***
213
214 dnl GLib is required
215 AG_GST_GLIB_CHECK([2.40.0])
216
217 PKG_CHECK_MODULES(GIO, gio-2.0 >= 2.16, HAVE_GIO=yes, HAVE_GIO=no)
218 AC_SUBST(GIO_CFLAGS)
219 AC_SUBST(GIO_LIBS)
220
221 dnl checks for gstreamer
222 dnl uninstalled is selected preferentially -- see pkg-config(1)
223 AG_GST_CHECK_GST($GST_API_VERSION, [$GST_REQ], yes)
224 AG_GST_CHECK_GST_BASE($GST_API_VERSION, [$GST_REQ], yes)
225 #AG_GST_CHECK_GST_GDP($GST_API_VERSION, [$GST_REQ], yes)
226 AG_GST_CHECK_GST_CHECK($GST_API_VERSION, [$GST_REQ], no)
227 AG_GST_CHECK_GST_CONTROLLER($GST_API_VERSION, [$GST_REQ], yes)
228 AG_GST_CHECK_GST_PLUGINS_BASE($GST_API_VERSION, [$GSTPB_REQ], yes)
229 AG_GST_CHECK_GST_PLUGINS_BAD($GST_API_VERSION, [$GST_REQ], yes)
230 AG_GST_CHECK_GST_PLUGINS_GOOD($GST_API_VERSION, [$GST_REQ], yes)
231 AM_CONDITIONAL(HAVE_GST_CHECK, test "x$HAVE_GST_CHECK" = "xyes")
232
233 AG_GST_ARG_WITH_PLUGINS
234 AG_GST_CHECK_PLUGIN(plugins)
235
236 dnl set location of plugin directory
237 AG_GST_SET_PLUGINDIR
238
239 GSTPB_PLUGINS_DIR=`$PKG_CONFIG gstreamer-plugins-base-$GST_API_VERSION --variable pluginsdir`
240 AC_SUBST(GSTPB_PLUGINS_DIR)
241 AC_MSG_NOTICE(Using GStreamer Base Plugins in $GSTPB_PLUGINS_DIR)
242
243 dnl check for gstreamer-pbutils
244 PKG_CHECK_MODULES(GST_PBUTILS, gstreamer-pbutils-$GST_API_VERSION, HAVE_GST_PBUTILS="yes", HAVE_GST_PBUTILS="no")
245 if test "x$HAVE_GST_PBUTILS" != "xyes"; then
246   AC_ERROR([gst-pbutils is required for rendering support])
247 fi
248 AC_SUBST(GST_PBUTILS_LIBS)
249 AC_SUBST(GST_PBUTILS_CFLAGS)
250
251 dnl check for gst-controller
252 PKG_CHECK_MODULES(GST_CONTROLLER, gstreamer-controller-$GST_API_VERSION, HAVE_GST_CONTROLLER="yes", HAVE_GST_CONROLLER="no")
253 if test "x$HAVE_GST_CONTROLLER" != "xyes"; then
254   AC_ERROR([gst-controller is required for transition support])
255 fi
256 AC_SUBST(GST_CONTROLLER_LIBS)
257 AC_SUBST(GST_CONTROLLER_CFLAGS)
258
259 dnl check for gstvideo
260 PKG_CHECK_MODULES(GST_VIDEO, gstreamer-video-$GST_API_VERSION, HAVE_GST_VIDEO="yes", HAVE_GST_CONROLLER="no")
261 if test "x$HAVE_GST_VIDEO" != "xyes"; then
262   AC_ERROR([gst-video is required for transition support])
263 fi
264 AC_SUBST(GST_VIDEO_LIBS)
265 AC_SUBST(GST_VIDEO_CFLAGS)
266
267 dnl Check for documentation xrefs
268 GLIB_PREFIX="`$PKG_CONFIG --variable=prefix glib-2.0`"
269 GST_PREFIX="`$PKG_CONFIG --variable=prefix gstreamer-$GST_API_VERSION`"
270 GSTPB_PREFIX="`$PKG_CONFIG --variable=prefix gstreamer-plugins-base-$GST_API_VERSION`"
271 AC_SUBST(GLIB_PREFIX)
272 AC_SUBST(GST_PREFIX)
273 AC_SUBST(GSTPB_PREFIX)
274
275 dnl pitivi formatter needs libxml
276 PKG_CHECK_MODULES(XML, libxml-2.0, HAVE_LIBXML="yes", HAVE_LIBXML="no")
277 if test "x$HAVE_LIBXML" != "xyes"; then
278   AC_ERROR([libxml2 is required])
279 fi
280 AC_SUBST(XML_LIBS)
281 AC_SUBST(XML_CFLAGS)
282
283 dnl GTK is optional and only used in examples
284 HAVE_GTK=no
285 HAVE_GTK_X11=no
286 GTK2_REQ=2.14.0
287 GTK3_REQ=2.91.3
288 if test "x$BUILD_EXAMPLES" = "xyes"; then
289   AC_MSG_CHECKING([which gtk+ version to compile examples against (optional)])
290   AC_ARG_WITH([gtk],
291     AC_HELP_STRING([--with-gtk=3.0|2.0],
292                    [which gtk+ version to compile against (default: 2.0)]),
293     [case "$with_gtk" in
294         2.0) GTK_REQ=$GTK2_REQ ;;
295         3.0) GTK_REQ=$GTK3_REQ ;;
296         *) AC_MSG_ERROR([invalid gtk+ version specified]);;
297     esac],
298     [with_gtk=2.0
299      GTK_REQ=$GTK2_REQ])
300   AC_MSG_RESULT([$with_gtk (>= $GTK_REQ)])
301   PKG_CHECK_MODULES(GTK, gtk+-$with_gtk >= $GTK_REQ, HAVE_GTK=yes, HAVE_GTK=no)
302   dnl some examples need gtk+-x11
303   PKG_CHECK_MODULES(GTK_X11, gtk+-x11-$with_gtk >= $GTK_REQ, HAVE_GTK_X11=yes, HAVE_GTK_X11=no)
304   AC_SUBST(GTK_LIBS)
305   AC_SUBST(GTK_CFLAGS)
306 fi
307 AM_CONDITIONAL(HAVE_GTK, test "x$HAVE_GTK" = "xyes")
308 AM_CONDITIONAL(HAVE_GTK_X11, test "x$HAVE_GTK_X11" = "xyes")
309
310 dnl Check for -Bsymbolic-functions linker flag used to avoid
311 dnl intra-library PLT jumps, if available.
312 AC_ARG_ENABLE(Bsymbolic,
313               [AS_HELP_STRING([--disable-Bsymbolic],[avoid linking with -Bsymbolic])],,
314               [SAVED_LDFLAGS="${LDFLAGS}" SAVED_LIBS="${LIBS}"
315                AC_MSG_CHECKING([for -Bsymbolic-functions linker flag])
316                LDFLAGS=-Wl,-Bsymbolic-functions
317                LIBS=
318                AC_TRY_LINK([], [return 0],
319                            AC_MSG_RESULT(yes)
320                            enable_Bsymbolic=yes,
321                            AC_MSG_RESULT(no)
322                            enable_Bsymbolic=no)
323                LDFLAGS="${SAVED_LDFLAGS}" LIBS="${SAVED_LIBS}"])
324
325 dnl building of benchmarks
326 AC_ARG_ENABLE(benchmarks,
327   AS_HELP_STRING([--disable-benchmarks],[disable building benchmarks apps]),
328   [
329     case "${enableval}" in
330       yes) BUILD_BENCHMARKS=yes ;;
331       no)  BUILD_BENCHMARKS=no ;;
332       *)   AC_MSG_ERROR(bad value ${enableval} for --disable-benchmarks) ;;
333     esac
334   ],
335 [BUILD_BENCHMARKS=yes]) dnl Default value
336 AM_CONDITIONAL(BUILD_BENCHMARKS, test "x$BUILD_BENCHMARKS" = "xyes")
337
338 dnl set license and copyright notice
339 GST_LICENSE="LGPL"
340 AC_DEFINE_UNQUOTED(GST_LICENSE, "$GST_LICENSE", [GStreamer license])
341 AC_SUBST(GST_LICENSE)
342
343 dnl define LIBDIR so we can inform people where we live
344 AS_AC_EXPAND(LIBDIR, $libdir)
345 AC_DEFINE_UNQUOTED(LIBDIR, "$LIBDIR", [library dir])
346
347 dnl set location of plugin directory
348 AG_GST_SET_PLUGINDIR
349
350 dnl define an ERROR_CFLAGS Makefile variable
351 AG_GST_SET_ERROR_CFLAGS($GST_GIT, [-Wmissing-declarations -Wmissing-prototypes -Wredundant-decls -Wundef \
352                                    -Wwrite-strings -Wformat-security -Wold-style-definition \
353                                    -Winit-self -Wmissing-include-dirs -Waddress -Waggregate-return -Wno-multichar \
354                                    -Wnested-externs])
355
356 dnl define an ERROR_CXXFLAGS Makefile variable
357 AG_GST_SET_ERROR_CXXFLAGS($GST_GIT)
358
359 dnl define correct level for debugging messages
360 AG_GST_SET_LEVEL_DEFAULT($GST_GIT)
361
362 dnl *** finalize CFLAGS, LDFLAGS, LIBS
363
364 dnl Overview:
365 dnl GST_OPTION_CFLAGS:  common flags for profiling, debugging, errors, ...
366 dnl GST_*:              flags shared by built objects to link against GStreamer
367 dnl GST_ALL_LDFLAGS:    linker flags shared by all
368 dnl GST_LIB_LDFLAGS:    additional linker flags for all libaries
369 dnl GST_LT_LDFLAGS:     library versioning of our libraries
370 dnl GST_PLUGIN_LDFLAGS: flags to be used for all plugins
371
372 dnl GST_OPTION_CFLAGS
373 if test "x$USE_DEBUG" = xyes; then
374    PROFILE_CFLAGS="-g"
375 fi
376 AC_SUBST(PROFILE_CFLAGS)
377
378 if test "x$PACKAGE_VERSION_NANO" = "x1"; then
379   dnl Define _only_ during CVS (not pre-releases or releases)
380   DEPRECATED_CFLAGS="-DGST_DISABLE_DEPRECATED"
381 else
382   DEPRECATED_CFLAGS=""
383 fi
384 AC_SUBST(DEPRECATED_CFLAGS)
385
386 dnl every flag in GST_OPTION_CFLAGS and GST_OPTION_CXXFLAGS can be overridden
387 dnl at make time with e.g. make ERROR_CFLAGS=""
388 GST_OPTION_CFLAGS="\$(WARNING_CFLAGS) \$(DEBUG_CFLAGS) \$(PROFILE_CFLAGS) \$(GCOV_CFLAGS) \$(OPT_CFLAGS) \$(DEPRECATED_CFLAGS)"
389 GST_OPTION_CXXFLAGS="\$(ERROR_CXXFLAGS) \$(DEBUG_CFLAGS) \$(PROFILE_CFLAGS) \$(GCOV_CFLAGS) \$(OPT_CFLAGS) \$(DEPRECATED_CFLAGS)"
390 AC_SUBST(GST_OPTION_CFLAGS)
391 AC_SUBST(GST_OPTION_CXXFLAGS)
392
393 dnl FIXME: do we want to rename to GST_ALL_* ?
394 dnl prefer internal headers to already installed ones
395 dnl also add builddir include for enumtypes and marshal
396 dnl add GST_OPTION_CFLAGS, but overridable
397 GST_CFLAGS="$GST_CFLAGS \$(GST_OPTION_CFLAGS) \$(ERROR_CFLAGS) -DGST_USE_UNSTABLE_API"
398 GST_CXXFLAGS="$GST_CXXFLAGS \$(GST_OPTION_CXXFLAGS)"
399 AC_SUBST(GST_CFLAGS)
400 AC_SUBST(GST_CXXFLAGS)
401 AC_SUBST(GST_LIBS)
402
403 dnl LDFLAGS really should only contain flags, not libs - they get added before
404 dnl whatevertarget_LIBS and -L flags here affect the rest of the linking
405 GST_ALL_LDFLAGS="-no-undefined"
406 if test "x${enable_Bsymbolic}" = "xyes"; then
407   GST_ALL_LDFLAGS="$GST_ALL_LDFLAGS -Wl,-Bsymbolic-functions"
408 fi
409 AC_SUBST(GST_ALL_LDFLAGS)
410
411 dnl GST_LIB_LDFLAGS
412 dnl linker flags shared by all libraries
413 dnl LDFLAGS modifier defining exported symbols from built libraries
414 GST_LIB_LDFLAGS=" -export-symbols-regex \^_*\(ges_\|GES_\).*"
415 AC_SUBST(GST_LIB_LDFLAGS)
416
417 dnl build static plugins or not
418 AC_MSG_CHECKING([whether to build static plugins or not])
419 AC_ARG_ENABLE(
420   static-plugins,
421   AC_HELP_STRING(
422     [--enable-static-plugins],
423     [build static plugins @<:@default=no@:>@]),
424   [AS_CASE(
425     [$enableval], [no], [], [yes], [],
426     [AC_MSG_ERROR([bad value "$enableval" for --enable-static-plugins])])],
427   [enable_static_plugins=no])
428 AC_MSG_RESULT([$enable_static_plugins])
429 if test "x$enable_static_plugins" = xyes; then
430   AC_DEFINE(GST_PLUGIN_BUILD_STATIC, 1,
431     [Define if static plugins should be built])
432   GST_PLUGIN_LIBTOOLFLAGS=""
433 else
434   GST_PLUGIN_LIBTOOLFLAGS="--tag=disable-static"
435 fi
436 AC_SUBST(GST_PLUGIN_LIBTOOLFLAGS)
437 AM_CONDITIONAL(GST_PLUGIN_BUILD_STATIC, test "x$enable_static_plugins" = "xyes")
438
439 dnl GST_PLUGIN_LDFLAGS must only contain flags, not libs - they get added before
440 dnl whatevertarget_LIBS and -L flags here affect the rest of the linking
441 GST_PLUGIN_LDFLAGS="-module -avoid-version -export-symbols-regex '^[_]*gst_plugin_.*' $GST_ALL_LDFLAGS"
442 AC_SUBST(GST_PLUGIN_LDFLAGS)
443
444 dnl *** output files ***
445
446 dnl po/Makefile.in
447
448 AC_CONFIG_FILES(
449 Makefile
450 ges/ges-version.h
451 common/Makefile
452 common/m4/Makefile
453 m4/Makefile
454 ges/Makefile
455 tests/Makefile
456 tests/check/Makefile
457 tests/benchmarks/Makefile
458 examples/Makefile
459 examples/c/Makefile
460 tests/validate/Makefile
461 tests/validate/scenarios/Makefile
462 tools/Makefile
463 docs/Makefile
464 docs/version.entities
465 docs/libs/Makefile
466 pkgconfig/Makefile
467 pkgconfig/gst-editing-services.pc
468 pkgconfig/gst-editing-services-uninstalled.pc
469 plugins/Makefile
470 plugins/nle/Makefile
471 bindings/Makefile
472 bindings/python/Makefile
473 bindings/python/gi/Makefile
474 bindings/python/gi/overrides/Makefile
475 )
476 AC_OUTPUT