Use gmodule-no-export-2.0
[platform/upstream/gstreamer.git] / subprojects / gst-plugins-bad / meson.build
1 project('gst-plugins-bad', 'c', 'cpp',
2   version : '1.21.0.1',
3   meson_version : '>= 0.60',
4   default_options : [ 'warning_level=1',
5                       'buildtype=debugoptimized' ])
6
7 gst_version = meson.project_version()
8 version_arr = gst_version.split('.')
9 gst_version_major = version_arr[0].to_int()
10 gst_version_minor = version_arr[1].to_int()
11 gst_version_micro = version_arr[2].to_int()
12  if version_arr.length() == 4
13   gst_version_nano = version_arr[3].to_int()
14 else
15   gst_version_nano = 0
16 endif
17 gst_version_is_stable = gst_version_minor.is_even()
18 gst_version_is_dev = gst_version_minor.is_odd() and gst_version_micro < 90
19
20 glib_req = '>= 2.56.0'
21 orc_req = '>= 0.4.17'
22
23 if gst_version_is_stable
24   gst_req = '>= @0@.@1@.0'.format(gst_version_major, gst_version_minor)
25 else
26   gst_req = '>= ' + gst_version
27 endif
28
29 api_version = '1.0'
30 soversion = 0
31 # maintaining compatibility with the previous libtool versioning
32 # current = minor * 100 + micro
33 curversion = gst_version_minor * 100 + gst_version_micro
34 libversion = '@0@.@1@.0'.format(soversion, curversion)
35 osxversion = curversion + 1
36
37 plugins_install_dir = join_paths(get_option('libdir'), 'gstreamer-1.0')
38 static_build = get_option('default_library') == 'static'
39 plugins = []
40 libraries = []
41
42 cc = meson.get_compiler('c')
43 cxx = meson.get_compiler('cpp')
44 host_system = host_machine.system()
45
46 if host_system in ['ios', 'darwin']
47   have_objc = add_languages('objc', native: false)
48   have_objcpp = add_languages('objcpp', native: false)
49 else
50   have_objc = false
51   have_objcpp = false
52 endif
53
54 cdata = configuration_data()
55
56 if cc.get_id() == 'msvc'
57   msvc_args = [
58       # Ignore several spurious warnings for things gstreamer does very commonly
59       # If a warning is completely useless and spammy, use '/wdXXXX' to suppress it
60       # If a warning is harmless but hard to fix, use '/woXXXX' so it's shown once
61       # NOTE: Only add warnings here if you are sure they're spurious
62       '/wd4018', # implicit signed/unsigned conversion
63       '/wd4146', # unary minus on unsigned (beware INT_MIN)
64       '/wd4244', # lossy type conversion (e.g. double -> int)
65       '/wd4305', # truncating type conversion (e.g. double -> float)
66       cc.get_supported_arguments(['/utf-8']), # set the input encoding to utf-8
67   ]
68
69   if gst_version_is_dev
70     # Enable some warnings on MSVC to match GCC/Clang behaviour
71     msvc_args += cc.get_supported_arguments([
72       '/we4002', # too many actual parameters for macro 'identifier'
73       '/we4003', # not enough actual parameters for macro 'identifier'
74       '/we4013', # 'function' undefined; assuming extern returning int
75       '/we4020', # 'function' : too many actual parameters
76       '/we4027', # function declared without formal parameter list
77       '/we4029', # declared formal parameter list different from definition
78       '/we4033', # 'function' must return a value
79       '/we4045', # 'array' : array bounds overflow
80       '/we4047', # 'operator' : 'identifier1' differs in levels of indirection from 'identifier2'
81       '/we4053', # one void operand for '?:'
82       '/we4062', # enumerator 'identifier' in switch of enum 'enumeration' is not handled
83       '/we4098', # 'function' : void function returning a value
84       '/we4101', # 'identifier' : unreferenced local variable
85       '/we4189', # 'identifier' : local variable is initialized but not referenced
86     ])
87   endif
88   add_project_arguments(msvc_args, language: ['c', 'cpp'])
89   # Disable SAFESEH with MSVC for plugins and libs that use external deps that
90   # are built with MinGW
91   noseh_link_args = ['/SAFESEH:NO']
92 else
93   if cxx.has_argument('-Wno-non-virtual-dtor')
94     add_project_arguments('-Wno-non-virtual-dtor', language: 'cpp')
95   endif
96
97   noseh_link_args = []
98 endif
99
100 if cc.has_link_argument('-Wl,-Bsymbolic-functions')
101   add_project_link_arguments('-Wl,-Bsymbolic-functions', language : 'c')
102 endif
103
104 # Symbol visibility
105 if cc.get_id() == 'msvc'
106   export_define = '__declspec(dllexport) extern'
107 elif cc.has_argument('-fvisibility=hidden')
108   add_project_arguments('-fvisibility=hidden', language: 'c')
109   add_project_arguments('-fvisibility=hidden', language: 'cpp')
110   if have_objc
111     add_project_arguments('-fvisibility=hidden', language: 'objc')
112   endif
113   export_define = 'extern __attribute__ ((visibility ("default")))'
114 else
115   export_define = 'extern'
116 endif
117
118 # Passing this through the command line would be too messy
119 cdata.set('GST_API_EXPORT', export_define)
120
121 # Disable strict aliasing
122 if cc.has_argument('-fno-strict-aliasing')
123   add_project_arguments('-fno-strict-aliasing', language: 'c')
124 endif
125 if cxx.has_argument('-fno-strict-aliasing')
126   add_project_arguments('-fno-strict-aliasing', language: 'cpp')
127 endif
128
129 # Define G_DISABLE_DEPRECATED for development versions
130 if gst_version_is_dev
131   message('Disabling deprecated GLib API')
132   add_project_arguments('-DG_DISABLE_DEPRECATED', language: 'c')
133 endif
134
135 cast_checks = get_option('gobject-cast-checks')
136 if cast_checks.disabled() or (cast_checks.auto() and not gst_version_is_dev)
137   message('Disabling GLib cast checks')
138   add_project_arguments('-DG_DISABLE_CAST_CHECKS', language: 'c')
139 endif
140
141 glib_asserts = get_option('glib-asserts')
142 if glib_asserts.disabled() or (glib_asserts.auto() and not gst_version_is_dev)
143   message('Disabling GLib asserts')
144   add_project_arguments('-DG_DISABLE_ASSERT', language: 'c')
145 endif
146
147 glib_checks = get_option('glib-checks')
148 if glib_checks.disabled() or (glib_checks.auto() and not gst_version_is_dev)
149   message('Disabling GLib checks')
150   add_project_arguments('-DG_DISABLE_CHECKS', language: 'c')
151 endif
152
153 check_headers = [
154   ['HAVE_DLFCN_H', 'dlfcn.h'],
155   ['HAVE_FCNTL_H', 'fcntl.h'],
156   ['HAVE_INTTYPES_H', 'inttypes.h'],
157   ['HAVE_MEMORY_H', 'memory.h'],
158   ['HAVE_NETINET_IN_H', 'netinet/in.h'],
159   ['HAVE_NETINET_IP_H', 'netinet/ip.h'],
160   ['HAVE_NETINET_TCP_H', 'netinet/tcp.h'],
161   ['HAVE_PTHREAD_H', 'pthread.h'],
162   ['HAVE_STDINT_H', 'stdint.h'],
163   ['HAVE_STDLIB_H', 'stdlib.h'],
164   ['HAVE_STRINGS_H', 'strings.h'],
165   ['HAVE_STRING_H', 'string.h'],
166   ['HAVE_SYS_PARAM_H', 'sys/param.h'],
167   ['HAVE_SYS_SOCKET_H', 'sys/socket.h'],
168   ['HAVE_SYS_STAT_H', 'sys/stat.h'],
169   ['HAVE_SYS_TIME_H', 'sys/time.h'],
170   ['HAVE_SYS_TYPES_H', 'sys/types.h'],
171   ['HAVE_SYS_UTSNAME_H', 'sys/utsname.h'],
172   ['HAVE_UNISTD_H', 'unistd.h'],
173   ['HAVE_WINDOWS_H', 'windows.h'],
174   ['HAVE_WINSOCK2_H', 'winsock2.h'],
175   ['HAVE_WS2TCPIP_H', 'ws2tcpip.h'],
176 ]
177
178 foreach h : check_headers
179   if cc.has_header(h.get(1))
180     cdata.set(h.get(0), 1)
181   endif
182 endforeach
183
184 check_functions = [
185   ['HAVE_DCGETTEXT', 'dcgettext'],
186   ['HAVE_GETPAGESIZE', 'getpagesize'],
187   ['HAVE_GMTIME_R', 'gmtime_r'],
188   ['HAVE_MEMFD_CREATE', 'memfd_create'],
189   ['HAVE_MMAP', 'mmap'],
190   ['HAVE_PIPE2', 'pipe2'],
191   ['HAVE_GETRUSAGE', 'getrusage', '#include<sys/resource.h>'],
192 ]
193
194 foreach f : check_functions
195   prefix = ''
196   if f.length() == 3
197     prefix = f.get(2)
198   endif
199   if cc.has_function(f.get(1), prefix: prefix)
200     cdata.set(f.get(0), 1)
201   endif
202 endforeach
203
204 cdata.set('SIZEOF_CHAR', cc.sizeof('char'))
205 cdata.set('SIZEOF_INT', cc.sizeof('int'))
206 cdata.set('SIZEOF_LONG', cc.sizeof('long'))
207 cdata.set('SIZEOF_SHORT', cc.sizeof('short'))
208 cdata.set('SIZEOF_VOIDP', cc.sizeof('void*'))
209
210 cdata.set_quoted('VERSION', gst_version)
211 cdata.set_quoted('PACKAGE', 'gst-plugins-bad')
212 cdata.set_quoted('PACKAGE_VERSION', gst_version)
213 cdata.set_quoted('PACKAGE_BUGREPORT', 'https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/issues/new')
214 cdata.set_quoted('PACKAGE_NAME', 'GStreamer Bad Plug-ins')
215 cdata.set_quoted('GETTEXT_PACKAGE', 'gst-plugins-bad-1.0')
216 cdata.set_quoted('GST_API_VERSION', api_version)
217 cdata.set_quoted('GST_LICENSE', 'LGPL')
218 cdata.set_quoted('LIBDIR', join_paths(get_option('prefix'), get_option('libdir')))
219 cdata.set_quoted('LOCALEDIR', join_paths(get_option('prefix'), get_option('localedir')))
220
221 warning_flags = [
222   '-Wmissing-declarations',
223   '-Wredundant-decls',
224   '-Wwrite-strings',
225   '-Wformat',
226   '-Wformat-security',
227   '-Winit-self',
228   '-Wmissing-include-dirs',
229   '-Waddress',
230   '-Wno-multichar',
231   '-Wvla',
232   '-Wpointer-arith',
233 ]
234
235 warning_c_flags = [
236   '-Wmissing-prototypes',
237   '-Wdeclaration-after-statement',
238   '-Wold-style-definition',
239 ]
240
241 warning_cxx_flags = [
242   '-Wformat-nonliteral',
243 ]
244
245 foreach extra_arg : warning_c_flags
246   if cc.has_argument (extra_arg)
247     add_project_arguments([extra_arg], language: 'c')
248   endif
249 endforeach
250
251 foreach extra_arg : warning_cxx_flags
252   if cxx.has_argument (extra_arg)
253     add_project_arguments([extra_arg], language: 'cpp')
254   endif
255 endforeach
256
257 foreach extra_arg : warning_flags
258   if cc.has_argument (extra_arg)
259     add_project_arguments([extra_arg], language: 'c')
260   endif
261   if cxx.has_argument (extra_arg)
262     add_project_arguments([extra_arg], language: 'cpp')
263   endif
264 endforeach
265
266 # GStreamer package name and origin url
267 gst_package_name = get_option('package-name')
268 if gst_package_name == ''
269   if gst_version_nano == 0
270     gst_package_name = 'GStreamer Bad Plug-ins source release'
271   elif gst_version_nano == 1
272     gst_package_name = 'GStreamer Bad Plug-ins git'
273   else
274     gst_package_name = 'GStreamer Bad Plug-ins prerelease'
275   endif
276 endif
277 cdata.set_quoted('GST_PACKAGE_NAME', gst_package_name)
278 cdata.set_quoted('GST_PACKAGE_ORIGIN', get_option('package-origin'))
279
280 # FIXME: This should be exposed as a configuration option
281 if host_system == 'linux'
282   cdata.set_quoted('DEFAULT_VIDEOSRC', 'v4l2src')
283 elif ['darwin', 'ios'].contains(host_system)
284   cdata.set_quoted('DEFAULT_VIDEOSRC', 'avfvideosrc')
285   cdata.set_quoted('GST_EXTRA_MODULE_SUFFIX', '.dylib')
286   # Yes, we set this for iOS too. Same as Autotools.
287   cdata.set('HAVE_OSX', 1)
288 else
289   cdata.set_quoted('DEFAULT_VIDEOSRC', 'videotestsrc')
290 endif
291
292 # Mandatory GST deps
293 gst_dep = dependency('gstreamer-1.0', version : gst_req,
294   fallback : ['gstreamer', 'gst_dep'])
295 gstbase_dep = dependency('gstreamer-base-1.0', version : gst_req,
296   fallback : ['gstreamer', 'gst_base_dep'])
297 gstnet_dep = dependency('gstreamer-net-1.0', version : gst_req,
298   fallback : ['gstreamer', 'gst_net_dep'])
299 gstcontroller_dep = dependency('gstreamer-controller-1.0', version : gst_req,
300   fallback : ['gstreamer', 'gst_controller_dep'])
301
302 gstpbutils_dep = dependency('gstreamer-pbutils-1.0', version : gst_req,
303     fallback : ['gst-plugins-base', 'pbutils_dep'])
304 gstallocators_dep = dependency('gstreamer-allocators-1.0', version : gst_req,
305     fallback : ['gst-plugins-base', 'allocators_dep'])
306 gstapp_dep = dependency('gstreamer-app-1.0', version : gst_req,
307     fallback : ['gst-plugins-base', 'app_dep'])
308 gstaudio_dep = dependency('gstreamer-audio-1.0', version : gst_req,
309     fallback : ['gst-plugins-base', 'audio_dep'])
310 gstfft_dep = dependency('gstreamer-fft-1.0', version : gst_req,
311     fallback : ['gst-plugins-base', 'fft_dep'])
312 gstriff_dep = dependency('gstreamer-riff-1.0', version : gst_req,
313     fallback : ['gst-plugins-base', 'riff_dep'])
314 gstrtp_dep = dependency('gstreamer-rtp-1.0', version : gst_req,
315     fallback : ['gst-plugins-base', 'rtp_dep'])
316 gstrtsp_dep = dependency('gstreamer-rtsp-1.0', version : gst_req,
317     fallback : ['gst-plugins-base', 'rtsp_dep'])
318 gstsdp_dep = dependency('gstreamer-sdp-1.0', version : gst_req,
319     fallback : ['gst-plugins-base', 'sdp_dep'])
320 gsttag_dep = dependency('gstreamer-tag-1.0', version : gst_req,
321     fallback : ['gst-plugins-base', 'tag_dep'])
322 gstvideo_dep = dependency('gstreamer-video-1.0', version : gst_req,
323     fallback : ['gst-plugins-base', 'video_dep'])
324 gstcheck_dep = dependency('gstreamer-check-1.0', version : gst_req,
325     required : get_option('tests'),
326     fallback : ['gstreamer', 'gst_check_dep'])
327
328 # GStreamer OpenGL
329 gstgl_dep = dependency('gstreamer-gl-1.0', version : gst_req,
330     fallback : ['gst-plugins-base', 'gstgl_dep'], required: get_option('gl'))
331 gstglproto_dep = dependency('gstreamer-gl-prototypes-1.0', version : gst_req,
332     fallback : ['gst-plugins-base', 'gstglproto_dep'], required: get_option('gl'))
333 gstglx11_dep = dependency('', required : false)
334 gstglwayland_dep = dependency('', required : false)
335 gstglegl_dep = dependency('', required : false)
336
337 if gstgl_dep.found()
338   if gstgl_dep.type_name() == 'pkgconfig'
339     gst_gl_apis = gstgl_dep.get_variable('gl_apis').split()
340     gst_gl_winsys = gstgl_dep.get_variable('gl_winsys').split()
341     gst_gl_platforms = gstgl_dep.get_variable('gl_platforms').split()
342   else
343     gstbase = subproject('gst-plugins-base')
344     gst_gl_apis = gstbase.get_variable('enabled_gl_apis')
345     gst_gl_winsys = gstbase.get_variable('enabled_gl_winsys')
346     gst_gl_platforms = gstbase.get_variable('enabled_gl_platforms')
347   endif
348
349   message('GStreamer OpenGL window systems: @0@'.format(' '.join(gst_gl_winsys)))
350   message('GStreamer OpenGL platforms: @0@'.format(' '.join(gst_gl_platforms)))
351   message('GStreamer OpenGL apis: @0@'.format(' '.join(gst_gl_apis)))
352
353   foreach ws : ['x11', 'wayland', 'android', 'cocoa', 'eagl', 'win32', 'dispmanx', 'viv_fb']
354     set_variable('gst_gl_have_window_@0@'.format(ws), gst_gl_winsys.contains(ws))
355   endforeach
356
357   foreach p : ['glx', 'egl', 'cgl', 'eagl', 'wgl']
358     set_variable('gst_gl_have_platform_@0@'.format(p), gst_gl_platforms.contains(p))
359   endforeach
360
361   foreach api : ['gl', 'gles2']
362     set_variable('gst_gl_have_api_@0@'.format(api), gst_gl_apis.contains(api))
363   endforeach
364
365   # Behind specific checks because meson fails at optional dependencies with a
366   # fallback to the same subproject.  On the first failure, meson will never
367   # check the system again even if the fallback never existed.
368   # Last checked with meson 0.54.3
369   if gst_gl_have_window_x11
370     gstglx11_dep = dependency('gstreamer-gl-x11-1.0', version : gst_req,
371         fallback : ['gst-plugins-base', 'gstglx11_dep'], required: true)
372   endif
373   if gst_gl_have_window_wayland
374     gstglwayland_dep = dependency('gstreamer-gl-wayland-1.0', version : gst_req,
375         fallback : ['gst-plugins-base', 'gstglwayland_dep'], required: true)
376   endif
377   if gst_gl_have_platform_egl
378     gstglegl_dep = dependency('gstreamer-gl-egl-1.0', version : gst_req,
379         fallback : ['gst-plugins-base', 'gstglegl_dep'], required: true)
380   endif
381 endif
382
383 libm = cc.find_library('m', required : false)
384 gio_dep = dependency('gio-2.0', version: glib_req)
385 gmodule_dep = dependency('gmodule-no-export-2.0')
386 # gio-unix-2.0 is used by sys/bluez
387
388 # Optional dep of ext/gl and gst/librfb
389 x11_dep = dependency('x11', required : get_option('x11'))
390 if x11_dep.found()
391   cdata.set('HAVE_X11', 1)
392 endif
393
394 #
395 # Solaris and Illumos distros split a lot of networking-related code
396 # into '-lsocket -lnsl'.  Anything that calls socketpair(), getifaddr(),
397 # etc. probably needs to include network_deps
398 #
399 if host_machine.system() == 'sunos'
400   network_deps = [
401     cc.find_library('socket', required: false),
402     cc.find_library('nsl',    required: false)
403   ]
404 else
405   network_deps = []
406 endif
407
408 if host_machine.system() == 'windows'
409   winsock2 = [cc.find_library('ws2_32')]
410
411   building_for_win7 = cc.compiles('''#include <windows.h>
412       #ifndef WINVER
413       #error "unknown minimum supported OS version"
414       #endif
415       #if (WINVER < _WIN32_WINNT_WIN7)
416       #error "Windows 7 API is not guaranteed"
417       #endif
418       ''',
419       name: 'building for Windows 7')
420
421   if not building_for_win7
422     add_project_arguments([
423       '-D_WIN32_WINNT=_WIN32_WINNT_WIN7',
424       '-DWINVER=_WIN32_WINNT_WIN7',
425     ], language: ['c', 'cpp'])
426   endif
427 else
428   winsock2 = []
429 endif
430
431 if ['darwin', 'ios'].contains(host_system)
432   if not have_objc
433     error('Building on MacOS/iOS/etc requires an ObjC compiler')
434   endif
435   if host_system == 'ios'
436     cdata.set('HAVE_IOS', 1)
437   endif
438
439   avfoundation_dep = dependency('AVFoundation', required : false)
440   if avfoundation_dep.found()
441       cdata.set('HAVE_AVFOUNDATION', 1)
442   endif
443
444   videotoolbox_dep = dependency('VideoToolbox', required : false)
445   if videotoolbox_dep.found()
446       cdata.set('HAVE_VIDEOTOOLBOX', 1)
447   endif
448
449 #  FIXME: framework.version() returns 'unknown'
450 #  if videotoolbox_dep.version().version_compare('>=10.9.6')
451 #    cdata.set('HAVE_VIDEOTOOLBOX_10_9_6', 1)
452 #  endif
453 endif
454
455 have_orcc = false
456 orcc_args = []
457 orc_targets = []
458 # Used by various libraries/elements that use Orc code
459 orc_dep = dependency('orc-0.4', version : orc_req, required : get_option('orc'),
460     fallback : ['orc', 'orc_dep'])
461 orcc = find_program('orcc', required : get_option('orc'))
462 if orc_dep.found() and orcc.found()
463   have_orcc = true
464   orcc_args = [orcc, '--include', 'glib.h']
465   cdata.set('HAVE_ORC', 1)
466 else
467   message('Orc Compiler not found or disabled, will use backup C code')
468   cdata.set('DISABLE_ORC', 1)
469 endif
470 cdata.set('GST_ENABLE_EXTRA_CHECKS', not get_option('extra-checks').disabled())
471
472 gnustl_dep = declare_dependency()
473 if host_system == 'android'
474   gnustl_dep = dependency('gnustl', required : false)
475 endif
476
477 # Disable compiler warnings for unused variables and args if gst debug system is disabled
478 if gst_dep.type_name() == 'internal'
479   gst_debug_disabled = not subproject('gstreamer').get_variable('gst_debug')
480 else
481   # We can't check that in the case of subprojects as we won't
482   # be able to build against an internal dependency (which is not built yet)
483   gst_debug_disabled = cc.has_header_symbol('gst/gstconfig.h', 'GST_DISABLE_GST_DEBUG', dependencies: gst_dep)
484 endif
485
486 if gst_debug_disabled
487   message('GStreamer debug system is disabled')
488   if cc.has_argument('-Wno-unused')
489     add_project_arguments('-Wno-unused', language: 'c')
490   endif
491   if cxx.has_argument ('-Wno-unused')
492     add_project_arguments('-Wno-unused', language: 'cpp')
493   endif
494 else
495   message('GStreamer debug system is enabled')
496 endif
497
498 gst_plugins_bad_args = ['-DHAVE_CONFIG_H']
499 configinc = include_directories('.')
500 libsinc = include_directories('gst-libs')
501
502 python3 = import('python').find_installation()
503
504 gir = find_program('g-ir-scanner', required : get_option('introspection'))
505 gnome = import('gnome')
506 build_gir = gir.found() and (not meson.is_cross_build() or get_option('introspection').enabled())
507 gir_init_section = [ '--add-init-section=extern void gst_init(gint*,gchar**);' + \
508     'g_setenv("GST_REGISTRY_1.0", "@0@", TRUE);'.format(meson.current_build_dir() + '/gir_empty_registry.reg') + \
509     'g_setenv("GST_PLUGIN_PATH_1_0", "", TRUE);' + \
510     'g_setenv("GST_PLUGIN_SYSTEM_PATH_1_0", "", TRUE);' + \
511     'gst_init(NULL,NULL);', '--quiet']
512
513 presetdir = join_paths(get_option('datadir'), 'gstreamer-' + api_version, 'presets')
514
515 pkgconfig = import('pkgconfig')
516 plugins_pkgconfig_install_dir = join_paths(plugins_install_dir, 'pkgconfig')
517 if get_option('default_library') == 'shared'
518   # If we don't build static plugins there is no need to generate pc files
519   plugins_pkgconfig_install_dir = disabler()
520 endif
521
522 pkgconfig_variables = ['exec_prefix=${prefix}',
523     'toolsdir=${exec_prefix}/bin',
524     'pluginsdir=${libdir}/gstreamer-1.0',
525     'datarootdir=${prefix}/share',
526     'datadir=${datarootdir}',
527     'girdir=${datadir}/gir-1.0',
528     'typelibdir=${libdir}/girepository-1.0']
529
530 pkgconfig_subdirs = ['gstreamer-1.0']
531
532 pkgconfig.generate(
533   libraries : [gst_dep],
534   variables : pkgconfig_variables,
535   subdirs : pkgconfig_subdirs,
536   name : 'gstreamer-plugins-bad-1.0',
537   description : 'Streaming media framework, bad plugins libraries',
538 )
539
540 gpl_allowed = get_option('gpl').allowed()
541
542 subdir('gst-libs')
543 subdir('gst')
544 subdir('sys')
545 subdir('ext')
546 subdir('tests')
547 subdir('data')
548 subdir('tools')
549
550 if have_orcc
551   update_orc_dist_files = find_program('scripts/update-orc-dist-files.py')
552
553   orc_update_targets = []
554   foreach t : orc_targets
555     orc_name = t.get('name')
556     orc_file = t.get('orc-source')
557     header = t.get('header')
558     source = t.get('source')
559     # alias_target() only works with build targets, so can't use run_target() here
560     orc_update_targets += [
561       custom_target('update-orc-@0@'.format(orc_name),
562         input: [header, source],
563         command: [update_orc_dist_files, orc_file, header, source],
564         output: ['@0@-dist.c'.format(orc_name)]) # not entirely true
565     ]
566   endforeach
567
568   if orc_update_targets.length() > 0
569     update_orc_dist_target = alias_target('update-orc-dist', orc_update_targets)
570   endif
571 endif
572
573 # xgettext is optional (on Windows for instance)
574 if find_program('xgettext', required : get_option('nls')).found()
575   cdata.set('ENABLE_NLS', 1)
576   subdir('po')
577 endif
578
579 subdir('scripts')
580
581 # Set release date
582 if gst_version_nano == 0
583   extract_release_date = find_program('scripts/extract-release-date-from-doap-file.py')
584   run_result = run_command(extract_release_date, gst_version, files('gst-plugins-bad.doap'), check: true)
585   release_date = run_result.stdout().strip()
586   cdata.set_quoted('GST_PACKAGE_RELEASE_DATETIME', release_date)
587   message('Package release date: ' + release_date)
588 endif
589
590 if gio_dep.version().version_compare('< 2.67.4')
591   cdata.set('g_memdup2(ptr,sz)', '(G_LIKELY(((guint64)(sz)) < G_MAXUINT)) ? g_memdup(ptr,sz) : (g_abort(),NULL)')
592 endif
593
594 configure_file(output : 'config.h', configuration : cdata)
595
596 subdir('docs')
597
598 plugin_names = []
599 foreach plugin: plugins
600   if plugin.name().startswith('gst')
601     plugin_names += [plugin.name().substring(3)]
602   else
603     plugin_names += [plugin.name()]
604   endif
605 endforeach
606
607 summary({
608     'Plugins': plugin_names,
609       '(A)GPL license allowed': gpl_allowed,
610 }, list_sep: ', ')