configure.ac: fix typo
[platform/upstream/gst-plugins-good.git] / configure.ac
1 dnl autoconf configuration file for gst-plugins 
2 AC_INIT
3 AC_CANONICAL_TARGET
4
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
9
10 dnl AM_MAINTAINER_MODE only provides the option to configure to enable it
11 AM_MAINTAINER_MODE
12
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")
16
17 AM_INIT_AUTOMAKE($PACKAGE,$VERSION)
18
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)
24
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
33
34 dnl FIXME take something else ?
35 AC_CONFIG_SRCDIR([gst/law/alaw.c])
36 AM_CONFIG_HEADER(config.h)
37
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)
42
43 AC_PROG_CC
44 AM_PROG_CC_STDC
45 AM_PROG_AS
46 AS="${CC}"
47 AS_PROG_OBJC
48
49 dnl the gettext stuff needed
50 dnl AM_GNU_GETTEXT_VERSION(0.11.5)
51 dnl AM_GNU_GETTEXT([external])
52                                                                                 
53 dnl GETTEXT_PACKAGE=gst-plugins-$GST_MAJORMINOR
54 dnl AC_SUBST(GETTEXT_PACKAGE)
55 dnl AC_DEFINE_UNQUOTED([GETTEXT_PACKAGE], "$GETTEXT_PACKAGE",
56 dnl                   [gettext package name])
57
58
59 dnl decide on error flags
60 AS_COMPILER_FLAG(-Wall, GST_WALL="yes", GST_WALL="no")
61
62 if test "x$GST_WALL" = "xyes"; then
63    GST_ERROR="$GST_ERROR -Wall"
64
65    if test "x$GST_CVS" = "xyes"; then
66      AS_COMPILER_FLAG(-Werror,GST_ERROR="$GST_ERROR -Werror",GST_ERROR="$GST_ERROR")
67    fi
68 fi
69
70 dnl determine c++ compiler
71 AC_PROG_CXX
72 dnl determine if c++ is available on this system
73 AC_CHECK_PROG(HAVE_CXX, $CXX, yes, no)
74 dnl determine c++ preprocessor
75 AC_PROG_CXXCPP
76 AC_ISC_POSIX
77
78 AC_HEADER_STDC([])
79 AC_C_INLINE
80 AX_CREATE_STDINT_H
81
82 dnl Check for malloc.h
83 AC_CHECK_HEADER(malloc.h,[
84   AC_DEFINE(HAVE_MALLOC_H, 1, [whether malloc.h available])
85 ])
86
87 dnl Check for a way to display the function name in debug output
88 GST_CHECK_FUNCTION()
89
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
95
96 dnl Check for FIONREAD ioctl declaration :
97 GST_CHECK_FIONREAD()
98
99 DEFAULT_AUDIOSINK="osssink"
100 DEFAULT_VIDEOSINK="xvimagesink"
101 DEFAULT_AUDIOSRC="osssrc"
102 DEFAULT_VIDEOSRC="v4lsrc"
103 DEFAULT_VISUALIZER="goom"
104 case "$host" in 
105   *-sun-* | *pc-solaris* )
106     DEFAULT_AUDIOSINK="sunaudiosink"
107     DEFAULT_VIDEOSINK="ximagesink"
108     DEFAULT_AUDIOSRC="sunaudiosrc"
109     ;;
110   *-darwin* )
111     DEFAULT_AUDIOSINK="osxaudiosink"
112     DEFAULT_AUDIOSRC="osxaudiosrc"
113     DEFAULT_VIDEOSINK="osxvideosink"
114     ;;
115 esac
116
117 AC_SUBST(DEFAULT_AUDIOSINK)
118 AC_DEFINE_UNQUOTED(DEFAULT_AUDIOSINK,"$DEFAULT_AUDIOSINK",[Default audio sink])
119 AC_SUBST(DEFAULT_AUDIOSRC)
120 AC_DEFINE_UNQUOTED(DEFAULT_AUDIOSRC,"$DEFAULT_AUDIOSRC",[Default audio source])
121 AC_SUBST(DEFAULT_VIDEOSINK)
122 AC_DEFINE_UNQUOTED(DEFAULT_VIDEOSINK,"$DEFAULT_VIDEOSINK",[Default video sink])
123 AC_SUBST(DEFAULT_VIDEOSRC)
124 AC_DEFINE_UNQUOTED(DEFAULT_VIDEOSRC,"$DEFAULT_VIDEOSRC",[Default video source])
125 AC_SUBST(DEFAULT_VISUALIZER)
126 AC_DEFINE_UNQUOTED(DEFAULT_VISUALIZER,"$DEFAULT_VISUALIZER",[Default visualizer])
127
128 dnl ############################################
129 dnl # Super Duper options for plug-in building #
130 dnl ############################################
131
132 dnl ext plug-ins; plug-ins that have external dependencies
133 GST_CHECK_FEATURE(EXTERNAL, [enable building of plug-ins with external deps],,
134 [HAVE_EXTERNAL=yes],enabled,
135 [
136   AC_MSG_WARN(building external plug-ins)
137   BUILD_EXTERNAL="yes"
138 ],[
139   AC_MSG_WARN(all plug-ins with external dependencies will not be built)
140   BUILD_EXTERNAL="no"
141 ])
142 # make BUILD_EXTERNAL available to Makefile.am
143 AM_CONDITIONAL(BUILD_EXTERNAL, test "x$BUILD_EXTERNAL" = "xyes")
144
145 dnl experimental plug-ins; stuff that hasn't had the dust settle yet
146 dnl read 'builds, but might not work'UTO
147 GST_CHECK_FEATURE(EXPERIMENTAL, [enable building of experimental plug-ins],,
148 [HAVE_EXPERIMENTAL=yes],disabled,
149 [
150   AC_MSG_WARN(building experimental plug-ins)
151   USE_TARKIN="yes"
152 ],[
153   AC_MSG_NOTICE(not building experimental plug-ins)
154   USE_TARKIN="no"
155 ])
156
157 dnl broken plug-ins; stuff that doesn't seem to build at the moment
158 GST_CHECK_FEATURE(BROKEN, [enable building of broken plug-ins],,
159 HAVE_BROKEN=yes,disabled,
160 [  
161   AC_MSG_WARN([building broken plug-ins -- no bug reports on these, only patches :)])
162 ],[
163   AC_MSG_NOTICE([not building broken plug-ins])
164 ])
165
166 dnl ##############################
167 dnl # Do automated configuration #
168 dnl ##############################
169
170 dnl Check for tools:
171 dnl ================
172
173 dnl allow for different autotools
174 AS_AUTOTOOLS_ALTERNATE()
175
176 dnl modify pkg-config path
177 AC_ARG_WITH(pkg-config-path, 
178    AC_HELP_STRING([--with-pkg-config-path],[colon-separated list of pkg-config(1) dirs]),
179    [export PKG_CONFIG_PATH=${withval}])
180
181 GST_DOC()
182 dnl check architecture
183 GST_ARCH()
184
185 dnl check for gconftool-2
186
187 dnl this macro defines an am conditional, so it needs to be run always
188 AM_GCONF_SOURCE_2
189
190 translit(dnm, m, l) AM_CONDITIONAL(USE_GCONFTOOL, true)
191 GST_CHECK_FEATURE(GCONFTOOL, [GConf schemas], , [
192   AC_PATH_PROG(GCONFTOOL, gconftool-2, no)
193   if test x$GCONFTOOL = xno; then
194     AC_MSG_WARN(Not installing GConf schemas)
195     HAVE_GCONFTOOL="no"
196   else
197     HAVE_GCONFTOOL="yes"
198   fi
199   AC_SUBST(HAVE_GCONFTOOL)
200 ])
201
202 dnl check for GConf libraries
203 translit(dnm, m, l) AM_CONDITIONAL(USE_GCONF, true)
204 GST_CHECK_FEATURE(GCONF, [GConf libraries], , [
205   PKG_CHECK_MODULES(GCONF, gconf-2.0, HAVE_GCONF="yes", HAVE_GCONF="no")
206   AC_SUBST(GCONF_CFLAGS)
207   AC_SUBST(GCONF_LIBS)
208 ])
209
210 dnl check for gstreamer
211 dnl uninstalled is selected preferentially -- see pkg-config(1)
212 GST_REQ=0.9.0.1
213 PKG_CHECK_MODULES(GST, gstreamer-$GST_MAJORMINOR >= $GST_REQ,
214   HAVE_GST="yes", HAVE_GST="no")
215
216 if test "x$HAVE_GST" = "xno"; then
217   AC_MSG_ERROR(no GStreamer found)
218 fi
219
220 GST_TOOLS_DIR=`pkg-config --variable=toolsdir gstreamer-$GST_MAJORMINOR`
221 if test -z $GST_TOOLS_DIR; then
222   AC_MSG_ERROR([no tools dir defined in GStreamer pkg-config file; core upgrade needed.])
223 fi
224 AC_SUBST(GST_TOOLS_DIR)
225
226 dnl check for gstreamer-control; uninstalled is selected preferentially
227 PKG_CHECK_MODULES(GST_CONTROL, gstreamer-control-$GST_MAJORMINOR >= $GST_REQ,
228   HAVE_GST_CONTROL="yes", HAVE_GST_CONTROL="no")
229
230 if test "x$HAVE_GST_CONTROL" = "xno"; then
231   AC_MSG_ERROR(no GStreamer Control Libs found)
232 fi
233
234 AC_SUBST(GST_CONTROL_LIBS)
235
236 dnl check for gstreamer-base; uninstalled is selected preferentially
237 PKG_CHECK_MODULES(GST_BASE, gstreamer-base-$GST_MAJORMINOR >= $GST_REQ,
238   HAVE_GST_BASE="yes", HAVE_GST_BASE="no")
239
240 if test "x$HAVE_GST_BASE" = "xno"; then
241   AC_MSG_ERROR(no GStreamer Base Libs found)
242 fi
243
244 AC_SUBST(GST_BASE_LIBS)
245
246 dnl check for gstreamer-interfaces; uinstalled is selected preferentially
247 PKG_CHECK_MODULES(GST_INTERFACES, gstreamer-interfaces-$GST_MAJORMINOR >= $GST_REQ,
248   HAVE_GST_INTERFACES="yes", HAVE_GST_INTERFACES="no")
249
250 if test "x$HAVE_GST_INTERFACES" = "xno"; then
251   AC_MSG_ERROR(no GStreamer Interfaces Libs found)
252 fi
253
254 AC_SUBST(GST_INTERFACES_LIBS)
255
256
257 dnl Determine endianness
258 AC_C_BIGENDIAN
259
260 dnl Check for fast float to int casting as defined in C99
261 AC_C99_FUNC_LRINT()
262 AC_C99_FUNC_LRINTF()
263
264 dnl Check for essential libraries first:
265 dnl ====================================
266
267 GST_GLIB2_CHECK()
268
269 dnl Check for additional libraries that we might use:
270 dnl =================================================
271
272 # we set the defaults always to make sure we have non-empty variables
273 # for the Makefile
274
275 PKG_CHECK_MODULES(LIBOIL, liboil-0.2, HAVE_LIBOIL=yes, HAVE_LIBOIL=no)
276 #PKG_CHECK_MODULES(LIBOIL, liboil-0.3 >= 0.3.0, HAVE_LIBOIL=yes, HAVE_LIBOIL=no)
277 AC_SUBST(LIBOIL_CFLAGS)
278 AC_SUBST(LIBOIL_LIBS)
279 if test "x${HAVE_LIBOIL}" = xyes ; then
280   #AC_DEFINE_UNQUOTED(HAVE_LIBOIL, 1, [Define if liboil is being used])
281   true
282 fi
283
284 dnl ===========================================================================
285 dnl ============================= gst plug-ins ================================
286 dnl ===========================================================================
287
288 plugindir="\$(libdir)/gstreamer-$GST_MAJORMINOR"
289 AC_SUBST(plugindir)
290
291 GST_PLUGIN_LDFLAGS="-module -avoid-version -export-symbols-regex '[_]*(gst_|Gst|GST_).*' $GST_LIBS"
292 AC_SUBST(GST_PLUGIN_LDFLAGS)
293
294 dnl these are all the gst plug-ins, compilable without additional libs
295 GST_PLUGINS_ALL="effectv"
296
297 dnl see if we can build C++ plug-ins
298 if test "x$HAVE_CXX" = "xyes"; then
299   GST_PLUGINS_ALL="$GST_PLUGINS_ALL"
300 else
301   AC_MSG_WARN([Not compiling plug-ins requiring C++ compiler])
302 fi
303
304 AC_SUBST(GST_PLUGINS_ALL)
305
306 GST_PLUGINS_SELECTED=""
307
308 AC_ARG_WITH(plugins,
309     AC_HELP_STRING([--with-plugins],[comma-separated list of plug-ins to compile]),
310     [for i in `echo $withval | tr , ' '`; do
311         if echo $GST_PLUGINS_ALL | grep $i > /dev/null
312         then
313             GST_PLUGINS_SELECTED="$GST_PLUGINS_SELECTED $i"
314         else
315             echo "plug-in $i not recognized, ignoring..."
316         fi
317     done],
318     [GST_PLUGINS_SELECTED=$GST_PLUGINS_ALL])
319
320 AC_SUBST(GST_PLUGINS_SELECTED)
321
322 dnl ==========================================================================
323 dnl ============================= sys plug-ins ================================
324 dnl ==========================================================================
325
326 dnl *** OSS audio *** (Linux, *BSD)
327 dnl translit(dnm, m, l) AM_CONDITIONAL(USE_OSS, true)
328 dnl GST_CHECK_FEATURE(OSS, [OSS audio], osssrc osssink, [
329 dnl  HAVE_OSS="yes"
330   dnl Linux and newer BSD versions :
331 dnl  AC_CHECK_HEADER(sys/soundcard.h, [
332 dnl    AC_DEFINE(HAVE_OSS_INCLUDE_IN_SYS,, [Define if OSS includes are in /sys/])
333 dnl    ] , [
334     dnl Some old BSD versions :
335 dnl    AC_CHECK_HEADER(soundcard.h, [
336 dnl      AC_DEFINE(HAVE_OSS_INCLUDE_IN_ROOT,, [Define if OSS includes are in /])
337 dnl      ], [
338       dnl Some old BSD versions :
339 dnl      AC_CHECK_HEADER(machine/soundcard.h, [
340 dnl        AC_DEFINE(HAVE_OSS_INCLUDE_IN_MACHINE,, [Define if OSS includes are in /machine/])
341 dnl        ], [
342 dnl        HAVE_OSS="no"
343 dnl      ])
344 dnl    ])
345 dnl  ])
346 dnl ])
347
348
349
350
351
352
353 AC_SUBST(GST_LIBS)
354 AC_SUBST(GST_CFLAGS)
355
356 dnl ###########################
357 dnl # Configure external libs #
358 dnl ###########################
359
360 dnl ############################
361 dnl # Set up some more defines #
362 dnl ############################
363
364 dnl set license and copyright notice
365 AC_DEFINE(GST_LICENSE, "LGPL", [GStreamer license])
366
367 dnl package name in plugins
368 AC_ARG_WITH(package-name,
369 AC_HELP_STRING([--with-package-name],[specify package name to use in plugins]),
370 [case "${withval}" in
371   yes) AC_MSG_ERROR(bad value ${withval} for --with-package-name) ;;
372   no) AC_MSG_ERROR(bad value ${withval} for --with-package-name) ;;
373   *) GST_PACKAGE="${withval}" ;;
374 esac], 
375 [
376 dnl default value
377 if test "x$GST_CVS" = "xyes"
378 then
379   dnl nano >= 1
380   GST_PACKAGE="GStreamer CVS/prerelease"
381 else
382   GST_PACKAGE="GStreamer source release"
383 fi
384 ]
385 )
386 AC_MSG_NOTICE(Using $GST_PACKAGE as package name)
387 AC_DEFINE_UNQUOTED(GST_PACKAGE, "$GST_PACKAGE", [package name in plugins])
388
389 dnl package origin URL
390 AC_ARG_WITH(package-origin,
391 AC_HELP_STRING([--with-package-origin],[specify package origin URL to use in plugins]),
392 [case "${withval}" in
393   yes) AC_MSG_ERROR(bad value ${withval} for --with-package-origin) ;;
394   no) AC_MSG_ERROR(bad value ${withval} for --with-package-origin) ;;
395   *) GST_ORIGIN="${withval}" ;;
396 esac], 
397 [GST_ORIGIN="http://gstreamer.freedesktop.org/"]) dnl Default value
398 AC_MSG_NOTICE(Using $GST_ORIGIN as package origin)
399 AC_DEFINE_UNQUOTED(GST_ORIGIN, "$GST_ORIGIN", [package origin])
400
401 dnl #########################
402 dnl # Make the output files #
403 dnl #########################
404
405 AC_CONFIG_FILES(
406 Makefile
407 gst-plugins.spec
408 gst/Makefile
409 gst/effectv/Makefile
410 sys/Makefile
411 common/Makefile
412 common/m4/Makefile
413 m4/Makefile
414 )
415 AC_OUTPUT
416
417 echo -n "configure: *** Plug-ins that will be built :"
418 echo -e "$GST_PLUGINS_YES" | sort
419 echo
420 echo -n "configure: *** Plug-ins that will not be built :"
421 echo -e "$GST_PLUGINS_NO" | sort
422 echo
423 if test "x$BUILD_EXTERNAL" = "xno"; then
424   echo "configure: *** No external plug-ins will be built"
425 fi