1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
|
orc_sources = [
'orc.c',
'orcbytecode.c',
'orccode.c',
'orccodemem.c',
'orccompiler.c',
'orcdebug.c',
'orcemulateopcodes.c',
'orcexecutor.c',
'orcfunctions.c',
'orconce.c',
'orcopcodes.c',
'orcparse.c',
'orcprogram.c',
'orcprogram-c.c',
'orcrule.c',
'orcutils.c',
]
orc_headers = [
'orc.h',
'orcarm.h',
'orcbytecode.h',
'orcbytecodes.h',
'orccode.h',
'orccompiler.h',
'orcconstant.h',
'orccpu.h',
'orccpuinsn.h',
'orcdebug.h',
'orcemulateopcodes.h', # FIXME: this probably shouldn't be installed, symbols are not exported or useful
'orcexecutor.h',
'orcfunctions.h',
'orcinstruction.h',
'orcinternal.h', # FIXME: this probably shouldn't be installed, symbols are not exported or useful
'orclimits.h',
'orcmmx.h',
'orcneon.h',
'orconce.h',
'orcopcode.h',
'orcparse.h',
'orcpowerpc.h',
'orcprogram.h',
'orcrule.h',
'orcsse.h',
'orctarget.h',
'orcutils.h',
'orcvariable.h',
'orcx86.h',
'orcx86insn.h',
'orcmips.h',
'orc-stdint.h',
]
install_headers(orc_headers, subdir : 'orc-' + orc_api + '/orc')
if 'sse' in enabled_backends
orc_sources += ['orcsse.c', 'orcrules-sse.c', 'orcprogram-sse.c',
'orcx86.c', 'orcx86insn.c']
endif
if 'mmx' in enabled_backends
# we assume it is ok to include the same file (orcx86) twice
# in case all backends are selected (ie mmx and sse)
orc_sources += ['orcmmx.c', 'orcrules-mmx.c', 'orcprogram-mmx.c', 'orcx86.c']
endif
if 'altivec' in enabled_backends
orc_sources += ['orcrules-altivec.c', 'orcprogram-altivec.c', 'orcpowerpc.c']
endif
if 'neon' in enabled_backends
orc_sources += ['orcprogram-neon.c', 'orcrules-neon.c', 'orcarm.c']
endif
# ARM backend is disabled until it has decent coverage
if 'arm' in enabled_backends
# we assume it is ok to include the same file (orcarm) twice
# in case all backends are selected (ie neon and arm)
# orc_sources += ['orcprogram-arm.c', 'orcrules-arm.c', 'orcarm.c']
endif
if 'c64x' in enabled_backends
orc_sources += ['orcprogram-c64x-c.c']
endif
if 'mips' in enabled_backends
orc_sources += ['orcmips.c', 'orcprogram-mips.c', 'orcrules-mips.c']
endif
if cpu_family.startswith('x86')
orc_sources += ['orccpu-x86.c']
elif cpu_family == 'ppc' or cpu_family == 'ppc64'
orc_sources += ['orccpu-powerpc.c']
# TODO: Add support for Windows
# https://gitlab.freedesktop.org/gstreamer/orc/-/issues/38
elif (cpu_family == 'arm' or cpu_family == 'aarch64') and host_system != 'windows'
orc_sources += ['orccpu-arm.c']
elif cpu_family == 'mips' and host_machine.endian() == 'little'
orc_sources += ['orccpu-mips.c']
endif
orc_c_args = ['-DORC_ENABLE_UNSTABLE_API', '-D_GNU_SOURCE']
orc_dependencies = [libm, librt, liblog]
if host_os != 'windows'
# winpthread may be detected but we don't use it
orc_dependencies += threads
endif
orc_lib = library ('orc-' + orc_api,
orc_sources,
version : libversion,
soversion : soversion,
darwin_versions : osxversion,
include_directories : orc_inc,
c_args : orc_c_args + ['-DBUILDING_ORC'],
dependencies : orc_dependencies,
install : true)
orc_dep_cargs = []
if get_option('default_library') == 'static'
orc_dep_cargs += ['-DORC_STATIC_COMPILATION']
endif
orc_dep = declare_dependency(include_directories : orc_inc,
dependencies : orc_dependencies,
compile_args : orc_dep_cargs,
link_with : orc_lib)
executable ('generate-bytecode',
'generate-bytecode.c',
dependencies : orc_dep,
install : false)
executable ('generate-emulation',
'generate-emulation.c',
dependencies : orc_dep,
install : false)
|