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.10.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
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.20
51 GSTPB_REQ=0.10.14
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 dnl disable experimental plug-ins
208 if test "x$BUILD_EXPERIMENTAL" != "xyes"; then
209 AG_GST_DISABLE_PLUGIN(synaesthesia)
210 fi
212 dnl *** ext plug-ins ***
213 dnl keep this list sorted alphabetically !
215 if test "x$BUILD_EXTERNAL" = "xyes"; then
217 echo
218 AC_MSG_NOTICE([Checking libraries for plugins in ext/])
219 echo
221 dnl *** a52dec ***
222 translit(dnm, m, l) AM_CONDITIONAL(USE_A52DEC, true)
223 AG_GST_CHECK_FEATURE(A52DEC, [a52dec], a52dec, [
224 AC_CHECK_A52DEC(HAVE_A52DEC=yes, HAVE_A52DEC=no)
225 ])
227 dnl *** AMR-NB ***
228 translit(dnm, m, l) AM_CONDITIONAL(USE_AMRNB, true)
229 AG_GST_CHECK_FEATURE(AMRNB, [AMR-NB], amrnb, [
230 AG_GST_CHECK_LIBHEADER(AMRNB, amrnb,
231 Decoder_Interface_init, -lm,
232 amrnb/interf_dec.h,
233 AMRNB_LIBS="-lamrnb -lm"
234 AC_SUBST(AMRNB_LIBS))
235 ])
237 dnl *** cdio ***
238 translit(dnm, m, l) AM_CONDITIONAL(USE_CDIO, true)
239 AG_GST_CHECK_FEATURE(CDIO, [cdio library], cdio, [
240 AG_GST_PKG_CHECK_MODULES(CDIO, libcdio >= 0.76)
241 ])
243 dnl *** dvdread ***
244 translit(dnm, m, l) AM_CONDITIONAL(USE_DVDREAD, true)
245 AG_GST_CHECK_FEATURE(DVDREAD, [dvdread library], dvdreadsrc, [
246 AG_GST_CHECK_LIBHEADER(DVDREAD, dvdread, DVDOpen, , dvdread/dvd_reader.h, DVDREAD_LIBS="-ldvdread")
247 AC_SUBST(DVDREAD_LIBS)
248 ])
250 dnl *** dvdnav ***
251 translit(dnm, m, l) AM_CONDITIONAL(USE_DVDNAV, true)
252 AG_GST_CHECK_FEATURE(DVDNAV, [dvdnav library], dvdnav, [
253 translit(dnm, m, l) AC_SUBST(DVDNAV_LIBS)
254 translit(dnm, m, l) AC_SUBST(DVDNAV_CFLAGS)
255 AG_GST_CHECK_CONFIGPROG(DVDNAV, dvdnav-config)
256 if test x"$HAVE_DVDNAV" = x"yes"; then
257 dnl check version
258 DVDNAV_VERSION=`dvdnav-config --version|head -n 1|sed 's/^.*) //'|sed 's/ (.*)//'`
259 DVDNAV_MAJOR=`echo $DVDNAV_VERSION | cut -d. -f1 | sed s/[a-zA-Z\-].*//g`
260 DVDNAV_MINOR=`echo $DVDNAV_VERSION | cut -d. -f2 | sed s/[a-zA-Z\-].*//g`
261 DVDNAV_MICRO=`echo $DVDNAV_VERSION | cut -d. -f3 | sed s/[a-zA-Z\-].*//g`
262 if [[ "$DVDNAV_MAJOR" -eq "0" ]] && \
263 [[ "$DVDNAV_MINOR" -lt "1" ]]; then
264 AC_MSG_WARN([libdvdnav >= 0.1.7 is required, you have $DVDNAV_VERSION])
265 HAVE_DVDNAV="no"
266 elif [[ "$DVDNAV_MAJOR" -eq "0" ]] && \
267 [[ "$DVDNAV_MINOR" -eq "1" ]] && \
268 [[ "$DVDNAV_MICRO" -lt "7" ]]; then
269 AC_MSG_WARN([libdvdnav >= 0.1.7 is required, you have $DVDNAV_VERSION])
270 HAVE_DVDNAV="no"
271 fi
272 fi
273 dnl now check for dvdread/nav_print.h - see #133002
274 AC_CHECK_HEADER(dvdread/nav_print.h, , [
275 AC_MSG_WARN([header dvdread/nav_print.h from dvdread missing])
276 HAVE_DVDNAV="no"
277 ])
278 AS_SCRUB_INCLUDE(DVDNAV_CFLAGS)
280 dnl disabled until plugin is fully functional
281 HAVE_DVDNAV=no
282 ], disabled, , [
283 AC_MSG_NOTICE([dvdnavsrc not stable yet, not building])
284 ])
286 dnl *** lame ***
287 translit(dnm, m, l) AM_CONDITIONAL(USE_LAME, true)
288 AG_GST_CHECK_FEATURE(LAME, [lame mp3 encoder library], lame, [
289 AG_GST_CHECK_LIBHEADER(LAME, mp3lame, lame_init, -lm, lame/lame.h,
290 [
291 HAVE_LAME="yes"
292 LAME_LIBS="-lmp3lame -lm"
293 dnl is lame presets available
294 LAME_CFLAGS=""
295 AC_TRY_COMPILE([#include <lame/lame.h>], [ int preset = MEDIUM ],
296 [LAME_CFLAGS="-DGSTLAME_PRESET"],
297 [LAME_CFLAGS=""]
298 )
299 AC_SUBST(LAME_CFLAGS)
300 AC_SUBST(LAME_LIBS)
301 ])
302 ])
304 dnl *** id3tag from the MAD project ***
305 translit(dnm, m, l) AM_CONDITIONAL(USE_ID3TAG, true)
306 AG_GST_CHECK_FEATURE(ID3TAG, [id3tag reading and writing from the MAD project],
307 id3tag, [
308 dnl check with pkg-config first
309 AG_GST_PKG_CHECK_MODULES(ID3TAG, id3tag >= 0.15)
310 if test "x$HAVE_ID3TAG" = "xno"; then
311 dnl fall back to oldskool detection
312 AC_CHECK_HEADER(id3tag.h, [
313 save_LIBS=$LIBS
314 LIBS="-lz"
315 AC_CHECK_LIB(id3tag, id3_tag_options,
316 HAVE_ID3TAG="yes" ID3TAG_LIBS="-lid3tag -lz")
317 LIBS=$save_LIBS
318 AC_SUBST(ID3TAG_LIBS)
319 ])
320 fi
321 ])
323 dnl *** mad ***
324 translit(dnm, m, l) AM_CONDITIONAL(USE_MAD, true)
325 AG_GST_CHECK_FEATURE(MAD, [mad mp3 decoder], mad, [
326 if test "x$HAVE_ID3TAG" = "xyes"; then
327 dnl check with pkg-config first
328 AG_GST_PKG_CHECK_MODULES(MAD, mad >= 0.15 id3tag >= 0.15)
329 if test "x$HAVE_MAD" = "xno"; then
330 dnl fall back to oldskool detection
331 AC_CHECK_HEADER(mad.h, [
332 AC_CHECK_LIB(mad, mad_decoder_finish,
333 HAVE_MAD="yes" MAD_LIBS="-lmad $ID3TAG_LIBS")
334 ])
335 fi
336 else
337 HAVE_MAD="no"
338 AC_MSG_WARN([libid3tag not available, cannot build MAD MP3 decoder plugin])
339 fi
340 ])
341 AC_SUBST(MAD_LIBS)
343 dnl *** mpeg2dec ***
344 translit(dnm, m, l) AM_CONDITIONAL(USE_MPEG2DEC, true)
345 AG_GST_CHECK_FEATURE(MPEG2DEC, [mpeg2dec], mpeg2dec, [
346 AG_GST_PKG_CHECK_MODULES(MPEG2DEC, libmpeg2 >= 0.4.0)
347 ])
349 dnl *** sidplay : works with libsidplay 1.36.x (not 2.x.x) ***
350 translit(dnm, m, l) AM_CONDITIONAL(USE_SIDPLAY, true)
351 AG_GST_CHECK_FEATURE(SIDPLAY, [libsidplay], sid, [
352 GST_PATH_SIDPLAY()
353 ])
355 else
357 dnl not building plugins with external dependencies,
358 dnl but we still need to set the conditionals
360 AM_CONDITIONAL(USE_A52DEC, false)
361 AM_CONDITIONAL(USE_AMRNB, false)
362 AM_CONDITIONAL(USE_CDIO, false)
363 AM_CONDITIONAL(USE_DVDREAD, false)
364 AM_CONDITIONAL(USE_DVDNAV, false)
365 AM_CONDITIONAL(USE_LAME, false)
366 AM_CONDITIONAL(USE_ID3TAG, false)
367 AM_CONDITIONAL(USE_MAD, false)
368 AM_CONDITIONAL(USE_MPEG2DEC, false)
369 AM_CONDITIONAL(USE_SIDPLAY, false)
371 fi dnl of EXT plugins
373 dnl *** finalize CFLAGS, LDFLAGS, LIBS
375 dnl Overview:
376 dnl GST_OPTION_CFLAGS: common flags for profiling, debugging, errors, ...
377 dnl GST_*: flags shared by built objects to link against GStreamer
378 dnl GST_ALL_LDFLAGS: linker flags shared by all
379 dnl GST_LIB_LDFLAGS: additional linker flags for all libaries
380 dnl GST_LT_LDFLAGS: library versioning of our libraries
381 dnl GST_PLUGIN_LDFLAGS: flags to be used for all plugins
383 dnl GST_OPTION_CFLAGS
384 if test "x$USE_DEBUG" = xyes; then
385 PROFILE_CFLAGS="-g"
386 fi
387 AC_SUBST(PROFILE_CFLAGS)
389 if test "x$PACKAGE_VERSION_NANO" = "x1"; then
390 dnl Define _only_ during CVS (not pre-releases or releases)
391 DEPRECATED_CFLAGS="-DGST_DISABLE_DEPRECATED"
392 else
393 DEPRECATED_CFLAGS=""
394 fi
395 AC_SUBST(DEPRECATED_CFLAGS)
397 dnl every flag in GST_OPTION_CFLAGS and GST_OPTION_CXXFLAGS can be overridden
398 dnl at make time with e.g. make ERROR_CFLAGS=""
399 GST_OPTION_CFLAGS="\$(ERROR_CFLAGS) \$(DEBUG_CFLAGS) \$(PROFILE_CFLAGS) \$(GCOV_CFLAGS) \$(OPT_CFLAGS) \$(DEPRECATED_CFLAGS)"
400 GST_OPTION_CXXFLAGS="\$(ERROR_CXXFLAGS) \$(DEBUG_CFLAGS) \$(PROFILE_CFLAGS) \$(GCOV_CFLAGS) \$(OPT_CFLAGS) \$(DEPRECATED_CFLAGS)"
401 AC_SUBST(GST_OPTION_CFLAGS)
402 AC_SUBST(GST_OPTION_CXXFLAGS)
404 dnl FIXME: do we want to rename to GST_ALL_* ?
405 dnl prefer internal headers to already installed ones
406 dnl also add builddir include for enumtypes and marshal
407 dnl add GST_OPTION_CFLAGS, but overridable
408 GST_CFLAGS="-I\$(top_srcdir)/gst-libs -I\$(top_builddir)/gst-libs $GST_CFLAGS \$(GST_OPTION_CFLAGS)"
409 GST_CXXFLAGS="-I\$(top_srcdir)/gst-libs -I\$(top_builddir)/gst-libs $GST_CXXFLAGS \$(GST_OPTION_CXXFLAGS)"
410 AC_SUBST(GST_CFLAGS)
411 AC_SUBST(GST_CXXFLAGS)
412 AC_SUBST(GST_LIBS)
414 dnl LDFLAGS really should only contain flags, not libs - they get added before
415 dnl whatevertarget_LIBS and -L flags here affect the rest of the linking
416 GST_ALL_LDFLAGS="-no-undefined"
417 AC_SUBST(GST_ALL_LDFLAGS)
419 dnl this really should only contain flags, not libs - they get added before
420 dnl whatevertarget_LIBS and -L flags here affect the rest of the linking
421 GST_PLUGIN_LDFLAGS="-module -avoid-version -export-symbols-regex '^[_]*gst_plugin_desc\$\$' $GST_ALL_LDFLAGS"
422 AC_SUBST(GST_PLUGIN_LDFLAGS)
424 dnl *** output files ***
426 AC_CONFIG_FILES(
427 Makefile
428 gst-libs/Makefile
429 gst-libs/gst/Makefile
430 gst/Makefile
431 gst/asfdemux/Makefile
432 gst/dvdlpcmdec/Makefile
433 gst/dvdsub/Makefile
434 gst/iec958/Makefile
435 gst/mpegaudioparse/Makefile
436 gst/mpegstream/Makefile
437 gst/realmedia/Makefile
438 gst/synaesthesia/Makefile
439 ext/Makefile
440 ext/a52dec/Makefile
441 ext/amrnb/Makefile
442 ext/cdio/Makefile
443 ext/dvdnav/Makefile
444 ext/dvdread/Makefile
445 ext/lame/Makefile
446 ext/mad/Makefile
447 ext/mpeg2dec/Makefile
448 ext/sidplay/Makefile
449 docs/Makefile
450 docs/plugins/Makefile
451 docs/version.entities
452 tests/Makefile
453 tests/check/Makefile
454 common/Makefile
455 common/m4/Makefile
456 m4/Makefile
457 po/Makefile.in
458 win32/common/config.h
459 gst-plugins-ugly.spec
460 )
461 AC_OUTPUT
463 AG_GST_OUTPUT_PLUGINS