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