1 dnl autoconf configuration file for gst-plugins
2 AC_INIT
3 AC_CANONICAL_TARGET
5 dnl We disable static building for development, for time savings
6 dnl this goes before AS_LIBTOOL to appease autoconf
7 dnl *NOTE*: dnl this line before release, so release does static too
8 AM_DISABLE_STATIC
10 dnl AM_MAINTAINER_MODE only provides the option to configure to enable it
11 AM_MAINTAINER_MODE
13 dnl when going to/from release please set the nano (fourth number) right !
14 dnl releases only do Wall, cvs and prerelease does Werror too
15 AS_VERSION(gst-plugins-ugly, GST_PLUGINS_UGLY_VERSION, 0, 10, 2, 1,
16 GST_CVS="no", GST_CVS="yes")
18 AM_INIT_AUTOMAKE($PACKAGE,$VERSION)
20 dnl our libraries and install dirs use major.minor as a version
21 GST_MAJORMINOR=$GST_PLUGINS_UGLY_VERSION_MAJOR.$GST_PLUGINS_UGLY_VERSION_MINOR
22 dnl we override it here if we need to for the release candidate of new series
23 GST_MAJORMINOR=0.10
24 AC_SUBST(GST_MAJORMINOR)
26 AS_LIBTOOL_TAGS
27 AM_PROG_LIBTOOL
29 dnl *** required versions of GStreamer stuff ***
30 GST_REQ=0.10.3
31 GSTPB_REQ=0.10.3
33 AC_CONFIG_SRCDIR([ext/mad/gstmad.c])
34 AM_CONFIG_HEADER(config.h)
36 dnl Add parameters for aclocal
37 dnl (This must come after AM_INIT_AUTOMAKE, since it modifies ACLOCAL)
38 ACLOCAL_FLAGS="-I m4 -I common/m4"
39 AC_SUBST(ACLOCAL_AMFLAGS, $ACLOCAL_FLAGS)
41 AC_PROG_CC
42 AM_PROG_CC_STDC
43 AM_PROG_AS
44 AS="${CC}"
45 AS_PROG_OBJC
47 dnl the gettext stuff needed
48 dnl AM_GNU_GETTEXT_VERSION(0.11.5)
49 dnl AM_GNU_GETTEXT([external])
51 dnl GETTEXT_PACKAGE=gst-plugins-ugly-$GST_MAJORMINOR
52 dnl AC_SUBST(GETTEXT_PACKAGE)
53 dnl AC_DEFINE_UNQUOTED([GETTEXT_PACKAGE], "$GETTEXT_PACKAGE",
54 dnl [gettext package name])
56 dnl define LOCALEDIR in config.h
57 dnl AS_AC_EXPAND(LOCALEDIR, $datadir/locale)
58 dnl AC_DEFINE_UNQUOTED([LOCALEDIR], "$LOCALEDIR",
59 dnl [gettext locale dir])
61 dnl decide on error flags
62 AS_COMPILER_FLAG(-Wall, GST_WALL="yes", GST_WALL="no")
64 if test "x$GST_WALL" = "xyes"; then
65 GST_ERROR="$GST_ERROR -Wall"
67 if test "x$GST_CVS" = "xyes"; then
68 AS_COMPILER_FLAG(-Werror,GST_ERROR="$GST_ERROR -Werror",GST_ERROR="$GST_ERROR")
69 fi
70 fi
72 dnl determine c++ compiler
73 AC_PROG_CXX
74 dnl determine if c++ is available on this system
75 AC_CHECK_PROG(HAVE_CXX, $CXX, yes, no)
76 dnl determine c++ preprocessor
77 AC_PROG_CXXCPP
78 AC_ISC_POSIX
80 AC_HEADER_STDC([])
81 AC_C_INLINE
83 dnl used by ext/a52dec
84 AX_CREATE_STDINT_H
86 dnl Check for malloc.h
87 AC_CHECK_HEADER(malloc.h,[
88 AC_DEFINE(HAVE_MALLOC_H, 1, [whether malloc.h available])
89 ])
91 dnl Check for a way to display the function name in debug output
92 GST_CHECK_FUNCTION()
94 dnl define correct errorlevel for debugging messages. We want to have GST_ERROR
95 dnl messages printed when running cvs builds
96 if test "x$GST_CVS" = "xyes"; then
97 AC_DEFINE(GST_LEVEL_DEFAULT, GST_LEVEL_ERROR, [Default errorlevel to use])
98 fi
100 dnl Check for FIONREAD ioctl declaration :
101 GST_CHECK_FIONREAD()
103 dnl ############################################
104 dnl # Super Duper options for plug-in building #
105 dnl ############################################
107 dnl ext plug-ins; plug-ins that have external dependencies
108 GST_CHECK_FEATURE(EXTERNAL, [enable building of plug-ins with external deps],,
109 [HAVE_EXTERNAL=yes],enabled,
110 [
111 AC_MSG_WARN(building external plug-ins)
112 BUILD_EXTERNAL="yes"
113 ],[
114 AC_MSG_WARN(all plug-ins with external dependencies will not be built)
115 BUILD_EXTERNAL="no"
116 ])
117 # make BUILD_EXTERNAL available to Makefile.am
118 AM_CONDITIONAL(BUILD_EXTERNAL, test "x$BUILD_EXTERNAL" = "xyes")
120 dnl ##############################
121 dnl # Do automated configuration #
122 dnl ##############################
124 dnl Check for tools:
125 dnl ================
127 dnl allow for different autotools
128 AS_AUTOTOOLS_ALTERNATE()
130 dnl modify pkg-config path
131 AC_ARG_WITH(pkg-config-path,
132 AC_HELP_STRING([--with-pkg-config-path],[colon-separated list of pkg-config(1) dirs]),
133 [export PKG_CONFIG_PATH=${withval}])
135 GST_DOCBOOK_CHECK()
136 dnl check architecture
137 GST_ARCH()
139 dnl check for gstreamer
140 dnl uninstalled is selected preferentially -- see pkg-config(1)
141 PKG_CHECK_MODULES(GST, gstreamer-$GST_MAJORMINOR >= $GST_REQ,
142 HAVE_GST="yes", HAVE_GST="no")
144 if test "x$HAVE_GST" = "xno"; then
145 AC_MSG_ERROR(no GStreamer found)
146 fi
148 GST_TOOLS_DIR=`pkg-config --variable=toolsdir gstreamer-$GST_MAJORMINOR`
149 if test -z $GST_TOOLS_DIR; then
150 AC_MSG_ERROR([no tools dir defined in GStreamer pkg-config file; core upgrade needed.])
151 fi
152 AC_SUBST(GST_TOOLS_DIR)
154 dnl check for gstreamer-base; uninstalled is selected preferentially
155 PKG_CHECK_MODULES(GST_BASE, gstreamer-base-$GST_MAJORMINOR >= $GST_REQ,
156 HAVE_GST_BASE="yes", HAVE_GST_BASE="no")
158 if test "x$HAVE_GST_BASE" = "xno"; then
159 AC_MSG_ERROR(no GStreamer Base Libs found)
160 fi
162 AC_SUBST(GST_BASE_LIBS)
163 AC_SUBST(GST_BASE_CFLAGS)
165 dnl check for gstreamer-plugins-base; uinstalled is selected preferentially
166 PKG_CHECK_MODULES(GST_PLUGINS_BASE,
167 gstreamer-plugins-base-$GST_MAJORMINOR >= $GSTPB_REQ,
168 HAVE_GST_PLUGINS_BASE="yes", HAVE_GST_PLUGINS_BASE="no")
170 if test "x$HAVE_GST_PLUGINS_BASE" = "xno"; then
171 AC_MSG_ERROR(no GStreamer Base Plugins development files found)
172 fi
174 AC_SUBST(GST_PLUGINS_BASE_LIBS)
175 AC_SUBST(GST_PLUGINS_BASE_CFLAGS)
177 dnl Determine endianness
178 AC_C_BIGENDIAN
180 dnl Check for essential libraries first:
181 dnl ====================================
183 GST_GLIB_CHECK([2.6.0])
185 dnl Check for additional libraries that we might use:
186 dnl =================================================
188 # we set the defaults always to make sure we have non-empty variables
189 # for the Makefile
191 PKG_CHECK_MODULES(LIBOIL, liboil-0.3 >= 0.3.0, HAVE_LIBOIL=yes, HAVE_LIBOIL=no)
192 AC_SUBST(LIBOIL_CFLAGS)
193 AC_SUBST(LIBOIL_LIBS)
194 if test "x${HAVE_LIBOIL}" = xyes ; then
195 AC_DEFINE_UNQUOTED(HAVE_LIBOIL, 1, [Define if liboil is being used])
196 true
197 fi
199 dnl ===========================================================================
200 dnl ============================= gst plug-ins ================================
201 dnl ===========================================================================
203 plugindir="\$(libdir)/gstreamer-$GST_MAJORMINOR"
204 AC_SUBST(plugindir)
206 GST_PLUGIN_LDFLAGS="-module -avoid-version -export-symbols-regex '[_]*(gst_|Gst|GST_).*' $GST_LIBS -no-undefined"
207 AC_SUBST(GST_PLUGIN_LDFLAGS)
209 dnl these are all the gst plug-ins, compilable without additional libs
210 GST_PLUGINS_ALL="\
211 asfdemux \
212 dvdlpcmdec \
213 dvdsub \
214 iec958 \
215 mpegaudioparse \
216 mpegstream \
217 realmedia \
218 "
220 dnl see if we can build C++ plug-ins
221 if test "x$HAVE_CXX" = "xyes"; then
222 GST_PLUGINS_ALL="$GST_PLUGINS_ALL"
223 else
224 AC_MSG_WARN([Not compiling plug-ins requiring C++ compiler])
225 fi
227 AC_SUBST(GST_PLUGINS_ALL)
229 GST_PLUGINS_SELECTED=""
231 AC_ARG_WITH(plugins,
232 AC_HELP_STRING([--with-plugins],[comma-separated list of plug-ins to compile]),
233 [for i in `echo $withval | tr , ' '`; do
234 if echo $GST_PLUGINS_ALL | grep $i > /dev/null
235 then
236 GST_PLUGINS_SELECTED="$GST_PLUGINS_SELECTED $i"
237 else
238 echo "plug-in $i not recognized, ignoring..."
239 fi
240 done],
241 [GST_PLUGINS_SELECTED=$GST_PLUGINS_ALL])
243 AC_SUBST(GST_PLUGINS_SELECTED)
245 dnl ###########################
246 dnl # Configure external libs #
247 dnl ###########################
249 dnl *** a52dec ***
250 translit(dnm, m, l) AM_CONDITIONAL(USE_A52DEC, true)
251 GST_CHECK_FEATURE(A52DEC, [a52dec], a52dec, [
252 AC_CHECK_A52DEC(HAVE_A52DEC=yes, HAVE_A52DEC=no)
253 ])
255 dnl *** AMR-NB ***
256 translit(dnm, m, l) AM_CONDITIONAL(USE_AMRNB, true)
257 GST_CHECK_FEATURE(AMRNB, [AMR-NB], amrnbdec amrnbenc, [
258 GST_CHECK_LIBHEADER(AMRNB, amrnb,
259 Decoder_Interface_init, -lm,
260 amrnb/interf_dec.h,
261 AMRNB_LIBS="-lamrnb -lm"
262 AC_SUBST(AMRNB_LIBS))
263 ])
265 dnl *** dvdread ***
266 translit(dnm, m, l) AM_CONDITIONAL(USE_DVDREAD, true)
267 GST_CHECK_FEATURE(DVDREAD, [dvdread library], dvdreadsrc, [
268 GST_CHECK_LIBHEADER(DVDREAD, dvdread, DVDOpen, , dvdread/dvd_reader.h, DVDREAD_LIBS="-ldvdread")
269 AC_SUBST(DVDREAD_LIBS)
270 ])
272 dnl *** dvdnav ***
273 translit(dnm, m, l) AM_CONDITIONAL(USE_DVDNAV, true)
274 GST_CHECK_FEATURE(DVDNAV, [dvdnav library], dvdnavsrc, [
275 translit(dnm, m, l) AC_SUBST(DVDNAV_LIBS)
276 translit(dnm, m, l) AC_SUBST(DVDNAV_CFLAGS)
277 GST_CHECK_CONFIGPROG(DVDNAV, dvdnav-config)
278 if test x"$HAVE_DVDNAV" = x"yes"; then
279 dnl check version
280 DVDNAV_VERSION=`dvdnav-config --version|head -n 1|sed 's/^.*) //'|sed 's/ (.*)//'`
281 DVDNAV_MAJOR=`echo $DVDNAV_VERSION | cut -d. -f1 | sed s/[a-zA-Z\-].*//g`
282 DVDNAV_MINOR=`echo $DVDNAV_VERSION | cut -d. -f2 | sed s/[a-zA-Z\-].*//g`
283 DVDNAV_MICRO=`echo $DVDNAV_VERSION | cut -d. -f3 | sed s/[a-zA-Z\-].*//g`
284 if [[ "$DVDNAV_MAJOR" -eq "0" ]] && \
285 [[ "$DVDNAV_MINOR" -lt "1" ]]; then
286 AC_MSG_WARN([libdvdnav >= 0.1.7 is required, you have $DVDNAV_VERSION])
287 HAVE_DVDNAV="no"
288 elif [[ "$DVDNAV_MAJOR" -eq "0" ]] && \
289 [[ "$DVDNAV_MINOR" -eq "1" ]] && \
290 [[ "$DVDNAV_MICRO" -lt "7" ]]; then
291 AC_MSG_WARN([libdvdnav >= 0.1.7 is required, you have $DVDNAV_VERSION])
292 HAVE_DVDNAV="no"
293 fi
294 fi
295 dnl now check for dvdread/nav_print.h - see #133002
296 AC_CHECK_HEADER(dvdread/nav_print.h, , [
297 AC_MSG_WARN([header dvdread/nav_print.h from dvdread missing])
298 HAVE_DVDNAV="no"
299 ])
300 AS_SCRUB_INCLUDE(DVDNAV_CFLAGS)
302 dnl disabled until plugin is fully functional
303 HAVE_DVDNAV=no
304 ], disabled, , [
305 AC_MSG_NOTICE([dvdnavsrc not stable yet, not building])
306 ])
308 dnl *** lame ***
309 translit(dnm, m, l) AM_CONDITIONAL(USE_LAME, true)
310 GST_CHECK_FEATURE(LAME, [lame mp3 encoder library], lame, [
311 GST_CHECK_LIBHEADER(LAME, mp3lame, lame_init, -lm, lame/lame.h,
312 [
313 HAVE_LAME="yes"
314 LAME_LIBS="-lmp3lame -lm"
315 dnl is lame presets available
316 LAME_CFLAGS=""
317 AC_TRY_RUN([
318 #include <lame/lame.h>
319 int main (int argc, char *argv[])
320 {
321 printf("%d\n", MEDIUM);
322 return 0;
323 }
324 ],
325 [LAME_CFLAGS="-DGSTLAME_PRESET"],
326 [LAME_CFLAGS=""]
327 )
328 AC_SUBST(LAME_CFLAGS)
329 AC_SUBST(LAME_LIBS)
330 ])
331 ])
333 dnl *** id3tag from the MAD project ***
334 translit(dnm, m, l) AM_CONDITIONAL(USE_ID3TAG, true)
335 GST_CHECK_FEATURE(ID3TAG, [id3tag reading and writing from the MAD project], id3tag, [
336 dnl check with pkg-config first
337 PKG_CHECK_MODULES(ID3TAG, id3tag >= 0.15, HAVE_ID3TAG="yes", HAVE_ID3TAG="no")
338 if test "x$HAVE_ID3TAG" = "xno"; then
339 dnl fall back to oldskool detection
340 AC_CHECK_HEADER(id3tag.h, [
341 save_LIBS=$LIBS
342 LIBS="-lz"
343 AC_CHECK_LIB(id3tag, id3_tag_options, HAVE_ID3TAG="yes" ID3TAG_LIBS="-lid3tag -lz")
344 LIBS=$save_LIBS
345 ])
346 fi
347 ])
348 AC_SUBST(ID3TAG_LIBS)
350 dnl *** mad ***
351 translit(dnm, m, l) AM_CONDITIONAL(USE_MAD, true)
352 GST_CHECK_FEATURE(MAD, [mad mp3 decoder], mad, [
353 if test "x$HAVE_ID3TAG" = "xyes"; then
354 dnl check with pkg-config first
355 PKG_CHECK_MODULES(MAD, mad >= 0.15 id3tag >= 0.15, HAVE_MAD="yes", HAVE_MAD="no")
356 if test "x$HAVE_MAD" = "xno"; then
357 dnl fall back to oldskool detection
358 AC_CHECK_HEADER(mad.h, [
359 AC_CHECK_LIB(mad, mad_decoder_finish, HAVE_MAD="yes" MAD_LIBS="-lmad $ID3TAG_LIBS")
360 ])
361 fi
362 else
363 HAVE_MAD="no"
364 AC_MSG_WARN([libid3tag was not available, cannot build MAD MP3 decoder plugin])
365 fi
366 ])
367 AC_SUBST(MAD_LIBS)
369 dnl *** mpeg2dec ***
370 translit(dnm, m, l) AM_CONDITIONAL(USE_MPEG2DEC, true)
371 GST_CHECK_FEATURE(MPEG2DEC, [mpeg2dec], mpeg2dec, [
372 PKG_CHECK_MODULES(MPEG2DEC, libmpeg2 >= 0.4.0,
373 HAVE_MPEG2DEC="yes", HAVE_MPEG2DEC="no")
374 AC_SUBST(MPEG2DEC_CFLAGS)
375 AC_SUBST(MPEG2DEC_LIBS)
376 ])
378 dnl *** sidplay : works with libsidplay 1.36.x (not 2.x.x) ***
379 translit(dnm, m, l) AM_CONDITIONAL(USE_SIDPLAY, true)
380 GST_CHECK_FEATURE(SIDPLAY, [sidplay plug-in], sidplay, [
381 GST_PATH_SIDPLAY()
382 ])
384 dnl also add builddir include for enumtypes and marshal
385 GST_CFLAGS="-I\$(top_srcdir)/gst-libs -I\$(top_builddir)/gst-libs $GST_CFLAGS $GST_ERROR"
387 AC_SUBST(GST_LIBS)
388 AC_SUBST(GST_CFLAGS)
390 dnl ######################
391 dnl # Checks for gtk-doc #
392 dnl ######################
394 GTK_DOC_CHECK([1.3])
395 AS_PATH_PYTHON([2.1])
397 dnl ############################
398 dnl # Set up some more defines #
399 dnl ############################
401 dnl set license and copyright notice
402 AC_DEFINE(GST_LICENSE, "LGPL", [GStreamer license])
404 dnl package name in plugins
405 AC_ARG_WITH(package-name,
406 AC_HELP_STRING([--with-package-name],[specify package name to use in plugins]),
407 [case "${withval}" in
408 yes) AC_MSG_ERROR(bad value ${withval} for --with-package-name) ;;
409 no) AC_MSG_ERROR(bad value ${withval} for --with-package-name) ;;
410 *) GST_PACKAGE="${withval}" ;;
411 esac],
412 [
413 dnl default value
414 if test "x$GST_CVS" = "xyes"
415 then
416 dnl nano >= 1
417 GST_PACKAGE="GStreamer CVS/prerelease"
418 else
419 GST_PACKAGE="GStreamer source release"
420 fi
421 ]
422 )
423 AC_MSG_NOTICE(Using $GST_PACKAGE as package name)
424 AC_DEFINE_UNQUOTED(GST_PACKAGE, "$GST_PACKAGE", [package name in plugins])
426 dnl package origin URL
427 AC_ARG_WITH(package-origin,
428 AC_HELP_STRING([--with-package-origin],[specify package origin URL to use in plugins]),
429 [case "${withval}" in
430 yes) AC_MSG_ERROR(bad value ${withval} for --with-package-origin) ;;
431 no) AC_MSG_ERROR(bad value ${withval} for --with-package-origin) ;;
432 *) GST_ORIGIN="${withval}" ;;
433 esac],
434 [GST_ORIGIN="http://gstreamer.freedesktop.org/"]) dnl Default value
435 AC_MSG_NOTICE(Using $GST_ORIGIN as package origin)
436 AC_DEFINE_UNQUOTED(GST_ORIGIN, "$GST_ORIGIN", [package origin])
438 dnl #########################
439 dnl # Make the output files #
440 dnl #########################
442 dnl po/Makefile.in
444 AC_CONFIG_FILES(
445 Makefile
446 gst/Makefile
447 gst/asfdemux/Makefile
448 gst/dvdlpcmdec/Makefile
449 gst/dvdsub/Makefile
450 gst/iec958/Makefile
451 gst/mpegaudioparse/Makefile
452 gst/mpegstream/Makefile
453 gst/realmedia/Makefile
454 ext/Makefile
455 ext/a52dec/Makefile
456 ext/amrnb/Makefile
457 ext/dvdnav/Makefile
458 ext/dvdread/Makefile
459 ext/lame/Makefile
460 ext/mad/Makefile
461 ext/mpeg2dec/Makefile
462 ext/sidplay/Makefile
463 docs/Makefile
464 docs/plugins/Makefile
465 docs/version.entities
466 common/Makefile
467 common/m4/Makefile
468 m4/Makefile
469 gst-plugins-ugly.spec
470 )
471 AC_OUTPUT
473 echo "configure: *** Core plug-ins, always built:"
474 ( for i in $GST_PLUGINS_ALL; do echo -e '\t'$i; done ) | sort
475 echo
476 echo -n "configure: *** Plug-ins relying on libraries that will be built:"
477 echo -e "$GST_PLUGINS_YES" | sort
478 echo
479 echo -n "configure: *** Plug-ins relying on libraries that will NOT be built:"
480 echo -e "$GST_PLUGINS_NO" | sort
481 echo
482 if test "x$BUILD_EXTERNAL" = "xno"; then
483 echo "configure: *** No external plug-ins will be built"
484 fi