]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - glsdk/gst-plugins-ugly0-10.git/blob - configure.ac
Port dvdsubdec to 0.10
[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, 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])
50                                                                             
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,
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 *** lame ***
273 translit(dnm, m, l) AM_CONDITIONAL(USE_LAME, true)
274 GST_CHECK_FEATURE(LAME, [lame mp3 encoder library], lame, [
275   GST_CHECK_LIBHEADER(LAME, mp3lame, lame_init, -lm, lame/lame.h,
276   [
277     HAVE_LAME="yes"
278     LAME_LIBS="-lmp3lame -lm"
279     dnl is lame presets available
280     LAME_CFLAGS=""
281     AC_TRY_RUN([
282 #include <lame/lame.h>
283 int main (int argc, char *argv[])
285   printf("%d\n", MEDIUM);
286   return 0;
288       ],
289       [LAME_CFLAGS="-DGSTLAME_PRESET"],
290       [LAME_CFLAGS=""]
291     )
292   AC_SUBST(LAME_CFLAGS)
293   AC_SUBST(LAME_LIBS)
294   ])
295 ])
297 dnl *** mad ***
298 dnl FIXME: we could use header checks here as well IMO
299 translit(dnm, m, l) AM_CONDITIONAL(USE_MAD, true)
300 GST_CHECK_FEATURE(MAD, [mad mp3 decoder], mad, [
301   dnl check with pkg-config first
302   PKG_CHECK_MODULES(MAD, mad >= 0.15 id3tag >= 0.15, HAVE_MAD="yes", HAVE_MAD="no")
303   if test "x$HAVE_MAD" = "xno"; then
304     dnl fall back to oldskool detection
305     AC_CHECK_LIB(mad, mad_decoder_finish, HAVE_MAD="yes" MAD_LIBS="-lmad")
306     if test "x$HAVE_MAD" = "xyes"; then
307       HAVE_MAD="no"
308       save_LIBS=$LIBS
309       LIBS="-lz"
310       AC_CHECK_LIB(id3tag, id3_tag_options, HAVE_MAD="yes" MAD_LIBS="-lmad -lid3tag -lz")
311       LIBS=$save_LIBS
312     fi
313   fi    
314 ])
315 AC_SUBST(MAD_LIBS)
317 dnl *** mpeg2dec ***
318 translit(dnm, m, l) AM_CONDITIONAL(USE_MPEG2DEC, true)
319 GST_CHECK_FEATURE(MPEG2DEC, [mpeg2dec], mpeg2dec, [
320   PKG_CHECK_MODULES(MPEG2DEC, libmpeg2 >= 0.4.0,
321       HAVE_MPEG2DEC="yes", HAVE_MPEG2DEC="no")
322   AC_SUBST(MPEG2DEC_CFLAGS)
323   AC_SUBST(MPEG2DEC_LIBS)
324 ])
326 dnl *** sidplay : works with libsidplay 1.36.x (not 2.x.x) ***
327 translit(dnm, m, l) AM_CONDITIONAL(USE_SIDPLAY, true)
328 GST_CHECK_FEATURE(SIDPLAY, [sidplay plug-in], sidplay, [
329   GST_PATH_SIDPLAY()
330 ])
332 dnl also add builddir include for enumtypes and marshal
333 GST_CFLAGS="-I\$(top_srcdir)/gst-libs -I\$(top_builddir)/gst-libs $GST_CFLAGS $GST_ERROR"
335 AC_SUBST(GST_LIBS)
336 AC_SUBST(GST_CFLAGS)
338 dnl ######################
339 dnl # Checks for gtk-doc #
340 dnl ######################
342 GTK_DOC_CHECK([1.3])
343 AS_PATH_PYTHON([2.1])
345 dnl ############################
346 dnl # Set up some more defines #
347 dnl ############################
349 dnl set license and copyright notice
350 AC_DEFINE(GST_LICENSE, "LGPL", [GStreamer license])
352 dnl package name in plugins
353 AC_ARG_WITH(package-name,
354 AC_HELP_STRING([--with-package-name],[specify package name to use in plugins]),
355 [case "${withval}" in
356   yes) AC_MSG_ERROR(bad value ${withval} for --with-package-name) ;;
357   no) AC_MSG_ERROR(bad value ${withval} for --with-package-name) ;;
358   *) GST_PACKAGE="${withval}" ;;
359 esac], 
361 dnl default value
362 if test "x$GST_CVS" = "xyes"
363 then
364   dnl nano >= 1
365   GST_PACKAGE="GStreamer CVS/prerelease"
366 else
367   GST_PACKAGE="GStreamer source release"
368 fi
371 AC_MSG_NOTICE(Using $GST_PACKAGE as package name)
372 AC_DEFINE_UNQUOTED(GST_PACKAGE, "$GST_PACKAGE", [package name in plugins])
374 dnl package origin URL
375 AC_ARG_WITH(package-origin,
376 AC_HELP_STRING([--with-package-origin],[specify package origin URL to use in plugins]),
377 [case "${withval}" in
378   yes) AC_MSG_ERROR(bad value ${withval} for --with-package-origin) ;;
379   no) AC_MSG_ERROR(bad value ${withval} for --with-package-origin) ;;
380   *) GST_ORIGIN="${withval}" ;;
381 esac], 
382 [GST_ORIGIN="http://gstreamer.freedesktop.org/"]) dnl Default value
383 AC_MSG_NOTICE(Using $GST_ORIGIN as package origin)
384 AC_DEFINE_UNQUOTED(GST_ORIGIN, "$GST_ORIGIN", [package origin])
386 dnl #########################
387 dnl # Make the output files #
388 dnl #########################
390 dnl po/Makefile.in
392 AC_CONFIG_FILES(
393 Makefile
394 gst/Makefile
395 gst/asfdemux/Makefile
396 gst/dvdlpcmdec/Makefile
397 gst/dvdsub/Makefile
398 gst/iec958/Makefile
399 gst/mpegaudioparse/Makefile
400 gst/mpegstream/Makefile
401 gst/realmedia/Makefile
402 ext/Makefile
403 ext/a52dec/Makefile
404 ext/amrnb/Makefile
405 ext/dvdread/Makefile
406 ext/lame/Makefile
407 ext/mad/Makefile
408 ext/mpeg2dec/Makefile
409 ext/sidplay/Makefile
410 docs/Makefile
411 docs/plugins/Makefile
412 docs/version.entities
413 common/Makefile
414 common/m4/Makefile
415 m4/Makefile
416 gst-plugins-ugly.spec
418 AC_OUTPUT
420 echo "configure: *** Core plug-ins, always built:"
421 ( for i in $GST_PLUGINS_ALL; do echo -e '\t'$i; done ) | sort
422 echo
423 echo -n "configure: *** Plug-ins relying on libraries that will be built:"
424 echo -e "$GST_PLUGINS_YES" | sort
425 echo
426 echo -n "configure: *** Plug-ins relying on libraries that will NOT be built:"
427 echo -e "$GST_PLUGINS_NO" | sort
428 echo
429 if test "x$BUILD_EXTERNAL" = "xno"; then
430   echo "configure: *** No external plug-ins will be built"
431 fi