nle: Hide away symbols, they're supposed to be internal
[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.5.2.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, 0, 0, 0)
55
56 dnl *** required versions of GStreamer stuff ***
57 GST_REQ=1.5.1
58 GSTPB_REQ=1.5.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_DEBUG
72 AG_GST_ARG_PROFILING
73 AG_GST_ARG_VALGRIND
74 AG_GST_ARG_GCOV
75
76 AG_GST_ARG_EXAMPLES
77
78 AG_GST_ARG_WITH_PKG_CONFIG_PATH
79 AG_GST_ARG_WITH_PACKAGE_NAME
80 AG_GST_ARG_WITH_PACKAGE_ORIGIN
81
82 AG_GST_PKG_CONFIG_PATH
83
84 AG_GST_FLEX_CHECK
85
86 dnl *** checks for platform ***
87
88 dnl * hardware/architecture *
89
90 dnl common/m4/gst-arch.m4
91 dnl check CPU type
92 AG_GST_ARCH
93
94 dnl Determine endianness
95 AC_C_BIGENDIAN
96
97 dnl *** checks for programs ***
98
99 dnl find a compiler
100 AC_PROG_CC
101
102 dnl determine c++ compiler
103 AC_PROG_CXX
104 dnl determine if c++ is available on this system
105 AC_CHECK_PROG(HAVE_CXX, $CXX, yes, no)
106
107 dnl check if the compiler supports '-c' and '-o' options
108 AM_PROG_CC_C_O
109
110 dnl check if the compiler supports do while(0) macros
111 AG_GST_CHECK_DOWHILE_MACROS
112
113 AC_PATH_PROG(VALGRIND_PATH, valgrind, no)
114 AM_CONDITIONAL(HAVE_VALGRIND, test ! "x$VALGRIND_PATH" = "xno")
115
116 dnl check for gobject-introspection
117 GOBJECT_INTROSPECTION_CHECK([0.9.6])
118
119 dnl check for documentation tools
120 AG_GST_DOCBOOK_CHECK
121 GTK_DOC_CHECK([1.3])
122 AS_PATH_PYTHON([2.1])
123 AG_GST_PLUGIN_DOCS([1.3],[2.1])
124
125 dnl check for python
126 AM_PATH_PYTHON
127 AC_MSG_CHECKING(for python >= 2.3)
128 prog="
129 import sys, string
130 minver = (2,3,0,'final',0)
131 if sys.version_info < minver:
132   sys.exit(1)
133 sys.exit(0)"
134
135 if $PYTHON -c "$prog" 1>&AC_FD_CC 2>&AC_FD_CC
136 then
137   HAVE_PYTHON=yes
138   AC_MSG_RESULT(okay)
139 else
140   HAVE_PYTHON=no
141   AC_MSG_RESULT(no python)
142 fi
143
144 dnl check for pygobject
145 AC_SUBST(PYGOBJECT_REQ, 4.22)
146 PKG_CHECK_MODULES(PYGOBJECT, pygobject-3.0 >= $PYGOBJECT_REQ,
147   [
148     HAVE_PYGOBJECT=yes
149   ], HAVE_PYGOBJECT=no)
150
151 AM_CONDITIONAL(WITH_PYTHON, [test "x$HAVE_PYGOBJECT" = "xyes"])
152
153 dnl check for pygobject
154 PKG_CHECK_MODULES(GST_VALIDATE, gst-validate-1.0 >= 1.5.2,
155   [
156     HAVE_GST_VALIDATE=yes
157     AC_DEFINE(HAVE_GST_VALIDATE, 1, [Define if build with gst-validate support])
158   ], HAVE_GST_VALIDATE=no)
159
160 AC_SUBST(GST_VALIDATE_CFLAGS)
161 AC_SUBST(GST_VALIDATE_LIBS)
162 AM_CONDITIONAL(HAVE_GST_VALIDATE, [test "x$HAVE_GST_VALIDATE" = "xyes"])
163
164 dnl needed for scenarios definition files
165 GST_PREFIX="`$PKG_CONFIG --variable=prefix gstreamer-$GST_API_VERSION`"
166 AC_SUBST(GST_PREFIX)
167 GST_DATADIR="$GST_PREFIX/share"
168 AC_DEFINE_UNQUOTED(GST_DATADIR, "$GST_DATADIR", [system wide data directory])
169
170 dnl check for bash completion
171 AC_ARG_WITH([bash-completion-dir],
172     AS_HELP_STRING([--with-bash-completion-dir[=PATH]],
173         [Install the bash auto-completion script in this directory. @<:@default=yes@:>@]),
174     [],
175     [with_bash_completion_dir=yes])
176
177 if test "x$with_bash_completion_dir" = "xyes"; then
178         if test "x$prefix" = xNONE; then
179                 PKG_CHECK_MODULES([BASH_COMPLETION], [bash-completion >= 2.0],
180                         [BASH_COMPLETION_DIR="`pkg-config --variable=completionsdir bash-completion`"],
181                         [BASH_COMPLETION_DIR="$datadir/bash-completion/completions"])
182         else
183                 PKG_CHECK_MODULES([BASH_COMPLETION], [bash-completion >= 2.0],
184                 [BASH_COMPLETION_DIR="`pkg-config --define-variable=prefix=$prefix --variable=completionsdir bash-completion`"],
185                 [BASH_COMPLETION_DIR="$prefix/$datadir/bash-completion/completions"])
186         fi
187 else
188     BASH_COMPLETION_DIR="$with_bash_completion_dir"
189 fi
190
191 AC_SUBST([BASH_COMPLETION_DIR])
192 AM_CONDITIONAL([ENABLE_BASH_COMPLETION],[test "x$with_bash_completion_dir" != "xno"])
193
194 dnl *** checks for libraries ***
195
196 dnl check for libm, for sin() etc.
197 # LT_LIB_M
198 # AC_SUBST(LIBM)
199
200 dnl *** checks for header files ***
201
202 AC_CHECK_HEADERS([unistd.h], HAVE_UNISTD_H=yes)
203 AM_CONDITIONAL(HAVE_UNISTD_H, test "x$HAVE_UNISTD_H" = "xyes")
204
205 if test "x$HAVE_UNISTD_H" != "xyes"; then
206   GST_PLUGINS_SELECTED=`echo $GST_PLUGINS_SELECTED | $SED -e s/festival//`
207 fi
208
209 dnl *** checks for types/defines ***
210
211 dnl *** checks for structures ***
212
213 dnl *** checks for compiler characteristics ***
214
215 dnl *** checks for library functions ***
216
217 dnl *** checks for headers ***
218
219 dnl *** checks for dependency libraries ***
220
221 dnl GLib is required
222 AG_GST_GLIB_CHECK([2.34.0])
223
224 PKG_CHECK_MODULES(GIO, gio-2.0 >= 2.16, HAVE_GIO=yes, HAVE_GIO=no)
225 AC_SUBST(GIO_CFLAGS)
226 AC_SUBST(GIO_LIBS)
227
228 dnl checks for gstreamer
229 dnl uninstalled is selected preferentially -- see pkg-config(1)
230 AG_GST_CHECK_GST($GST_API_VERSION, [$GST_REQ], yes)
231 AG_GST_CHECK_GST_BASE($GST_API_VERSION, [$GST_REQ], yes)
232 #AG_GST_CHECK_GST_GDP($GST_API_VERSION, [$GST_REQ], yes)
233 AG_GST_CHECK_GST_CHECK($GST_API_VERSION, [$GST_REQ], no)
234 AG_GST_CHECK_GST_CONTROLLER($GST_API_VERSION, [$GST_REQ], yes)
235 AG_GST_CHECK_GST_PLUGINS_BASE($GST_API_VERSION, [$GSTPB_REQ], yes)
236 AM_CONDITIONAL(HAVE_GST_CHECK, test "x$HAVE_GST_CHECK" = "xyes")
237
238 GSTPB_PLUGINS_DIR=`$PKG_CONFIG gstreamer-plugins-base-$GST_API_VERSION --variable pluginsdir`
239 AC_SUBST(GSTPB_PLUGINS_DIR)
240 AC_MSG_NOTICE(Using GStreamer Base Plugins in $GSTPB_PLUGINS_DIR)
241
242 dnl check for gstreamer-pbutils
243 PKG_CHECK_MODULES(GST_PBUTILS, gstreamer-pbutils-$GST_API_VERSION, HAVE_GST_PBUTILS="yes", HAVE_GST_PBUTILS="no")
244 if test "x$HAVE_GST_PBUTILS" != "xyes"; then
245   AC_ERROR([gst-pbutils is required for rendering support])
246 fi
247 AC_SUBST(GST_PBUTILS_LIBS)
248 AC_SUBST(GST_PBUTILS_CFLAGS)
249
250 dnl check for gst-controller
251 PKG_CHECK_MODULES(GST_CONTROLLER, gstreamer-controller-$GST_API_VERSION, HAVE_GST_CONTROLLER="yes", HAVE_GST_CONROLLER="no")
252 if test "x$HAVE_GST_CONTROLLER" != "xyes"; then
253   AC_ERROR([gst-controller is required for transition support])
254 fi
255 AC_SUBST(GST_CONTROLLER_LIBS)
256 AC_SUBST(GST_CONTROLLER_CFLAGS)
257
258 dnl check for gstvideo
259 PKG_CHECK_MODULES(GST_VIDEO, gstreamer-video-$GST_API_VERSION, HAVE_GST_VIDEO="yes", HAVE_GST_CONROLLER="no")
260 if test "x$HAVE_GST_VIDEO" != "xyes"; then
261   AC_ERROR([gst-video is required for transition support])
262 fi
263 AC_SUBST(GST_VIDEO_LIBS)
264 AC_SUBST(GST_VIDEO_CFLAGS)
265
266 dnl Check for documentation xrefs
267 GLIB_PREFIX="`$PKG_CONFIG --variable=prefix glib-2.0`"
268 GST_PREFIX="`$PKG_CONFIG --variable=prefix gstreamer-$GST_API_VERSION`"
269 GSTPB_PREFIX="`$PKG_CONFIG --variable=prefix gstreamer-plugins-base-$GST_API_VERSION`"
270 AC_SUBST(GLIB_PREFIX)
271 AC_SUBST(GST_PREFIX)
272 AC_SUBST(GSTPB_PREFIX)
273
274 dnl pitivi formatter needs libxml
275 PKG_CHECK_MODULES(XML, libxml-2.0, HAVE_LIBXML="yes", HAVE_LIBXML="no")
276 if test "x$HAVE_LIBXML" != "xyes"; then
277   AC_ERROR([libxml2 is required])
278 fi
279 AC_SUBST(XML_LIBS)
280 AC_SUBST(XML_CFLAGS)
281
282 dnl GTK is optional and only used in examples
283 HAVE_GTK=no
284 HAVE_GTK_X11=no
285 GTK2_REQ=2.14.0
286 GTK3_REQ=2.91.3
287 if test "x$BUILD_EXAMPLES" = "xyes"; then
288   AC_MSG_CHECKING([which gtk+ version to compile examples against (optional)])
289   AC_ARG_WITH([gtk],
290     AC_HELP_STRING([--with-gtk=3.0|2.0],
291                    [which gtk+ version to compile against (default: 2.0)]),
292     [case "$with_gtk" in
293         2.0) GTK_REQ=$GTK2_REQ ;;
294         3.0) GTK_REQ=$GTK3_REQ ;;
295         *) AC_MSG_ERROR([invalid gtk+ version specified]);;
296     esac],
297     [with_gtk=2.0
298      GTK_REQ=$GTK2_REQ])
299   AC_MSG_RESULT([$with_gtk (>= $GTK_REQ)])
300   PKG_CHECK_MODULES(GTK, gtk+-$with_gtk >= $GTK_REQ, HAVE_GTK=yes, HAVE_GTK=no)
301   dnl some examples need gtk+-x11
302   PKG_CHECK_MODULES(GTK_X11, gtk+-x11-$with_gtk >= $GTK_REQ, HAVE_GTK_X11=yes, HAVE_GTK_X11=no)
303   AC_SUBST(GTK_LIBS)
304   AC_SUBST(GTK_CFLAGS)
305 fi
306 AM_CONDITIONAL(HAVE_GTK, test "x$HAVE_GTK" = "xyes")
307 AM_CONDITIONAL(HAVE_GTK_X11, test "x$HAVE_GTK_X11" = "xyes")
308
309 dnl building of benchmarks
310 AC_ARG_ENABLE(benchmarks,
311   AS_HELP_STRING([--disable-benchmarks],[disable building benchmarks apps]),
312   [
313     case "${enableval}" in
314       yes) BUILD_BENCHMARKS=yes ;;
315       no)  BUILD_BENCHMARKS=no ;;
316       *)   AC_MSG_ERROR(bad value ${enableval} for --disable-benchmarks) ;;
317     esac
318   ],
319 [BUILD_BENCHMARKS=yes]) dnl Default value
320 AM_CONDITIONAL(BUILD_BENCHMARKS, test "x$BUILD_BENCHMARKS" = "xyes")
321
322 dnl set license and copyright notice
323 GST_LICENSE="LGPL"
324 AC_DEFINE_UNQUOTED(GST_LICENSE, "$GST_LICENSE", [GStreamer license])
325 AC_SUBST(GST_LICENSE)
326
327 dnl define LIBDIR so we can inform people where we live
328 AS_AC_EXPAND(LIBDIR, $libdir)
329 AC_DEFINE_UNQUOTED(LIBDIR, "$LIBDIR", [library dir])
330
331 dnl set location of plugin directory
332 AG_GST_SET_PLUGINDIR
333
334 dnl define an ERROR_CFLAGS Makefile variable
335 AG_GST_SET_ERROR_CFLAGS($GST_GIT, [-Wmissing-declarations -Wmissing-prototypes -Wredundant-decls -Wundef \
336                                    -Wwrite-strings -Wformat-security -Wold-style-definition \
337                                    -Winit-self -Wmissing-include-dirs -Waddress -Waggregate-return -Wno-multichar \
338                                    -Wnested-externs])
339
340 dnl define an ERROR_CXXFLAGS Makefile variable
341 AG_GST_SET_ERROR_CXXFLAGS($GST_GIT)
342
343 dnl define correct level for debugging messages
344 AG_GST_SET_LEVEL_DEFAULT($GST_GIT)
345
346 dnl *** finalize CFLAGS, LDFLAGS, LIBS
347
348 dnl Overview:
349 dnl GST_OPTION_CFLAGS:  common flags for profiling, debugging, errors, ...
350 dnl GST_*:              flags shared by built objects to link against GStreamer
351 dnl GST_ALL_LDFLAGS:    linker flags shared by all
352 dnl GST_LIB_LDFLAGS:    additional linker flags for all libaries
353 dnl GST_LT_LDFLAGS:     library versioning of our libraries
354 dnl GST_PLUGIN_LDFLAGS: flags to be used for all plugins
355
356 dnl GST_OPTION_CFLAGS
357 if test "x$USE_DEBUG" = xyes; then
358    PROFILE_CFLAGS="-g"
359 fi
360 AC_SUBST(PROFILE_CFLAGS)
361
362 if test "x$PACKAGE_VERSION_NANO" = "x1"; then
363   dnl Define _only_ during CVS (not pre-releases or releases)
364   DEPRECATED_CFLAGS="-DGST_DISABLE_DEPRECATED"
365 else
366   DEPRECATED_CFLAGS=""
367 fi
368 AC_SUBST(DEPRECATED_CFLAGS)
369
370 dnl every flag in GST_OPTION_CFLAGS and GST_OPTION_CXXFLAGS can be overridden
371 dnl at make time with e.g. make ERROR_CFLAGS=""
372 GST_OPTION_CFLAGS="\$(WARNING_CFLAGS) \$(DEBUG_CFLAGS) \$(PROFILE_CFLAGS) \$(GCOV_CFLAGS) \$(OPT_CFLAGS) \$(DEPRECATED_CFLAGS)"
373 GST_OPTION_CXXFLAGS="\$(ERROR_CXXFLAGS) \$(DEBUG_CFLAGS) \$(PROFILE_CFLAGS) \$(GCOV_CFLAGS) \$(OPT_CFLAGS) \$(DEPRECATED_CFLAGS)"
374 AC_SUBST(GST_OPTION_CFLAGS)
375 AC_SUBST(GST_OPTION_CXXFLAGS)
376
377 dnl FIXME: do we want to rename to GST_ALL_* ?
378 dnl prefer internal headers to already installed ones
379 dnl also add builddir include for enumtypes and marshal
380 dnl add GST_OPTION_CFLAGS, but overridable
381 GST_CFLAGS="$GST_CFLAGS \$(GST_OPTION_CFLAGS) \$(ERROR_CFLAGS) -DGST_USE_UNSTABLE_API"
382 GST_CXXFLAGS="$GST_CXXFLAGS \$(GST_OPTION_CXXFLAGS)"
383 AC_SUBST(GST_CFLAGS)
384 AC_SUBST(GST_CXXFLAGS)
385 AC_SUBST(GST_LIBS)
386
387 dnl LDFLAGS really should only contain flags, not libs - they get added before
388 dnl whatevertarget_LIBS and -L flags here affect the rest of the linking
389 GST_ALL_LDFLAGS="-no-undefined"
390 AC_SUBST(GST_ALL_LDFLAGS)
391
392 dnl GST_LIB_LDFLAGS
393 dnl linker flags shared by all libraries
394 dnl LDFLAGS modifier defining exported symbols from built libraries
395 GST_LIB_LDFLAGS=" -export-symbols-regex \^_*\(ges_\|GES_\).*"
396 AC_SUBST(GST_LIB_LDFLAGS)
397
398 dnl *** output files ***
399
400 dnl po/Makefile.in
401
402 AC_CONFIG_FILES(
403 Makefile
404 ges/ges-version.h
405 common/Makefile
406 common/m4/Makefile
407 gst-editing-services.spec
408 m4/Makefile
409 ges/Makefile
410 tests/Makefile
411 tests/check/Makefile
412 tests/benchmarks/Makefile
413 tests/examples/Makefile
414 tests/validate/Makefile
415 tests/validate/scenarios/Makefile
416 tools/Makefile
417 docs/Makefile
418 docs/version.entities
419 docs/libs/Makefile
420 pkgconfig/Makefile
421 pkgconfig/gst-editing-services.pc
422 pkgconfig/gst-editing-services-uninstalled.pc
423 bindings/Makefile
424 bindings/python/Makefile
425 bindings/python/gi/Makefile
426 bindings/python/gi/overrides/Makefile
427 bindings/python/examples/Makefile
428 )
429 AC_OUTPUT