Added a signal which notifies when a required dparam is added.
[platform/upstream/gstreamer.git] / configure.ac
1 AC_INIT
2 AC_CANONICAL_TARGET([])
3
4 dnl when going to/from release please set the nano (fourth number) right !
5 AS_VERSION(gstreamer, GST_VERSION, 0, 3, 3, 1)
6 AM_INIT_AUTOMAKE($PACKAGE,$VERSION)
7 AS_LIBTOOL(GST, 0, 0, 0, yes)
8
9 AC_CONFIG_SRCDIR([gst/gst.c])
10 AM_CONFIG_HEADER(config.h)
11
12 dnl Add parameters for aclocal
13 dnl (This must come after AM_INIT_AUTOMAKE, since it modifies ACLOCAL)
14 ACLOCAL="$ACLOCAL -I common/m4 $ACLOCAL_FLAGS"
15
16 AM_MAINTAINER_MODE
17
18 AC_PROG_CC
19 AM_PROG_CC_STDC
20 AM_PROG_AS
21 AS="${CC}"
22 AC_PROG_CXX
23 AC_PROG_CXXCPP
24 AC_ISC_POSIX
25
26 dnl We disable static building for development, for time savings
27 dnl *NOTE*: dnl this line before release, so release does static too
28 dnl AM_DISABLE_STATIC
29
30 AC_HEADER_STDC([])
31
32
33 dnl ##############################
34 dnl # Do automated configuration #
35 dnl ##############################
36
37 dnl Check for tools:
38 dnl ================
39
40 dnl modify pkg-config path
41 AC_ARG_WITH(pkg-config-path, 
42    AC_HELP_STRING([--with-pkg-config-path],[colon-separated list of pkg-config(1) dirs]),
43    [export PKG_CONFIG_PATH=${withval}])
44
45 dnl Check for nasm
46 AC_PATH_PROG(NASM_PATH, nasm, no)
47 AC_SUBST(NASM_PATH)
48 if test x$NASM_PATH = xno; then
49   AC_MSG_WARN(Couldn't find nasm)
50   HAVE_NASM="no"
51 else AC_DEFINE(HAVE_NASM, 1, [Define if NASM, the netwide assembler, is available])
52   HAVE_NASM="yes"
53 fi
54
55 GST_DOC()
56 GST_ARCH()
57
58 dnl
59 dnl We should really use AC_SYS_LARGEFILE, but the problem is
60 dnl many of the plugins don't include "config.h".  To assure
61 dnl binary compatibility, it is necessary that all gstreamer
62 dnl code be compiled with the same sizeof(off_t), so we use
63 dnl the following crude hack.
64 dnl
65
66 dnl
67 dnl GST_CFLAGS are split up as GST_EXT_CFLAGS and GST_INT_CFLAGS
68 dnl same for libs
69 dnl this is so we can make GST_CFLAGS for external modules available
70 dnl without mixing in internal (uninstalled) CFLAGS
71 dnl
72
73 AC_MSG_CHECKING(for large file support)
74 AC_TRY_RUN([
75 #define _LARGEFILE_SOURCE
76 #define _FILE_OFFSET_BITS 64
77 #include <sys/types.h>
78 int main () { return !(sizeof(off_t) == 8); }
79 ],
80 [
81 AC_MSG_RESULT(yes)
82 GST_EXT_CFLAGS="-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"
83 ],
84 [
85 AC_MSG_RESULT(no)
86 ],
87 [
88 AC_MSG_RESULT(no)
89 ])
90
91 dnl Check for essential libraries first:
92 dnl ====================================
93
94 dnl === GLib 2 ===
95 dnl Minimum required version of GLib2
96 GLIB2_REQ="1.3.12"
97 AC_SUBST(GLIB2_REQ)
98
99 dnl Check for glib2
100 PKG_CHECK_MODULES(GLIB2, glib-2.0 >= $GLIB2_REQ gobject-2.0 gthread-2.0 gmodule-2.0,
101   HAVE_GLIB2=yes,HAVE_GLIB2=no)
102 GLIB_LIBS=$GLIB2_LIBS
103 GLIB_CFLAGS=$GLIB2_CFLAGS
104 AC_SUBST(GLIB_LIBS)
105 AC_SUBST(GLIB_CFLAGS)
106
107 if test "x$HAVE_GLIB2" = "xno"; then
108   AC_MSG_ERROR([GStreamer requires GLib 2.0 to compile.])
109 fi
110
111 GST_PKG_DEPS="glib-2.0, gobject-2.0, gmodule-2.0, gthread-2.0"
112 AC_SUBST(GST_PKG_DEPS)
113   
114 dnl === libxml 2 ===
115 dnl Minimum required version of libxml2
116 LIBXML2_REQ="2.4.0"
117 AC_SUBST(LIBXML2_REQ)
118
119 dnl check for libxml2
120 LIBXML_PKG=', libxml-2.0'
121 PKG_CHECK_MODULES(XML, libxml-2.0 >= $LIBXML2_REQ, HAVE_LIBXML2=yes, HAVE_LIBXML2=no)
122 if test "x$HAVE_LIBXML2" = "xyes"; then
123   AC_DEFINE(HAVE_LIBXML2, 1, [Define if libxml2 is available])
124 else
125   AC_MSG_ERROR([Need libxml2 for glib2 builds -- you should be able to do without it -- this needs fixing])
126 fi
127 AC_SUBST(LIBXML_PKG)
128 AC_SUBST(XML_LIBS)
129 AC_SUBST(XML_CFLAGS)
130
131 GST_CHECK_LIBHEADER(POPT, popt, poptStrippedArgv,, popt.h, POPT_LIBS="-lpopt",
132   AC_MSG_ERROR([popt 1.5 or newer is required to build gstreamer. You can
133 download the latest version from ftp://people.redhat.com/sopwith/popt/]))
134
135 dnl Check for atomic.h
136 dnl Note: use AC_CHECK_HEADER not AC_CHECK_HEADERS, because the latter
137 dnl defines the wrong default symbol as well (HAVE_ASM_ATOMIC_H)
138 AC_CHECK_HEADER(asm/atomic.h, HAVE_ATOMIC_H=yes, HAVE_ATOMIC_H=no)
139 dnl Do a compile to check that it has atomic_set (eg, linux 2.0 didn't)
140 if test x$HAVE_ATOMIC_H = xyes; then
141   AC_TRY_RUN([
142 #include "asm/atomic.h"
143 main() { atomic_t t; atomic_set(&t,0); atomic_inc(&t); atomic_add(1,&t);return 0;}
144   ],, [
145     # Not successful
146     if test x$HAVE_ATOMIC_H = xyes; then
147       AC_MSG_WARN(Atomic reference counting is out of date: doing without.)
148     fi
149     HAVE_ATOMIC_H=no
150   ], [
151     # Cross compiling
152     AC_MSG_RESULT(yes)
153     AC_MSG_WARN(Can't check properly for atomic reference counting.  Assuming OK.)
154   ])
155 fi
156
157 dnl ######################################################################
158 dnl # Check command line parameters, and set shell variables accordingly #
159 dnl ######################################################################
160
161 dnl FIXME: simplify all this down using a few m4 macros
162
163 AC_ARG_ENABLE(libmmx,
164 AC_HELP_STRING([--enable-libmmx][use libmmx, if available]),
165 [case "${enableval}" in
166   yes) USE_LIBMMX=$HAVE_LIBMMX ;;
167   no)  USE_LIBMMX=no ;;
168   *) AC_MSG_ERROR(bad value ${enableval} for --enable-libmmx) ;;
169 esac], 
170 [USE_LIBMMX=$HAVE_LIBMMX]) dnl Default value
171
172 AC_ARG_ENABLE(atomic,
173 AC_HELP_STRING([--enable-atomic][use atomic reference counting header]),
174 [case "${enableval}" in
175   yes) USE_ATOMIC_H=$HAVE_ATOMIC_H;;
176   noset) USE_ATOMIC_H=$HAVE_ATOMIC_H;;
177   no)  USE_ATOMIC_H=no;;
178   *) AC_MSG_ERROR(bad value ${enableval} for --enable-atomic) ;;
179 esac], 
180 [USE_ATOMIC_H=$HAVE_ATOMIC_H]) dnl Default value
181
182 AC_ARG_ENABLE(plugin-builddir,
183 AC_HELP_STRING([--enable-plugin-builddir][allow tests/demos to use non-installed plugins]),
184 [case "${enableval}" in
185   yes) PLUGINS_USE_BUILDDIR=yes ;;
186   no)  PLUGINS_USE_BUILDDIR=no ;;
187   *) AC_MSG_ERROR(bad value ${enableval} for --enable-plugin-builddir) ;;
188 esac], 
189 [PLUGINS_USE_BUILDDIR=no]) dnl Default value
190
191 GST_DEBUGINFO
192
193 AC_ARG_ENABLE(profiling,
194 AC_HELP_STRING([--enable-profiling][adds -pg to compiler commandline, for profiling]),
195 [case "${enableval}" in
196   yes) USE_PROFILING=yes ;;
197   no)  UES_PROFILING=no ;;
198   *) AC_MSG_ERROR(bad value ${enableval} for --enable-profiling) ;;
199 esac], 
200 [USE_PROFILING=no]) dnl Default value
201
202 dnl default to building registry in the source tree if we are enabling plugin build dir
203 if test "x$PLUGINS_USE_BUILDDIR" = "xyes"; then
204   GST_CONFIG_DIR=`pwd`
205 else
206   GST_CONFIG_DIR=/etc/gstreamer
207 fi
208 AC_ARG_WITH(configdir,
209 AC_HELP_STRING([--with-configdir][specify path to use for plugin and command completion registries]),
210 [case "${withval}" in
211   yes) AC_MSG_ERROR(bad value ${withval} for --with-configdir) ;;
212   no) AC_MSG_ERROR(bad value ${withval} for --with-configdir) ;;
213   *) GST_CONFIG_DIR="${withval}" ;;
214 esac], 
215 [:]) dnl Default value
216
217 AC_ARG_ENABLE(tests,
218 AC_HELP_STRING([--disable-tests][disable building test apps]),
219 [case "${enableval}" in
220   yes) BUILD_TESTS=yes ;;
221   no)  BUILD_TESTS=no ;;
222   *) AC_MSG_ERROR(bad value ${enableval} for --disable-tests) ;;
223 esac], 
224 [BUILD_TESTS=yes]) dnl Default value
225
226 AC_ARG_ENABLE(examples,
227 AC_HELP_STRING([--disable-examples][disable building examples]),
228 [case "${enableval}" in
229   yes) BUILD_EXAMPLES=yes ;;
230   no)  BUILD_EXAMPLES=no ;;
231   *) AC_MSG_ERROR(bad value ${enableval} for --disable-examples) ;;
232 esac], 
233 [BUILD_EXAMPLES=yes]) dnl Default value
234
235 dnl Next, check for the optional components:
236 dnl ========================================
237
238 translit(dnm, m, l) AM_CONDITIONAL(GST_DISABLE_LOADSAVE, true)
239 GST_SUBSYSTEM_DISABLE(LOADSAVE,[pipeline XML load/save])
240 translit(dnm, m, l) AM_CONDITIONAL(GST_DISABLE_TYPEFIND, true)
241 GST_SUBSYSTEM_DISABLE(TYPEFIND,[typefind plugin],)
242 translit(dnm, m, l) AM_CONDITIONAL(GST_DISABLE_AUTOPLUG, true)
243 GST_SUBSYSTEM_DISABLE(AUTOPLUG,[autoplugger subsystem])
244 translit(dnm, m, l) AM_CONDITIONAL(GST_DISABLE_PARSE, true)
245 GST_SUBSYSTEM_DISABLE(PARSE,[command-line parser])
246 translit(dnm, m, l) AM_CONDITIONAL(GST_DISABLE_TRACE, true)
247 GST_SUBSYSTEM_DISABLE(TRACE,[tracing subsystem])
248 translit(dnm, m, l) AM_CONDITIONAL(GST_DISABLE_REGISTRY, true)
249 GST_SUBSYSTEM_DISABLE(REGISTRY,[plugin registry])
250
251 GST_EXT_CFLAGS="$GST_EXT_CFLAGS $GST_SUBSYSTEM_DISABLE_DEFINES"
252
253 dnl ################################################
254 dnl # Set defines according to variables set above #
255 dnl ################################################
256
257
258 dnl These should be "USE_*" instead of "HAVE_*", but some packages expect
259 dnl HAVE_ and it is likely to be easier to stick with the old name
260 if test "x$USE_LIBMMX" = xyes; then
261   AC_DEFINE(HAVE_LIBMMX, 1, [Define if libmmx is available])
262 fi
263
264 if test "x$USE_ATOMIC_H" = xyes; then
265   AC_DEFINE(HAVE_ATOMIC_H, 1, [Define if atomic.h header file is available])
266 fi
267
268 if test "x$PLUGINS_USE_BUILDDIR" = xyes; then
269   AC_DEFINE(PLUGINS_USE_BUILDDIR, 1, [Define if plugins should be loaded from the build tree - only developers should use this])
270 fi
271
272 dnl if test "x$USE_DEBUG" = xyes; then
273 dnl   CFLAGS="$CFLAGS -g"
274 dnl fi
275
276 if test "x$USE_PROFILING" = xyes; then
277 dnl  CFLAGS="$CFLAGS -pg -fprofile-arcs"
278   FOMIT_FRAME_POINTER=""
279 else
280   FOMIT_FRAME_POINTER="-fomit-frame-pointer"
281 fi
282
283 dnl
284 dnl AC_SUBST(FOMIT_FRAME_POINTER)
285 dnl
286
287 dnl #############################
288 dnl # Set automake conditionals #
289 dnl #############################
290
291 dnl These should be "USE_*" instead of "HAVE_*", but some packages expect
292 dnl HAVE_ and it is likely to be easier to stick with the old name
293 AM_CONDITIONAL(HAVE_ATOMIC_H,       test "x$USE_ATOMIC_H" = "xyes")
294
295 AM_CONDITIONAL(EXPERIMENTAL,        test "$EXPERIMENTAL" = "$xyes")
296 AM_CONDITIONAL(BROKEN,              test "$BROKEN" = "$xyes")
297
298 AM_CONDITIONAL(HAVE_NASM,           test "x$HAVE_NASM" = "xyes")
299 AM_CONDITIONAL(BUILD_TESTS,         test "x$BUILD_TESTS" = "xyes")
300 AM_CONDITIONAL(BUILD_EXAMPLES,      test "x$BUILD_EXAMPLES" = "xyes")
301 AM_CONDITIONAL(PLUGINS_USE_BUILDDIR,  test "x$PLUGINS_USE_BUILDDIR" = "xyes")
302
303
304 dnl ############################
305 dnl # Set up some more defines #
306 dnl ############################
307
308 dnl Set location of configuration dir.
309 AC_DEFINE_UNQUOTED(GST_CONFIG_DIR, "$GST_CONFIG_DIR", [Define the configuration directory])
310 AC_SUBST(GST_CONFIG_DIR)
311
312 dnl Set location of plugin directory
313 if test "x${prefix}" = "xNONE"; then
314   PLUGINS_DIR=${ac_default_prefix}/lib/gst
315 else
316   PLUGINS_DIR=${prefix}/lib/gst
317 fi
318 AC_DEFINE_UNQUOTED(PLUGINS_DIR, "$PLUGINS_DIR", [Define the plugin directory])
319 AC_SUBST(PLUGINS_DIR)
320
321 dnl Set location of uninstalled plugin directory
322 PLUGINS_BUILDDIR=`pwd`
323 AC_DEFINE_UNQUOTED(PLUGINS_BUILDDIR, "$PLUGINS_BUILDDIR", [Define the uninstalled plugin directory])
324 AC_SUBST(PLUGINS_BUILDDIR)
325
326 dnl since glib and xml are package deps, there's no need to include their cflags
327 dnl in the pkg-config file
328
329 dnl for pkg-config
330 GST_PKG_CFLAGS=$GST_EXT_CFLAGS
331 GST_PKG_LIBS=$GST_EXT_LIBS
332 AC_SUBST(GST_PKG_CFLAGS)
333 AC_SUBST(GST_PKG_LIBS)
334
335 dnl finalize _CFLAGS and _LIBS
336 dnl add GLIB and XML if necessary to EXT_*
337 GST_CFLAGS="$GST_EXT_CFLAGS $XML_CFLAGS $GLIB_CFLAGS"
338 GST_LIBS="$GST_EXT_LIBS $XML_LIBS $GLIB_LIBS -lpopt"
339
340 dnl Private vars for libgst only
341 LIBGST_LIBS="$GST_LIBS"
342 LIBGST_CFLAGS="$GST_CFLAGS -I\$(top_srcdir) -Wall"
343 AC_SUBST(LIBGST_LIBS)
344 AC_SUBST(LIBGST_CFLAGS)
345
346 dnl Vars for everyone else
347 GST_INT_LIBS="\$(top_builddir)/gst/libgstreamer.la"
348 GST_INT_CFLAGS="-I\$(top_srcdir)/libs -I\$(top_srcdir)/include"
349
350 AC_SUBST(GST_CFLAGS, "$LIBGST_CFLAGS $GST_INT_CFLAGS")
351 AC_SUBST(GST_LIBS, "$LIBGST_LIBS $GST_INT_LIBS")
352
353 GST_PLUGIN_LDFLAGS='-module -avoid-version'
354 AC_SUBST(GST_PLUGIN_LDFLAGS)
355
356 AC_CONFIG_SUBDIRS(libs/ext/cothreads)
357
358 dnl ##################################################
359 dnl # Prepare informative messages to display at end #
360 dnl ##################################################
361
362 infomessages=
363
364 if test "x$PLUGINS_USE_BUILDDIR" = xyes; then
365   infomessages="$infomessages
366 *** Warning: You have configured using the --enable-plugin-builddir option.
367
368 This option is for development purposes only: binaries built with
369 it should be used with code in the build tree only.  To build an
370 installable version, use ./configure without the --enable-plugin-builddir
371 option.  Note that the autogen.sh script supplies the plugin builddir
372 option automatically -- run ./autogen.sh --disable-plugin-buildddir to make
373 an installable build.
374
375 "
376 fi
377
378 dnl #########################
379 dnl # Make the output files #
380 dnl #########################
381
382 dnl libs/ext/Makefile
383 AC_OUTPUT(
384 Makefile
385 include/Makefile
386 gst/Makefile
387 gst/gstversion.h
388 gst/autoplug/Makefile
389 gst/elements/Makefile
390 gst/parse/Makefile
391 gst/schedulers/Makefile
392 gst/types/Makefile
393 libs/Makefile
394 libs/gst/Makefile
395 libs/gst/bytestream/Makefile
396 libs/gst/getbits/Makefile
397 libs/gst/putbits/Makefile
398 libs/gst/control/Makefile
399 libs/ext/Makefile
400 tests/Makefile
401 tests/bufspeed/Makefile
402 tests/memchunk/Makefile
403 tests/muxing/Makefile
404 tests/sched/Makefile
405 testsuite/Makefile
406 testsuite/bytestream/Makefile
407 testsuite/caps/Makefile
408 testsuite/cleanup/Makefile
409 testsuite/elements/Makefile
410 testsuite/plugin/Makefile
411 testsuite/dynparams/Makefile
412 examples/Makefile
413 examples/autoplug/Makefile
414 examples/helloworld/Makefile
415 examples/helloworld2/Makefile
416 examples/launch/Makefile
417 examples/queue/Makefile
418 examples/queue2/Makefile
419 examples/queue3/Makefile
420 examples/queue4/Makefile
421 examples/thread/Makefile
422 examples/mixer/Makefile
423 examples/cutter/Makefile
424 examples/launch/Makefile
425 examples/xml/Makefile
426 examples/plugins/Makefile
427 examples/typefind/Makefile
428 examples/mixer/Makefile
429 tools/Makefile
430 docs/Makefile
431 docs/gst/Makefile
432 docs/gst/gstreamer.types
433 docs/libs/Makefile
434 docs/plugins/Makefile
435 docs/plugins/gstreamer-plugins.types
436 docs/manual/Makefile
437 docs/fwg/Makefile
438 docs/xsl/Makefile
439 docs/devhelp/Makefile
440 stamp.h
441 gstreamer.pc
442 gstreamer-uninstalled.pc
443 gstreamer.spec,
444 echo "$infomessages", infomessages="$infomessages"
445 )