-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmeson.build
148 lines (117 loc) · 4.72 KB
/
meson.build
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
139
140
141
142
143
144
145
146
147
148
project('cctools', ['c', 'cpp'],
version : '1010.6',
default_options : ['c_std=gnu11', 'cpp_std=gnu++14'])
add_global_arguments('-DCURRENT_PROJECT_VERSION="' + meson.project_version() + '"', language : 'c')
add_global_arguments('-DCODEDIRECTORY_SUPPORT', language : 'c')
add_global_arguments('-DLTO_SUPPORT', language : 'c')
add_global_arguments('-Wno-macro-redefined', language : 'c')
cc = meson.get_compiler('c')
ld64_proj = subproject('ld64', default_options : 'program-prefix=' + get_option('program-prefix'), required : false)
if ld64_proj.found()
libprunetrie_dep = ld64_proj.get_variable('libprunetrie_dep')
endif
incdirs = []
subdir('include')
subdir('libstuff')
subdir('misc')
subdir('otool')
subdir('man')
subdir('EXTERNAL_HEADERS')
llvm_dep = dependency('llvm', modules : ['lto'])
blocks_dep = dependency('blocks')
deps = [blocks_dep, llvm_dep.partial_dependency(includes : true, compile_args : true)]
libstuff_cflags = []
if cc.has_header('corecrypto/ccdigest.h')
libstuff_cflags += '-DHAVE_CORECRYPTO'
else
openssl_dep = dependency('openssl')
deps += openssl_dep
endif
libstuff = static_library('stuff', libstuff_srcs,
dependencies : deps,
c_args : libstuff_cflags,
include_directories : [incdirs, libstuff_inc])
subdir('ar')
subdir('as')
bitcode_strip = executable(get_option('program-prefix') + 'bitcode_strip', bitcode_strip_srcs,
link_with : libstuff,
include_directories : incdirs,
install : true)
cmpdylib = executable(get_option('program-prefix') + 'cmpdylib', cmpdylib_srcs,
link_with : libstuff,
include_directories : incdirs,
install : true)
codesign_allocate = executable(get_option('program-prefix') + 'codesign_allocate', codesign_allocate_srcs,
link_with : libstuff,
include_directories : incdirs,
install : true)
install_symlink(get_option('program-prefix') + 'codesign_allocate-p',
pointing_to : get_option('program-prefix') + 'codesign_allocate',
install_dir : get_option('bindir'))
ctf_insert = executable(get_option('program-prefix') + 'ctf_insert', ctf_insert_srcs,
link_with : libstuff,
include_directories : [incdirs, libstuff_inc],
install : true)
install_name_tool = executable(get_option('program-prefix') + 'install_name_tool', install_name_tool_srcs,
link_with : libstuff,
include_directories : incdirs,
install : true)
libtool = executable(get_option('program-prefix') + 'libtool', libtool_srcs,
link_with : libstuff,
include_directories : incdirs,
install : true)
install_symlink(get_option('program-prefix') + 'ranlib',
pointing_to : get_option('program-prefix') + 'libtool',
install_dir : get_option('bindir'))
lipo = executable(get_option('program-prefix') + 'lipo', lipo_srcs,
link_with : libstuff,
include_directories : incdirs,
install : true)
llvm_otool = executable(get_option('program-prefix') + 'llvm-otool', llvm_otool_srcs,
link_with : libstuff,
include_directories : incdirs,
c_args : ['-DEFI_SUPPORT', '-DLLVM_OTOOL'],
install : true)
install_symlink(get_option('program-prefix') + 'otool',
pointing_to : get_option('program-prefix') + 'llvm-otool',
install_dir : get_option('bindir'))
nm_classic = executable(get_option('program-prefix') + 'nm-classic', nm_classic_srcs,
link_with : libstuff,
include_directories : incdirs,
install : true)
nmedit = executable(get_option('program-prefix') + 'nmedit', nmedit_srcs,
link_with : libstuff,
include_directories : incdirs,
c_args : ['-DNMEDIT'],
install : true)
otool_classic = executable(get_option('program-prefix') + 'otool-classic', otool_classic_srcs,
link_with : libstuff,
include_directories : [incdirs, otool_classic_inc],
c_args : ['-DEFI_SUPPORT', '-DOTOOL'],
link_language : 'cpp', # otool uses __cxa_demangle() from libc++
install : true)
pagestuff = executable(get_option('program-prefix') + 'pagestuff', pagestuff_srcs,
link_with : libstuff,
include_directories : incdirs,
install : true)
segedit = executable(get_option('program-prefix') + 'segedit', segedit_srcs,
link_with : libstuff,
include_directories : incdirs,
install : true)
size_classic = executable(get_option('program-prefix') + 'size-classic', size_classic_srcs,
link_with : libstuff,
include_directories : incdirs,
install : true)
install_symlink(get_option('program-prefix') + 'size',
pointing_to : get_option('program-prefix') + 'size-classic',
install_dir : get_option('bindir'))
strings = executable(get_option('program-prefix') + 'strings', strings_srcs,
link_with : libstuff,
include_directories : incdirs,
install : true)
strip = executable(get_option('program-prefix') + 'strip', strip_srcs,
link_with : libstuff,
include_directories : incdirs,
dependencies : ld64_proj.found() ? libprunetrie_dep : [],
c_args : ld64_proj.found() ? ['-DTRIE_SUPPORT'] : [],
install : true)