release 0.10.7
[platform/upstream/gstreamer.git] / configure.ac
1 AC_PREREQ(2.60)
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.10.7,
6     http://gstreamer.net/,
7     gst-rtsp)
8
9 dnl initialize automake
10 AM_INIT_AUTOMAKE([-Wno-portability 1.10])
11
12 dnl define PACKAGE_VERSION_* variables
13 AS_VERSION
14
15 dnl check if this is a release version
16 AS_NANO(GST_CVS="no", GST_CVS="yes")
17
18 dnl can autoconf find the source ?
19 AC_CONFIG_SRCDIR([gst/rtsp-server/rtsp-server.c])
20
21 dnl define the output header for config
22 AM_CONFIG_HEADER([config.h])
23
24 dnl AM_MAINTAINER_MODE only provides the option to configure to enable it
25 AM_MAINTAINER_MODE
26
27 dnl sets host_* variables
28 AC_CANONICAL_HOST
29
30 dnl use pretty build output with automake >= 1.11
31 m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])],
32   [AM_DEFAULT_VERBOSITY=1
33    AC_SUBST(AM_DEFAULT_VERBOSITY)])
34
35 dnl our libraries and install dirs use major.minor as a version
36 GST_MAJORMINOR=$PACKAGE_VERSION_MAJOR.$PACKAGE_VERSION_MINOR
37 dnl we override it here if we need to for the release candidate of new series
38 GST_MAJORMINOR=0.10
39 AC_SUBST(GST_MAJORMINOR)
40
41 AM_PROG_LIBTOOL
42
43 dnl *** required versions of GStreamer stuff ***
44 GST_REQ=0.10.29
45 GSTPB_REQ=0.10.29
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 gobject-introspection
81 GOBJECT_INTROSPECTION_CHECK([0.6.3])
82
83 dnl check for documentation tools
84 AG_GST_DOCBOOK_CHECK
85 GTK_DOC_CHECK([1.3])
86
87 AC_SUBST(PYGOBJECT_REQ, 2.11.2)
88
89 dnl check for pygobject (optional, used in the bindings)
90 PKG_CHECK_MODULES(PYGOBJECT, pygobject-2.0 >= $PYGOBJECT_REQ,
91   [
92     HAVE_PYGOBJECT="yes"
93   ],
94   [
95     HAVE_PYGOBJECT="no"
96   ])
97 AC_SUBST(PYGOBJECT_CFLAGS)
98
99 dnl check for gst-python
100 PKG_CHECK_MODULES(PYGST, gst-python-0.10,
101   [
102     HAVE_PYGST="yes"
103   ],
104   [
105     HAVE_PYGST="no"
106   ])
107
108 if test "x$HAVE_PYGST" = "xyes"; then
109   PYGST_DEFSDIR=`pkg-config gst-python-0.10 --variable=defsdir`
110 fi
111 AC_SUBST(PYGST_DEFSDIR, $PYGST_DEFSDIR)
112
113 if test "x$HAVE_PYTHON_HEADERS" = "xyes" -a \
114     "x$HAVE_PYGOBJECT" = "xyes" -a \
115     "x$HAVE_PYGST" = "xyes"; then
116   HAVE_PYTHON_BINDINGS="yes"
117 else
118   HAVE_PYTHON_BINDINGS="no"
119 fi
120
121 AM_CONDITIONAL(WITH_PYTHON, [test "x$HAVE_PYTHON_BINDINGS" = "xyes"])
122
123 dnl Check for Vala
124 AC_ARG_ENABLE([vala],
125   AC_HELP_STRING([--enable-vala],[enable Vala bindings (default=yes)]),
126   [case "${enableval}" in
127     yes) enable_vala=yes ;;
128     no)  enable_vala=no ;;
129     *) AC_MSG_ERROR(bad value ${enableval} for --enable-vala) ;;
130    esac
131   ],
132   [enable_vala=yes]) dnl Default value
133 AM_CONDITIONAL(WITH_VALA, [test "x$enable_vala" = "xyes"])
134
135 dnl *** checks for libraries ***
136
137 dnl *** checks for header files ***
138
139 dnl *** checks for types/defines ***
140
141 dnl *** checks for structures ***
142
143 dnl *** checks for compiler characteristics ***
144
145 dnl *** checks for library functions ***
146
147 dnl *** checks for dependancy libraries ***
148
149 dnl GLib is required (GStreamer is ok with GLib-2.8, but we want at least 2.10)
150 GLIB_REQ=2.10.0
151 AC_SUBST([GLIB_REQ])
152 AG_GST_GLIB_CHECK([$GLIB_REQ])
153
154 dnl checks for gstreamer
155 dnl uninstalled is selected preferentially -- see pkg-config(1)
156 AG_GST_CHECK_GST($GST_MAJORMINOR, [$GST_REQ], [yes])
157
158 GST_TOOLS_DIR=`$PKG_CONFIG --variable=toolsdir gstreamer-$GST_MAJORMINOR`
159 if test -z $GST_TOOLS_DIR; then
160   AC_MSG_ERROR([no tools dir defined in GStreamer pkg-config file; core upgrade needed.])
161 fi
162 AC_SUBST(GST_TOOLS_DIR)
163
164 GST_PLUGINS_DIR=`$PKG_CONFIG gstreamer-$GST_MAJORMINOR --variable pluginsdir`
165 AC_SUBST(GST_PLUGINS_DIR)
166 AC_MSG_NOTICE(Using GStreamer Core Plugins in $GST_PLUGINS_DIR)
167
168 AG_GST_CHECK_GST_BASE($GST_MAJORMINOR, [$GST_REQ], [yes])
169
170 AG_GST_CHECK_GST_PLUGINS_BASE($GST_MAJORMINOR, [$GSTPB_REQ], [yes])
171 GSTPB_PLUGINS_DIR=`$PKG_CONFIG gstreamer-plugins-base-$GST_MAJORMINOR --variable pluginsdir`
172 AC_SUBST(GSTPB_PLUGINS_DIR)
173 AC_MSG_NOTICE(Using GStreamer Base Plugins in $GSTPB_PLUGINS_DIR)
174
175 AG_GST_CHECK_GST_CHECK($GST_MAJORMINOR, [$GST_REQ], no)
176
177 dnl FIXME: get rid of this by making sure gstreamer-check brings it in
178 dnl check for "check", unit testing library/header
179 AM_PATH_CHECK(0.9.2, HAVE_CHECK=yes, HAVE_CHECK=no)
180 AM_CONDITIONAL(HAVE_CHECK, test "x$HAVE_CHECK" = "xyes")
181
182 dnl *** set variables based on configure arguments ***
183
184 dnl set license and copyright notice
185 GST_LICENSE="LGPL"
186 AC_DEFINE_UNQUOTED(GST_LICENSE, "$GST_LICENSE", [GStreamer license])
187 AC_SUBST(GST_LICENSE)
188
189 dnl set location of plugin directory
190 AG_GST_SET_PLUGINDIR
191
192 dnl define an ERROR_CFLAGS Makefile variable
193 AG_GST_SET_ERROR_CFLAGS($GST_CVS)
194
195 dnl define correct level for debugging messages
196 AG_GST_SET_LEVEL_DEFAULT($GST_CVS)
197
198 dnl used in examples
199 AG_GST_DEFAULT_ELEMENTS
200
201 dnl *** finalize CFLAGS, LDFLAGS, LIBS
202
203 dnl Overview:
204 dnl GST_OPTION_CFLAGS:  common flags for profiling, debugging, errors, ...
205 dnl GST_*:              flags shared by built objects to link against GStreamer
206 dnl GST_ALL_LDFLAGS:    linker flags shared by all
207 dnl GST_LIB_LDFLAGS:    additional linker flags for all libaries
208 dnl GST_LT_LDFLAGS:     library versioning of our libraries
209 dnl GST_PLUGIN_LDFLAGS: flags to be used for all plugins
210
211 dnl GST_OPTION_CFLAGS
212 if test "x$USE_DEBUG" = xyes; then
213    PROFILE_CFLAGS="-g"
214 fi
215 AC_SUBST(PROFILE_CFLAGS)
216
217 DEPRECATED_CFLAGS="-DGST_DISABLE_DEPRECATED"
218 AC_SUBST(DEPRECATED_CFLAGS)
219
220 dnl every flag in GST_OPTION_CFLAGS can be overridden at make time
221 GST_OPTION_CFLAGS="\$(ERROR_CFLAGS) \$(DEBUG_CFLAGS) \$(PROFILE_CFLAGS) \$(GCOV_CFLAGS) \$(OPT_CFLAGS) \$(DEPRECATED_CFLAGS)"
222 AC_SUBST(GST_OPTION_CFLAGS)
223
224 dnl FIXME: do we want to rename to GST_ALL_* ?
225 dnl prefer internal headers to already installed ones
226 dnl add GST_OPTION_CFLAGS, but overridable
227 GST_CFLAGS="$GST_CFLAGS \$(GST_OPTION_CFLAGS)"
228 AC_SUBST(GST_CFLAGS)
229 AC_SUBST(GST_LIBS)
230
231 dnl GST_ALL_*
232 dnl vars common to for all internal objects (core libs, elements, applications)
233 dnl CFLAGS:
234 dnl - src and build dirs need to be added because every piece that gets built
235 dnl   will need the GStreamer source and generated headers
236 GST_ALL_CFLAGS="-I\$(top_srcdir) -I\$(top_builddir) $GST_CFLAGS \$(GST_OPTION_CFLAGS)"
237 AC_SUBST([GST_ALL_CFLAGS])
238
239 dnl FIXME: check if LTLIBINTL is needed everywhere
240 dnl I presume it is given that it contains the symbols that _() stuff maps to
241 GST_ALL_LIBS="$GST_LIBS $LTLIBINTL \$(GCOV_LIBS)"
242 AC_SUBST([GST_ALL_LIBS])
243
244 dnl LDFLAGS really should only contain flags, not libs - they get added before
245 dnl whatevertarget_LIBS and -L flags here affect the rest of the linking
246 GST_ALL_LDFLAGS="-no-undefined"
247 AC_SUBST(GST_ALL_LDFLAGS)
248
249 dnl GST_OBJ_*
250 dnl default vars for all internal objects built on libgstphonon
251 dnl includes GST_ALL_*
252 GST_OBJ_CFLAGS="\$(GST_ALL_CFLAGS)"
253 AC_SUBST([GST_OBJ_CFLAGS])
254 GST_OBJ_LIBS="\$(top_builddir)/gst-phonon/libgstphonon.la \$(GST_ALL_LIBS)"
255 AC_SUBST([GST_OBJ_LIBS])
256
257 dnl this really should only contain flags, not libs - they get added before
258 dnl whatevertarget_LIBS and -L flags here affect the rest of the linking
259
260 dnl *** output files ***
261
262 dnl keep this alphabetic per directory, please
263 AC_CONFIG_FILES([
264 Makefile
265 gst-rtsp.spec
266 common/Makefile
267 common/m4/Makefile
268 m4/Makefile
269 gst/Makefile
270 gst/rtsp-server/Makefile
271 examples/Makefile
272 bindings/Makefile
273 bindings/python/Makefile
274 bindings/python/codegen/Makefile
275 bindings/vala/Makefile
276 pkgconfig/Makefile
277 pkgconfig/gst-rtsp-server.pc
278 pkgconfig/gst-rtsp-server-uninstalled.pc
279 ])
280 AC_OUTPUT
281
282 echo "
283
284 Configuration
285         Version                    : ${VERSION}
286         Source code location       : ${srcdir}
287         Prefix                     : ${prefix}
288         Compiler                   : ${CC}
289         Vala bindings              : ${enable_vala}
290         Python bindings:           : ${HAVE_PYTHON_BINDINGS}
291
292 Gst-rtsp-server configured. Type 'make' to build.
293 "