forked from ish-app/ish
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmeson.build
108 lines (88 loc) · 2.41 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
project('ish', 'c',
default_options: ['default_library=static', 'c_std=gnu11'])
log_on = get_option('log').split()
log_off = get_option('nolog').split()
foreach channel : log_on + log_off
if log_on.contains(channel)
add_project_arguments('-DDEBUG_' + channel + '=1', language: 'c')
else
add_project_arguments('-DDEBUG_' + channel + '=0', language: 'c')
endif
endforeach
if get_option('no_crlf')
add_project_arguments('-DNO_CRLF', language: 'c')
endif
includes = [include_directories('.')]
cc = meson.get_compiler('c')
threads = dependency('threads')
librt = cc.find_library('rt', required: false)
gdbm = subproject('gdbm').get_variable('gdbm')
softfloat = subproject('softfloat').get_variable('softfloat_dep')
subdir('vdso') # ish depends on the vdso
cify = executable('tools/cify', ['tools/cify.c'], native: true)
cified_vdso = custom_target('cify-vdso',
output: ['libvdso.so.c', 'libvdso.so.h'],
depends: [vdso],
command: [cify, 'vdso_data', vdso.full_path(), '@OUTPUT@'])
src = [
'kernel/init.c',
'kernel/errno.c',
'kernel/calls.c',
'kernel/user.c',
'kernel/vdso.c',
'kernel/task.c',
'kernel/group.c',
'kernel/fork.c',
'kernel/exec.c',
'kernel/exit.c',
'kernel/time.c',
'kernel/mmap.c',
'kernel/uname.c',
'kernel/tls.c',
'kernel/getset.c',
'kernel/signal.c',
'kernel/resource.c',
'kernel/fs.c',
'kernel/fs_info.c',
'fs/fd.c',
'fs/stat.c',
'fs/dir.c',
'fs/generic.c',
'fs/path.c',
'fs/real.c',
'fs/fake.c',
'fs/fake-rebuild.c',
'fs/adhoc.c',
'fs/sock.c',
'fs/pipe.c',
'fs/dev.c',
'fs/tty.c',
'fs/tty-real.c',
'fs/poll.c',
'kernel/poll.c',
'util/timer.c',
'emu/memory.c',
'emu/tlb.c',
'emu/interp.c',
'emu/modrm.c',
cified_vdso,
]
libish = library('ish', src,
include_directories: includes,
dependencies: [librt, threads, softfloat, gdbm])
ish = declare_dependency(
link_with: libish,
dependencies: [librt, threads, softfloat, gdbm],
include_directories: includes)
# ptraceomatic et al
subdir('tools')
if not meson.is_cross_build()
executable('ish', ['main.c'], dependencies: ish)
endif
gdb_scripts = ['ish-gdb.gdb']
foreach script : gdb_scripts
custom_target(script,
output: script, input: script,
command: ['ln', '-sf', '@INPUT@', '@OUTPUT@'],
build_by_default: true)
endforeach