Remove mpg123 plugin, moved to -good
[platform/upstream/gst-plugins-ugly.git] / configure.ac
1 AC_PREREQ([2.69])
2
3 dnl please read gstreamer/docs/random/autotools before changing this file
4
5 dnl initialize autoconf
6 dnl releases only do -Wall, cvs and prerelease does -Werror too
7 dnl use a three digit version number for releases, and four for cvs/prerelease
8 AC_INIT([GStreamer Ugly Plug-ins],[1.13.0.1],[http://bugzilla.gnome.org/enter_bug.cgi?product=GStreamer],[gst-plugins-ugly])
9
10 AG_GST_INIT
11
12 dnl initialize automake
13 AM_INIT_AUTOMAKE([-Wno-portability 1.14 no-dist-gzip dist-xz tar-ustar subdir-objects])
14
15 dnl define PACKAGE_VERSION_* variables
16 AS_VERSION
17
18 dnl check if this is a release version
19 AS_NANO(GST_GIT="no", GST_GIT="yes")
20
21 dnl can autoconf find the source ?
22 AC_CONFIG_SRCDIR([gst/asfdemux/gstasfdemux.c])
23
24 dnl define the output header for config
25 AC_CONFIG_HEADERS(config.h)
26
27 dnl AM_MAINTAINER_MODE only provides the option to configure to enable it
28 AM_MAINTAINER_MODE([enable])
29
30 dnl sets host_* variables
31 AC_CANONICAL_HOST
32
33 dnl use pretty build output with automake >= 1.11
34 m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])],
35   [AM_DEFAULT_VERBOSITY=1
36    AC_SUBST(AM_DEFAULT_VERBOSITY)])
37
38 dnl our libraries and install dirs use GST_API_VERSION in the filename
39 dnl to allow side-by-side installation of different API versions
40 GST_API_VERSION=1.0
41 AC_SUBST(GST_API_VERSION)
42 AC_DEFINE_UNQUOTED(GST_API_VERSION, "$GST_API_VERSION",
43   [GStreamer API Version])
44
45 AS_LIBTOOL(GST, 1300, 0, 1300)
46
47 dnl *** required versions of GStreamer stuff ***
48 GST_REQ=1.13.0.1
49 GSTPB_REQ=1.13.0.1
50
51 dnl *** autotools stuff ****
52
53 dnl allow for different autotools
54 AS_AUTOTOOLS_ALTERNATE
55
56 dnl Add parameters for aclocal
57 AC_SUBST(ACLOCAL_AMFLAGS, "-I m4 -I common/m4")
58
59 dnl set up gettext
60 dnl the version check needs to stay here because autopoint greps for it
61 AM_GNU_GETTEXT_VERSION(0.17)
62 AM_GNU_GETTEXT([external])
63 AG_GST_GETTEXT([gst-plugins-ugly-$GST_API_VERSION])
64
65 dnl *** check for arguments to configure ***
66
67 AG_GST_ARG_DISABLE_FATAL_WARNINGS
68 AG_GST_ARG_ENABLE_EXTRA_CHECKS
69
70 AG_GST_ARG_DEBUG
71 AG_GST_ARG_PROFILING
72 AG_GST_ARG_VALGRIND
73 AG_GST_ARG_GCOV
74
75 AG_GST_ARG_EXAMPLES
76
77 AG_GST_ARG_WITH_PKG_CONFIG_PATH
78 AG_GST_ARG_WITH_PACKAGE_NAME
79 AG_GST_ARG_WITH_PACKAGE_ORIGIN
80
81 AG_GST_ARG_WITH_PLUGINS
82
83 AG_GST_ARG_ENABLE_EXTERNAL
84
85 AG_GST_ARG_ENABLE_EXPERIMENTAL
86
87 dnl *** checks for platform ***
88
89 dnl * hardware/architecture *
90
91 dnl common/m4/gst-arch.m4
92 dnl check CPU type
93 AG_GST_ARCH
94
95 dnl Determine endianness
96 AC_C_BIGENDIAN
97
98 dnl *** checks for programs ***
99
100 dnl find a compiler
101 AC_PROG_CC
102 AC_PROG_CC_STDC
103
104 dnl determine c++ compiler
105 AC_PROG_CXX
106 dnl determine if c++ is available on this system
107 AC_CHECK_PROG(HAVE_CXX, $CXX, yes, no)
108
109 dnl check if the compiler supports '-c' and '-o' options
110 AM_PROG_CC_C_O
111
112 AC_PATH_PROG(VALGRIND_PATH, valgrind, no)
113 AM_CONDITIONAL(HAVE_VALGRIND, test ! "x$VALGRIND_PATH" = "xno")
114
115 dnl check if the compiler supports do while(0) macros
116 AG_GST_CHECK_DOWHILE_MACROS
117
118 dnl check for documentation tools
119 GTK_DOC_CHECK([1.12])
120 AG_GST_PLUGIN_DOCS([1.12])
121
122 dnl *** checks for libraries ***
123
124 dnl check for libm, for sin()
125 LT_LIB_M
126 AC_SUBST(LIBM)
127
128 dnl *** checks for header files ***
129
130 dnl used by ext/a52dec
131 AX_CREATE_STDINT_H
132
133 dnl Check for malloc.h
134 AC_CHECK_HEADERS([malloc.h])
135
136 dnl *** checks for types/defines ***
137
138 dnl *** checks for structures ***
139
140 dnl *** checks for compiler characteristics ***
141
142 dnl *** checks for library functions ***
143
144 dnl Check for a way to display the function name in debug output
145 AG_GST_CHECK_FUNCTION
146
147 dnl *** checks for dependency libraries ***
148
149 dnl GLib is required
150 GLIB_REQ=2.40.0
151 AG_GST_GLIB_CHECK([$GLIB_REQ])
152
153 ORC_CHECK([0.4.16])
154
155 dnl checks for gstreamer
156 dnl uninstalled is selected preferentially -- see pkg-config(1)
157 AG_GST_CHECK_GST($GST_API_VERSION, [$GST_REQ], yes)
158 AG_GST_CHECK_GST_BASE($GST_API_VERSION, [$GST_REQ], yes)
159 AG_GST_CHECK_GST_CHECK($GST_API_VERSION, [$GST_REQ], no)
160 AG_GST_CHECK_GST_PLUGINS_BASE($GST_API_VERSION, [$GSTPB_REQ], yes)
161 AM_CONDITIONAL(HAVE_GST_CHECK, test "x$HAVE_GST_CHECK" = "xyes")
162
163 dnl Check for documentation xrefs
164 GLIB_PREFIX="`$PKG_CONFIG --variable=prefix glib-2.0`"
165 GST_PREFIX="`$PKG_CONFIG --variable=prefix gstreamer-$GST_API_VERSION`"
166 GSTPB_PREFIX="`$PKG_CONFIG --variable=prefix gstreamer-plugins-base-$GST_API_VERSION`"
167 AC_SUBST(GLIB_PREFIX)
168 AC_SUBST(GST_PREFIX)
169 AC_SUBST(GSTPB_PREFIX)
170
171 dnl Needed by plugins that use g_module_*() API
172 PKG_CHECK_MODULES(GMODULE_NO_EXPORT, gmodule-no-export-2.0)
173
174 dnl Check for -Bsymbolic-functions linker flag used to avoid
175 dnl intra-library PLT jumps, if available.
176 AC_ARG_ENABLE(Bsymbolic,
177               [AS_HELP_STRING([--disable-Bsymbolic],[avoid linking with -Bsymbolic])],,
178               [SAVED_LDFLAGS="${LDFLAGS}" SAVED_LIBS="${LIBS}"
179                AC_MSG_CHECKING([for -Bsymbolic-functions linker flag])
180                LDFLAGS=-Wl,-Bsymbolic-functions
181                LIBS=
182                AC_TRY_LINK([], [return 0],
183                            AC_MSG_RESULT(yes)
184                            enable_Bsymbolic=yes,
185                            AC_MSG_RESULT(no)
186                            enable_Bsymbolic=no)
187                LDFLAGS="${SAVED_LDFLAGS}" LIBS="${SAVED_LIBS}"])
188
189 dnl *** set variables based on configure arguments ***
190
191 dnl set license and copyright notice
192 GST_LICENSE="LGPL"
193 AC_DEFINE_UNQUOTED(GST_LICENSE, "$GST_LICENSE", [GStreamer license])
194 AC_SUBST(GST_LICENSE)
195
196 dnl set location of plugin directory
197 AG_GST_SET_PLUGINDIR
198
199 dnl set release date/time
200 AG_GST_SET_PACKAGE_RELEASE_DATETIME_WITH_NANO([$PACKAGE_VERSION_NANO],
201   ["${srcdir}/gst-plugins-ugly.doap"],
202   [$PACKAGE_VERSION_MAJOR.$PACKAGE_VERSION_MINOR.$PACKAGE_VERSION_MICRO])
203
204 dnl define an ERROR_CFLAGS Makefile variable
205 AG_GST_SET_ERROR_CFLAGS($FATAL_WARNINGS, [
206     -Wmissing-declarations -Wmissing-prototypes -Wredundant-decls
207     -Wwrite-strings -Wformat-nonliteral -Wformat-security -Wold-style-definition
208     -Winit-self -Wmissing-include-dirs -Waddress
209     -Waggregate-return -Wno-multichar -Wnested-externs ])
210
211 dnl define an ERROR_CXXFLAGS Makefile variable
212 AG_GST_SET_ERROR_CXXFLAGS($FATAL_WARNINGS, [
213     -Wmissing-declarations -Wredundant-decls
214     -Wwrite-strings -Wformat-nonliteral -Wformat-security
215     -Winit-self -Wmissing-include-dirs -Waddress -Waggregate-return
216     -Wno-multichar])
217
218 dnl define correct level for debugging messages
219 AG_GST_SET_LEVEL_DEFAULT($GST_GIT)
220
221 dnl used in examples
222 AG_GST_DEFAULT_ELEMENTS
223
224 dnl *** plug-ins to include ***
225
226 dnl these are all the gst plug-ins, compilable without additional libs
227 AG_GST_CHECK_PLUGIN(asfdemux)
228 AG_GST_CHECK_PLUGIN(dvdlpcmdec)
229 AG_GST_CHECK_PLUGIN(dvdsub)
230 AG_GST_CHECK_PLUGIN(xingmux)
231 AG_GST_CHECK_PLUGIN(realmedia)
232
233 AC_CHECK_HEADERS([winsock2.h], HAVE_WINSOCK2_H=yes)
234
235 if test "x$HAVE_WINSOCK2_H" = "xyes"; then
236   WIN32_LIBS="-lws2_32"
237   AC_SUBST(WIN32_LIBS)
238 fi
239
240 dnl *** ext plug-ins ***
241 dnl keep this list sorted alphabetically !
242
243 if test "x$BUILD_EXTERNAL" = "xyes"; then
244
245 echo
246 AC_MSG_NOTICE([Checking libraries for plugins in ext/])
247 echo
248
249 dnl *** a52dec ***
250 translit(dnm, m, l) AM_CONDITIONAL(USE_A52DEC, true)
251 AG_GST_CHECK_FEATURE(A52DEC, [a52dec], a52dec, [
252   AC_CHECK_A52DEC(HAVE_A52DEC=yes, HAVE_A52DEC=no)
253 ])
254
255 dnl *** amr-nb ***
256 translit(dnm, m, l) AM_CONDITIONAL(USE_AMRNB, true)
257 AG_GST_CHECK_FEATURE(AMRNB, [amrnb library], amrnb, [
258   AG_GST_PKG_CHECK_MODULES(AMRNB, opencore-amrnb >= 0.1.3)
259 ])
260
261 dnl *** amr-wb dec ***
262 translit(dnm, m, l) AM_CONDITIONAL(USE_AMRWB, true)
263 AG_GST_CHECK_FEATURE(AMRWB, [amrwb library], amrwbdec, [
264   AG_GST_PKG_CHECK_MODULES(AMRWB, opencore-amrwb >= 0.1.3)
265 ])
266
267 dnl *** cdio ***
268 translit(dnm, m, l) AM_CONDITIONAL(USE_CDIO, true)
269 AG_GST_CHECK_FEATURE(CDIO, [cdio library], cdio, [
270   AG_GST_PKG_CHECK_MODULES(CDIO, libcdio >= 0.76)
271 ])
272
273 dnl *** dvdread ***
274 translit(dnm, m, l) AM_CONDITIONAL(USE_DVDREAD, true)
275 AG_GST_CHECK_FEATURE(DVDREAD, [dvdread library], dvdreadsrc, [
276   AG_GST_CHECK_LIBHEADER(DVDREAD, dvdread, DVDOpen, , dvdread/dvd_reader.h, DVDREAD_LIBS="-ldvdread")
277   AC_SUBST(DVDREAD_LIBS)
278 ])
279
280 dnl *** lame ***
281 translit(dnm, m, l) AM_CONDITIONAL(USE_LAME, true)
282 AG_GST_CHECK_FEATURE(LAME, [lame mp3 encoder library], lame, [
283   AG_GST_CHECK_LIBHEADER(LAME, mp3lame, lame_init, $LIBM, lame/lame.h,
284   [
285     HAVE_LAME="yes"
286     LAME_LIBS="-lmp3lame $LIBM"
287     dnl is lame presets available
288     LAME_CFLAGS=""
289     AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <lame/lame.h>]], [[ int preset = MEDIUM ]])],[LAME_CFLAGS="-DGSTLAME_PRESET"],[LAME_CFLAGS=""
290     ])
291     AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <lame/lame.h>]], [[
292         void *ptr = &lame_set_VBR_quality
293       ]])],[LAME_CFLAGS="$LAME_CFLAGS -DHAVE_LAME_SET_VBR_QUALITY"],[LAME_CFLAGS="$LAME_CFLAGS"
294     ])
295   AC_SUBST(LAME_CFLAGS)
296   AC_SUBST(LAME_LIBS)
297   ])
298 ])
299
300 dnl *** mpeg2dec ***
301 translit(dnm, m, l) AM_CONDITIONAL(USE_MPEG2DEC, true)
302 AG_GST_CHECK_FEATURE(MPEG2DEC, [mpeg2dec], mpeg2dec, [
303   AG_GST_PKG_CHECK_MODULES(MPEG2DEC, libmpeg2 >= 0.5.1)
304 ])
305
306 dnl *** sidplay : works with libsidplay 1.36.x (not 2.x.x) ***
307 translit(dnm, m, l) AM_CONDITIONAL(USE_SIDPLAY, true)
308 AG_GST_CHECK_FEATURE(SIDPLAY, [libsidplay], sid, [
309   GST_PATH_SIDPLAY()
310 ])
311
312 dnl *** twolame ***
313 translit(dnm, m, l) AM_CONDITIONAL(USE_TWOLAME, true)
314 AG_GST_CHECK_FEATURE(TWOLAME, [twolame], twolame, [
315   PKG_CHECK_MODULES(TWOLAME, twolame >= 0.3.10, [
316       HAVE_TWOLAME="yes"], [
317       HAVE_TWOLAME="no"
318   ])
319   AC_SUBST(TWOLAME_CFLAGS)
320   AC_SUBST(TWOLAME_LIBS)
321 ])
322
323 dnl *** x264 (MPEG-4 part 10/h.264/AVC encoder) ***
324 translit(dnm, m, l) AM_CONDITIONAL(USE_X264, true)
325 AG_GST_CHECK_FEATURE(X264, [x264 plug-in], x264, [
326   AG_GST_PKG_CHECK_MODULES(X264, x264 >= 0.120)
327
328   dnl Paths to additional x264 library variants, e.g. 10/12 bit
329   AC_ARG_WITH([x264-libraries],
330     AS_HELP_STRING([--with-x264-libraries=PATHS], [Colon separated list of additional x264 library paths, e.g. for 10-bit version]),
331     [
332       if test "x$withval" != "x"
333       then
334         AC_DEFINE_UNQUOTED(HAVE_X264_ADDITIONAL_LIBRARIES, "$withval", [Additional x264 libraries])
335       fi
336     ], []
337   )
338 ])
339
340 else
341
342 dnl not building plugins with external dependencies,
343 dnl but we still need to set the conditionals
344
345 AM_CONDITIONAL(USE_A52DEC, false)
346 AM_CONDITIONAL(USE_AMRNB, false)
347 AM_CONDITIONAL(USE_AMRWB, false)
348 AM_CONDITIONAL(USE_CDIO, false)
349 AM_CONDITIONAL(USE_DVDREAD, false)
350 AM_CONDITIONAL(USE_LAME, false)
351 AM_CONDITIONAL(USE_MPEG2DEC, false)
352 AM_CONDITIONAL(USE_SIDPLAY, false)
353 AM_CONDITIONAL(USE_TWOLAME, false)
354 AM_CONDITIONAL(USE_X264, false)
355
356 fi dnl of EXT plugins
357
358 dnl *** finalize CFLAGS, LDFLAGS, LIBS
359
360 dnl Overview:
361 dnl GST_OPTION_CFLAGS:  common flags for profiling, debugging, errors, ...
362 dnl GST_*:              flags shared by built objects to link against GStreamer
363 dnl GST_ALL_LDFLAGS:    linker flags shared by all
364 dnl GST_LIB_LDFLAGS:    additional linker flags for all libaries
365 dnl GST_LT_LDFLAGS:     library versioning of our libraries
366 dnl GST_PLUGIN_LDFLAGS: flags to be used for all plugins
367
368 dnl GST_OPTION_CFLAGS
369 if test "x$USE_DEBUG" = xyes; then
370    PROFILE_CFLAGS="-g"
371 fi
372 AC_SUBST(PROFILE_CFLAGS)
373
374 if test "x$PACKAGE_VERSION_NANO" = "x1"; then
375   dnl Define _only_ during CVS (not pre-releases or releases)
376   DEPRECATED_CFLAGS="-DGST_DISABLE_DEPRECATED"
377 else
378   DEPRECATED_CFLAGS=""
379 fi
380 AC_SUBST(DEPRECATED_CFLAGS)
381
382 dnl every flag in GST_OPTION_CFLAGS and GST_OPTION_CXXFLAGS can be overridden
383 dnl at make time with e.g. make ERROR_CFLAGS=""
384 GST_OPTION_CFLAGS="\$(WARNING_CFLAGS) \$(ERROR_CFLAGS) \$(DEBUG_CFLAGS) \$(PROFILE_CFLAGS) \$(GCOV_CFLAGS) \$(OPT_CFLAGS) \$(DEPRECATED_CFLAGS)"
385 GST_OPTION_CXXFLAGS="\$(WARNING_CXXFLAGS) \$(ERROR_CXXFLAGS) \$(DEBUG_CFLAGS) \$(PROFILE_CFLAGS) \$(GCOV_CFLAGS) \$(OPT_CFLAGS) \$(DEPRECATED_CFLAGS)"
386 AC_SUBST(GST_OPTION_CFLAGS)
387 AC_SUBST(GST_OPTION_CXXFLAGS)
388
389 dnl FIXME: do we want to rename to GST_ALL_* ?
390 dnl prefer internal headers to already installed ones
391 dnl also add builddir include for enumtypes and marshal
392 dnl add GST_OPTION_CFLAGS, but overridable
393 GST_CFLAGS="$GST_CFLAGS"
394 GST_CXXFLAGS="-I\$(top_srcdir)/gst-libs -I\$(top_builddir)/gst-libs $GST_CFLAGS $GLIB_EXTRA_CFLAGS \$(GST_OPTION_CXXFLAGS)"
395 GST_CFLAGS="-I\$(top_srcdir)/gst-libs -I\$(top_builddir)/gst-libs $GST_CFLAGS $GLIB_EXTRA_CFLAGS \$(GST_OPTION_CFLAGS)"
396 AC_SUBST(GST_CFLAGS)
397 AC_SUBST(GST_CXXFLAGS)
398 AC_SUBST(GST_LIBS)
399
400 dnl LDFLAGS really should only contain flags, not libs - they get added before
401 dnl whatevertarget_LIBS and -L flags here affect the rest of the linking
402 GST_ALL_LDFLAGS="-no-undefined"
403 if test "x${enable_Bsymbolic}" = "xyes"; then
404   GST_ALL_LDFLAGS="$GST_ALL_LDFLAGS -Wl,-Bsymbolic-functions"
405 fi
406 AC_SUBST(GST_ALL_LDFLAGS)
407
408 dnl this really should only contain flags, not libs - they get added before
409 dnl whatevertarget_LIBS and -L flags here affect the rest of the linking
410 GST_PLUGIN_LDFLAGS="-module -avoid-version -export-symbols-regex '^[_]*gst_plugin_.*' $GST_ALL_LDFLAGS"
411 AC_SUBST(GST_PLUGIN_LDFLAGS)
412
413 dnl *** output files ***
414
415 AC_CONFIG_FILES(
416 Makefile
417 common/Makefile
418 common/m4/Makefile
419 gst-libs/Makefile
420 gst-libs/gst/Makefile
421 gst/Makefile
422 gst/asfdemux/Makefile
423 gst/dvdlpcmdec/Makefile
424 gst/dvdsub/Makefile
425 gst/realmedia/Makefile
426 gst/xingmux/Makefile
427 ext/Makefile
428 ext/a52dec/Makefile
429 ext/amrnb/Makefile
430 ext/amrwbdec/Makefile
431 ext/cdio/Makefile
432 ext/dvdread/Makefile
433 ext/lame/Makefile
434 ext/mpeg2dec/Makefile
435 ext/sidplay/Makefile
436 ext/twolame/Makefile
437 ext/x264/Makefile
438 docs/Makefile
439 docs/plugins/Makefile
440 docs/version.entities
441 tests/Makefile
442 tests/check/Makefile
443 tests/files/Makefile
444 m4/Makefile
445 po/Makefile.in
446 pkgconfig/Makefile
447 pkgconfig/gstreamer-plugins-ugly-uninstalled.pc
448 )
449
450 AC_OUTPUT
451
452 AG_GST_OUTPUT_PLUGINS
453
454 ORC_OUTPUT