]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - glsdk/gst-plugins-ugly0-10.git/blob - configure.ac
port plugins listing changes
[glsdk/gst-plugins-ugly0-10.git] / configure.ac
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, 9, 4, 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.9
24 AC_SUBST(GST_MAJORMINOR)
26 dnl CURRENT, REVISION, AGE
27 dnl - library source changed -> increment REVISION
28 dnl - interfaces added/removed/changed -> increment CURRENT, REVISION = 0
29 dnl - interfaces added -> increment AGE
30 dnl - interfaces removed -> AGE = 0
31 dnl for 0.8.3 release, gst_play_get_all_by_interface was added, so update
32 AS_LIBTOOL(GST_PLUGINS_GOOD, 0, 0, 0)
33 AS_LIBTOOL_TAGS([CXX])
34 AM_PROG_LIBTOOL
36 AC_CONFIG_SRCDIR([ext/mad/gstmad.c])
37 AM_CONFIG_HEADER(config.h)
39 dnl Add parameters for aclocal
40 dnl (This must come after AM_INIT_AUTOMAKE, since it modifies ACLOCAL)
41 ACLOCAL_FLAGS="-I m4 -I common/m4"
42 AC_SUBST(ACLOCAL_AMFLAGS, $ACLOCAL_FLAGS)
44 AC_PROG_CC
45 AM_PROG_CC_STDC
46 AM_PROG_AS
47 AS="${CC}"
48 AS_PROG_OBJC
50 dnl the gettext stuff needed
51 dnl AM_GNU_GETTEXT_VERSION(0.11.5)
52 dnl AM_GNU_GETTEXT([external])
53                                                                             
54 dnl GETTEXT_PACKAGE=gst-plugins-ugly-$GST_MAJORMINOR
55 dnl AC_SUBST(GETTEXT_PACKAGE)
56 dnl AC_DEFINE_UNQUOTED([GETTEXT_PACKAGE], "$GETTEXT_PACKAGE",
57 dnl                   [gettext package name])
59 dnl define LOCALEDIR in config.h
60 dnl AS_AC_EXPAND(LOCALEDIR, $datadir/locale)
61 dnl AC_DEFINE_UNQUOTED([LOCALEDIR], "$LOCALEDIR",
62 dnl                   [gettext locale dir])
64 dnl decide on error flags
65 AS_COMPILER_FLAG(-Wall, GST_WALL="yes", GST_WALL="no")
67 if test "x$GST_WALL" = "xyes"; then
68    GST_ERROR="$GST_ERROR -Wall"
70    if test "x$GST_CVS" = "xyes"; then
71      AS_COMPILER_FLAG(-Werror,GST_ERROR="$GST_ERROR -Werror",GST_ERROR="$GST_ERROR")
72    fi
73 fi
75 dnl determine c++ compiler
76 AC_PROG_CXX
77 dnl determine if c++ is available on this system
78 AC_CHECK_PROG(HAVE_CXX, $CXX, yes, no)
79 dnl determine c++ preprocessor
80 AC_PROG_CXXCPP
81 AC_ISC_POSIX
83 AC_HEADER_STDC([])
84 AC_C_INLINE
86 dnl used by ext/a52dec
87 AX_CREATE_STDINT_H
89 dnl Check for malloc.h
90 AC_CHECK_HEADER(malloc.h,[
91   AC_DEFINE(HAVE_MALLOC_H, 1, [whether malloc.h available])
92 ])
94 dnl Check for a way to display the function name in debug output
95 GST_CHECK_FUNCTION()
97 dnl define correct errorlevel for debugging messages. We want to have GST_ERROR
98 dnl messages printed when running cvs builds
99 if test "x$GST_CVS" = "xyes"; then
100   AC_DEFINE(GST_LEVEL_DEFAULT, GST_LEVEL_ERROR, [Default errorlevel to use])
101 fi
103 dnl Check for FIONREAD ioctl declaration :
104 GST_CHECK_FIONREAD()
106 dnl ############################################
107 dnl # Super Duper options for plug-in building #
108 dnl ############################################
110 dnl ext plug-ins; plug-ins that have external dependencies
111 GST_CHECK_FEATURE(EXTERNAL, [enable building of plug-ins with external deps],,
112 [HAVE_EXTERNAL=yes],enabled,
114   AC_MSG_WARN(building external plug-ins)
115   BUILD_EXTERNAL="yes"
116 ],[
117   AC_MSG_WARN(all plug-ins with external dependencies will not be built)
118   BUILD_EXTERNAL="no"
119 ])
120 # make BUILD_EXTERNAL available to Makefile.am
121 AM_CONDITIONAL(BUILD_EXTERNAL, test "x$BUILD_EXTERNAL" = "xyes")
123 dnl ##############################
124 dnl # Do automated configuration #
125 dnl ##############################
127 dnl Check for tools:
128 dnl ================
130 dnl allow for different autotools
131 AS_AUTOTOOLS_ALTERNATE()
133 dnl modify pkg-config path
134 AC_ARG_WITH(pkg-config-path, 
135    AC_HELP_STRING([--with-pkg-config-path],[colon-separated list of pkg-config(1) dirs]),
136    [export PKG_CONFIG_PATH=${withval}])
138 GST_DOCBOOK_CHECK()
139 dnl check architecture
140 GST_ARCH()
142 dnl check for gstreamer
143 dnl uninstalled is selected preferentially -- see pkg-config(1)
144 GST_REQ=0.9.0.1
145 PKG_CHECK_MODULES(GST, gstreamer-$GST_MAJORMINOR >= $GST_REQ,
146   HAVE_GST="yes", HAVE_GST="no")
148 if test "x$HAVE_GST" = "xno"; then
149   AC_MSG_ERROR(no GStreamer found)
150 fi
152 GST_TOOLS_DIR=`pkg-config --variable=toolsdir gstreamer-$GST_MAJORMINOR`
153 if test -z $GST_TOOLS_DIR; then
154   AC_MSG_ERROR([no tools dir defined in GStreamer pkg-config file; core upgrade needed.])
155 fi
156 AC_SUBST(GST_TOOLS_DIR)
158 dnl check for gstreamer-base; uninstalled is selected preferentially
159 PKG_CHECK_MODULES(GST_BASE, gstreamer-base-$GST_MAJORMINOR >= $GST_REQ,
160   HAVE_GST_BASE="yes", HAVE_GST_BASE="no")
162 if test "x$HAVE_GST_BASE" = "xno"; then
163   AC_MSG_ERROR(no GStreamer Base Libs found)
164 fi
166 AC_SUBST(GST_BASE_LIBS)
167 AC_SUBST(GST_BASE_CFLAGS)
169 dnl check for gstreamer-plugins-base; uinstalled is selected preferentially
170 PKG_CHECK_MODULES(GST_PLUGINS_BASE,
171   gstreamer-plugins-base-$GST_MAJORMINOR >= $GST_REQ,
172   HAVE_GST_PLUGINS_BASE="yes", HAVE_GST_PLUGINS_BASE="no")
174 if test "x$HAVE_GST_PLUGINS_BASE" = "xno"; then
175   AC_MSG_ERROR(no GStreamer Base Plugins development files found)
176 fi
178 AC_SUBST(GST_PLUGINS_BASE_LIBS)
179 AC_SUBST(GST_PLUGINS_BASE_CFLAGS)
181 dnl Determine endianness
182 AC_C_BIGENDIAN
184 dnl Check for essential libraries first:
185 dnl ====================================
187 GST_GLIB_CHECK([2.6.0])
189 dnl Check for additional libraries that we might use:
190 dnl =================================================
192 # we set the defaults always to make sure we have non-empty variables
193 # for the Makefile
195 PKG_CHECK_MODULES(LIBOIL, liboil-0.3 >= 0.3.0, HAVE_LIBOIL=yes, HAVE_LIBOIL=no)
196 AC_SUBST(LIBOIL_CFLAGS)
197 AC_SUBST(LIBOIL_LIBS)
198 if test "x${HAVE_LIBOIL}" = xyes ; then
199   AC_DEFINE_UNQUOTED(HAVE_LIBOIL, 1, [Define if liboil is being used])
200   true
201 fi
203 dnl ===========================================================================
204 dnl ============================= gst plug-ins ================================
205 dnl ===========================================================================
207 plugindir="\$(libdir)/gstreamer-$GST_MAJORMINOR"
208 AC_SUBST(plugindir)
210 GST_PLUGIN_LDFLAGS="-module -avoid-version -export-symbols-regex '[_]*(gst_|Gst|GST_).*' $GST_LIBS"
211 AC_SUBST(GST_PLUGIN_LDFLAGS)
213 dnl these are all the gst plug-ins, compilable without additional libs
214 GST_PLUGINS_ALL="\
215                 dvdlpcmdec \
216                 iec958 \
217                 mpegaudioparse \
218                 realmedia \
219                 "
221 dnl see if we can build C++ plug-ins
222 if test "x$HAVE_CXX" = "xyes"; then
223   GST_PLUGINS_ALL="$GST_PLUGINS_ALL"
224 else
225   AC_MSG_WARN([Not compiling plug-ins requiring C++ compiler])
226 fi
228 AC_SUBST(GST_PLUGINS_ALL)
230 GST_PLUGINS_SELECTED=""
232 AC_ARG_WITH(plugins,
233     AC_HELP_STRING([--with-plugins],[comma-separated list of plug-ins to compile]),
234     [for i in `echo $withval | tr , ' '`; do
235         if echo $GST_PLUGINS_ALL | grep $i > /dev/null
236         then
237             GST_PLUGINS_SELECTED="$GST_PLUGINS_SELECTED $i"
238         else
239             echo "plug-in $i not recognized, ignoring..."
240         fi
241     done],
242     [GST_PLUGINS_SELECTED=$GST_PLUGINS_ALL])
244 AC_SUBST(GST_PLUGINS_SELECTED)
246 dnl ###########################
247 dnl # Configure external libs #
248 dnl ###########################
250 dnl *** a52dec ***
251 translit(dnm, m, l) AM_CONDITIONAL(USE_A52DEC, true)
252 GST_CHECK_FEATURE(A52DEC, [a52dec], a52dec, [
253   AC_CHECK_A52DEC(HAVE_A52DEC=yes, HAVE_A52DEC=no)
254 ])
256 dnl *** AMR-NB ***
257 translit(dnm, m, l) AM_CONDITIONAL(USE_AMRNB, true)
258 GST_CHECK_FEATURE(AMRNB, [AMR-NB], amrnbdec amrnbenc, [
259   GST_CHECK_LIBHEADER(AMRNB, amrnb,
260                       Decoder_Interface_init, -lm,
261                       amrnb/interf_dec.h,
262                       AMRNB_LIBS="-lamrnb -lm"
263                       AC_SUBST(AMRNB_LIBS))
264 ])
267 dnl *** lame ***
268 translit(dnm, m, l) AM_CONDITIONAL(USE_LAME, true)
269 GST_CHECK_FEATURE(LAME, [lame mp3 encoder library], lame, [
270   GST_CHECK_LIBHEADER(LAME, mp3lame, lame_init, -lm, lame/lame.h,
271   [
272     HAVE_LAME="yes"
273     LAME_LIBS="-lmp3lame -lm"
274     dnl is lame presets available
275     LAME_CFLAGS=""
276     AC_TRY_RUN([
277 #include <lame/lame.h>
278 int main (int argc, char *argv[])
280   printf("%d\n", MEDIUM);
281   return 0;
283       ],
284       [LAME_CFLAGS="-DGSTLAME_PRESET"],
285       [LAME_CFLAGS=""]
286     )
287   AC_SUBST(LAME_CFLAGS)
288   AC_SUBST(LAME_LIBS)
289   ])
290 ])
292 dnl *** mad ***
293 dnl FIXME: we could use header checks here as well IMO
294 translit(dnm, m, l) AM_CONDITIONAL(USE_MAD, true)
295 GST_CHECK_FEATURE(MAD, [mad mp3 decoder], mad, [
296   dnl check with pkg-config first
297   PKG_CHECK_MODULES(MAD, mad >= 0.15 id3tag >= 0.15, HAVE_MAD="yes", HAVE_MAD="no")
298   if test "x$HAVE_MAD" = "xno"; then
299     dnl fall back to oldskool detection
300     AC_CHECK_LIB(mad, mad_decoder_finish, HAVE_MAD="yes" MAD_LIBS="-lmad")
301     if test "x$HAVE_MAD" = "xyes"; then
302       HAVE_MAD="no"
303       save_LIBS=$LIBS
304       LIBS="-lz"
305       AC_CHECK_LIB(id3tag, id3_tag_options, HAVE_MAD="yes" MAD_LIBS="-lmad -lid3tag -lz")
306       LIBS=$save_LIBS
307     fi
308   fi    
309 ])
310 AC_SUBST(MAD_LIBS)
312 dnl *** mpeg2dec ***
313 translit(dnm, m, l) AM_CONDITIONAL(USE_MPEG2DEC, true)
314 GST_CHECK_FEATURE(MPEG2DEC, [mpeg2dec], mpeg2dec, [
315   PKG_CHECK_MODULES(MPEG2DEC, libmpeg2 >= 0.4.0,
316       HAVE_MPEG2DEC="yes", HAVE_MPEG2DEC="no")
317   AC_SUBST(MPEG2DEC_CFLAGS)
318   AC_SUBST(MPEG2DEC_LIBS)
319 ])
321 dnl *** sidplay : works with libsidplay 1.36.x (not 2.x.x) ***
322 translit(dnm, m, l) AM_CONDITIONAL(USE_SIDPLAY, true)
323 GST_CHECK_FEATURE(SIDPLAY, [sidplay plug-in], sidplay, [
324   GST_PATH_SIDPLAY()
325 ])
327 dnl also add builddir include for enumtypes and marshal
328 GST_CFLAGS="-I\$(top_srcdir)/gst-libs -I\$(top_builddir)/gst-libs $GST_CFLAGS $GST_ERROR"
330 AC_SUBST(GST_LIBS)
331 AC_SUBST(GST_CFLAGS)
333 dnl ######################
334 dnl # Checks for gtk-doc #
335 dnl ######################
337 GTK_DOC_CHECK([1.3])
338 AS_PATH_PYTHON([2.1])
340 dnl ############################
341 dnl # Set up some more defines #
342 dnl ############################
344 dnl set license and copyright notice
345 AC_DEFINE(GST_LICENSE, "LGPL", [GStreamer license])
347 dnl package name in plugins
348 AC_ARG_WITH(package-name,
349 AC_HELP_STRING([--with-package-name],[specify package name to use in plugins]),
350 [case "${withval}" in
351   yes) AC_MSG_ERROR(bad value ${withval} for --with-package-name) ;;
352   no) AC_MSG_ERROR(bad value ${withval} for --with-package-name) ;;
353   *) GST_PACKAGE="${withval}" ;;
354 esac], 
356 dnl default value
357 if test "x$GST_CVS" = "xyes"
358 then
359   dnl nano >= 1
360   GST_PACKAGE="GStreamer CVS/prerelease"
361 else
362   GST_PACKAGE="GStreamer source release"
363 fi
366 AC_MSG_NOTICE(Using $GST_PACKAGE as package name)
367 AC_DEFINE_UNQUOTED(GST_PACKAGE, "$GST_PACKAGE", [package name in plugins])
369 dnl package origin URL
370 AC_ARG_WITH(package-origin,
371 AC_HELP_STRING([--with-package-origin],[specify package origin URL to use in plugins]),
372 [case "${withval}" in
373   yes) AC_MSG_ERROR(bad value ${withval} for --with-package-origin) ;;
374   no) AC_MSG_ERROR(bad value ${withval} for --with-package-origin) ;;
375   *) GST_ORIGIN="${withval}" ;;
376 esac], 
377 [GST_ORIGIN="http://gstreamer.freedesktop.org/"]) dnl Default value
378 AC_MSG_NOTICE(Using $GST_ORIGIN as package origin)
379 AC_DEFINE_UNQUOTED(GST_ORIGIN, "$GST_ORIGIN", [package origin])
381 dnl #########################
382 dnl # Make the output files #
383 dnl #########################
385 dnl po/Makefile.in
387 AC_CONFIG_FILES(
388 Makefile
389 gst/Makefile
390 gst/dvdlpcmdec/Makefile
391 gst/iec958/Makefile
392 gst/mpegaudioparse/Makefile
393 gst/realmedia/Makefile
394 ext/Makefile
395 ext/a52dec/Makefile
396 ext/amrnb/Makefile
397 ext/lame/Makefile
398 ext/mad/Makefile
399 ext/mpeg2dec/Makefile
400 ext/sidplay/Makefile
401 docs/Makefile
402 docs/plugins/Makefile
403 docs/version.entities
404 common/Makefile
405 common/m4/Makefile
406 m4/Makefile
407 gst-plugins-ugly.spec
409 AC_OUTPUT
411 echo "configure: *** Core plug-ins, always built:"
412 ( for i in $GST_PLUGINS_ALL; do echo -e '\t'$i; done ) | sort
413 echo
414 echo -n "configure: *** Plug-ins relying on libraries that will be built:"
415 echo -e "$GST_PLUGINS_YES" | sort
416 echo
417 echo -n "configure: *** Plug-ins relying on libraries that will NOT be built:"
418 echo -e "$GST_PLUGINS_NO" | sort
419 echo
420 if test "x$BUILD_EXTERNAL" = "xno"; then
421   echo "configure: *** No external plug-ins will be built"
422 fi