]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - glsdk/gst-plugins-ugly0-10.git/blob - configure.ac
updates to make this closer to compile
[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, GST_PLUGINS_VERSION, 0, 8, 90, 1, GST_CVS="no", GST_CVS="yes")
17 AM_INIT_AUTOMAKE($PACKAGE,$VERSION)
19 dnl our libraries and install dirs use major.minor as a version
20 GST_MAJORMINOR=$GST_PLUGINS_VERSION_MAJOR.$GST_PLUGINS_VERSION_MINOR
21 dnl we override it here if we need to for the release candidate of new series
22 GST_MAJORMINOR=0.9
23 AC_SUBST(GST_MAJORMINOR)
25 dnl CURRENT, REVISION, AGE
26 dnl - library source changed -> increment REVISION
27 dnl - interfaces added/removed/changed -> increment CURRENT, REVISION = 0
28 dnl - interfaces added -> increment AGE
29 dnl - interfaces removed -> AGE = 0
30 dnl for 0.8.3 release, gst_play_get_all_by_interface was added, so update
31 AS_LIBTOOL(GST_PLUGINS, 1, 0, 1)
32 AM_PROG_LIBTOOL
34 dnl FIXME take something else ?
35 AC_CONFIG_SRCDIR([gst/law/alaw.c])
36 AM_CONFIG_HEADER(config.h)
38 dnl Add parameters for aclocal
39 dnl (This must come after AM_INIT_AUTOMAKE, since it modifies ACLOCAL)
40 ACLOCAL_FLAGS="-I m4 -I common/m4"
41 AC_SUBST(ACLOCAL_AMFLAGS, $ACLOCAL_FLAGS)
43 AC_PROG_CC
44 AM_PROG_CC_STDC
45 AM_PROG_AS
46 AS="${CC}"
47 AS_PROG_OBJC
49 dnl decide on error flags
50 AS_COMPILER_FLAG(-Wall, GST_WALL="yes", GST_WALL="no")
52 if test "x$GST_WALL" = "xyes"; then
53    GST_ERROR="$GST_ERROR -Wall"
55    if test "x$GST_CVS" = "xyes"; then
56      AS_COMPILER_FLAG(-Werror,GST_ERROR="$GST_ERROR -Werror",GST_ERROR="$GST_ERROR")
57    fi
58 fi
60 dnl determine c++ compiler
61 AC_PROG_CXX
62 dnl determine if c++ is available on this system
63 AC_CHECK_PROG(HAVE_CXX, $CXX, yes, no)
64 dnl determine c++ preprocessor
65 AC_PROG_CXXCPP
66 AC_ISC_POSIX
68 AC_HEADER_STDC([])
69 AC_C_INLINE
70 AX_CREATE_STDINT_H
72 dnl Check for malloc.h
73 AC_CHECK_HEADER(malloc.h,[
74   AC_DEFINE(HAVE_MALLOC_H, 1, [whether malloc.h available])
75 ])
77 dnl Check for a way to display the function name in debug output
78 GST_CHECK_FUNCTION()
80 dnl define correct errorlevel for debugging messages. We want to have GST_ERROR
81 dnl messages printed when running cvs builds
82 if test "x$GST_CVS" = "xyes"; then
83   AC_DEFINE(GST_LEVEL_DEFAULT, GST_LEVEL_ERROR, [Default errorlevel to use])
84 fi
86 dnl Check for FIONREAD ioctl declaration :
87 GST_CHECK_FIONREAD()
89 DEFAULT_AUDIOSINK="osssink"
90 DEFAULT_VIDEOSINK="xvimagesink"
91 DEFAULT_AUDIOSRC="osssrc"
92 DEFAULT_VIDEOSRC="v4lsrc"
93 DEFAULT_VISUALIZER="goom"
94 case "$host" in 
95   *-sun-* | *pc-solaris* )
96     DEFAULT_AUDIOSINK="sunaudiosink"
97     DEFAULT_VIDEOSINK="ximagesink"
98     DEFAULT_AUDIOSRC="sunaudiosrc"
99     ;;
100   *-darwin* )
101     DEFAULT_AUDIOSINK="osxaudiosink"
102     DEFAULT_AUDIOSRC="osxaudiosrc"
103     DEFAULT_VIDEOSINK="osxvideosink"
104     ;;
105 esac
107 AC_SUBST(DEFAULT_AUDIOSINK)
108 AC_DEFINE_UNQUOTED(DEFAULT_AUDIOSINK,"$DEFAULT_AUDIOSINK",[Default audio sink])
109 AC_SUBST(DEFAULT_AUDIOSRC)
110 AC_DEFINE_UNQUOTED(DEFAULT_AUDIOSRC,"$DEFAULT_AUDIOSRC",[Default audio source])
111 AC_SUBST(DEFAULT_VIDEOSINK)
112 AC_DEFINE_UNQUOTED(DEFAULT_VIDEOSINK,"$DEFAULT_VIDEOSINK",[Default video sink])
113 AC_SUBST(DEFAULT_VIDEOSRC)
114 AC_DEFINE_UNQUOTED(DEFAULT_VIDEOSRC,"$DEFAULT_VIDEOSRC",[Default video source])
115 AC_SUBST(DEFAULT_VISUALIZER)
116 AC_DEFINE_UNQUOTED(DEFAULT_VISUALIZER,"$DEFAULT_VISUALIZER",[Default visualizer])
118 dnl ############################################
119 dnl # Super Duper options for plug-in building #
120 dnl ############################################
122 dnl ext plug-ins; plug-ins that have external dependencies
123 GST_CHECK_FEATURE(EXTERNAL, [enable building of plug-ins with external deps],,
124 [HAVE_EXTERNAL=yes],enabled,
126   AC_MSG_WARN(building external plug-ins)
127   BUILD_EXTERNAL="yes"
128 ],[
129   AC_MSG_WARN(all plug-ins with external dependencies will not be built)
130   BUILD_EXTERNAL="no"
131 ])
132 # make BUILD_EXTERNAL available to Makefile.am
133 AM_CONDITIONAL(BUILD_EXTERNAL, test "x$BUILD_EXTERNAL" = "xyes")
135 dnl experimental plug-ins; stuff that hasn't had the dust settle yet
136 dnl read 'builds, but might not work'UTO
137 GST_CHECK_FEATURE(EXPERIMENTAL, [enable building of experimental plug-ins],,
138 [HAVE_EXPERIMENTAL=yes],disabled,
140   AC_MSG_WARN(building experimental plug-ins)
141   USE_TARKIN="yes"
142 ],[
143   AC_MSG_NOTICE(not building experimental plug-ins)
144   USE_TARKIN="no"
145 ])
147 dnl broken plug-ins; stuff that doesn't seem to build at the moment
148 GST_CHECK_FEATURE(BROKEN, [enable building of broken plug-ins],,
149 HAVE_BROKEN=yes,disabled,
150 [  
151   AC_MSG_WARN([building broken plug-ins -- no bug reports on these, only patches :)])
152 ],[
153   AC_MSG_NOTICE([not building broken plug-ins])
154 ])
156 dnl ##############################
157 dnl # Do automated configuration #
158 dnl ##############################
160 dnl Check for tools:
161 dnl ================
163 dnl allow for different autotools
164 AS_AUTOTOOLS_ALTERNATE()
166 dnl modify pkg-config path
167 AC_ARG_WITH(pkg-config-path, 
168    AC_HELP_STRING([--with-pkg-config-path],[colon-separated list of pkg-config(1) dirs]),
169    [export PKG_CONFIG_PATH=${withval}])
171 GST_DOC()
172 dnl check architecture
173 GST_ARCH()
175 dnl check for gconftool-2
177 dnl this macro defines an am conditional, so it needs to be run always
178 AM_GCONF_SOURCE_2
180 translit(dnm, m, l) AM_CONDITIONAL(USE_GCONFTOOL, true)
181 GST_CHECK_FEATURE(GCONFTOOL, [GConf schemas], , [
182   AC_PATH_PROG(GCONFTOOL, gconftool-2, no)
183   if test x$GCONFTOOL = xno; then
184     AC_MSG_WARN(Not installing GConf schemas)
185     HAVE_GCONFTOOL="no"
186   else
187     HAVE_GCONFTOOL="yes"
188   fi
189   AC_SUBST(HAVE_GCONFTOOL)
190 ])
192 dnl check for GConf libraries
193 translit(dnm, m, l) AM_CONDITIONAL(USE_GCONF, true)
194 GST_CHECK_FEATURE(GCONF, [GConf libraries], , [
195   PKG_CHECK_MODULES(GCONF, gconf-2.0, HAVE_GCONF="yes", HAVE_GCONF="no")
196   AC_SUBST(GCONF_CFLAGS)
197   AC_SUBST(GCONF_LIBS)
198 ])
200 dnl check for gstreamer
201 dnl uninstalled is selected preferentially -- see pkg-config(1)
202 GST_REQ=0.9.0.1
203 PKG_CHECK_MODULES(GST, gstreamer-$GST_MAJORMINOR >= $GST_REQ,
204   HAVE_GST="yes", HAVE_GST="no")
206 if test "x$HAVE_GST" = "xno"; then
207   AC_MSG_ERROR(no GStreamer found)
208 fi
210 GST_TOOLS_DIR=`pkg-config --variable=toolsdir gstreamer-$GST_MAJORMINOR`
211 if test -z $GST_TOOLS_DIR; then
212   AC_MSG_ERROR([no tools dir defined in GStreamer pkg-config file; core upgrade needed.])
213 fi
214 AC_SUBST(GST_TOOLS_DIR)
216 dnl check for gstreamer-control; uninstalled is selected preferentially
217 PKG_CHECK_MODULES(GST_CONTROL, gstreamer-control-$GST_MAJORMINOR >= $GST_REQ,
218   HAVE_GST_CONTROL="yes", HAVE_GST_CONTROL="no")
220 if test "x$HAVE_GST_CONTROL" = "xno"; then
221   AC_MSG_ERROR(no GStreamer Control Libs found)
222 fi
224 AC_SUBST(GST_CONTROL_LIBS)
226 dnl check for gstreamer-base; uninstalled is selected preferentially
227 PKG_CHECK_MODULES(GST_BASE, gstreamer-base-$GST_MAJORMINOR >= $GST_REQ,
228   HAVE_GST_BASE="yes", HAVE_GST_BASE="no")
230 if test "x$HAVE_GST_BASE" = "xno"; then
231   AC_MSG_ERROR(no GStreamer Base Libs found)
232 fi
234 AC_SUBST(GST_BASE_LIBS)
236 dnl check for gstreamer-interfaces; uinstalled is selected preferentially
237 PKG_CHECK_MODULES(GST_INTERFACES, gstreamer-interfaces-$GST_MAJORMINOR >= $GST_REQ,
238   HAVE_GST_INTERFACES="yes", HAVE_GST_INTERFACES="no")
240 if test "x$HAVE_GST_INTERFACES" = "xno"; then
241   AC_MSG_ERROR(no GStreamer Interfaces Libs found)
242 fi
244 AC_SUBST(GST_INTERFACES_LIBS)
247 dnl Determine endianness
248 AC_C_BIGENDIAN
250 dnl Check for fast float to int casting as defined in C99
251 AC_C99_FUNC_LRINT()
252 AC_C99_FUNC_LRINTF()
254 dnl Check for essential libraries first:
255 dnl ====================================
257 GST_GLIB2_CHECK()
259 dnl Check for additional libraries that we might use:
260 dnl =================================================
262 # we set the defaults always to make sure we have non-empty variables
263 # for the Makefile
265 PKG_CHECK_MODULES(LIBOIL, liboil-0.2, HAVE_LIBOIL=yes, HAVE_LIBOIL=no)
266 #PKG_CHECK_MODULES(LIBOIL, liboil-0.3 >= 0.3.0, HAVE_LIBOIL=yes, HAVE_LIBOIL=no)
267 AC_SUBST(LIBOIL_CFLAGS)
268 AC_SUBST(LIBOIL_LIBS)
269 if test "x${HAVE_LIBOIL}" = xyes ; then
270   #AC_DEFINE_UNQUOTED(HAVE_LIBOIL, 1, [Define if liboil is being used])
271   true
272 fi
274 dnl ===========================================================================
275 dnl ============================= gst plug-ins ================================
276 dnl ===========================================================================
278 plugindir="\$(libdir)/gstreamer-$GST_MAJORMINOR"
279 AC_SUBST(plugindir)
281 GST_PLUGIN_LDFLAGS="-module -avoid-version -export-symbols-regex '[_]*(gst_|Gst|GST_).*' $GST_LIBS"
282 AC_SUBST(GST_PLUGIN_LDFLAGS)
284 dnl these are all the gst plug-ins, compilable without additional libs
285 GST_PLUGINS_ALL="effectv"
287 dnl see if we can build C++ plug-ins
288 if test "x$HAVE_CXX" = "xyes"; then
289   GST_PLUGINS_ALL="$GST_PLUGINS_ALL"
290 else
291   AC_MSG_WARN([Not compiling plug-ins requiring C++ compiler])
292 fi
294 AC_SUBST(GST_PLUGINS_ALL)
296 GST_PLUGINS_SELECTED=""
298 AC_ARG_WITH(plugins,
299     AC_HELP_STRING([--with-plugins],[comma-separated list of plug-ins to compile]),
300     [for i in `echo $withval | tr , ' '`; do
301         if echo $GST_PLUGINS_ALL | grep $i > /dev/null
302         then
303             GST_PLUGINS_SELECTED="$GST_PLUGINS_SELECTED $i"
304         else
305             echo "plug-in $i not recognized, ignoring..."
306         fi
307     done],
308     [GST_PLUGINS_SELECTED=$GST_PLUGINS_ALL])
310 AC_SUBST(GST_PLUGINS_SELECTED)
312 dnl ==========================================================================
313 dnl ============================= sys plug-ins ================================
314 dnl ==========================================================================
316 dnl *** OSS audio *** (Linux, *BSD)
317 translit(dnm, m, l) AM_CONDITIONAL(USE_OSS, true)
318 GST_CHECK_FEATURE(OSS, [OSS audio], osssrc osssink, [
319   HAVE_OSS="yes"
320   dnl Linux and newer BSD versions :
321   AC_CHECK_HEADER(sys/soundcard.h, [
322     AC_DEFINE(HAVE_OSS_INCLUDE_IN_SYS,, [Define if OSS includes are in /sys/])
323     ] , [
324     dnl Some old BSD versions :
325     AC_CHECK_HEADER(soundcard.h, [
326       AC_DEFINE(HAVE_OSS_INCLUDE_IN_ROOT,, [Define if OSS includes are in /])
327       ], [
328       dnl Some old BSD versions :
329       AC_CHECK_HEADER(machine/soundcard.h, [
330         AC_DEFINE(HAVE_OSS_INCLUDE_IN_MACHINE,, [Define if OSS includes are in /machine/])
331         ], [
332         HAVE_OSS="no"
333       ])
334     ])
335   ])
336 ])
343 AC_SUBST(GST_LIBS)
344 AC_SUBST(GST_CFLAGS)
346 dnl ###########################
347 dnl # Configure external libs #
348 dnl ###########################
350 dnl ############################
351 dnl # Set up some more defines #
352 dnl ############################
354 dnl set license and copyright notice
355 AC_DEFINE(GST_LICENSE, "LGPL", [GStreamer license])
357 dnl package name in plugins
358 AC_ARG_WITH(package-name,
359 AC_HELP_STRING([--with-package-name],[specify package name to use in plugins]),
360 [case "${withval}" in
361   yes) AC_MSG_ERROR(bad value ${withval} for --with-package-name) ;;
362   no) AC_MSG_ERROR(bad value ${withval} for --with-package-name) ;;
363   *) GST_PACKAGE="${withval}" ;;
364 esac], 
366 dnl default value
367 if test "x$GST_CVS" = "xyes"
368 then
369   dnl nano >= 1
370   GST_PACKAGE="GStreamer CVS/prerelease"
371 else
372   GST_PACKAGE="GStreamer source release"
373 fi
376 AC_MSG_NOTICE(Using $GST_PACKAGE as package name)
377 AC_DEFINE_UNQUOTED(GST_PACKAGE, "$GST_PACKAGE", [package name in plugins])
379 dnl package origin URL
380 AC_ARG_WITH(package-origin,
381 AC_HELP_STRING([--with-package-origin],[specify package origin URL to use in plugins]),
382 [case "${withval}" in
383   yes) AC_MSG_ERROR(bad value ${withval} for --with-package-origin) ;;
384   no) AC_MSG_ERROR(bad value ${withval} for --with-package-origin) ;;
385   *) GST_ORIGIN="${withval}" ;;
386 esac], 
387 [GST_ORIGIN="http://gstreamer.freedesktop.org/"]) dnl Default value
388 AC_MSG_NOTICE(Using $GST_ORIGIN as package origin)
389 AC_DEFINE_UNQUOTED(GST_ORIGIN, "$GST_ORIGIN", [package origin])
391 dnl #########################
392 dnl # Make the output files #
393 dnl #########################
395 AC_CONFIG_FILES(
396 Makefile
397 gst-plugins.spec
398 gst/Makefile
399 gst/effectv/Makefile
400 sys/Makefile
401 sys/oss/Makefile
402 common/Makefile
403 common/m4/Makefile
404 m4/Makefile
406 AC_OUTPUT
408 echo -n "configure: *** Plug-ins that will be built :"
409 echo -e "$GST_PLUGINS_YES" | sort
410 echo
411 echo -n "configure: *** Plug-ins that will not be built :"
412 echo -e "$GST_PLUGINS_NO" | sort
413 echo
414 if test "x$BUILD_EXTERNAL" = "xno"; then
415   echo "configure: *** No external plug-ins will be built"
416 fi