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([CXX])
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 iec958 \
214 mpegaudioparse \
215 mpegstream \
216 realmedia \
217 "
219 dnl see if we can build C++ plug-ins
220 if test "x$HAVE_CXX" = "xyes"; then
221 GST_PLUGINS_ALL="$GST_PLUGINS_ALL"
222 else
223 AC_MSG_WARN([Not compiling plug-ins requiring C++ compiler])
224 fi
226 AC_SUBST(GST_PLUGINS_ALL)
228 GST_PLUGINS_SELECTED=""
230 AC_ARG_WITH(plugins,
231 AC_HELP_STRING([--with-plugins],[comma-separated list of plug-ins to compile]),
232 [for i in `echo $withval | tr , ' '`; do
233 if echo $GST_PLUGINS_ALL | grep $i > /dev/null
234 then
235 GST_PLUGINS_SELECTED="$GST_PLUGINS_SELECTED $i"
236 else
237 echo "plug-in $i not recognized, ignoring..."
238 fi
239 done],
240 [GST_PLUGINS_SELECTED=$GST_PLUGINS_ALL])
242 AC_SUBST(GST_PLUGINS_SELECTED)
244 dnl ###########################
245 dnl # Configure external libs #
246 dnl ###########################
248 dnl *** a52dec ***
249 translit(dnm, m, l) AM_CONDITIONAL(USE_A52DEC, true)
250 GST_CHECK_FEATURE(A52DEC, [a52dec], a52dec, [
251 AC_CHECK_A52DEC(HAVE_A52DEC=yes, HAVE_A52DEC=no)
252 ])
254 dnl *** AMR-NB ***
255 translit(dnm, m, l) AM_CONDITIONAL(USE_AMRNB, true)
256 GST_CHECK_FEATURE(AMRNB, [AMR-NB], amrnbdec amrnbenc, [
257 GST_CHECK_LIBHEADER(AMRNB, amrnb,
258 Decoder_Interface_init, -lm,
259 amrnb/interf_dec.h,
260 AMRNB_LIBS="-lamrnb -lm"
261 AC_SUBST(AMRNB_LIBS))
262 ])
264 dnl *** dvdread ***
265 translit(dnm, m, l) AM_CONDITIONAL(USE_DVDREAD, true)
266 GST_CHECK_FEATURE(DVDREAD, [dvdread library], dvdreadsrc, [
267 GST_CHECK_LIBHEADER(DVDREAD, dvdread, DVDOpen, , dvdread/dvd_reader.h, DVDREAD_LIBS="-ldvdread")
268 AC_SUBST(DVDREAD_LIBS)
269 ])
271 dnl *** lame ***
272 translit(dnm, m, l) AM_CONDITIONAL(USE_LAME, true)
273 GST_CHECK_FEATURE(LAME, [lame mp3 encoder library], lame, [
274 GST_CHECK_LIBHEADER(LAME, mp3lame, lame_init, -lm, lame/lame.h,
275 [
276 HAVE_LAME="yes"
277 LAME_LIBS="-lmp3lame -lm"
278 dnl is lame presets available
279 LAME_CFLAGS=""
280 AC_TRY_RUN([
281 #include <lame/lame.h>
282 int main (int argc, char *argv[])
283 {
284 printf("%d\n", MEDIUM);
285 return 0;
286 }
287 ],
288 [LAME_CFLAGS="-DGSTLAME_PRESET"],
289 [LAME_CFLAGS=""]
290 )
291 AC_SUBST(LAME_CFLAGS)
292 AC_SUBST(LAME_LIBS)
293 ])
294 ])
296 dnl *** mad ***
297 dnl FIXME: we could use header checks here as well IMO
298 translit(dnm, m, l) AM_CONDITIONAL(USE_MAD, true)
299 GST_CHECK_FEATURE(MAD, [mad mp3 decoder], mad, [
300 dnl check with pkg-config first
301 PKG_CHECK_MODULES(MAD, mad >= 0.15 id3tag >= 0.15, HAVE_MAD="yes", HAVE_MAD="no")
302 if test "x$HAVE_MAD" = "xno"; then
303 dnl fall back to oldskool detection
304 AC_CHECK_LIB(mad, mad_decoder_finish, HAVE_MAD="yes" MAD_LIBS="-lmad")
305 if test "x$HAVE_MAD" = "xyes"; then
306 HAVE_MAD="no"
307 save_LIBS=$LIBS
308 LIBS="-lz"
309 AC_CHECK_LIB(id3tag, id3_tag_options, HAVE_MAD="yes" MAD_LIBS="-lmad -lid3tag -lz")
310 LIBS=$save_LIBS
311 fi
312 fi
313 ])
314 AC_SUBST(MAD_LIBS)
316 dnl *** mpeg2dec ***
317 translit(dnm, m, l) AM_CONDITIONAL(USE_MPEG2DEC, true)
318 GST_CHECK_FEATURE(MPEG2DEC, [mpeg2dec], mpeg2dec, [
319 PKG_CHECK_MODULES(MPEG2DEC, libmpeg2 >= 0.4.0,
320 HAVE_MPEG2DEC="yes", HAVE_MPEG2DEC="no")
321 AC_SUBST(MPEG2DEC_CFLAGS)
322 AC_SUBST(MPEG2DEC_LIBS)
323 ])
325 dnl *** sidplay : works with libsidplay 1.36.x (not 2.x.x) ***
326 translit(dnm, m, l) AM_CONDITIONAL(USE_SIDPLAY, true)
327 GST_CHECK_FEATURE(SIDPLAY, [sidplay plug-in], sidplay, [
328 GST_PATH_SIDPLAY()
329 ])
331 dnl also add builddir include for enumtypes and marshal
332 GST_CFLAGS="-I\$(top_srcdir)/gst-libs -I\$(top_builddir)/gst-libs $GST_CFLAGS $GST_ERROR"
334 AC_SUBST(GST_LIBS)
335 AC_SUBST(GST_CFLAGS)
337 dnl ######################
338 dnl # Checks for gtk-doc #
339 dnl ######################
341 GTK_DOC_CHECK([1.3])
342 AS_PATH_PYTHON([2.1])
344 dnl ############################
345 dnl # Set up some more defines #
346 dnl ############################
348 dnl set license and copyright notice
349 AC_DEFINE(GST_LICENSE, "LGPL", [GStreamer license])
351 dnl package name in plugins
352 AC_ARG_WITH(package-name,
353 AC_HELP_STRING([--with-package-name],[specify package name to use in plugins]),
354 [case "${withval}" in
355 yes) AC_MSG_ERROR(bad value ${withval} for --with-package-name) ;;
356 no) AC_MSG_ERROR(bad value ${withval} for --with-package-name) ;;
357 *) GST_PACKAGE="${withval}" ;;
358 esac],
359 [
360 dnl default value
361 if test "x$GST_CVS" = "xyes"
362 then
363 dnl nano >= 1
364 GST_PACKAGE="GStreamer CVS/prerelease"
365 else
366 GST_PACKAGE="GStreamer source release"
367 fi
368 ]
369 )
370 AC_MSG_NOTICE(Using $GST_PACKAGE as package name)
371 AC_DEFINE_UNQUOTED(GST_PACKAGE, "$GST_PACKAGE", [package name in plugins])
373 dnl package origin URL
374 AC_ARG_WITH(package-origin,
375 AC_HELP_STRING([--with-package-origin],[specify package origin URL to use in plugins]),
376 [case "${withval}" in
377 yes) AC_MSG_ERROR(bad value ${withval} for --with-package-origin) ;;
378 no) AC_MSG_ERROR(bad value ${withval} for --with-package-origin) ;;
379 *) GST_ORIGIN="${withval}" ;;
380 esac],
381 [GST_ORIGIN="http://gstreamer.freedesktop.org/"]) dnl Default value
382 AC_MSG_NOTICE(Using $GST_ORIGIN as package origin)
383 AC_DEFINE_UNQUOTED(GST_ORIGIN, "$GST_ORIGIN", [package origin])
385 dnl #########################
386 dnl # Make the output files #
387 dnl #########################
389 dnl po/Makefile.in
391 AC_CONFIG_FILES(
392 Makefile
393 gst/Makefile
394 gst/asfdemux/Makefile
395 gst/dvdlpcmdec/Makefile
396 gst/iec958/Makefile
397 gst/mpegaudioparse/Makefile
398 gst/mpegstream/Makefile
399 gst/realmedia/Makefile
400 ext/Makefile
401 ext/a52dec/Makefile
402 ext/amrnb/Makefile
403 ext/dvdread/Makefile
404 ext/lame/Makefile
405 ext/mad/Makefile
406 ext/mpeg2dec/Makefile
407 ext/sidplay/Makefile
408 docs/Makefile
409 docs/plugins/Makefile
410 docs/version.entities
411 common/Makefile
412 common/m4/Makefile
413 m4/Makefile
414 gst-plugins-ugly.spec
415 )
416 AC_OUTPUT
418 echo "configure: *** Core plug-ins, always built:"
419 ( for i in $GST_PLUGINS_ALL; do echo -e '\t'$i; done ) | sort
420 echo
421 echo -n "configure: *** Plug-ins relying on libraries that will be built:"
422 echo -e "$GST_PLUGINS_YES" | sort
423 echo
424 echo -n "configure: *** Plug-ins relying on libraries that will NOT be built:"
425 echo -e "$GST_PLUGINS_NO" | sort
426 echo
427 if test "x$BUILD_EXTERNAL" = "xno"; then
428 echo "configure: *** No external plug-ins will be built"
429 fi