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