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