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