rtsp-client: don't use g_object_unref on GstRTSPSessionMedia
[platform/upstream/gstreamer.git] / configure.ac
1 AC_PREREQ(2.62)
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(Gst-RTSP, 0.11.89.1,
6     http://bugzilla.gnome.org/enter_bug.cgi?product=GStreamer,
7     gst-rtsp)
8 AG_GST_INIT
9
10 dnl initialize automake
11 AM_INIT_AUTOMAKE([-Wno-portability 1.11 no-dist-gzip dist-xz tar-ustar])
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 AM_CONFIG_HEADER([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 AS_LIBTOOL(GST, 0, 0, 0)
43
44 dnl *** required versions of GStreamer stuff ***
45 GST_REQ=0.11.0
46 GSTPB_REQ=0.11.0
47
48 dnl *** autotools stuff ****
49
50 dnl allow for different autotools
51 AS_AUTOTOOLS_ALTERNATE
52
53 dnl Add parameters for aclocal
54 AC_SUBST(ACLOCAL_AMFLAGS, "-I m4 -I common/m4")
55 AC_CONFIG_MACRO_DIR([m4])
56
57 dnl set up gettext
58 dnl the version check needs to stay here because autopoint greps for it
59 AM_GNU_GETTEXT_VERSION([0.17])
60 AM_GNU_GETTEXT([external])
61 AG_GST_GETTEXT([gstreamer-$GST_API_VERSION])
62
63 dnl *** check for arguments to configure ***
64
65 AG_GST_ARG_DEBUG
66 AG_GST_ARG_VALGRIND
67 AG_GST_ARG_GCOV
68 AG_GST_ARG_WITH_PACKAGE_NAME
69 AG_GST_ARG_WITH_PACKAGE_ORIGIN
70
71 AG_GST_PKG_CONFIG_PATH
72
73 dnl *** checks for platform ***
74
75 dnl * hardware/architecture *
76
77 dnl *** checks for programs ***
78
79 dnl find a compiler
80 AC_PROG_CC
81 AM_PROG_CC_C_O
82
83 AC_PATH_PROG(VALGRIND_PATH, valgrind, no)
84 AM_CONDITIONAL(HAVE_VALGRIND, test ! "x$VALGRIND_PATH" = "xno")
85
86 dnl check for gobject-introspection
87 GOBJECT_INTROSPECTION_CHECK([0.6.3])
88
89 dnl check for documentation tools
90 AG_GST_DOCBOOK_CHECK
91 GTK_DOC_CHECK([1.3])
92
93 dnl Check for Vala
94 AC_ARG_ENABLE([vala],
95   AC_HELP_STRING([--enable-vala],[enable Vala bindings (default=yes)]),
96   [case "${enableval}" in
97     yes) enable_vala=yes ;;
98     no)  enable_vala=no ;;
99     *) AC_MSG_ERROR(bad value ${enableval} for --enable-vala) ;;
100    esac
101   ],
102   [enable_vala=yes]) dnl Default value
103 AM_CONDITIONAL(WITH_VALA, [test "x$enable_vala" = "xyes"])
104
105 dnl *** checks for libraries ***
106
107 dnl *** checks for header files ***
108
109 dnl *** checks for types/defines ***
110
111 dnl *** checks for structures ***
112
113 dnl *** checks for compiler characteristics ***
114
115 dnl *** checks for library functions ***
116
117 dnl *** checks for dependancy libraries ***
118
119 dnl GLib is required (GStreamer is ok with GLib-2.8, but we want at least 2.10)
120 GLIB_REQ=2.10.0
121 AC_SUBST([GLIB_REQ])
122 AG_GST_GLIB_CHECK([$GLIB_REQ])
123
124 dnl checks for gstreamer
125 dnl uninstalled is selected preferentially -- see pkg-config(1)
126 AG_GST_CHECK_GST($GST_API_VERSION, [$GST_REQ], [yes])
127
128 GST_TOOLS_DIR=`$PKG_CONFIG --variable=toolsdir gstreamer-$GST_API_VERSION`
129 if test -z $GST_TOOLS_DIR; then
130   AC_MSG_ERROR([no tools dir defined in GStreamer pkg-config file; core upgrade needed.])
131 fi
132 AC_SUBST(GST_TOOLS_DIR)
133
134 GST_PLUGINS_DIR=`$PKG_CONFIG gstreamer-$GST_API_VERSION --variable pluginsdir`
135 AC_SUBST(GST_PLUGINS_DIR)
136 AC_MSG_NOTICE(Using GStreamer Core Plugins in $GST_PLUGINS_DIR)
137
138 AG_GST_CHECK_GST_BASE($GST_API_VERSION, [$GST_REQ], [yes])
139
140 AG_GST_CHECK_GST_PLUGINS_BASE($GST_API_VERSION, [$GSTPB_REQ], [yes])
141 GSTPB_PLUGINS_DIR=`$PKG_CONFIG gstreamer-plugins-base-$GST_API_VERSION --variable pluginsdir`
142 AC_SUBST(GSTPB_PLUGINS_DIR)
143 AC_MSG_NOTICE(Using GStreamer Base Plugins in $GSTPB_PLUGINS_DIR)
144
145 AG_GST_CHECK_GST_CHECK($GST_API_VERSION, [$GST_REQ], no)
146
147 dnl FIXME: get rid of this by making sure gstreamer-check brings it in
148 dnl check for "check", unit testing library/header
149 AM_PATH_CHECK(0.9.2, HAVE_CHECK=yes, HAVE_CHECK=no)
150 AM_CONDITIONAL(HAVE_CHECK, test "x$HAVE_CHECK" = "xyes")
151
152 dnl *** set variables based on configure arguments ***
153
154 dnl set license and copyright notice
155 GST_LICENSE="LGPL"
156 AC_DEFINE_UNQUOTED(GST_LICENSE, "$GST_LICENSE", [GStreamer license])
157 AC_SUBST(GST_LICENSE)
158
159 dnl set location of plugin directory
160 AG_GST_SET_PLUGINDIR
161
162 # set by AG_GST_PARSE_SUBSYSTEM_DISABLES above
163 dnl make sure it doesn't complain about unused variables if debugging is disabled
164 NO_WARNINGS=""
165 AG_GST_CHECK_GST_DEBUG_DISABLED([NO_WARNINGS="-Wno-unused"], [NO_WARNINGS=""])
166
167 dnl define an ERROR_CFLAGS Makefile variable
168 AG_GST_SET_ERROR_CFLAGS($GST_GIT, [$NO_WARNINGS])
169
170 dnl define correct level for debugging messages
171 AG_GST_SET_LEVEL_DEFAULT($GST_GIT)
172
173 dnl used in examples
174 AG_GST_DEFAULT_ELEMENTS
175
176 dnl *** finalize CFLAGS, LDFLAGS, LIBS
177
178 dnl Overview:
179 dnl GST_OPTION_CFLAGS:  common flags for profiling, debugging, errors, ...
180 dnl GST_*:              flags shared by built objects to link against GStreamer
181 dnl GST_ALL_LDFLAGS:    linker flags shared by all
182 dnl GST_LIB_LDFLAGS:    additional linker flags for all libaries
183 dnl GST_LT_LDFLAGS:     library versioning of our libraries
184 dnl GST_PLUGIN_LDFLAGS: flags to be used for all plugins
185
186 dnl GST_OPTION_CFLAGS
187 if test "x$USE_DEBUG" = xyes; then
188    PROFILE_CFLAGS="-g"
189 fi
190 AC_SUBST(PROFILE_CFLAGS)
191
192 DEPRECATED_CFLAGS="-DGST_DISABLE_DEPRECATED"
193 AC_SUBST(DEPRECATED_CFLAGS)
194
195 dnl every flag in GST_OPTION_CFLAGS can be overridden at make time
196 GST_OPTION_CFLAGS="\$(WARNING_CFLAGS) \$(ERROR_CFLAGS) \$(DEBUG_CFLAGS) \$(PROFILE_CFLAGS) \$(GCOV_CFLAGS) \$(OPT_CFLAGS) \$(DEPRECATED_CFLAGS)"
197 AC_SUBST(GST_OPTION_CFLAGS)
198
199 dnl FIXME: do we want to rename to GST_ALL_* ?
200 dnl prefer internal headers to already installed ones
201 dnl add GST_OPTION_CFLAGS, but overridable
202 GST_CFLAGS="$GST_CFLAGS -DGST_USE_UNSTABLE_API \$(GST_OPTION_CFLAGS)"
203 AC_SUBST(GST_CFLAGS)
204 AC_SUBST(GST_LIBS)
205
206 dnl GST_ALL_*
207 dnl vars common to for all internal objects (core libs, elements, applications)
208 dnl CFLAGS:
209 dnl - src and build dirs need to be added because every piece that gets built
210 dnl   will need the GStreamer source and generated headers
211 GST_ALL_CFLAGS="-I\$(top_srcdir) -I\$(top_builddir) $GST_PLUGINS_BASE_CFLAGS $GST_CFLAGS \$(GST_OPTION_CFLAGS)"
212 AC_SUBST([GST_ALL_CFLAGS])
213
214 dnl FIXME: check if LTLIBINTL is needed everywhere
215 dnl I presume it is given that it contains the symbols that _() stuff maps to
216 GST_ALL_LIBS="$GST_LIBS $LTLIBINTL \$(GCOV_LIBS)"
217 AC_SUBST([GST_ALL_LIBS])
218
219 dnl LDFLAGS really should only contain flags, not libs - they get added before
220 dnl whatevertarget_LIBS and -L flags here affect the rest of the linking
221 GST_ALL_LDFLAGS="-no-undefined"
222 AC_SUBST(GST_ALL_LDFLAGS)
223
224 dnl GST_LIB_LDFLAGS
225 dnl linker flags shared by all libraries
226 dnl LDFLAGS modifier defining exported symbols from built libraries
227 GST_LIB_LDFLAGS="-export-symbols-regex \^[_]?\(gst_\|Gst\|GST_\).*"
228 AC_SUBST(GST_LIB_LDFLAGS)
229
230 dnl GST_OBJ_*
231 dnl default vars for all internal objects built on libgstrtspserver
232 dnl includes GST_ALL_*
233 GST_OBJ_CFLAGS="\$(GST_ALL_CFLAGS)"
234 AC_SUBST([GST_OBJ_CFLAGS])
235 GST_OBJ_LIBS="\$(top_builddir)/gst/rtsp-server/libgstrtspserver-$GST_API_VERSION.la \$(GST_ALL_LIBS)"
236 AC_SUBST([GST_OBJ_LIBS])
237
238 dnl this really should only contain flags, not libs - they get added before
239 dnl whatevertarget_LIBS and -L flags here affect the rest of the linking
240
241 dnl *** output files ***
242
243 dnl keep this alphabetic per directory, please
244 AC_CONFIG_FILES([
245 Makefile
246 gst-rtsp.spec
247 common/Makefile
248 common/m4/Makefile
249 gst/Makefile
250 gst/rtsp-server/Makefile
251 examples/Makefile
252 tests/Makefile
253 bindings/Makefile
254 bindings/vala/Makefile
255 pkgconfig/Makefile
256 pkgconfig/gstreamer-rtsp-server.pc
257 pkgconfig/gstreamer-rtsp-server-uninstalled.pc
258 docs/Makefile
259 docs/version.entities
260 docs/libs/Makefile
261 ])
262 AC_OUTPUT
263
264 echo "
265
266 Configuration
267         Version                    : ${VERSION}
268         Source code location       : ${srcdir}
269         Prefix                     : ${prefix}
270         Compiler                   : ${CC}
271         Vala bindings              : ${enable_vala}
272
273 gst-rtsp-server configured. Type 'make' to build.
274 "