1 AC_PREREQ(2.52)
3 dnl please read gstreamer/docs/random/autotools before changing this file
5 dnl initialize autoconf
6 dnl releases only do -Wall, cvs and prerelease does -Werror too
7 dnl use a three digit version number for releases, and four for cvs/prerelease
8 AC_INIT(GStreamer Ugly Plug-ins, 0.10.12.1,
9 http://bugzilla.gnome.org/enter_bug.cgi?product=GStreamer,
10 gst-plugins-ugly)
12 AG_GST_INIT
14 dnl initialize automake
15 AM_INIT_AUTOMAKE([-Wno-portability])
17 dnl define PACKAGE_VERSION_* variables
18 AS_VERSION
20 dnl check if this is a release version
21 AS_NANO(GST_CVS="no", GST_CVS="yes")
23 dnl can autoconf find the source ?
24 AC_CONFIG_SRCDIR([ext/mad/gstmad.c])
26 dnl define the output header for config
27 AM_CONFIG_HEADER(config.h)
29 dnl AM_MAINTAINER_MODE only provides the option to configure to enable it
30 AM_MAINTAINER_MODE
32 dnl sets host_* variables
33 AC_CANONICAL_HOST
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)
41 dnl FIXME: this macro doesn't actually work;
42 dnl the generated libtool script has no support for the listed tags.
43 dnl So this needs to be fixed first if we want to use this
44 dnl AS_LIBTOOL_TAGS([CXX])
46 AC_LIBTOOL_WIN32_DLL
47 AM_PROG_LIBTOOL
49 dnl *** required versions of GStreamer stuff ***
50 GST_REQ=0.10.24
51 GSTPB_REQ=0.10.24
53 dnl *** autotools stuff ****
55 dnl allow for different autotools
56 AS_AUTOTOOLS_ALTERNATE
58 dnl Add parameters for aclocal
59 AC_SUBST(ACLOCAL_AMFLAGS, "-I m4 -I common/m4")
61 dnl set up gettext
62 dnl the version check needs to stay here because autopoint greps for it
63 AM_GNU_GETTEXT_VERSION(0.17)
64 AM_GNU_GETTEXT([external])
65 AG_GST_GETTEXT([gst-plugins-ugly-$GST_MAJORMINOR])
67 dnl *** check for arguments to configure ***
69 AG_GST_ARG_DEBUG
70 AG_GST_ARG_PROFILING
71 AG_GST_ARG_VALGRIND
72 AG_GST_ARG_GCOV
74 AG_GST_ARG_EXAMPLES
76 AG_GST_ARG_WITH_PKG_CONFIG_PATH
77 AG_GST_ARG_WITH_PACKAGE_NAME
78 AG_GST_ARG_WITH_PACKAGE_ORIGIN
80 AG_GST_ARG_WITH_PLUGINS
82 AG_GST_ARG_ENABLE_EXTERNAL
84 AG_GST_ARG_ENABLE_EXPERIMENTAL
86 dnl *** checks for platform ***
88 dnl * hardware/architecture *
90 dnl common/m4/gst-arch.m4
91 dnl check CPU type
92 AG_GST_ARCH
94 dnl Determine endianness
95 AC_C_BIGENDIAN
97 dnl *** checks for programs ***
99 dnl find a compiler
100 AC_PROG_CC
102 dnl determine c++ compiler
103 AC_PROG_CXX
104 dnl determine if c++ is available on this system
105 AC_CHECK_PROG(HAVE_CXX, $CXX, yes, no)
107 dnl check if the compiler supports '-c' and '-o' options
108 AM_PROG_CC_C_O
110 AC_PATH_PROG(VALGRIND_PATH, valgrind, no)
111 AM_CONDITIONAL(HAVE_VALGRIND, test ! "x$VALGRIND_PATH" = "xno")
113 dnl check if the compiler supports do while(0) macros
114 AG_GST_CHECK_DOWHILE_MACROS
116 dnl check for documentation tools
117 GTK_DOC_CHECK([1.3])
118 AS_PATH_PYTHON([2.1])
119 AG_GST_PLUGIN_DOCS([1.3],[2.1])
121 dnl *** checks for libraries ***
123 dnl check for libm, for sin()
124 AC_CHECK_LIBM
125 AC_SUBST(LIBM)
127 dnl *** checks for header files ***
129 dnl used by ext/a52dec
130 AX_CREATE_STDINT_H
132 dnl Check for malloc.h
133 AC_CHECK_HEADERS([malloc.h])
135 dnl *** checks for types/defines ***
137 dnl *** checks for structures ***
139 dnl *** checks for compiler characteristics ***
141 dnl *** checks for library functions ***
143 dnl Check for a way to display the function name in debug output
144 AG_GST_CHECK_FUNCTION
146 dnl *** checks for dependency libraries ***
148 dnl GLib is required
149 AG_GST_GLIB_CHECK([2.12])
151 dnl liboil is required
152 PKG_CHECK_MODULES(LIBOIL, liboil-0.3 >= 0.3.8, HAVE_LIBOIL=yes, HAVE_LIBOIL=no)
153 if test "x$HAVE_LIBOIL" != "xyes"; then
154 AC_ERROR([liboil-0.3.8 or later is required])
155 fi
157 dnl checks for gstreamer
158 dnl uninstalled is selected preferentially -- see pkg-config(1)
159 AG_GST_CHECK_GST($GST_MAJORMINOR, [$GST_REQ], yes)
160 AG_GST_CHECK_GST_BASE($GST_MAJORMINOR, [$GST_REQ], yes)
161 AG_GST_CHECK_GST_CHECK($GST_MAJORMINOR, [$GST_REQ], no)
162 AG_GST_CHECK_GST_PLUGINS_BASE($GST_MAJORMINOR, [$GSTPB_REQ], yes)
163 AM_CONDITIONAL(HAVE_GST_CHECK, test "x$HAVE_GST_CHECK" = "xyes")
165 dnl Check for documentation xrefs
166 GLIB_PREFIX="`$PKG_CONFIG --variable=prefix glib-2.0`"
167 GST_PREFIX="`$PKG_CONFIG --variable=prefix gstreamer-$GST_MAJORMINOR`"
168 GSTPB_PREFIX="`$PKG_CONFIG --variable=prefix gstreamer-plugins-base-$GST_MAJORMINOR`"
169 AC_SUBST(GLIB_PREFIX)
170 AC_SUBST(GST_PREFIX)
171 AC_SUBST(GSTPB_PREFIX)
173 dnl *** set variables based on configure arguments ***
175 dnl set license and copyright notice
176 GST_LICENSE="LGPL"
177 AC_DEFINE_UNQUOTED(GST_LICENSE, "$GST_LICENSE", [GStreamer license])
178 AC_SUBST(GST_LICENSE)
180 dnl set location of plugin directory
181 AG_GST_SET_PLUGINDIR
183 dnl define an ERROR_CFLAGS Makefile variable
184 AG_GST_SET_ERROR_CFLAGS($GST_CVS)
186 dnl define an ERROR_CXXFLAGS Makefile variable
187 AG_GST_SET_ERROR_CXXFLAGS($GST_CVS)
189 dnl define correct level for debugging messages
190 AG_GST_SET_LEVEL_DEFAULT($GST_CVS)
192 dnl used in examples
193 AG_GST_DEFAULT_ELEMENTS
195 dnl *** plug-ins to include ***
197 dnl these are all the gst plug-ins, compilable without additional libs
198 AG_GST_CHECK_PLUGIN(asfdemux)
199 AG_GST_CHECK_PLUGIN(dvdlpcmdec)
200 AG_GST_CHECK_PLUGIN(dvdsub)
201 AG_GST_CHECK_PLUGIN(iec958)
202 AG_GST_CHECK_PLUGIN(mpegaudioparse)
203 AG_GST_CHECK_PLUGIN(mpegstream)
204 AG_GST_CHECK_PLUGIN(realmedia)
205 AG_GST_CHECK_PLUGIN(synaesthesia)
207 AC_CHECK_HEADERS([winsock2.h], HAVE_WINSOCK2_H=yes)
209 if test "x$HAVE_WINSOCK2_H" = "xyes"; then
210 WIN32_LIBS="-lws2_32"
211 AC_SUBST(WIN32_LIBS)
212 fi
214 dnl disable experimental plug-ins
215 if test "x$BUILD_EXPERIMENTAL" != "xyes"; then
216 AG_GST_DISABLE_PLUGIN(synaesthesia)
217 fi
219 dnl *** ext plug-ins ***
220 dnl keep this list sorted alphabetically !
222 if test "x$BUILD_EXTERNAL" = "xyes"; then
224 echo
225 AC_MSG_NOTICE([Checking libraries for plugins in ext/])
226 echo
228 dnl *** a52dec ***
229 translit(dnm, m, l) AM_CONDITIONAL(USE_A52DEC, true)
230 AG_GST_CHECK_FEATURE(A52DEC, [a52dec], a52dec, [
231 AC_CHECK_A52DEC(HAVE_A52DEC=yes, HAVE_A52DEC=no)
232 ])
234 dnl *** amr-nb ***
235 translit(dnm, m, l) AM_CONDITIONAL(USE_AMRNB, true)
236 AG_GST_CHECK_FEATURE(AMRNB, [amrnb library], amrnb, [
237 PKG_CHECK_MODULES(AMRNB, opencore-amrnb, HAVE_AMRNB="yes",
238 [ AG_GST_CHECK_LIBHEADER(AMRNB, opencore-amrnb,
239 Decoder_Interface_init, -lm,
240 opencore-amrnb/interf_dec.h,
241 AMRNB_LIBS="-lopencore-amrnb")
242 ])
243 AC_SUBST(AMRNB_CFLAGS)
244 AC_SUBST(AMRNB_LIBS)
245 ])
247 dnl *** amr-wb dec ***
248 translit(dnm, m, l) AM_CONDITIONAL(USE_AMRWB, true)
249 AG_GST_CHECK_FEATURE(AMRWB, [amrwb library], amrwbdec, [
250 PKG_CHECK_MODULES(AMRWB, opencore-amrwb, HAVE_AMRWB="yes",
251 [ AG_GST_CHECK_LIBHEADER(AMRWB, opencore-amrwb,
252 D_IF_decode, ,
253 opencore-amrwb/dec_if.h,
254 AMRWB_LIBS="-lopencore-amrwb")
255 ])
256 AC_SUBST(AMRWB_CFLAGS)
257 AC_SUBST(AMRWB_LIBS)
258 ])
260 dnl *** cdio ***
261 translit(dnm, m, l) AM_CONDITIONAL(USE_CDIO, true)
262 AG_GST_CHECK_FEATURE(CDIO, [cdio library], cdio, [
263 AG_GST_PKG_CHECK_MODULES(CDIO, libcdio >= 0.76)
264 ])
266 dnl *** dvdread ***
267 translit(dnm, m, l) AM_CONDITIONAL(USE_DVDREAD, true)
268 AG_GST_CHECK_FEATURE(DVDREAD, [dvdread library], dvdreadsrc, [
269 AG_GST_CHECK_LIBHEADER(DVDREAD, dvdread, DVDOpen, , dvdread/dvd_reader.h, DVDREAD_LIBS="-ldvdread")
270 AC_SUBST(DVDREAD_LIBS)
271 ])
273 dnl *** lame ***
274 translit(dnm, m, l) AM_CONDITIONAL(USE_LAME, true)
275 AG_GST_CHECK_FEATURE(LAME, [lame mp3 encoder library], lame, [
276 AG_GST_CHECK_LIBHEADER(LAME, mp3lame, lame_init, -lm, lame/lame.h,
277 [
278 HAVE_LAME="yes"
279 LAME_LIBS="-lmp3lame -lm"
280 dnl is lame presets available
281 LAME_CFLAGS=""
282 AC_TRY_COMPILE([#include <lame/lame.h>], [ int preset = MEDIUM ],
283 [LAME_CFLAGS="-DGSTLAME_PRESET"],
284 [LAME_CFLAGS=""]
285 )
286 AC_TRY_COMPILE([#include <lame/lame.h>], [
287 void *ptr = &lame_set_VBR_quality
288 ],
289 [LAME_CFLAGS="$LAME_CFLAGS -DHAVE_LAME_SET_VBR_QUALITY"],
290 [LAME_CFLAGS="$LAME_CFLAGS"]
291 )
292 AC_SUBST(LAME_CFLAGS)
293 AC_SUBST(LAME_LIBS)
294 ])
295 ])
297 dnl *** mad ***
298 translit(dnm, m, l) AM_CONDITIONAL(USE_MAD, true)
299 AG_GST_CHECK_FEATURE(MAD, [mad mp3 decoder], mad, [
301 dnl check with pkg-config first
302 AG_GST_PKG_CHECK_MODULES(ID3TAG, id3tag >= 0.15)
303 if test "x$HAVE_ID3TAG" = "xno"; then
304 dnl fall back to oldskool detection
305 AC_CHECK_HEADER(id3tag.h, [
306 save_LIBS=$LIBS
307 LIBS="-lz"
308 AC_CHECK_LIB(id3tag, id3_tag_options,
309 HAVE_ID3TAG="yes" ID3TAG_LIBS="-lid3tag -lz")
310 LIBS=$save_LIBS
311 AC_SUBST(ID3TAG_LIBS)
312 ])
313 fi
315 if test "x$HAVE_ID3TAG" = "xyes"; then
316 dnl check with pkg-config first
317 AG_GST_PKG_CHECK_MODULES(MAD, mad >= 0.15)
318 MAD_LIBS="$MAD_LIBS $ID3TAG_LIBS"
319 if test "x$HAVE_MAD" = "xno"; then
320 dnl fall back to oldskool detection
321 AC_CHECK_HEADER(mad.h, [
322 AC_CHECK_LIB(mad, mad_decoder_finish,
323 HAVE_MAD="yes" MAD_LIBS="-lmad $ID3TAG_LIBS")
324 ])
325 fi
326 else
327 HAVE_MAD="no"
328 AC_MSG_WARN([libid3tag not available, cannot build MAD MP3 decoder plugin])
329 fi
330 ])
331 AC_SUBST(MAD_LIBS)
333 dnl *** mpeg2dec ***
334 translit(dnm, m, l) AM_CONDITIONAL(USE_MPEG2DEC, true)
335 AG_GST_CHECK_FEATURE(MPEG2DEC, [mpeg2dec], mpeg2dec, [
336 AG_GST_PKG_CHECK_MODULES(MPEG2DEC, libmpeg2 >= 0.4.0)
337 ])
339 dnl *** sidplay : works with libsidplay 1.36.x (not 2.x.x) ***
340 translit(dnm, m, l) AM_CONDITIONAL(USE_SIDPLAY, true)
341 AG_GST_CHECK_FEATURE(SIDPLAY, [libsidplay], sid, [
342 GST_PATH_SIDPLAY()
343 ])
345 dnl *** twolame ***
346 translit(dnm, m, l) AM_CONDITIONAL(USE_TWOLAME, true)
347 AG_GST_CHECK_FEATURE(TWOLAME, [twolame], twolame, [
348 PKG_CHECK_MODULES(TWOLAME, twolame >= 0.3.10, [
349 HAVE_TWOLAME="yes"], [
350 HAVE_TWOLAME="no"
351 AC_MSG_RESULT(no)
352 ])
353 AC_SUBST(TWOLAME_CFLAGS)
354 AC_SUBST(TWOLAME_LIBS)
355 ])
357 dnl *** x264 (MPEG-4 part 10/h.264/AVC encoder) ***
358 translit(dnm, m, l) AM_CONDITIONAL(USE_X264, true)
359 AG_GST_CHECK_FEATURE(X264, [x264 plug-in], x264, [
360 AG_GST_CHECK_LIBHEADER(X264, x264, x264_nal_encode, -lm, x264.h,
361 AC_MSG_CHECKING([for uptodate x264 API version])
362 dnl _stdint not yet generated, so no compiling
363 AC_TRY_CPP([
364 #include <x264.h>
365 #if X264_BUILD < 55
366 #error "x264 build too old"
367 #endif
368 ], [
369 AC_MSG_RESULT(yes)
370 X264_LIBS="$LDFLAGS -lx264 -lm"
371 X264_CFLAGS="$CFLAGS"
372 AC_SUBST(X264_LIBS)
373 AC_SUBST(X264_CFLAGS)
374 ], [
375 AC_MSG_RESULT(no)
376 HAVE_X264=no
377 ]))
378 ])
380 else
382 dnl not building plugins with external dependencies,
383 dnl but we still need to set the conditionals
385 AM_CONDITIONAL(USE_A52DEC, false)
386 AM_CONDITIONAL(USE_AMRNB, false)
387 AM_CONDITIONAL(USE_AMRWB, false)
388 AM_CONDITIONAL(USE_CDIO, false)
389 AM_CONDITIONAL(USE_DVDREAD, false)
390 AM_CONDITIONAL(USE_LAME, false)
391 AM_CONDITIONAL(USE_MAD, false)
392 AM_CONDITIONAL(USE_MPEG2DEC, false)
393 AM_CONDITIONAL(USE_SIDPLAY, false)
394 AM_CONDITIONAL(USE_TWOLAME, false)
395 AM_CONDITIONAL(USE_X264, false)
397 fi dnl of EXT plugins
399 dnl *** finalize CFLAGS, LDFLAGS, LIBS
401 dnl Overview:
402 dnl GST_OPTION_CFLAGS: common flags for profiling, debugging, errors, ...
403 dnl GST_*: flags shared by built objects to link against GStreamer
404 dnl GST_ALL_LDFLAGS: linker flags shared by all
405 dnl GST_LIB_LDFLAGS: additional linker flags for all libaries
406 dnl GST_LT_LDFLAGS: library versioning of our libraries
407 dnl GST_PLUGIN_LDFLAGS: flags to be used for all plugins
409 dnl GST_OPTION_CFLAGS
410 if test "x$USE_DEBUG" = xyes; then
411 PROFILE_CFLAGS="-g"
412 fi
413 AC_SUBST(PROFILE_CFLAGS)
415 if test "x$PACKAGE_VERSION_NANO" = "x1"; then
416 dnl Define _only_ during CVS (not pre-releases or releases)
417 DEPRECATED_CFLAGS="-DGST_DISABLE_DEPRECATED"
418 else
419 DEPRECATED_CFLAGS=""
420 fi
421 AC_SUBST(DEPRECATED_CFLAGS)
423 dnl every flag in GST_OPTION_CFLAGS and GST_OPTION_CXXFLAGS can be overridden
424 dnl at make time with e.g. make ERROR_CFLAGS=""
425 GST_OPTION_CFLAGS="\$(ERROR_CFLAGS) \$(DEBUG_CFLAGS) \$(PROFILE_CFLAGS) \$(GCOV_CFLAGS) \$(OPT_CFLAGS) \$(DEPRECATED_CFLAGS)"
426 GST_OPTION_CXXFLAGS="\$(ERROR_CXXFLAGS) \$(DEBUG_CFLAGS) \$(PROFILE_CFLAGS) \$(GCOV_CFLAGS) \$(OPT_CFLAGS) \$(DEPRECATED_CFLAGS)"
427 AC_SUBST(GST_OPTION_CFLAGS)
428 AC_SUBST(GST_OPTION_CXXFLAGS)
430 dnl FIXME: do we want to rename to GST_ALL_* ?
431 dnl prefer internal headers to already installed ones
432 dnl also add builddir include for enumtypes and marshal
433 dnl add GST_OPTION_CFLAGS, but overridable
434 GST_CFLAGS="-I\$(top_srcdir)/gst-libs -I\$(top_builddir)/gst-libs $GST_CFLAGS \$(GST_OPTION_CFLAGS)"
435 GST_CXXFLAGS="-I\$(top_srcdir)/gst-libs -I\$(top_builddir)/gst-libs $GST_CXXFLAGS \$(GST_OPTION_CXXFLAGS)"
436 AC_SUBST(GST_CFLAGS)
437 AC_SUBST(GST_CXXFLAGS)
438 AC_SUBST(GST_LIBS)
440 dnl LDFLAGS really should only contain flags, not libs - they get added before
441 dnl whatevertarget_LIBS and -L flags here affect the rest of the linking
442 GST_ALL_LDFLAGS="-no-undefined"
443 AC_SUBST(GST_ALL_LDFLAGS)
445 dnl this really should only contain flags, not libs - they get added before
446 dnl whatevertarget_LIBS and -L flags here affect the rest of the linking
447 GST_PLUGIN_LDFLAGS="-module -avoid-version -export-symbols-regex '^[_]*gst_plugin_desc\$\$' $GST_ALL_LDFLAGS"
448 AC_SUBST(GST_PLUGIN_LDFLAGS)
450 SHAVE_INIT([common],[enable])
452 dnl *** output files ***
454 AC_CONFIG_FILES(
455 Makefile
456 common/Makefile
457 common/m4/Makefile
458 common/shave
459 common/shave-libtool
460 gst-libs/Makefile
461 gst-libs/gst/Makefile
462 gst/Makefile
463 gst/asfdemux/Makefile
464 gst/dvdlpcmdec/Makefile
465 gst/dvdsub/Makefile
466 gst/iec958/Makefile
467 gst/mpegaudioparse/Makefile
468 gst/mpegstream/Makefile
469 gst/realmedia/Makefile
470 gst/synaesthesia/Makefile
471 ext/Makefile
472 ext/a52dec/Makefile
473 ext/amrnb/Makefile
474 ext/amrwbdec/Makefile
475 ext/cdio/Makefile
476 ext/dvdread/Makefile
477 ext/lame/Makefile
478 ext/mad/Makefile
479 ext/mpeg2dec/Makefile
480 ext/sidplay/Makefile
481 ext/twolame/Makefile
482 ext/x264/Makefile
483 docs/Makefile
484 docs/plugins/Makefile
485 docs/version.entities
486 tests/Makefile
487 tests/check/Makefile
488 m4/Makefile
489 po/Makefile.in
490 win32/common/config.h
491 gst-plugins-ugly.spec
492 )
493 AC_OUTPUT
495 AG_GST_OUTPUT_PLUGINS