]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - glsdk/gst-plugins-ugly0-10.git/blob - configure.ac
1e8c5e9130f74b24a303c03ff5c238c59314c422
[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, 1, 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.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
85 AX_CREATE_STDINT_H
87 dnl Check for malloc.h
88 AC_CHECK_HEADER(malloc.h,[
89   AC_DEFINE(HAVE_MALLOC_H, 1, [whether malloc.h available])
90 ])
92 dnl Check for a way to display the function name in debug output
93 GST_CHECK_FUNCTION()
95 dnl define correct errorlevel for debugging messages. We want to have GST_ERROR
96 dnl messages printed when running cvs builds
97 if test "x$GST_CVS" = "xyes"; then
98   AC_DEFINE(GST_LEVEL_DEFAULT, GST_LEVEL_ERROR, [Default errorlevel to use])
99 fi
101 dnl Check for FIONREAD ioctl declaration :
102 GST_CHECK_FIONREAD()
104 dnl ############################################
105 dnl # Super Duper options for plug-in building #
106 dnl ############################################
108 dnl ext plug-ins; plug-ins that have external dependencies
109 GST_CHECK_FEATURE(EXTERNAL, [enable building of plug-ins with external deps],,
110 [HAVE_EXTERNAL=yes],enabled,
112   AC_MSG_WARN(building external plug-ins)
113   BUILD_EXTERNAL="yes"
114 ],[
115   AC_MSG_WARN(all plug-ins with external dependencies will not be built)
116   BUILD_EXTERNAL="no"
117 ])
118 # make BUILD_EXTERNAL available to Makefile.am
119 AM_CONDITIONAL(BUILD_EXTERNAL, test "x$BUILD_EXTERNAL" = "xyes")
121 dnl ##############################
122 dnl # Do automated configuration #
123 dnl ##############################
125 dnl Check for tools:
126 dnl ================
128 dnl allow for different autotools
129 AS_AUTOTOOLS_ALTERNATE()
131 dnl modify pkg-config path
132 AC_ARG_WITH(pkg-config-path, 
133    AC_HELP_STRING([--with-pkg-config-path],[colon-separated list of pkg-config(1) dirs]),
134    [export PKG_CONFIG_PATH=${withval}])
136 GST_DOC()
137 dnl check architecture
138 GST_ARCH()
140 dnl check for gstreamer
141 dnl uninstalled is selected preferentially -- see pkg-config(1)
142 GST_REQ=0.9.0.1
143 PKG_CHECK_MODULES(GST, gstreamer-$GST_MAJORMINOR >= $GST_REQ,
144   HAVE_GST="yes", HAVE_GST="no")
146 if test "x$HAVE_GST" = "xno"; then
147   AC_MSG_ERROR(no GStreamer found)
148 fi
150 GST_TOOLS_DIR=`pkg-config --variable=toolsdir gstreamer-$GST_MAJORMINOR`
151 if test -z $GST_TOOLS_DIR; then
152   AC_MSG_ERROR([no tools dir defined in GStreamer pkg-config file; core upgrade needed.])
153 fi
154 AC_SUBST(GST_TOOLS_DIR)
156 dnl check for gstreamer-base; uninstalled is selected preferentially
157 PKG_CHECK_MODULES(GST_BASE, gstreamer-base-$GST_MAJORMINOR >= $GST_REQ,
158   HAVE_GST_BASE="yes", HAVE_GST_BASE="no")
160 if test "x$HAVE_GST_BASE" = "xno"; then
161   AC_MSG_ERROR(no GStreamer Base Libs found)
162 fi
164 AC_SUBST(GST_BASE_LIBS)
165 AC_SUBST(GST_BASE_CFLAGS)
167 dnl check for gstreamer-plugins-base; uinstalled is selected preferentially
168 PKG_CHECK_MODULES(GST_PLUGINS_BASE,
169   gstreamer-plugins-base-$GST_MAJORMINOR >= $GST_REQ,
170   HAVE_GST_PLUGINS_BASE="yes", HAVE_GST_PLUGINS_BASE="no")
172 if test "x$HAVE_GST_PLUGINS_BASE" = "xno"; then
173   AC_MSG_ERROR(no GStreamer Base Plugins development files found)
174 fi
176 AC_SUBST(GST_PLUGINS_BASE_LIBS)
177 AC_SUBST(GST_PLUGINS_BASE_CFLAGS)
179 dnl Determine endianness
180 AC_C_BIGENDIAN
182 dnl Check for fast float to int casting as defined in C99
183 AC_C99_FUNC_LRINT()
184 AC_C99_FUNC_LRINTF()
186 dnl Check for essential libraries first:
187 dnl ====================================
189 GST_GLIB2_CHECK()
191 dnl Check for additional libraries that we might use:
192 dnl =================================================
194 # we set the defaults always to make sure we have non-empty variables
195 # for the Makefile
197 PKG_CHECK_MODULES(LIBOIL, liboil-0.3 >= 0.3.0, HAVE_LIBOIL=yes, HAVE_LIBOIL=no)
198 AC_SUBST(LIBOIL_CFLAGS)
199 AC_SUBST(LIBOIL_LIBS)
200 if test "x${HAVE_LIBOIL}" = xyes ; then
201   AC_DEFINE_UNQUOTED(HAVE_LIBOIL, 1, [Define if liboil is being used])
202   true
203 fi
205 dnl ===========================================================================
206 dnl ============================= gst plug-ins ================================
207 dnl ===========================================================================
209 plugindir="\$(libdir)/gstreamer-$GST_MAJORMINOR"
210 AC_SUBST(plugindir)
212 GST_PLUGIN_LDFLAGS="-module -avoid-version -export-symbols-regex '[_]*(gst_|Gst|GST_).*' $GST_LIBS"
213 AC_SUBST(GST_PLUGIN_LDFLAGS)
215 dnl these are all the gst plug-ins, compilable without additional libs
216 GST_PLUGINS_ALL="\
217                 dvdlpcmdec \
218                 iec958 \
219                 mpegaudioparse \
220                 realmedia \
221                 "
223 dnl see if we can build C++ plug-ins
224 if test "x$HAVE_CXX" = "xyes"; then
225   GST_PLUGINS_ALL="$GST_PLUGINS_ALL"
226 else
227   AC_MSG_WARN([Not compiling plug-ins requiring C++ compiler])
228 fi
230 AC_SUBST(GST_PLUGINS_ALL)
232 GST_PLUGINS_SELECTED=""
234 AC_ARG_WITH(plugins,
235     AC_HELP_STRING([--with-plugins],[comma-separated list of plug-ins to compile]),
236     [for i in `echo $withval | tr , ' '`; do
237         if echo $GST_PLUGINS_ALL | grep $i > /dev/null
238         then
239             GST_PLUGINS_SELECTED="$GST_PLUGINS_SELECTED $i"
240         else
241             echo "plug-in $i not recognized, ignoring..."
242         fi
243     done],
244     [GST_PLUGINS_SELECTED=$GST_PLUGINS_ALL])
246 AC_SUBST(GST_PLUGINS_SELECTED)
248 dnl ###########################
249 dnl # Configure external libs #
250 dnl ###########################
252 dnl *** AMR-NB ***
253 translit(dnm, m, l) AM_CONDITIONAL(USE_AMRNB, true)
254 GST_CHECK_FEATURE(AMRNB, [AMR-NB], amrnbdec amrnbenc, [
255   GST_CHECK_LIBHEADER(AMRNB, amrnb,
256                       Decoder_Interface_init, -lm,
257                       amrnb/interf_dec.h,
258                       AMRNB_LIBS="-lamrnb -lm"
259                       AC_SUBST(AMRNB_LIBS))
260 ])
263 dnl *** lame ***
264 translit(dnm, m, l) AM_CONDITIONAL(USE_LAME, true)
265 GST_CHECK_FEATURE(LAME, [lame mp3 encoder library], lame, [
266   GST_CHECK_LIBHEADER(LAME, mp3lame, lame_init, -lm, lame/lame.h,
267   [
268     HAVE_LAME="yes"
269     LAME_LIBS="-lmp3lame -lm"
270     dnl is lame presets available
271     LAME_CFLAGS=""
272     AC_TRY_RUN([
273 #include <lame/lame.h>
274 int main (int argc, char *argv[])
276   printf("%d\n", MEDIUM);
277   return 0;
279       ],
280       [LAME_CFLAGS="-DGSTLAME_PRESET"],
281       [LAME_CFLAGS=""]
282     )
283   AC_SUBST(LAME_CFLAGS)
284   AC_SUBST(LAME_LIBS)
285   ])
286 ])
288 dnl *** mad ***
289 dnl FIXME: we could use header checks here as well IMO
290 translit(dnm, m, l) AM_CONDITIONAL(USE_MAD, true)
291 GST_CHECK_FEATURE(MAD, [mad mp3 decoder], mad, [
292   dnl check with pkg-config first
293   PKG_CHECK_MODULES(MAD, mad >= 0.15 id3tag >= 0.15, HAVE_MAD="yes", HAVE_MAD="no")
294   if test "x$HAVE_MAD" = "xno"; then
295     dnl fall back to oldskool detection
296     AC_CHECK_LIB(mad, mad_decoder_finish, HAVE_MAD="yes" MAD_LIBS="-lmad")
297     if test "x$HAVE_MAD" = "xyes"; then
298       HAVE_MAD="no"
299       save_LIBS=$LIBS
300       LIBS="-lz"
301       AC_CHECK_LIB(id3tag, id3_tag_options, HAVE_MAD="yes" MAD_LIBS="-lmad -lid3tag -lz")
302       LIBS=$save_LIBS
303     fi
304   fi    
305 ])
306 AC_SUBST(MAD_LIBS)
308 dnl *** mpeg2dec ***
309 translit(dnm, m, l) AM_CONDITIONAL(USE_MPEG2DEC, true)
310 GST_CHECK_FEATURE(MPEG2DEC, [mpeg2dec], mpeg2dec, [
311   PKG_CHECK_MODULES(MPEG2DEC, libmpeg2 >= 0.4.0,
312       HAVE_MPEG2DEC="yes", HAVE_MPEG2DEC="no")
313   AC_SUBST(MPEG2DEC_CFLAGS)
314   AC_SUBST(MPEG2DEC_LIBS)
315 ])
317 dnl *** sidplay : works with libsidplay 1.36.x (not 2.x.x) ***
318 translit(dnm, m, l) AM_CONDITIONAL(USE_SIDPLAY, true)
319 GST_CHECK_FEATURE(SIDPLAY, [sidplay plug-in], sidplay, [
320   GST_PATH_SIDPLAY()
321 ])
323 dnl also add builddir include for enumtypes and marshal
324 GST_CFLAGS="-I\$(top_srcdir)/gst-libs -I\$(top_builddir)/gst-libs $GST_CFLAGS $GST_ERROR"
326 AC_SUBST(GST_LIBS)
327 AC_SUBST(GST_CFLAGS)
329 dnl ######################
330 dnl # Checks for gtk-doc #
331 dnl ######################
333 GTK_DOC_CHECK([1.3])
334 AS_PATH_PYTHON([2.1])
336 dnl ############################
337 dnl # Set up some more defines #
338 dnl ############################
340 dnl set license and copyright notice
341 AC_DEFINE(GST_LICENSE, "LGPL", [GStreamer license])
343 dnl package name in plugins
344 AC_ARG_WITH(package-name,
345 AC_HELP_STRING([--with-package-name],[specify package name to use in plugins]),
346 [case "${withval}" in
347   yes) AC_MSG_ERROR(bad value ${withval} for --with-package-name) ;;
348   no) AC_MSG_ERROR(bad value ${withval} for --with-package-name) ;;
349   *) GST_PACKAGE="${withval}" ;;
350 esac], 
352 dnl default value
353 if test "x$GST_CVS" = "xyes"
354 then
355   dnl nano >= 1
356   GST_PACKAGE="GStreamer CVS/prerelease"
357 else
358   GST_PACKAGE="GStreamer source release"
359 fi
362 AC_MSG_NOTICE(Using $GST_PACKAGE as package name)
363 AC_DEFINE_UNQUOTED(GST_PACKAGE, "$GST_PACKAGE", [package name in plugins])
365 dnl package origin URL
366 AC_ARG_WITH(package-origin,
367 AC_HELP_STRING([--with-package-origin],[specify package origin URL to use in plugins]),
368 [case "${withval}" in
369   yes) AC_MSG_ERROR(bad value ${withval} for --with-package-origin) ;;
370   no) AC_MSG_ERROR(bad value ${withval} for --with-package-origin) ;;
371   *) GST_ORIGIN="${withval}" ;;
372 esac], 
373 [GST_ORIGIN="http://gstreamer.freedesktop.org/"]) dnl Default value
374 AC_MSG_NOTICE(Using $GST_ORIGIN as package origin)
375 AC_DEFINE_UNQUOTED(GST_ORIGIN, "$GST_ORIGIN", [package origin])
377 dnl #########################
378 dnl # Make the output files #
379 dnl #########################
381 dnl po/Makefile.in
383 AC_CONFIG_FILES(
384 Makefile
385 gst/Makefile
386 gst/dvdlpcmdec/Makefile
387 gst/iec958/Makefile
388 gst/mpegaudioparse/Makefile
389 gst/realmedia/Makefile
390 ext/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 -n "configure: *** Plug-ins that will be built :"
407 echo -e "$GST_PLUGINS_YES" | sort
408 echo
409 echo -n "configure: *** Plug-ins that will not be built :"
410 echo -e "$GST_PLUGINS_NO" | sort
411 echo
412 if test "x$BUILD_EXTERNAL" = "xno"; then
413   echo "configure: *** No external plug-ins will be built"
414 fi