-# These are only needed/used by the ABI tests from core
-host_defines = [
- [ 'x86', 'HAVE_CPU_I386' ],
- [ 'x86_64', 'HAVE_CPU_X86_64' ],
- [ 'arm', 'HAVE_CPU_ARM' ],
- [ 'aarch64', 'HAVE_CPU_AARCH64' ],
- [ 'mips', 'HAVE_CPU_MIPS' ],
- [ 'powerpc', 'HAVE_CPU_PPC' ],
- [ 'powerpc64', 'HAVE_CPU_PPC64' ],
- [ 'alpha', 'HAVE_CPU_ALPHA' ],
- [ 'sparc', 'HAVE_CPU_SPARC' ],
- [ 'ia64', 'HAVE_CPU_IA64' ],
- [ 'hppa', 'HAVE_CPU_HPPA' ],
- [ 'm68k', 'HAVE_CPU_M68K' ],
- [ 's390', 'HAVE_CPU_S390' ],
-]
-foreach h : host_defines
- if h.get(0) == host_machine.cpu_family()
- core_conf.set(h.get(1), 1)
- endif
-endforeach
-# FIXME: should really be called HOST_CPU or such
-core_conf.set_quoted('TARGET_CPU', host_machine.cpu())
-
-check_headers = [
- ['HAVE_DLFCN_H', 'dlfcn.h'],
- ['HAVE_EMMINTRIN_H', 'emmintrin.h'],
- ['HAVE_INTTYPES_H', 'inttypes.h'],
- ['HAVE_MEMORY_H', 'memory.h'],
- ['HAVE_NETINET_IN_H', 'netinet/in.h'],
- ['HAVE_NETINET_TCP_H', 'netinet/tcp.h'],
- ['HAVE_PROCESS_H', 'process.h'],
- ['HAVE_SMMINTRIN_H', 'smmintrin.h'],
- ['HAVE_STDINT_H', 'stdint.h'],
- ['HAVE_STRINGS_H', 'strings.h'],
- ['HAVE_STRING_H', 'string.h'],
- ['HAVE_SYS_SOCKET_H', 'sys/socket.h'],
- ['HAVE_SYS_STAT_H', 'sys/stat.h'],
- ['HAVE_SYS_TYPES_H', 'sys/types.h'],
- ['HAVE_SYS_WAIT_H', 'sys/wait.h'],
- ['HAVE_UNISTD_H', 'unistd.h'],
- ['HAVE_WINSOCK2_H', 'winsock2.h'],
- ['HAVE_XMMINTRIN_H', 'xmmintrin.h'],
- ['HAVE_LINUX_DMA_BUF_H', 'linux/dma-buf.h'],
-]
-foreach h : check_headers
- if cc.has_header(h.get(1))
- core_conf.set(h.get(0), 1)
- endif
-endforeach
-
-check_functions = [
- ['HAVE_DCGETTEXT', 'dcgettext', '#include<libintl.h>'],
- ['HAVE_GMTIME_R', 'gmtime_r', '#include<time.h>'],
- ['HAVE_LOCALTIME_R', 'localtime_r', '#include<time.h>'],
- ['HAVE_LRINTF', 'lrintf', '#include<math.h>'],
- ['HAVE_MMAP', 'mmap', '#include<sys/mman.h>'],
- ['HAVE_LOG2', 'log2', '#include<math.h>'],
-]
-
-libm = cc.find_library('m', required : false)
-foreach f : check_functions
- if cc.has_function(f.get(1), prefix : f.get(2), dependencies : libm)
- core_conf.set(f.get(0), 1)
+orc_subproject = subproject('orc', required: get_option('orc'))
+
+subprojects_names = []
+plugins_doc_caches = []
+orc_update_targets = []
+all_plugins = []
+all_libraries = []
+foreach sp : subprojects
+ project_name = sp[0]
+ build_infos = sp[1]
+ is_required = build_infos.get('option', true)
+ sysdep = build_infos.get('sysdep', '')
+ sysdep_version = build_infos.get('sysdep_version', '')
+ match_gst_version = build_infos.get('match_gst_version', true)
+
+ if match_gst_version
+ subproj = subproject(project_name, version: gst_version, required: is_required)
+ elif sysdep != ''
+ sysdep_dep = dependency(sysdep, version: sysdep_version, required: false)
+ if not sysdep_dep.found()
+ subproj = subproject(project_name, required: is_required)
+ endif
+ else
+ subproj = subproject(project_name, required: is_required)