x264enc: Port to color_{primaries,transfer,matrix}_to_iso
[platform/upstream/gstreamer.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.17.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, 1700, 0, 1700)
46
47 dnl *** required versions of GStreamer stuff ***
48 GST_REQ=1.17.0.1
49 GSTPB_REQ=1.17.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 *** software ***
99
100 dnl check for large file support
101 dnl affected plugins must include config.h
102 AC_SYS_LARGEFILE
103
104 dnl *** checks for programs ***
105
106 dnl find a compiler
107 AC_PROG_CC
108 AC_PROG_CC_STDC
109
110 dnl determine c++ compiler
111 AC_PROG_CXX
112 dnl determine if c++ is available on this system
113 AC_CHECK_PROG(HAVE_CXX, $CXX, yes, no)
114
115 dnl check if the compiler supports '-c' and '-o' options
116 AM_PROG_CC_C_O
117
118 AC_PATH_PROG(VALGRIND_PATH, valgrind, no)
119 AM_CONDITIONAL(HAVE_VALGRIND, test ! "x$VALGRIND_PATH" = "xno")
120
121 dnl check if the compiler supports do while(0) macros
122 AG_GST_CHECK_DOWHILE_MACROS
123
124 dnl *** checks for libraries ***
125
126 dnl check for libm, for sin()
127 LT_LIB_M
128 AC_SUBST(LIBM)
129
130 dnl *** checks for header files ***
131
132 dnl used by ext/a52dec
133 AX_CREATE_STDINT_H
134
135 dnl Check for malloc.h
136 AC_CHECK_HEADERS([malloc.h])
137
138 dnl *** checks for types/defines ***
139
140 dnl *** checks for structures ***
141
142 dnl *** checks for compiler characteristics ***
143
144 dnl *** checks for library functions ***
145
146 dnl Check for a way to display the function name in debug output
147 AG_GST_CHECK_FUNCTION
148
149 dnl *** checks for dependency libraries ***
150
151 dnl GLib is required
152 GLIB_REQ=2.44.0
153 AG_GST_GLIB_CHECK([$GLIB_REQ])
154
155 ORC_CHECK([0.4.16])
156
157 dnl checks for gstreamer
158 dnl uninstalled is selected preferentially -- see pkg-config(1)
159 AG_GST_CHECK_GST($GST_API_VERSION, [$GST_REQ], yes)
160 AG_GST_CHECK_GST_BASE($GST_API_VERSION, [$GST_REQ], yes)
161 AG_GST_CHECK_GST_CHECK($GST_API_VERSION, [$GST_REQ], no)
162 AG_GST_CHECK_GST_PLUGINS_BASE($GST_API_VERSION, [$GSTPB_REQ], yes)
163 AM_CONDITIONAL(HAVE_GST_CHECK, test "x$HAVE_GST_CHECK" = "xyes")
164
165 dnl Check for documentation xrefs
166 GLIB_PREFIX="`$PKG_CONFIG --variable=prefix glib-2.0`"
167 GST_PREFIX="`$PKG_CONFIG --variable=prefix gstreamer-$GST_API_VERSION`"
168 GSTPB_PREFIX="`$PKG_CONFIG --variable=prefix gstreamer-plugins-base-$GST_API_VERSION`"
169 AC_SUBST(GLIB_PREFIX)
170 AC_SUBST(GST_PREFIX)
171 AC_SUBST(GSTPB_PREFIX)
172
173 dnl Needed by plugins that use g_module_*() API
174 PKG_CHECK_MODULES(GMODULE_NO_EXPORT, gmodule-no-export-2.0)
175
176 dnl Check for -Bsymbolic-functions linker flag used to avoid
177 dnl intra-library PLT jumps, if available.
178 AC_ARG_ENABLE(Bsymbolic,
179               [AS_HELP_STRING([--disable-Bsymbolic],[avoid linking with -Bsymbolic])],,
180               [SAVED_LDFLAGS="${LDFLAGS}" SAVED_LIBS="${LIBS}"
181                AC_MSG_CHECKING([for -Bsymbolic-functions linker flag])
182                LDFLAGS=-Wl,-Bsymbolic-functions
183                LIBS=
184                AC_TRY_LINK([], [return 0],
185                            AC_MSG_RESULT(yes)
186                            enable_Bsymbolic=yes,
187                            AC_MSG_RESULT(no)
188                            enable_Bsymbolic=no)
189                LDFLAGS="${SAVED_LDFLAGS}" LIBS="${SAVED_LIBS}"])
190
191 dnl *** set variables based on configure arguments ***
192
193 dnl set license and copyright notice
194 GST_LICENSE="LGPL"
195 AC_DEFINE_UNQUOTED(GST_LICENSE, "$GST_LICENSE", [GStreamer license])
196 AC_SUBST(GST_LICENSE)
197
198 dnl set location of plugin directory
199 AG_GST_SET_PLUGINDIR
200
201 dnl set release date/time
202 AG_GST_SET_PACKAGE_RELEASE_DATETIME_WITH_NANO([$PACKAGE_VERSION_NANO],
203   ["${srcdir}/gst-plugins-ugly.doap"],
204   [$PACKAGE_VERSION_MAJOR.$PACKAGE_VERSION_MINOR.$PACKAGE_VERSION_MICRO])
205
206 dnl define an ERROR_CFLAGS Makefile variable
207 AG_GST_SET_ERROR_CFLAGS($FATAL_WARNINGS, [
208     -Wmissing-declarations -Wmissing-prototypes -Wredundant-decls
209     -Wwrite-strings -Wformat-nonliteral -Wformat-security -Wold-style-definition
210     -Winit-self -Wmissing-include-dirs -Waddress
211     -Waggregate-return -Wno-multichar -Wnested-externs ])
212
213 dnl define an ERROR_CXXFLAGS Makefile variable
214 AG_GST_SET_ERROR_CXXFLAGS($FATAL_WARNINGS, [
215     -Wmissing-declarations -Wredundant-decls
216     -Wwrite-strings -Wformat-nonliteral -Wformat-security
217     -Winit-self -Wmissing-include-dirs -Waddress -Waggregate-return
218     -Wno-multichar])
219
220 dnl define correct level for debugging messages
221 AG_GST_SET_LEVEL_DEFAULT($GST_GIT)
222
223 dnl used in examples
224 AG_GST_DEFAULT_ELEMENTS
225
226 dnl *** plug-ins to include ***
227
228 dnl these are all the gst plug-ins, compilable without additional libs
229 AG_GST_CHECK_PLUGIN(asfdemux)
230 AG_GST_CHECK_PLUGIN(dvdlpcmdec)
231 AG_GST_CHECK_PLUGIN(dvdsub)
232 AG_GST_CHECK_PLUGIN(xingmux)
233 AG_GST_CHECK_PLUGIN(realmedia)
234
235 AC_CHECK_HEADERS([winsock2.h], HAVE_WINSOCK2_H=yes)
236
237 if test "x$HAVE_WINSOCK2_H" = "xyes"; then
238   WIN32_LIBS="-lws2_32"
239   AC_SUBST(WIN32_LIBS)
240 fi
241
242 dnl *** ext plug-ins ***
243 dnl keep this list sorted alphabetically !
244
245 if test "x$BUILD_EXTERNAL" = "xyes"; then
246
247 echo
248 AC_MSG_NOTICE([Checking libraries for plugins in ext/])
249 echo
250
251 dnl *** a52dec ***
252 translit(dnm, m, l) AM_CONDITIONAL(USE_A52DEC, true)
253 AG_GST_CHECK_FEATURE(A52DEC, [a52dec], a52dec, [
254   AC_CHECK_A52DEC(HAVE_A52DEC=yes, HAVE_A52DEC=no)
255 ])
256
257 dnl *** amr-nb ***
258 translit(dnm, m, l) AM_CONDITIONAL(USE_AMRNB, true)
259 AG_GST_CHECK_FEATURE(AMRNB, [amrnb library], amrnb, [
260   AG_GST_PKG_CHECK_MODULES(AMRNB, opencore-amrnb >= 0.1.3)
261 ])
262
263 dnl *** amr-wb dec ***
264 translit(dnm, m, l) AM_CONDITIONAL(USE_AMRWB, true)
265 AG_GST_CHECK_FEATURE(AMRWB, [amrwb library], amrwbdec, [
266   AG_GST_PKG_CHECK_MODULES(AMRWB, opencore-amrwb >= 0.1.3)
267 ])
268
269 dnl *** cdio ***
270 translit(dnm, m, l) AM_CONDITIONAL(USE_CDIO, true)
271 AG_GST_CHECK_FEATURE(CDIO, [cdio library], cdio, [
272   AG_GST_PKG_CHECK_MODULES(CDIO, libcdio >= 0.76)
273 ])
274
275 dnl *** dvdread ***
276 translit(dnm, m, l) AM_CONDITIONAL(USE_DVDREAD, true)
277 AG_GST_CHECK_FEATURE(DVDREAD, [dvdread library], dvdreadsrc, [
278   AG_GST_CHECK_LIBHEADER(DVDREAD, dvdread, DVDOpen, , dvdread/dvd_reader.h, DVDREAD_LIBS="-ldvdread")
279   AC_SUBST(DVDREAD_LIBS)
280 ])
281
282 dnl *** mpeg2dec ***
283 translit(dnm, m, l) AM_CONDITIONAL(USE_MPEG2DEC, true)
284 AG_GST_CHECK_FEATURE(MPEG2DEC, [mpeg2dec], mpeg2dec, [
285   AG_GST_PKG_CHECK_MODULES(MPEG2DEC, libmpeg2 >= 0.5.1)
286 ])
287
288 dnl *** sidplay : works with libsidplay 1.36.x (not 2.x.x) ***
289 translit(dnm, m, l) AM_CONDITIONAL(USE_SIDPLAY, true)
290 AG_GST_CHECK_FEATURE(SIDPLAY, [libsidplay], sid, [
291   GST_PATH_SIDPLAY()
292 ])
293
294 dnl *** x264 (MPEG-4 part 10/h.264/AVC encoder) ***
295 translit(dnm, m, l) AM_CONDITIONAL(USE_X264, true)
296 AG_GST_CHECK_FEATURE(X264, [x264 plug-in], x264, [
297   AG_GST_PKG_CHECK_MODULES(X264, x264 >= 0.120)
298
299   dnl Paths to additional x264 library variants, e.g. 10/12 bit
300   AC_ARG_WITH([x264-libraries],
301     AS_HELP_STRING([--with-x264-libraries=PATHS], [Colon separated list of additional x264 library paths, e.g. for 10-bit version]),
302     [
303       if test "x$withval" != "x"
304       then
305         AC_DEFINE_UNQUOTED(HAVE_X264_ADDITIONAL_LIBRARIES, "$withval", [Additional x264 libraries])
306       fi
307     ], []
308   )
309 ])
310
311 else
312
313 dnl not building plugins with external dependencies,
314 dnl but we still need to set the conditionals
315
316 AM_CONDITIONAL(USE_A52DEC, false)
317 AM_CONDITIONAL(USE_AMRNB, false)
318 AM_CONDITIONAL(USE_AMRWB, false)
319 AM_CONDITIONAL(USE_CDIO, false)
320 AM_CONDITIONAL(USE_DVDREAD, false)
321 AM_CONDITIONAL(USE_MPEG2DEC, false)
322 AM_CONDITIONAL(USE_SIDPLAY, false)
323 AM_CONDITIONAL(USE_X264, false)
324
325 fi dnl of EXT plugins
326
327 dnl *** finalize CFLAGS, LDFLAGS, LIBS
328
329 dnl Overview:
330 dnl GST_OPTION_CFLAGS:  common flags for profiling, debugging, errors, ...
331 dnl GST_*:              flags shared by built objects to link against GStreamer
332 dnl GST_ALL_LDFLAGS:    linker flags shared by all
333 dnl GST_LIB_LDFLAGS:    additional linker flags for all libaries
334 dnl GST_LT_LDFLAGS:     library versioning of our libraries
335 dnl GST_PLUGIN_LDFLAGS: flags to be used for all plugins
336
337 dnl GST_OPTION_CFLAGS
338 if test "x$USE_DEBUG" = xyes; then
339    PROFILE_CFLAGS="-g"
340 fi
341 AC_SUBST(PROFILE_CFLAGS)
342
343 if test "x$PACKAGE_VERSION_NANO" = "x1"; then
344   dnl Define _only_ during CVS (not pre-releases or releases)
345   DEPRECATED_CFLAGS="-DGST_DISABLE_DEPRECATED"
346 else
347   DEPRECATED_CFLAGS=""
348 fi
349 AC_SUBST(DEPRECATED_CFLAGS)
350
351 VISIBILITY_CFLAGS=""
352 AS_COMPILER_FLAG([-fvisibility=hidden], [VISIBILITY_CFLAGS="-fvisibility=hidden"])
353 AC_SUBST(VISIBILITY_CFLAGS)
354
355 VISIBILITY_CXXFLAGS=""
356 if test "x$HAVE_CXX" = "xyes"; then
357   AS_CXX_COMPILER_FLAG([-fvisibility=hidden], [VISIBILITY_CXXFLAGS="-fvisibility=hidden"])
358 fi
359 AC_SUBST(VISIBILITY_CXXFLAGS)
360
361 dnl disable strict aliasing
362 AS_COMPILER_FLAG([-fno-strict-aliasing], [EXTRA_CFLAGS="-fno-strict-aliasing"])
363 AC_SUBST(EXTRA_CFLAGS)
364
365 dnl every flag in GST_OPTION_CFLAGS and GST_OPTION_CXXFLAGS can be overridden
366 dnl at make time with e.g. make ERROR_CFLAGS=""
367 GST_OPTION_CFLAGS="\$(WARNING_CFLAGS) \$(ERROR_CFLAGS) \$(DEBUG_CFLAGS) \$(PROFILE_CFLAGS) \$(GCOV_CFLAGS) \$(OPT_CFLAGS) \$(DEPRECATED_CFLAGS)"
368 GST_OPTION_CXXFLAGS="\$(WARNING_CXXFLAGS) \$(ERROR_CXXFLAGS) \$(DEBUG_CFLAGS) \$(PROFILE_CFLAGS) \$(GCOV_CFLAGS) \$(OPT_CFLAGS) \$(DEPRECATED_CFLAGS)"
369 AC_SUBST(GST_OPTION_CFLAGS)
370 AC_SUBST(GST_OPTION_CXXFLAGS)
371
372 dnl FIXME: do we want to rename to GST_ALL_* ?
373 dnl prefer internal headers to already installed ones
374 dnl also add builddir include for enumtypes and marshal
375 dnl add GST_OPTION_CFLAGS, but overridable
376 GST_CFLAGS="$GST_CFLAGS"
377 GST_CXXFLAGS="-I\$(top_srcdir)/gst-libs -I\$(top_builddir)/gst-libs $GST_CFLAGS $EXTRA_CFLAGS $GLIB_EXTRA_CFLAGS \$(GST_OPTION_CXXFLAGS) \$(VISIBILITY_CXXFLAGS)"
378 GST_CFLAGS="-I\$(top_srcdir)/gst-libs -I\$(top_builddir)/gst-libs $GST_CFLAGS $EXTRA_CFLAGS $GLIB_EXTRA_CFLAGS \$(GST_OPTION_CFLAGS) \$(VISIBILITY_CFLAGS)"
379 AC_SUBST(GST_CFLAGS)
380 AC_SUBST(GST_CXXFLAGS)
381 AC_SUBST(GST_LIBS)
382
383 dnl LDFLAGS really should only contain flags, not libs - they get added before
384 dnl whatevertarget_LIBS and -L flags here affect the rest of the linking
385 GST_ALL_LDFLAGS="-no-undefined"
386 if test "x${enable_Bsymbolic}" = "xyes"; then
387   GST_ALL_LDFLAGS="$GST_ALL_LDFLAGS -Wl,-Bsymbolic-functions"
388 fi
389 AC_SUBST(GST_ALL_LDFLAGS)
390
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 $GST_ALL_LDFLAGS"
394 AC_SUBST(GST_PLUGIN_LDFLAGS)
395
396 dnl *** output files ***
397
398 AC_CONFIG_FILES(
399 Makefile
400 common/Makefile
401 common/m4/Makefile
402 gst-libs/Makefile
403 gst-libs/gst/Makefile
404 gst/Makefile
405 gst/asfdemux/Makefile
406 gst/dvdlpcmdec/Makefile
407 gst/dvdsub/Makefile
408 gst/realmedia/Makefile
409 gst/xingmux/Makefile
410 ext/Makefile
411 ext/a52dec/Makefile
412 ext/amrnb/Makefile
413 ext/amrwbdec/Makefile
414 ext/cdio/Makefile
415 ext/dvdread/Makefile
416 ext/mpeg2dec/Makefile
417 ext/sidplay/Makefile
418 ext/x264/Makefile
419 tests/Makefile
420 tests/check/Makefile
421 tests/files/Makefile
422 m4/Makefile
423 po/Makefile.in
424 pkgconfig/Makefile
425 pkgconfig/gstreamer-plugins-ugly-uninstalled.pc
426 )
427
428 AC_OUTPUT
429
430 AG_GST_OUTPUT_PLUGINS
431
432 ORC_OUTPUT