rtsp-media: Unblock all streams
[platform/upstream/gstreamer.git] / configure.ac
1 AC_PREREQ(2.69)
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([GStreamer RTSP Server Library], [1.17.0.1],
6     [http://bugzilla.gnome.org/enter_bug.cgi?product=GStreamer],
7     [gst-rtsp-server])
8 AG_GST_INIT
9
10 dnl initialize automake
11 AM_INIT_AUTOMAKE([-Wno-portability 1.14 no-dist-gzip dist-xz tar-ustar subdir-objects])
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([gst/rtsp-server/rtsp-server.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
42 dnl CURRENT, REVISION, AGE
43 dnl - library source changed -> increment REVISION
44 dnl - interfaces added/removed/changed -> increment CURRENT, REVISION = 0
45 dnl - interfaces added -> increment AGE
46 dnl - interfaces removed -> AGE = 0
47 dnl
48 dnl Keep CURRENT as MINOR * 100 + MICRO
49 dnl Ex : 1.0.0 => 0
50 dnl      1.0.3 => 3
51 dnl      1.1.0 => 100
52 dnl      1.2.5 => 205
53 dnl      1.10.9 (who knows) => 1009
54 dnl
55 dnl sets GST_LT_LDFLAGS
56 AS_LIBTOOL(GST, 1700, 0, 1700)
57
58 dnl *** required versions of GStreamer stuff ***
59 GST_REQ=1.17.0.1
60 GSTPB_REQ=1.17.0.1
61 GSTPG_REQ=1.17.0.1
62 GSTPD_REQ=1.17.0.1
63
64 dnl *** autotools stuff ****
65
66 dnl allow for different autotools
67 AS_AUTOTOOLS_ALTERNATE
68
69 dnl Add parameters for aclocal
70 AC_SUBST(ACLOCAL_AMFLAGS, "-I m4 -I common/m4")
71 AC_CONFIG_MACRO_DIR([m4])
72
73 dnl set up gettext
74 dnl the version check needs to stay here because autopoint greps for it
75 #AM_GNU_GETTEXT_VERSION([0.17])
76 #AM_GNU_GETTEXT([external])
77 #AG_GST_GETTEXT([gst-rtsp-server-$GST_API_VERSION])
78
79 dnl *** check for arguments to configure ***
80
81 AG_GST_ARG_DISABLE_FATAL_WARNINGS
82 AG_GST_ARG_ENABLE_EXTRA_CHECKS
83
84 AG_GST_ARG_DEBUG
85 AG_GST_ARG_VALGRIND
86 AG_GST_ARG_GCOV
87 AG_GST_ARG_WITH_PKG_CONFIG_PATH
88 AG_GST_ARG_WITH_PACKAGE_NAME
89 AG_GST_ARG_WITH_PACKAGE_ORIGIN
90
91 AG_GST_ARG_EXAMPLES
92
93 AG_GST_PKG_CONFIG_PATH
94
95 AG_GST_SET_PACKAGE_RELEASE_DATETIME_WITH_NANO([$PACKAGE_VERSION_NANO],
96   ["${srcdir}/gst-rtsp-server.doap"],
97   [$PACKAGE_VERSION_MAJOR.$PACKAGE_VERSION_MINOR.$PACKAGE_VERSION_MICRO])
98
99 dnl building of tests
100 AC_ARG_ENABLE(tests,
101   AS_HELP_STRING([--disable-tests],[disable building test apps]),
102   [
103     case "${enableval}" in
104       yes) BUILD_TESTS=yes ;;
105       no)  BUILD_TESTS=no ;;
106       *)   AC_MSG_ERROR(bad value ${enableval} for --disable-tests) ;;
107     esac
108   ],
109 [BUILD_TESTS=yes]) dnl Default value
110 AM_CONDITIONAL(BUILD_TESTS,         test "x$BUILD_TESTS" = "xyes")
111
112 dnl *** checks for platform ***
113
114 dnl * hardware/architecture *
115
116 dnl *** checks for programs ***
117
118 dnl find a compiler
119 AC_PROG_CC
120 AC_PROG_CC_STDC
121
122 dnl check if the compiler supports '-c' and '-o' options
123 AM_PROG_CC_C_O
124
125 dnl find an assembler
126 AM_PROG_AS
127
128 AC_PATH_PROG(VALGRIND_PATH, valgrind, no)
129 AM_CONDITIONAL(HAVE_VALGRIND, test ! "x$VALGRIND_PATH" = "xno")
130
131 dnl check for gobject-introspection
132 GOBJECT_INTROSPECTION_CHECK([1.31.1])
133
134 dnl *** checks for libraries ***
135
136 dnl check for pthreads
137 AX_PTHREAD
138
139 dnl *** checks for header files ***
140
141 dnl *** checks for types/defines ***
142
143 dnl *** checks for structures ***
144
145 dnl *** checks for compiler characteristics ***
146
147 dnl *** checks for library functions ***
148
149 dnl *** checks for dependancy libraries ***
150
151 dnl GLib is required
152 GLIB_REQ=2.44.0
153 AC_SUBST([GLIB_REQ])
154 AG_GST_GLIB_CHECK([$GLIB_REQ])
155
156 dnl checks for gstreamer
157 dnl uninstalled is selected preferentially -- see pkg-config(1)
158 AG_GST_CHECK_GST($GST_API_VERSION, [$GST_REQ], [yes])
159
160 GST_TOOLS_DIR=`$PKG_CONFIG --variable=toolsdir gstreamer-$GST_API_VERSION`
161 if test -z $GST_TOOLS_DIR; then
162   AC_MSG_ERROR([no tools dir defined in GStreamer pkg-config file; core upgrade needed.])
163 fi
164 AC_SUBST(GST_TOOLS_DIR)
165
166 GST_PLUGINS_DIR=`$PKG_CONFIG gstreamer-$GST_API_VERSION --variable pluginsdir`
167 AC_SUBST(GST_PLUGINS_DIR)
168 AC_MSG_NOTICE(Using GStreamer Core Plugins in $GST_PLUGINS_DIR)
169
170 AG_GST_CHECK_GST_BASE($GST_API_VERSION, [$GST_REQ], [yes])
171
172 AG_GST_CHECK_GST_NET($GST_API_VERSION, [$GST_REQ], yes)
173
174 AG_GST_CHECK_GST_PLUGINS_BASE($GST_API_VERSION, [$GSTPB_REQ], [yes])
175
176 dnl check for uninstalled plugin directories for unit tests
177 AG_GST_CHECK_UNINSTALLED_SETUP([
178   AG_GST_CHECK_GST_PLUGINS_GOOD($GST_API_VERSION, [$GSTPB_REQ])
179   AG_GST_CHECK_GST_PLUGINS_BAD($GST_API_VERSION, [$GSTPB_REQ])
180 ])
181
182 AG_GST_CHECK_GST_CHECK($GST_API_VERSION, [$GST_REQ], no)
183 AM_CONDITIONAL(HAVE_CHECK, test "x$HAVE_GST_CHECK" = "xyes")
184
185 dnl Check for -Bsymbolic-functions linker flag used to avoid
186 dnl intra-library PLT jumps, if available.
187 AC_ARG_ENABLE(Bsymbolic,
188               [AS_HELP_STRING([--disable-Bsymbolic],[avoid linking with -Bsymbolic])],,
189               [SAVED_LDFLAGS="${LDFLAGS}" SAVED_LIBS="${LIBS}"
190                AC_MSG_CHECKING([for -Bsymbolic-functions linker flag])
191                LDFLAGS=-Wl,-Bsymbolic-functions
192                LIBS=
193                AC_TRY_LINK([], [return 0],
194                            AC_MSG_RESULT(yes)
195                            enable_Bsymbolic=yes,
196                            AC_MSG_RESULT(no)
197                            enable_Bsymbolic=no)
198                LDFLAGS="${SAVED_LDFLAGS}" LIBS="${SAVED_LIBS}"])
199
200 dnl *** set variables based on configure arguments ***
201
202 dnl set license and copyright notice
203 GST_LICENSE="LGPL"
204 AC_DEFINE_UNQUOTED(GST_LICENSE, "$GST_LICENSE", [GStreamer license])
205 AC_SUBST(GST_LICENSE)
206
207 dnl set location of plugin directory
208 AG_GST_SET_PLUGINDIR
209
210 dnl set release date/time (and check that release version is in doap file)
211 AG_GST_SET_PACKAGE_RELEASE_DATETIME_WITH_NANO([$PACKAGE_VERSION_NANO],
212   ["${srcdir}/gst-rtsp-server.doap"],
213   [$PACKAGE_VERSION_MAJOR.$PACKAGE_VERSION_MINOR.$PACKAGE_VERSION_MICRO])
214
215 # set by AG_GST_PARSE_SUBSYSTEM_DISABLES above
216 dnl make sure it doesn't complain about unused variables if debugging is disabled
217 NO_WARNINGS=""
218 AG_GST_CHECK_GST_DEBUG_DISABLED([NO_WARNINGS="-Wno-unused"], [NO_WARNINGS=""])
219
220 dnl define an ERROR_CFLAGS Makefile variable
221 AG_GST_SET_ERROR_CFLAGS($FATAL_WARNINGS, [-Wmissing-declarations -Wmissing-prototypes -Wredundant-decls -Wundef -Wwrite-strings -Wformat-nonliteral -Wformat-security -Wold-style-definition -Winit-self -Wmissing-include-dirs -Waddress -Waggregate-return -Wno-multichar -Wnested-externs $NO_WARNINGS])
222
223 dnl define correct level for debugging messages
224 AG_GST_SET_LEVEL_DEFAULT($GST_GIT)
225
226 dnl used in examples
227 AG_GST_DEFAULT_ELEMENTS
228
229 dnl *** finalize CFLAGS, LDFLAGS, LIBS
230
231 dnl Overview:
232 dnl GST_OPTION_CFLAGS:  common flags for profiling, debugging, errors, ...
233 dnl GST_*:              flags shared by built objects to link against GStreamer
234 dnl GST_ALL_LDFLAGS:    linker flags shared by all
235 dnl GST_LIB_LDFLAGS:    additional linker flags for all libaries
236 dnl GST_LT_LDFLAGS:     library versioning of our libraries
237 dnl GST_PLUGIN_LDFLAGS: flags to be used for all plugins
238
239 dnl GST_OPTION_CFLAGS
240 if test "x$USE_DEBUG" = xyes; then
241    PROFILE_CFLAGS="-g"
242 fi
243 AC_SUBST(PROFILE_CFLAGS)
244
245 # GST_DISABLE_DEPRECATED: hide the visibility of deprecated
246 # functionality from the API that gstreamer uses
247 # GST_REMOVE_DEPRECATED: don't compile deprecated functionality (breaks ABI)
248 if test "x$PACKAGE_VERSION_NANO" = "x1"; then
249   dnl Define _only_ when compiling from git (not for pre-releases or releases)
250   DEPRECATED_CFLAGS="-DGST_DISABLE_DEPRECATED"
251 else
252   DEPRECATED_CFLAGS=""
253 fi
254 AC_SUBST(DEPRECATED_CFLAGS)
255
256 VISIBILITY_CFLAGS=""
257 AS_COMPILER_FLAG([-fvisibility=hidden], [
258   VISIBILITY_CFLAGS="-fvisibility=hidden"
259   AC_DEFINE(GST_API_EXPORT, [extern __attribute__ ((visibility ("default")))], [public symbol export define])
260 ], [
261   VISIBILITY_CFLAGS=""
262   AC_DEFINE(GST_API_EXPORT, [extern], [public symbol export define])
263 ])
264 AC_SUBST(VISIBILITY_CFLAGS)
265
266 dnl disable strict aliasing
267 AS_COMPILER_FLAG([-fno-strict-aliasing], [EXTRA_CFLAGS="-fno-strict-aliasing"])
268 AC_SUBST(EXTRA_CFLAGS)
269
270 dnl every flag in GST_OPTION_CFLAGS can be overridden at make time
271 GST_OPTION_CFLAGS="\$(WARNING_CFLAGS) \$(ERROR_CFLAGS) \$(DEBUG_CFLAGS) \$(PROFILE_CFLAGS) \$(GCOV_CFLAGS) \$(OPT_CFLAGS) \$(DEPRECATED_CFLAGS)"
272 AC_SUBST(GST_OPTION_CFLAGS)
273
274 dnl FIXME: do we want to rename to GST_ALL_* ?
275 dnl prefer internal headers to already installed ones
276 dnl add GST_OPTION_CFLAGS, but overridable
277 GST_CFLAGS="$GST_CFLAGS $EXTRA_CFLAGS \$(GST_STATIC_CFLAGS) \$(GST_OPTION_CFLAGS) \$(VISIBILITY_CFLAGS)"
278 AC_SUBST(GST_CFLAGS)
279 AC_SUBST(GST_LIBS)
280
281 dnl GST_ALL_*
282 dnl vars common to for all internal objects (core libs, elements, applications)
283 dnl CFLAGS:
284 dnl - src and build dirs need to be added because every piece that gets built
285 dnl   will need the GStreamer source and generated headers
286 GST_ALL_CFLAGS="-I\$(top_srcdir) -I\$(top_builddir) $GST_PLUGINS_BASE_CFLAGS $GST_CFLAGS \$(GST_OPTION_CFLAGS)"
287 AC_SUBST([GST_ALL_CFLAGS])
288
289 dnl FIXME: check if LTLIBINTL is needed everywhere
290 dnl I presume it is given that it contains the symbols that _() stuff maps to
291 GST_ALL_LIBS="$GST_LIBS $LTLIBINTL \$(GCOV_LIBS)"
292 AC_SUBST([GST_ALL_LIBS])
293
294 dnl LDFLAGS really should only contain flags, not libs - they get added before
295 dnl whatevertarget_LIBS and -L flags here affect the rest of the linking
296 GST_ALL_LDFLAGS="-no-undefined"
297 if test "x${enable_Bsymbolic}" = "xyes"; then
298   GST_ALL_LDFLAGS="$GST_ALL_LDFLAGS -Wl,-Bsymbolic-functions"
299 fi
300
301 AC_SUBST(GST_ALL_LDFLAGS)
302
303 dnl GST_LIB_LDFLAGS
304 dnl linker flags shared by all libraries
305 dnl LDFLAGS modifier defining exported symbols from built libraries
306 GST_LIB_LDFLAGS=""
307 AC_SUBST(GST_LIB_LDFLAGS)
308
309 dnl GST_OBJ_*
310 dnl default vars for all internal objects built on libgstrtspserver
311 dnl includes GST_ALL_*
312 GST_OBJ_CFLAGS="\$(GST_ALL_CFLAGS)"
313 AC_SUBST([GST_OBJ_CFLAGS])
314 GST_OBJ_LIBS="\$(top_builddir)/gst/rtsp-server/libgstrtspserver-$GST_API_VERSION.la \$(GST_ALL_LIBS)"
315 AC_SUBST([GST_OBJ_LIBS])
316
317 dnl If only building static libraries, define GST_STATIC_COMPILATION. This is
318 dnl needed only on Windows, but it doesn't hurt to have it everywhere.
319 if test x$enable_static = xyes -a x$enable_shared = xno; then
320   GST_STATIC_CFLAGS="-DGST_STATIC_COMPILATION"
321 fi
322 AC_SUBST(GST_STATIC_CFLAGS)
323
324 GST_PLUGIN_LDFLAGS="-module -avoid-version $GST_ALL_LDFLAGS"
325 AC_SUBST(GST_PLUGIN_LDFLAGS)
326
327 PKG_CHECK_MODULES(LIBCGROUP, libcgroup >= 0.26, HAVE_LIBCGROUP="yes", HAVE_LIBCGROUP="no")
328 AC_SUBST(LIBCGROUP_CFLAGS)
329 AC_SUBST(LIBCGROUP_LIBS)
330 AM_CONDITIONAL(HAVE_LIBCGROUP, test "x$HAVE_LIBCGROUP" = "xyes")
331
332 dnl this really should only contain flags, not libs - they get added before
333 dnl whatevertarget_LIBS and -L flags here affect the rest of the linking
334
335 dnl *** output files ***
336
337 dnl keep this alphabetic per directory, please
338 AC_CONFIG_FILES([
339 Makefile
340 common/Makefile
341 common/m4/Makefile
342 gst/Makefile
343 gst/rtsp-server/Makefile
344 gst/rtsp-sink/Makefile
345 examples/Makefile
346 tests/Makefile
347 tests/check/Makefile
348 pkgconfig/Makefile
349 pkgconfig/gstreamer-rtsp-server.pc
350 pkgconfig/gstreamer-rtsp-server-uninstalled.pc
351 ])
352 AC_OUTPUT
353
354 echo "
355
356 Configuration
357         Version                    : ${VERSION}
358         Source code location       : ${srcdir}
359         Prefix                     : ${prefix}
360         Compiler                   : ${CC}
361         CGroups example            : ${HAVE_LIBCGROUP}
362
363 gst-rtsp-server configured. Type 'make' to build.
364 "