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