configure: bump required versions
[platform/upstream/gstreamer.git] / configure.ac
1 AC_PREREQ(2.52)
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(Gst-RTSP, 0.10.4.1,
7     http://gstreamer.net/,
8     gst-rtsp)
9
10 dnl initialize automake
11 AM_INIT_AUTOMAKE
12
13 dnl define PACKAGE_VERSION_* variables
14 AS_VERSION
15
16 dnl check if this is a release version
17 AS_NANO(GST_CVS="no", GST_CVS="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
27
28 dnl sets host_* variables
29 AC_CANONICAL_HOST
30
31 dnl our libraries and install dirs use major.minor as a version
32 GST_MAJORMINOR=$PACKAGE_VERSION_MAJOR.$PACKAGE_VERSION_MINOR
33 dnl we override it here if we need to for the release candidate of new series
34 GST_MAJORMINOR=0.10
35 AC_SUBST(GST_MAJORMINOR)
36
37 AM_PROG_LIBTOOL
38
39 dnl *** required versions of GStreamer stuff ***
40 GST_REQ=0.10.25
41 GSTPB_REQ=0.10.25
42
43 dnl export for .pc files
44 AC_SUBST([GST_REQ])
45 AC_SUBST([GSTPB_REQ])
46
47 dnl *** autotools stuff ****
48
49 dnl allow for different autotools
50 AS_AUTOTOOLS_ALTERNATE
51
52 dnl Add parameters for aclocal
53 AC_SUBST(ACLOCAL_AMFLAGS, "-I m4 -I common/m4")
54
55 dnl *** check for arguments to configure ***
56
57 AG_GST_ARG_DEBUG
58 AG_GST_ARG_VALGRIND
59 AG_GST_ARG_GCOV
60 AG_GST_ARG_WITH_PACKAGE_NAME
61 AG_GST_ARG_WITH_PACKAGE_ORIGIN
62
63 dnl *** checks for platform ***
64
65 dnl * hardware/architecture *
66
67 dnl *** checks for programs ***
68
69 dnl find a compiler
70 AC_PROG_CC
71 AM_PROG_CC_C_O
72
73 dnl check for python
74 AM_PATH_PYTHON(2.3)
75 AM_CHECK_PYTHON_HEADERS([HAVE_PYTHON_HEADERS="yes"], [HAVE_PYTHON_HEADERS="no"])
76
77 AC_PATH_PROG(VALGRIND_PATH, valgrind, no)
78 AM_CONDITIONAL(HAVE_VALGRIND, test ! "x$VALGRIND_PATH" = "xno")
79
80 dnl check for documentation tools
81 AG_GST_DOCBOOK_CHECK
82 GTK_DOC_CHECK([1.3])
83
84 AC_SUBST(PYGOBJECT_REQ, 2.11.2)
85
86 dnl check for pygobject (optional, used in the bindings)
87 PKG_CHECK_MODULES(PYGOBJECT, pygobject-2.0 >= $PYGOBJECT_REQ,
88   [
89     HAVE_PYGOBJECT="yes"
90   ],
91   [
92     HAVE_PYGOBJECT="no"
93   ])
94 AC_SUBST(PYGOBJECT_CFLAGS)
95
96 dnl check for gst-python
97 PKG_CHECK_MODULES(PYGST, gst-python-0.10,
98   [
99     HAVE_PYGST="yes"
100   ],
101   [
102     HAVE_PYGST="no"
103   ])
104
105 if test "x$HAVE_PYGST" = "xyes"; then
106   PYGST_DEFSDIR=`pkg-config gst-python-0.10 --variable=defsdir`
107 fi
108 AC_SUBST(PYGST_DEFSDIR, $PYGST_DEFSDIR)
109
110 if test "x$HAVE_PYTHON_HEADERS" = "xyes" -a \
111     "x$HAVE_PYGOBJECT" = "xyes" -a \
112     "x$HAVE_PYGST" = "xyes"; then
113   HAVE_PYTHON_BINDINGS="yes"
114 else
115   HAVE_PYTHON_BINDINGS="no"
116 fi
117
118 AM_CONDITIONAL(WITH_PYTHON, [test "x$HAVE_PYTHON_BINDINGS" = "xyes"])
119
120 dnl Check for vala
121 PKG_CHECK_EXISTS([vala-1.0], [HAVE_VALA="yes"], [HAVE_VALA="no"])
122
123 AM_CONDITIONAL(WITH_VALA, [test "x$HAVE_VALA" = "xyes"])
124
125 AC_ARG_WITH([vapidir],
126   AS_HELP_STRING([--with-vapidir], [Define where to install the VAPI files]))
127         
128 if test "x$HAVE_VALA" = "xyes"; then
129   if test "x$with_vapidir" = "x"; then
130         VAPIDIR="`pkg-config --variable vapidir vala-1.0`" 
131   else
132     VAPIDIR="$with_vapidir"
133   fi
134 fi
135 AC_SUBST(VAPIDIR)
136         
137 dnl *** checks for libraries ***
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 (GStreamer is ok with GLib-2.8, but we want at least 2.10)
152 GLIB_REQ=2.10.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_MAJORMINOR, [$GST_REQ])
159
160 GST_TOOLS_DIR=`$PKG_CONFIG --variable=toolsdir gstreamer-$GST_MAJORMINOR`
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_MAJORMINOR --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_MAJORMINOR, [$GST_REQ])
171
172 AG_GST_CHECK_GST_PLUGINS_BASE($GST_MAJORMINOR, [$GSTPB_REQ])
173 GSTPB_PLUGINS_DIR=`$PKG_CONFIG gstreamer-plugins-base-$GST_MAJORMINOR --variable pluginsdir`
174 AC_SUBST(GSTPB_PLUGINS_DIR)
175 AC_MSG_NOTICE(Using GStreamer Base Plugins in $GSTPB_PLUGINS_DIR)
176
177 AG_GST_CHECK_GST_CHECK($GST_MAJORMINOR, [$GST_REQ], no)
178
179 dnl FIXME: get rid of this by making sure gstreamer-check brings it in
180 dnl check for "check", unit testing library/header
181 AM_PATH_CHECK(0.9.2, HAVE_CHECK=yes, HAVE_CHECK=no)
182 AM_CONDITIONAL(HAVE_CHECK, test "x$HAVE_CHECK" = "xyes")
183
184 dnl *** set variables based on configure arguments ***
185
186 dnl set license and copyright notice
187 GST_LICENSE="LGPL"
188 AC_DEFINE_UNQUOTED(GST_LICENSE, "$GST_LICENSE", [GStreamer license])
189 AC_SUBST(GST_LICENSE)
190
191 dnl set location of plugin directory
192 AG_GST_SET_PLUGINDIR
193
194 dnl define an ERROR_CFLAGS Makefile variable
195 AG_GST_SET_ERROR_CFLAGS($GST_CVS)
196
197 dnl define correct level for debugging messages
198 AG_GST_SET_LEVEL_DEFAULT($GST_CVS)
199
200 dnl used in examples
201 AG_GST_DEFAULT_ELEMENTS
202
203 dnl *** finalize CFLAGS, LDFLAGS, LIBS
204
205 dnl Overview:
206 dnl GST_OPTION_CFLAGS:  common flags for profiling, debugging, errors, ...
207 dnl GST_*:              flags shared by built objects to link against GStreamer
208 dnl GST_ALL_LDFLAGS:    linker flags shared by all
209 dnl GST_LIB_LDFLAGS:    additional linker flags for all libaries
210 dnl GST_LT_LDFLAGS:     library versioning of our libraries
211 dnl GST_PLUGIN_LDFLAGS: flags to be used for all plugins
212
213 dnl GST_OPTION_CFLAGS
214 if test "x$USE_DEBUG" = xyes; then
215    PROFILE_CFLAGS="-g"
216 fi
217 AC_SUBST(PROFILE_CFLAGS)
218
219 DEPRECATED_CFLAGS="-DGST_DISABLE_DEPRECATED"
220 AC_SUBST(DEPRECATED_CFLAGS)
221
222 dnl every flag in GST_OPTION_CFLAGS can be overridden at make time
223 GST_OPTION_CFLAGS="\$(ERROR_CFLAGS) \$(DEBUG_CFLAGS) \$(PROFILE_CFLAGS) \$(GCOV_CFLAGS) \$(OPT_CFLAGS) \$(DEPRECATED_CFLAGS)"
224 AC_SUBST(GST_OPTION_CFLAGS)
225
226 dnl FIXME: do we want to rename to GST_ALL_* ?
227 dnl prefer internal headers to already installed ones
228 dnl add GST_OPTION_CFLAGS, but overridable
229 GST_CFLAGS="$GST_CFLAGS \$(GST_OPTION_CFLAGS)"
230 AC_SUBST(GST_CFLAGS)
231 AC_SUBST(GST_LIBS)
232
233 dnl GST_ALL_*
234 dnl vars common to for all internal objects (core libs, elements, applications)
235 dnl CFLAGS:
236 dnl - src and build dirs need to be added because every piece that gets built
237 dnl   will need the GStreamer source and generated headers
238 GST_ALL_CFLAGS="-I\$(top_srcdir) -I\$(top_builddir) $GST_CFLAGS \$(GST_OPTION_CFLAGS)"
239 AC_SUBST([GST_ALL_CFLAGS])
240
241 dnl FIXME: check if LTLIBINTL is needed everywhere
242 dnl I presume it is given that it contains the symbols that _() stuff maps to
243 GST_ALL_LIBS="$GST_LIBS $LTLIBINTL \$(GCOV_LIBS)"
244 AC_SUBST([GST_ALL_LIBS])
245
246 dnl LDFLAGS really should only contain flags, not libs - they get added before
247 dnl whatevertarget_LIBS and -L flags here affect the rest of the linking
248 GST_ALL_LDFLAGS="-no-undefined"
249 AC_SUBST(GST_ALL_LDFLAGS)
250
251 dnl GST_OBJ_*
252 dnl default vars for all internal objects built on libgstphonon
253 dnl includes GST_ALL_*
254 GST_OBJ_CFLAGS="\$(GST_ALL_CFLAGS)"
255 AC_SUBST([GST_OBJ_CFLAGS])
256 GST_OBJ_LIBS="\$(top_builddir)/gst-phonon/libgstphonon.la \$(GST_ALL_LIBS)"
257 AC_SUBST([GST_OBJ_LIBS])
258
259 dnl this really should only contain flags, not libs - they get added before
260 dnl whatevertarget_LIBS and -L flags here affect the rest of the linking
261
262 dnl *** output files ***
263
264 dnl keep this alphabetic per directory, please
265 AC_CONFIG_FILES([
266 Makefile
267 gst-rtsp.spec
268 common/Makefile
269 common/m4/Makefile
270 m4/Makefile
271 gst/Makefile
272 gst/rtsp-server/Makefile
273 examples/Makefile
274 bindings/Makefile
275 bindings/python/Makefile
276 bindings/python/codegen/Makefile
277 bindings/vala/Makefile
278 pkgconfig/Makefile
279 pkgconfig/gst-rtsp-server.pc
280 pkgconfig/gst-rtsp-server-uninstalled.pc
281 ])
282 AC_OUTPUT
283
284 echo "
285
286 Configuration
287         Version                    : ${VERSION}
288         Source code location       : ${srcdir}
289         Prefix                     : ${prefix}
290         Compiler                   : ${CC}
291         Vala bindings              : ${HAVE_VALA}
292         Python bindings:           : ${HAVE_PYTHON_BINDINGS}
293
294 Gst-rtsp-server configured. Type 'make' to build.
295 "