-
Notifications
You must be signed in to change notification settings - Fork 11
/
meson.build
212 lines (189 loc) · 7.97 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
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
# -*-python-*-
project('fbida', 'c', default_options : [ 'c_std=gnu99' ])
# tweak warnings
add_global_arguments('-Wno-pointer-sign', language : 'c')
add_global_arguments('-D_GNU_SOURCE=1', language : 'c')
# init configuration
config = configuration_data()
version = run_command('cat', 'VERSION')
config.set_quoted('VERSION', version.stdout().strip())
x11resrun = run_command('scripts/x11resdir.sh', get_option('prefix'))
x11resdir = x11resrun.stdout().strip()
# pkg-config deps
pixman_dep = dependency('pixman-1')
poppler_dep = dependency('poppler-glib', required : get_option('pdf'))
cairo_dep = dependency('cairo')
drm_dep = dependency('libdrm')
exif_dep = dependency('libexif')
png_dep = dependency('libpng', required : get_option('png'))
tiff_dep = dependency('libtiff-4', required : get_option('tiff'))
webp_dep = dependency('libwebp', required : get_option('webp'))
udev_dep = dependency('libudev')
input_dep = dependency('libinput')
xkb_dep = dependency('xkbcommon')
glib_dep = dependency('glib-2.0')
tsm_dep = dependency('libtsm', required : false)
systemd_dep = dependency('libsystemd', required : false, version : '>=237')
# other library deps
cc = meson.get_compiler('c')
jpeg_dep = cc.find_library('jpeg')
util_dep = cc.find_library('util')
iconv_dep = cc.find_library('iconv', required : false)
math_dep = cc.find_library('m', required : false)
pcd_dep = cc.find_library('pcd', required : false)
gif_dep = cc.find_library('gif', required : get_option('gif'))
# motif + x11 libs
motif_dep = cc.find_library('Xm', required : get_option('motif'))
xpm_dep = cc.find_library('Xpm', required : get_option('motif'))
xt_dep = cc.find_library('Xt', required : get_option('motif'))
xext_dep = cc.find_library('Xext', required : get_option('motif'))
x11_dep = cc.find_library('X11', required : get_option('motif'))
# image formats
read_srcs = [ 'readers.c', 'rd/read-ppm.c', 'rd/read-bmp.c',
'rd/read-jpeg.c' ]
write_srcs = [ 'writers.c', 'wr/write-ppm.c', 'wr/write-ps.c',
'wr/write-jpeg.c' ]
image_deps = [ jpeg_dep, png_dep, tiff_dep,
pcd_dep, gif_dep, webp_dep ]
if pcd_dep.found()
read_srcs += 'rd/read-pcd.c'
config.set('HAVE_LIBPCD', true)
endif
if get_option('png').enabled()
read_srcs += 'rd/read-png.c'
write_srcs += 'wr/write-png.c'
config.set('HAVE_LIBPNG', true)
endif
if get_option('tiff').enabled()
read_srcs += 'rd/read-tiff.c'
write_srcs += 'wr/write-tiff.c'
config.set('HAVE_LIBTIFF', true)
endif
if get_option('gif').enabled()
read_srcs += 'rd/read-gif.c'
config.set('HAVE_LIBGIF', true)
endif
if get_option('webp').enabled()
read_srcs += 'rd/read-webp.c'
config.set('HAVE_LIBWEBP', true)
endif
if systemd_dep.found()
config.set('HAVE_SYSTEMD', true)
endif
# jpeg transformation support
jpeg_run = run_command('scripts/jpeg-version.sh')
jpeg_ver = jpeg_run.stdout().strip()
trans_src = ''.join(['jpeg/', jpeg_ver, '/transupp.c'])
trans_inc = include_directories(''.join(['jpeg/', jpeg_ver]))
# finish & write configuration
if motif_dep.found()
config.set('HAVE_MOTIF', true)
endif
if target_machine.system() == 'linux'
config.set('SYSTEM_LINUX', true)
endif
configure_file(output : 'config.h', configuration : config)
add_global_arguments(['-include', 'config.h'], language : 'c')
########################################################################
# build fbi
fbi_srcs = [ 'fbi.c', 'fb-gui.c', 'desktop.c',
'parseconfig.c', 'fbiconfig.c',
'vt.c', 'kbd.c', 'logind.c',
'fbtools.c', 'drmtools.c', 'gfx.c',
'filter.c', 'op.c', 'jpegtools.c',
trans_src, read_srcs ]
fbi_deps = [ drm_dep, pixman_dep, cairo_dep,
exif_dep, image_deps, iconv_dep,
math_dep, udev_dep, input_dep, xkb_dep, systemd_dep ]
executable('fbi',
sources : fbi_srcs,
dependencies : fbi_deps,
include_directories : trans_inc,
install : true)
install_man('man/fbi.1')
# build exiftran
exiftr_srcs = [ 'exiftran.c', 'genthumbnail.c', 'jpegtools.c',
'filter.c', 'op.c', 'readers.c', 'rd/read-jpeg.c',
trans_src ]
exiftr_deps = [ jpeg_dep, exif_dep, math_dep, pixman_dep ]
executable('exiftran',
sources : exiftr_srcs,
dependencies : exiftr_deps,
include_directories : trans_inc,
install : true)
install_man('man/exiftran.1')
# build thumbnail.cgi
executable('thumbnail.cgi',
sources : 'thumbnail.cgi.c',
dependencies : exif_dep)
# build fbpdf
fbpdf_srcs = [ 'fbpdf.c', 'parseconfig.c', 'fbiconfig.c',
'vt.c', 'kbd.c', 'logind.c',
'fbtools.c', 'drmtools.c', 'gfx.c' ]
fbpdf_deps = [ drm_dep, pixman_dep, poppler_dep, cairo_dep,
udev_dep, input_dep, xkb_dep, systemd_dep ]
if get_option('pdf').enabled()
executable('fbpdf',
sources : fbpdf_srcs,
dependencies : fbpdf_deps,
install : true)
install_data('fbgs',
install_dir : get_option('bindir'),
install_mode : 'rwxr--r--')
endif
# build fbcon
fbcon_srcs = [ 'fbcon.c', 'drmtools.c', 'fbtools.c', 'gfx.c',
'vt.c', 'kbd.c', 'logind.c' ]
fbcon_deps = [ drm_dep, cairo_dep, util_dep, udev_dep, input_dep, xkb_dep, glib_dep,
tsm_dep, systemd_dep ]
if tsm_dep.found() and target_machine.system() == 'linux'
executable('fbcon',
sources : fbcon_srcs,
dependencies : fbcon_deps,
install : true)
install_data('fbcon.desktop',
install_dir : 'share/wayland-sessions')
endif
# build kbdtest
executable('kbdtest',
sources : [ 'kbdtest.c', 'kbd.c', 'logind.c' ],
dependencies : [ udev_dep, input_dep, xkb_dep, systemd_dep ] )
# build vttest
executable('vttest',
sources : [ 'vttest.c', 'kbd.c', 'logind.c' ],
dependencies : [ udev_dep, input_dep, xkb_dep, systemd_dep ] )
# build ida
mkfallback = find_program('scripts/fallback.pl')
hexify = find_program('scripts/hexify.sh')
copy = find_program('cp')
ida_ad = custom_target('ida-app-defaults-fallback',
input : ['Ida.ad'],
output : ['Ida.ad.h'],
command : [ mkfallback, '@INPUT@', '@OUTPUT@'])
ida_logo = custom_target('ida-logo',
input : ['logo.jpg'],
output : ['logo.h'],
command : [ hexify, '@INPUT@', '@OUTPUT@'])
ida_srcs = [ 'ida.c', 'man.c', 'hex.c', 'x11.c', 'viewer.c',
'icons.c', 'parseconfig.c', 'idaconfig.c',
'fileops.c', 'desktop.c', 'RegEdit.c', 'selections.c',
'xdnd.c', 'filebutton.c', 'filelist.c', 'browser.c',
'jpegtools.c', 'op.c', 'filter.c', 'lut.c', 'color.c',
trans_src, read_srcs, write_srcs,
'rd/read-xwd.c', 'rd/read-xpm.c',
ida_ad, ida_logo ]
ida_deps = [ pixman_dep, exif_dep, image_deps, iconv_dep, math_dep,
motif_dep, xpm_dep, xt_dep, xext_dep, x11_dep ]
if get_option('motif').enabled()
executable('ida',
sources : ida_srcs,
dependencies : ida_deps,
include_directories : trans_inc,
install : true)
install_man('man/ida.1')
custom_target('ida-app-defaults',
input : ['Ida.ad'],
output : ['Ida'],
command : [ copy, '@INPUT@', '@OUTPUT@'],
install : true, install_dir : x11resdir)
endif