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.15.0.1],
6 [http://bugzilla.gnome.org/enter_bug.cgi?product=GStreamer],
10 dnl initialize automake
11 AM_INIT_AUTOMAKE([-Wno-portability 1.14 no-dist-gzip dist-xz tar-ustar subdir-objects])
13 dnl define PACKAGE_VERSION_* variables
16 dnl check if this is a release version
17 AS_NANO(GST_GIT="no", GST_GIT="yes")
19 dnl can autoconf find the source ?
20 AC_CONFIG_SRCDIR([gst/rtsp-server/rtsp-server.c])
22 dnl define the output header for config
23 AC_CONFIG_HEADERS([config.h])
25 dnl AM_MAINTAINER_MODE only provides the option to configure to enable it
26 AM_MAINTAINER_MODE([enable])
28 dnl sets host_* variables
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)])
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
40 AC_SUBST(GST_API_VERSION)
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
48 dnl Keep CURRENT as MINOR * 100 + MICRO
53 dnl 1.10.9 (who knows) => 1009
55 dnl sets GST_LT_LDFLAGS
56 AS_LIBTOOL(GST, 1500, 0, 1500)
58 dnl *** required versions of GStreamer stuff ***
64 dnl *** autotools stuff ****
66 dnl allow for different autotools
67 AS_AUTOTOOLS_ALTERNATE
69 dnl Add parameters for aclocal
70 AC_SUBST(ACLOCAL_AMFLAGS, "-I m4 -I common/m4")
71 AC_CONFIG_MACRO_DIR([m4])
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])
79 dnl *** check for arguments to configure ***
81 AG_GST_ARG_DISABLE_FATAL_WARNINGS
82 AG_GST_ARG_ENABLE_EXTRA_CHECKS
87 AG_GST_ARG_WITH_PKG_CONFIG_PATH
88 AG_GST_ARG_WITH_PACKAGE_NAME
89 AG_GST_ARG_WITH_PACKAGE_ORIGIN
93 AG_GST_PKG_CONFIG_PATH
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])
101 AS_HELP_STRING([--disable-tests],[disable building test apps]),
103 case "${enableval}" in
104 yes) BUILD_TESTS=yes ;;
105 no) BUILD_TESTS=no ;;
106 *) AC_MSG_ERROR(bad value ${enableval} for --disable-tests) ;;
109 [BUILD_TESTS=yes]) dnl Default value
110 AM_CONDITIONAL(BUILD_TESTS, test "x$BUILD_TESTS" = "xyes")
112 dnl *** checks for platform ***
114 dnl * hardware/architecture *
116 dnl *** checks for programs ***
122 dnl check if the compiler supports '-c' and '-o' options
125 dnl find an assembler
128 AC_PATH_PROG(VALGRIND_PATH, valgrind, no)
129 AM_CONDITIONAL(HAVE_VALGRIND, test ! "x$VALGRIND_PATH" = "xno")
131 dnl check for gobject-introspection
132 GOBJECT_INTROSPECTION_CHECK([1.31.1])
134 dnl check for documentation tools
136 GTK_DOC_CHECK([1.12])
138 dnl *** checks for libraries ***
140 dnl check for pthreads
143 dnl *** checks for header files ***
145 dnl *** checks for types/defines ***
147 dnl *** checks for structures ***
149 dnl *** checks for compiler characteristics ***
151 dnl *** checks for library functions ***
153 dnl *** checks for dependancy libraries ***
158 AG_GST_GLIB_CHECK([$GLIB_REQ])
160 dnl checks for gstreamer
161 dnl uninstalled is selected preferentially -- see pkg-config(1)
162 AG_GST_CHECK_GST($GST_API_VERSION, [$GST_REQ], [yes])
164 GST_TOOLS_DIR=`$PKG_CONFIG --variable=toolsdir gstreamer-$GST_API_VERSION`
165 if test -z $GST_TOOLS_DIR; then
166 AC_MSG_ERROR([no tools dir defined in GStreamer pkg-config file; core upgrade needed.])
168 AC_SUBST(GST_TOOLS_DIR)
170 GST_PLUGINS_DIR=`$PKG_CONFIG gstreamer-$GST_API_VERSION --variable pluginsdir`
171 AC_SUBST(GST_PLUGINS_DIR)
172 AC_MSG_NOTICE(Using GStreamer Core Plugins in $GST_PLUGINS_DIR)
174 AG_GST_CHECK_GST_BASE($GST_API_VERSION, [$GST_REQ], [yes])
176 AG_GST_CHECK_GST_NET($GST_API_VERSION, [$GST_REQ], yes)
178 AG_GST_CHECK_GST_PLUGINS_BASE($GST_API_VERSION, [$GSTPB_REQ], [yes])
180 dnl check for uninstalled plugin directories for unit tests
181 AG_GST_CHECK_UNINSTALLED_SETUP([
182 AG_GST_CHECK_GST_PLUGINS_GOOD($GST_API_VERSION, [$GSTPB_REQ])
183 AG_GST_CHECK_GST_PLUGINS_BAD($GST_API_VERSION, [$GSTPB_REQ])
186 AG_GST_CHECK_GST_CHECK($GST_API_VERSION, [$GST_REQ], no)
187 AM_CONDITIONAL(HAVE_CHECK, test "x$HAVE_GST_CHECK" = "xyes")
189 dnl Check for -Bsymbolic-functions linker flag used to avoid
190 dnl intra-library PLT jumps, if available.
191 AC_ARG_ENABLE(Bsymbolic,
192 [AS_HELP_STRING([--disable-Bsymbolic],[avoid linking with -Bsymbolic])],,
193 [SAVED_LDFLAGS="${LDFLAGS}" SAVED_LIBS="${LIBS}"
194 AC_MSG_CHECKING([for -Bsymbolic-functions linker flag])
195 LDFLAGS=-Wl,-Bsymbolic-functions
197 AC_TRY_LINK([], [return 0],
199 enable_Bsymbolic=yes,
202 LDFLAGS="${SAVED_LDFLAGS}" LIBS="${SAVED_LIBS}"])
204 dnl *** set variables based on configure arguments ***
206 dnl set license and copyright notice
208 AC_DEFINE_UNQUOTED(GST_LICENSE, "$GST_LICENSE", [GStreamer license])
209 AC_SUBST(GST_LICENSE)
211 dnl set location of plugin directory
214 dnl set release date/time (and check that release version is in doap file)
215 AG_GST_SET_PACKAGE_RELEASE_DATETIME_WITH_NANO([$PACKAGE_VERSION_NANO],
216 ["${srcdir}/gst-rtsp-server.doap"],
217 [$PACKAGE_VERSION_MAJOR.$PACKAGE_VERSION_MINOR.$PACKAGE_VERSION_MICRO])
219 # set by AG_GST_PARSE_SUBSYSTEM_DISABLES above
220 dnl make sure it doesn't complain about unused variables if debugging is disabled
222 AG_GST_CHECK_GST_DEBUG_DISABLED([NO_WARNINGS="-Wno-unused"], [NO_WARNINGS=""])
224 dnl define an ERROR_CFLAGS Makefile variable
225 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])
227 dnl define correct level for debugging messages
228 AG_GST_SET_LEVEL_DEFAULT($GST_GIT)
231 AG_GST_DEFAULT_ELEMENTS
233 dnl *** finalize CFLAGS, LDFLAGS, LIBS
236 dnl GST_OPTION_CFLAGS: common flags for profiling, debugging, errors, ...
237 dnl GST_*: flags shared by built objects to link against GStreamer
238 dnl GST_ALL_LDFLAGS: linker flags shared by all
239 dnl GST_LIB_LDFLAGS: additional linker flags for all libaries
240 dnl GST_LT_LDFLAGS: library versioning of our libraries
241 dnl GST_PLUGIN_LDFLAGS: flags to be used for all plugins
243 dnl GST_OPTION_CFLAGS
244 if test "x$USE_DEBUG" = xyes; then
247 AC_SUBST(PROFILE_CFLAGS)
249 # GST_DISABLE_DEPRECATED: hide the visibility of deprecated
250 # functionality from the API that gstreamer uses
251 # GST_REMOVE_DEPRECATED: don't compile deprecated functionality (breaks ABI)
252 if test "x$PACKAGE_VERSION_NANO" = "x1"; then
253 dnl Define _only_ when compiling from git (not for pre-releases or releases)
254 DEPRECATED_CFLAGS="-DGST_DISABLE_DEPRECATED"
258 AC_SUBST(DEPRECATED_CFLAGS)
261 AS_COMPILER_FLAG([-fvisibility=hidden], [VISIBILITY_CFLAGS="-fvisibility=hidden"])
262 AC_SUBST(VISIBILITY_CFLAGS)
264 dnl disable strict aliasing
265 AS_COMPILER_FLAG([-fno-strict-aliasing], [EXTRA_CFLAGS="-fno-strict-aliasing"])
266 AC_SUBST(EXTRA_CFLAGS)
268 dnl every flag in GST_OPTION_CFLAGS can be overridden at make time
269 GST_OPTION_CFLAGS="\$(WARNING_CFLAGS) \$(ERROR_CFLAGS) \$(DEBUG_CFLAGS) \$(PROFILE_CFLAGS) \$(GCOV_CFLAGS) \$(OPT_CFLAGS) \$(DEPRECATED_CFLAGS)"
270 AC_SUBST(GST_OPTION_CFLAGS)
272 dnl FIXME: do we want to rename to GST_ALL_* ?
273 dnl prefer internal headers to already installed ones
274 dnl add GST_OPTION_CFLAGS, but overridable
275 GST_CFLAGS="$GST_CFLAGS $EXTRA_CFLAGS \$(GST_STATIC_CFLAGS) \$(GST_OPTION_CFLAGS) \$(VISIBILITY_CFLAGS)"
280 dnl vars common to for all internal objects (core libs, elements, applications)
282 dnl - src and build dirs need to be added because every piece that gets built
283 dnl will need the GStreamer source and generated headers
284 GST_ALL_CFLAGS="-I\$(top_srcdir) -I\$(top_builddir) $GST_PLUGINS_BASE_CFLAGS $GST_CFLAGS \$(GST_OPTION_CFLAGS)"
285 AC_SUBST([GST_ALL_CFLAGS])
287 dnl FIXME: check if LTLIBINTL is needed everywhere
288 dnl I presume it is given that it contains the symbols that _() stuff maps to
289 GST_ALL_LIBS="$GST_LIBS $LTLIBINTL \$(GCOV_LIBS)"
290 AC_SUBST([GST_ALL_LIBS])
292 dnl LDFLAGS really should only contain flags, not libs - they get added before
293 dnl whatevertarget_LIBS and -L flags here affect the rest of the linking
294 GST_ALL_LDFLAGS="-no-undefined"
295 if test "x${enable_Bsymbolic}" = "xyes"; then
296 GST_ALL_LDFLAGS="$GST_ALL_LDFLAGS -Wl,-Bsymbolic-functions"
299 AC_SUBST(GST_ALL_LDFLAGS)
302 dnl linker flags shared by all libraries
303 dnl LDFLAGS modifier defining exported symbols from built libraries
305 AC_SUBST(GST_LIB_LDFLAGS)
308 dnl default vars for all internal objects built on libgstrtspserver
309 dnl includes GST_ALL_*
310 GST_OBJ_CFLAGS="\$(GST_ALL_CFLAGS)"
311 AC_SUBST([GST_OBJ_CFLAGS])
312 GST_OBJ_LIBS="\$(top_builddir)/gst/rtsp-server/libgstrtspserver-$GST_API_VERSION.la \$(GST_ALL_LIBS)"
313 AC_SUBST([GST_OBJ_LIBS])
315 dnl If only building static libraries, define GST_STATIC_COMPILATION. This is
316 dnl needed only on Windows, but it doesn't hurt to have it everywhere.
317 if test x$enable_static = xyes -a x$enable_shared = xno; then
318 GST_STATIC_CFLAGS="-DGST_STATIC_COMPILATION"
320 AC_SUBST(GST_STATIC_CFLAGS)
322 GST_PLUGIN_LDFLAGS="-module -avoid-version $GST_ALL_LDFLAGS"
323 AC_SUBST(GST_PLUGIN_LDFLAGS)
325 PKG_CHECK_MODULES(LIBCGROUP, libcgroup >= 0.26, HAVE_LIBCGROUP="yes", HAVE_LIBCGROUP="no")
326 AC_SUBST(LIBCGROUP_CFLAGS)
327 AC_SUBST(LIBCGROUP_LIBS)
328 AM_CONDITIONAL(HAVE_LIBCGROUP, test "x$HAVE_LIBCGROUP" = "xyes")
330 dnl this really should only contain flags, not libs - they get added before
331 dnl whatevertarget_LIBS and -L flags here affect the rest of the linking
333 dnl *** output files ***
335 dnl keep this alphabetic per directory, please
341 gst/rtsp-server/Makefile
342 gst/rtsp-sink/Makefile
347 pkgconfig/gstreamer-rtsp-server.pc
348 pkgconfig/gstreamer-rtsp-server-uninstalled.pc
350 docs/version.entities
359 Source code location : ${srcdir}
362 CGroups example : ${HAVE_LIBCGROUP}
364 gst-rtsp-server configured. Type 'make' to build.