]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - glsdk/gst-plugins-ugly0-10.git/blob - configure.ac
disable use of AS_LIBTOOL_TAGS, it doesn't work correctly
[glsdk/gst-plugins-ugly0-10.git] / configure.ac
1 AC_PREREQ(2.52)
3 dnl initialize autoconf
4 dnl when going to/from release please set the nano (fourth number) right !
5 dnl releases only do Wall, cvs and prerelease does Werror too
6 AC_INIT(GStreamer Ugly Plug-ins, 0.10.3.1,
7     http://bugzilla.gnome.org/enter_bug.cgi?product=GStreamer,
8     gst-plugins-ugly)
10 dnl initialize automake
11 AM_INIT_AUTOMAKE
13 dnl define PACKAGE_VERSION_* variables
14 AS_VERSION
16 dnl check if this is a release version
17 AS_NANO(GST_CVS="no", GST_CVS="yes")
19 dnl can autoconf find the source ?
20 AC_CONFIG_SRCDIR([ext/mad/gstmad.c])
22 dnl define the output header for config
23 AM_CONFIG_HEADER(config.h)
25 dnl AM_MAINTAINER_MODE only provides the option to configure to enable it
26 AM_MAINTAINER_MODE
28 dnl sets host_* variables
29 AC_CANONICAL_HOST
31 dnl our libraries and install dirs use major.minor as a version
32 GST_MAJORMINOR=$PACKAGE_VERSION_MAJOR.$PACKAGE_VERSION_MINOR
33 dnl we override it here if we need to for the release candidate of new series
34 GST_MAJORMINOR=0.10
35 AC_SUBST(GST_MAJORMINOR)
37 dnl FIXME: this macro doesn't actually work;
38 dnl the generated libtool script has no support for the listed tags.
39 dnl So this needs to be fixed first if we want to use this
40 dnl AS_LIBTOOL_TAGS([CXX])
42 AM_PROG_LIBTOOL
44 dnl *** required versions of GStreamer stuff ***
45 GST_REQ=0.10.3
46 GSTPB_REQ=0.10.3
48 dnl *** autotools stuff ****
50 dnl allow for different autotools
51 AS_AUTOTOOLS_ALTERNATE
53 dnl Add parameters for aclocal
54 AC_SUBST(ACLOCAL_AMFLAGS, "-I m4 -I common/m4")
56 dnl set up gettext
57 dnl AM_GNU_GETTEXT_VERSION(0.11.5)
58 dnl AM_GNU_GETTEXT([external])
59 dnl GST_GETTEXT([gst-plugins-ugly-$GST_MAJOR_MINOR])
61 dnl *** check for arguments to configure ***
63 GST_ARG_DEBUG
64 GST_ARG_PROFILING
65 GST_ARG_VALGRIND
66 GST_ARG_GCOV
68 GST_ARG_EXAMPLES
70 GST_ARG_WITH_PKG_CONFIG_PATH
71 GST_ARG_WITH_PACKAGE_NAME
72 GST_ARG_WITH_PACKAGE_ORIGIN
74 dnl these are all the gst plug-ins, compilable without additional libs
75 GST_PLUGINS_ALL="\
76         asfdemux \
77         dvdlpcmdec \
78         dvdsub \
79         iec958 \
80         mpegaudioparse \
81         mpegstream \
82         realmedia \
83         "
85 AC_SUBST(GST_PLUGINS_ALL)
87 GST_PLUGINS_SELECTED=""
89 AC_ARG_WITH(plugins,
90     AC_HELP_STRING([--with-plugins],
91       [comma-separated list of plug-ins to compile]),
92     [for i in `echo $withval | tr , ' '`; do
93         if echo $GST_PLUGINS_ALL | grep $i > /dev/null
94         then
95             GST_PLUGINS_SELECTED="$GST_PLUGINS_SELECTED $i"
96         else
97             echo "plug-in $i not recognized, ignoring..."
98         fi
99     done],
100     [GST_PLUGINS_SELECTED=$GST_PLUGINS_ALL])
102 AC_SUBST(GST_PLUGINS_SELECTED)
104 dnl ext plug-ins; plug-ins that have external dependencies
105 GST_CHECK_FEATURE(EXTERNAL, [enable building of plug-ins with external deps],,
106   [HAVE_EXTERNAL=yes], enabled,
107   [
108     AC_MSG_NOTICE(building external plug-ins)
109     BUILD_EXTERNAL="yes"
110   ],[
111     AC_MSG_NOTICE(all plug-ins with external dependencies will not be built)
112     BUILD_EXTERNAL="no"
113   ])
114 AM_CONDITIONAL(BUILD_EXTERNAL, test "x$BUILD_EXTERNAL" = "xyes")
116 dnl *** checks for platform ***
118 dnl * hardware/architecture *
120 dnl common/m4/gst-arch.m4
121 dnl check CPU type
122 GST_ARCH
124 dnl Determine endianness
125 AC_C_BIGENDIAN
127 dnl *** checks for programs ***
129 dnl find a compiler
130 AC_PROG_CC
132 dnl determine c++ compiler
133 AC_PROG_CXX
134 dnl determine if c++ is available on this system
135 AC_CHECK_PROG(HAVE_CXX, $CXX, yes, no)
137 AC_PATH_PROG(VALGRIND_PATH, valgrind, no)
138 AM_CONDITIONAL(HAVE_VALGRIND, test ! "x$VALGRIND_PATH" = "xno")
140 dnl check for documentation tools
141 GTK_DOC_CHECK([1.3])
142 AS_PATH_PYTHON([2.1])
144 dnl *** checks for libraries ***
146 dnl *** checks for header files ***
148 dnl used by ext/a52dec
149 AX_CREATE_STDINT_H
151 dnl Check for malloc.h
152 AC_CHECK_HEADERS([malloc.h])
154 dnl *** checks for types/defines ***
156 dnl *** checks for structures ***
158 dnl *** checks for compiler characteristics ***
160 dnl *** checks for library functions ***
162 dnl Check for a way to display the function name in debug output
163 GST_CHECK_FUNCTION
165 dnl *** checks for dependancy libraries ***
167 dnl liboil is required
168 PKG_CHECK_MODULES(LIBOIL, liboil-0.3 >= 0.3.6, HAVE_LIBOIL=yes, HAVE_LIBOIL=no)
169 if test "x$HAVE_LIBOIL" != "xyes"
170 then
171   AC_ERROR([liboil-0.3.6 or later is required])
172 fi
174 dnl checks for gstreamer
175 dnl uninstalled is selected preferentially -- see pkg-config(1)
176 GST_CHECK_GST($GST_MAJORMINOR, [$GST_REQ])
177 GST_CHECK_GST_BASE($GST_MAJORMINOR, [$GST_REQ])
178 GST_CHECK_GST_CHECK($GST_MAJORMINOR, [$GST_REQ], no)
179 GST_CHECK_GST_PLUGINS_BASE($GST_MAJORMINOR, [$GSTPB_REQ])
181 dnl FIXME: get rid of this by making sure gstreamer-check brings it in
182 dnl check for "check", unit testing library/header
183 AM_PATH_CHECK(0.9.2, HAVE_CHECK=yes, HAVE_CHECK=no)
184 AM_CONDITIONAL(HAVE_CHECK, test "x$HAVE_CHECK" = "xyes")
186 dnl *** set variables based on configure arguments ***
188 dnl set license and copyright notice
189 GST_LICENSE="LGPL"
190 AC_DEFINE_UNQUOTED(GST_LICENSE, "$GST_LICENSE", [GStreamer license])
191 AC_SUBST(GST_LICENSE)
193 dnl set location of plugin directory
194 GST_SET_PLUGINDIR
196 dnl define an ERROR_CFLAGS Makefile variable
197 GST_SET_ERROR_CFLAGS($GST_CVS)
199 dnl define correct level for debugging messages
200 GST_SET_LEVEL_DEFAULT($GST_CVS)
202 dnl used in examples
203 GST_DEFAULT_ELEMENTS
205 dnl *** ext plug-ins ***
206 dnl keep this list sorted alphabetically !
208 if test "x$BUILD_EXTERNAL" = "xyes"; then
210 echo
211 AC_MSG_NOTICE([Checking libraries for plugins in ext/])
212 echo
214 dnl *** a52dec ***
215 translit(dnm, m, l) AM_CONDITIONAL(USE_A52DEC, true)
216 GST_CHECK_FEATURE(A52DEC, [a52dec], a52dec, [
217   AC_CHECK_A52DEC(HAVE_A52DEC=yes, HAVE_A52DEC=no)
218 ])
220 dnl *** AMR-NB ***
221 translit(dnm, m, l) AM_CONDITIONAL(USE_AMRNB, true)
222 GST_CHECK_FEATURE(AMRNB, [AMR-NB], amrnbdec amrnbenc, [
223   GST_CHECK_LIBHEADER(AMRNB, amrnb,
224                       Decoder_Interface_init, -lm,
225                       amrnb/interf_dec.h,
226                       AMRNB_LIBS="-lamrnb -lm"
227                       AC_SUBST(AMRNB_LIBS))
228 ])
230 dnl *** dvdread ***
231 translit(dnm, m, l) AM_CONDITIONAL(USE_DVDREAD, true)
232 GST_CHECK_FEATURE(DVDREAD, [dvdread library], dvdreadsrc, [
233   GST_CHECK_LIBHEADER(DVDREAD, dvdread, DVDOpen, , dvdread/dvd_reader.h, DVDREAD_LIBS="-ldvdread")
234   AC_SUBST(DVDREAD_LIBS)
235 ])
237 dnl *** dvdnav ***
238 translit(dnm, m, l) AM_CONDITIONAL(USE_DVDNAV, true)
239 GST_CHECK_FEATURE(DVDNAV, [dvdnav library], dvdnavsrc, [
240   translit(dnm, m, l) AC_SUBST(DVDNAV_LIBS)
241   translit(dnm, m, l) AC_SUBST(DVDNAV_CFLAGS)
242   GST_CHECK_CONFIGPROG(DVDNAV, dvdnav-config)
243   if test x"$HAVE_DVDNAV" = x"yes"; then
244     dnl check version
245     DVDNAV_VERSION=`dvdnav-config --version|head -n 1|sed 's/^.*) //'|sed 's/ (.*)//'`
246     DVDNAV_MAJOR=`echo $DVDNAV_VERSION | cut -d. -f1 | sed s/[a-zA-Z\-].*//g`
247     DVDNAV_MINOR=`echo $DVDNAV_VERSION | cut -d. -f2 | sed s/[a-zA-Z\-].*//g`
248     DVDNAV_MICRO=`echo $DVDNAV_VERSION | cut -d. -f3 | sed s/[a-zA-Z\-].*//g`
249     if [[ "$DVDNAV_MAJOR" -eq "0" ]] && \
250        [[ "$DVDNAV_MINOR" -lt "1" ]]; then
251       AC_MSG_WARN([libdvdnav >= 0.1.7 is required, you have $DVDNAV_VERSION])
252       HAVE_DVDNAV="no"
253     elif [[ "$DVDNAV_MAJOR" -eq "0" ]] && \
254          [[ "$DVDNAV_MINOR" -eq "1" ]] && \
255          [[ "$DVDNAV_MICRO" -lt "7" ]]; then
256       AC_MSG_WARN([libdvdnav >= 0.1.7 is required, you have $DVDNAV_VERSION])
257       HAVE_DVDNAV="no"
258     fi
259   fi
260   dnl now check for dvdread/nav_print.h - see #133002
261   AC_CHECK_HEADER(dvdread/nav_print.h, , [
262       AC_MSG_WARN([header dvdread/nav_print.h from dvdread missing])
263       HAVE_DVDNAV="no"
264   ])
265   AS_SCRUB_INCLUDE(DVDNAV_CFLAGS)
267   dnl disabled until plugin is fully functional
268   HAVE_DVDNAV=no
269 ], disabled, , [
270   AC_MSG_NOTICE([dvdnavsrc not stable yet, not building])
271 ])
273 dnl *** lame ***
274 translit(dnm, m, l) AM_CONDITIONAL(USE_LAME, true)
275 GST_CHECK_FEATURE(LAME, [lame mp3 encoder library], lame, [
276   GST_CHECK_LIBHEADER(LAME, mp3lame, lame_init, -lm, lame/lame.h,
277   [
278     HAVE_LAME="yes"
279     LAME_LIBS="-lmp3lame -lm"
280     dnl is lame presets available
281     LAME_CFLAGS=""
282     AC_TRY_RUN([
283 #include <lame/lame.h>
284 int main (int argc, char *argv[])
286   printf("%d\n", MEDIUM);
287   return 0;
289       ],
290       [LAME_CFLAGS="-DGSTLAME_PRESET"],
291       [LAME_CFLAGS=""]
292     )
293   AC_SUBST(LAME_CFLAGS)
294   AC_SUBST(LAME_LIBS)
295   ])
296 ])
298 dnl *** id3tag from the MAD project ***
299 translit(dnm, m, l) AM_CONDITIONAL(USE_ID3TAG, true)
300 GST_CHECK_FEATURE(ID3TAG, [id3tag reading and writing from the MAD project],
301   id3tag, [
302   dnl check with pkg-config first
303   PKG_CHECK_MODULES(ID3TAG, id3tag >= 0.15, HAVE_ID3TAG="yes", HAVE_ID3TAG="no")
304   if test "x$HAVE_ID3TAG" = "xno"; then
305     dnl fall back to oldskool detection
306     AC_CHECK_HEADER(id3tag.h, [
307       save_LIBS=$LIBS
308       LIBS="-lz"
309       AC_CHECK_LIB(id3tag, id3_tag_options,
310         HAVE_ID3TAG="yes" ID3TAG_LIBS="-lid3tag -lz")
311       LIBS=$save_LIBS
312     ])
313   fi
314 ])
315 AC_SUBST(ID3TAG_LIBS)
317 dnl *** mad ***
318 translit(dnm, m, l) AM_CONDITIONAL(USE_MAD, true)
319 GST_CHECK_FEATURE(MAD, [mad mp3 decoder], mad, [
320   if test "x$HAVE_ID3TAG" = "xyes"; then
321     dnl check with pkg-config first
322     PKG_CHECK_MODULES(MAD, mad >= 0.15 id3tag >= 0.15,
323       HAVE_MAD="yes", HAVE_MAD="no")
324     if test "x$HAVE_MAD" = "xno"; then
325       dnl fall back to oldskool detection
326       AC_CHECK_HEADER(mad.h, [
327         AC_CHECK_LIB(mad, mad_decoder_finish,
328           HAVE_MAD="yes" MAD_LIBS="-lmad $ID3TAG_LIBS")
329       ])
330     fi    
331   else
332     HAVE_MAD="no"
333     AC_MSG_WARN([libid3tag not available, cannot build MAD MP3 decoder plugin])
334   fi
335 ])
336 AC_SUBST(MAD_LIBS)
338 dnl *** mpeg2dec ***
339 translit(dnm, m, l) AM_CONDITIONAL(USE_MPEG2DEC, true)
340 GST_CHECK_FEATURE(MPEG2DEC, [mpeg2dec], mpeg2dec, [
341   PKG_CHECK_MODULES(MPEG2DEC, libmpeg2 >= 0.4.0,
342       HAVE_MPEG2DEC="yes", HAVE_MPEG2DEC="no")
343   AC_SUBST(MPEG2DEC_CFLAGS)
344   AC_SUBST(MPEG2DEC_LIBS)
345 ])
347 dnl *** sidplay : works with libsidplay 1.36.x (not 2.x.x) ***
348 translit(dnm, m, l) AM_CONDITIONAL(USE_SIDPLAY, true)
349 GST_CHECK_FEATURE(SIDPLAY, [sidplay plug-in], sidplay, [
350   GST_PATH_SIDPLAY()
351 ])
353 fi dnl of EXT plugins
355 dnl *** finalize CFLAGS, LDFLAGS, LIBS
357 dnl Overview:
358 dnl GST_OPTION_CFLAGS:  common flags for profiling, debugging, errors, ...
359 dnl GST_*:              flags shared by built objects to link against GStreamer
360 dnl GST_ALL_LDFLAGS:    linker flags shared by all
361 dnl GST_LIB_LDFLAGS:    additional linker flags for all libaries
362 dnl GST_LT_LDFLAGS:     library versioning of our libraries
363 dnl GST_PLUGIN_LDFLAGS: flags to be used for all plugins
365 dnl GST_OPTION_CFLAGS
366 if test "x$USE_DEBUG" = xyes; then
367    PROFILE_CFLAGS="-g"
368 fi
369 AC_SUBST(PROFILE_CFLAGS)
371 DEPRECATED_CFLAGS="-DGST_DISABLE_DEPRECATED"
372 AC_SUBST(DEPRECATED_CFLAGS)
374 dnl every flag in GST_OPTION_CFLAGS can be overridden at make time
375 GST_OPTION_CFLAGS="\$(ERROR_CFLAGS) \$(DEBUG_CFLAGS) \$(PROFILE_CFLAGS) \$(GCOV_CFLAGS) \$(OPT_CFLAGS) \$(DEPRECATED_CFLAGS)"
376 AC_SUBST(GST_OPTION_CFLAGS)
378 dnl FIXME: do we want to rename to GST_ALL_* ?
379 dnl prefer internal headers to already installed ones
380 dnl also add builddir include for enumtypes and marshal
381 dnl add GST_OPTION_CFLAGS, but overridable
382 GST_CFLAGS="-I\$(top_srcdir)/gst-libs -I\$(top_builddir)/gst-libs $GST_CFLAGS \$(GST_OPTION_CFLAGS)"
383 AC_SUBST(GST_CFLAGS)
384 AC_SUBST(GST_LIBS)
386 dnl LDFLAGS really should only contain flags, not libs - they get added before
387 dnl whatevertarget_LIBS and -L flags here affect the rest of the linking
388 GST_ALL_LDFLAGS="-no-undefined"
389 AC_SUBST(GST_ALL_LDFLAGS)
391 dnl this really should only contain flags, not libs - they get added before
392 dnl whatevertarget_LIBS and -L flags here affect the rest of the linking
393 GST_PLUGIN_LDFLAGS="-module -avoid-version -export-symbols-regex '^[_]*gst_plugin_desc\$\$' $GST_ALL_LDFLAGS"
394 AC_SUBST(GST_PLUGIN_LDFLAGS)
396 dnl *** output files ***
398 dnl po/Makefile.in
400 AC_CONFIG_FILES(
401 Makefile
402 gst/Makefile
403 gst/asfdemux/Makefile
404 gst/dvdlpcmdec/Makefile
405 gst/dvdsub/Makefile
406 gst/iec958/Makefile
407 gst/mpegaudioparse/Makefile
408 gst/mpegstream/Makefile
409 gst/realmedia/Makefile
410 ext/Makefile
411 ext/a52dec/Makefile
412 ext/amrnb/Makefile
413 ext/dvdnav/Makefile
414 ext/dvdread/Makefile
415 ext/lame/Makefile
416 ext/mad/Makefile
417 ext/mpeg2dec/Makefile
418 ext/sidplay/Makefile
419 docs/Makefile
420 docs/plugins/Makefile
421 docs/version.entities
422 common/Makefile
423 common/m4/Makefile
424 m4/Makefile
425 gst-plugins-ugly.spec
427 AC_OUTPUT
429 GST_OUTPUT_PLUGINS