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