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