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
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
|
--- a/meson.build
+++ b/meson.build
@@ -44,6 +44,7 @@
config_gfxnvidia = get_option('config_gfxnvidia')
config_internal = get_option('config_internal')
config_it8212 = get_option('config_it8212')
+config_jlink_spi = get_option('config_jlink_spi')
config_linux_mtd = get_option('config_linux_mtd')
config_linux_spi = get_option('config_linux_spi')
config_mstarddc_spi = get_option('config_mstarddc_spi')
@@ -67,6 +68,10 @@
deps = []
srcs = []
+config_bitbang_spi = false
+need_libftdi = false
+need_libpci = false
+need_libusb = false
need_raw_access = false
need_serial = false
@@ -81,24 +86,24 @@
add_project_arguments('-DHAVE_UTSNAME=1', language : 'c')
endif
-# some programmers require libusb
-if get_option('usb')
- srcs += 'usbdev.c'
- deps += dependency('libusb-1.0')
-else
+if get_option('no_libftdi_programmers')
+ message('Disabling ALL libftdi-based programmers')
+ config_ft2232_spi = false
+ config_usbblaster_spi = false
+endif
+
+if get_option('no_libusb_programmers')
+ message('Disabling ALL libusb-based programmers')
config_ch341a_spi = false
config_dediprog = false
- config_digilent_spi = false
config_developerbox_spi = false
+ config_digilent_spi = false
config_pickit2_spi = false
+ config_stlinkv3_spi = false
endif
-# some programmers require libpci
-if get_option('pciutils')
- srcs += 'pcidev.c'
- deps += dependency('libpci')
- cargs += '-DNEED_PCI=1'
-else
+if get_option('no_libpci_programmers')
+ message('Disabling ALL libpci-based programmers')
config_atahpt = false
config_atapromise = false
config_atavia = false
@@ -121,14 +126,20 @@
# set defines for configured programmers
if config_atahpt
srcs += 'atahpt.c'
+ need_libpci = true
+ need_raw_access = true
cargs += '-DCONFIG_ATAHPT=1'
endif
if config_atapromise
srcs += 'atapromise.c'
+ need_libpci = true
+ need_raw_access = true
cargs += '-DCONFIG_ATAPROMISE=1'
endif
if config_atavia
srcs += 'atavia.c'
+ need_libpci = true
+ need_raw_access = true
cargs += '-DCONFIG_ATAVIA=1'
endif
if config_buspirate_spi
@@ -138,22 +149,28 @@
endif
if config_ch341a_spi
srcs += 'ch341a_spi.c'
+ need_libusb = true
cargs += '-DCONFIG_CH341A_SPI=1'
endif
if config_dediprog
srcs += 'dediprog.c'
+ need_libusb = true
cargs += '-DCONFIG_DEDIPROG=1'
endif
if config_developerbox_spi
srcs += 'developerbox_spi.c'
+ need_libusb = true
cargs += '-DCONFIG_DEVELOPERBOX_SPI=1'
endif
if config_digilent_spi
srcs += 'digilent_spi.c'
+ need_libusb = true
cargs += '-DCONFIG_DIGILENT_SPI=1'
endif
if config_drkaiser
srcs += 'drkaiser.c'
+ need_libpci = true
+ need_raw_access = true
cargs += '-DCONFIG_DRKAISER=1'
endif
if config_dummy
@@ -162,12 +179,14 @@
endif
if config_ft2232_spi
srcs += 'ft2232_spi.c'
+ need_libftdi = true
cargs += '-DCONFIG_FT2232_SPI=1'
- deps += dependency('libftdi1')
cargs += '-DHAVE_FT232H=1'
endif
if config_gfxnvidia
srcs += 'gfxnvidia.c'
+ need_libpci = true
+ need_raw_access = true
cargs += '-DCONFIG_GFXNVIDIA=1'
endif
if config_internal
@@ -186,6 +205,8 @@
srcs += 'sb600spi.c'
srcs += 'wbsio_spi.c'
endif
+ need_libpci = true
+ need_raw_access = true
config_bitbang_spi = true
cargs += '-DCONFIG_INTERNAL=1'
if get_option('config_internal_dmi')
@@ -195,6 +216,8 @@
endif
if config_it8212
srcs += 'it8212.c'
+ need_libpci = true
+ need_raw_access = true
cargs += '-DCONFIG_IT8212=1'
endif
if config_linux_mtd
@@ -211,36 +234,51 @@
endif
if config_nic3com
srcs += 'nic3com.c'
+ need_libpci = true
+ need_raw_access = true
cargs += '-DCONFIG_NIC3COM=1'
endif
if config_nicintel
srcs += 'nicintel.c'
+ need_libpci = true
+ need_raw_access = true
cargs += '-DCONFIG_NICINTEL=1'
endif
if config_nicintel_eeprom
srcs += 'nicintel_eeprom.c'
+ need_libpci = true
+ need_raw_access = true
cargs += '-DCONFIG_NICINTEL_EEPROM=1'
endif
if config_nicintel_spi
srcs += 'nicintel_spi.c'
+ need_libpci = true
+ need_raw_access = true
config_bitbang_spi = true
cargs += '-DCONFIG_NICINTEL_SPI=1'
endif
if config_nicnatsemi
srcs += 'nicnatsemi.c'
+ need_libpci = true
+ need_raw_access = true
cargs += '-DCONFIG_NICNATSEMI=1'
endif
if config_nicrealtek
srcs += 'nicrealtek.c'
+ need_libpci = true
+ need_raw_access = true
cargs += '-DCONFIG_NICREALTEK=1'
endif
if config_ogp_spi
config_bitbang_spi = true
srcs += 'ogp_spi.c'
+ need_libpci = true
+ need_raw_access = true
cargs += '-DCONFIG_OGP_SPI=1'
endif
if config_pickit2_spi
srcs += 'pickit2_spi.c'
+ need_libusb = true
cargs += '-DCONFIG_PICKIT2_SPI=1'
endif
if config_pony_spi
@@ -252,15 +290,20 @@
if config_rayer_spi
srcs += 'rayer_spi.c'
config_bitbang_spi = true
+ need_libpci = true
need_raw_access = true
cargs += '-DCONFIG_RAYER_SPI=1'
endif
if config_satamv
srcs += 'satamv.c'
+ need_libpci = true
+ need_raw_access = true
cargs += '-DCONFIG_SATAMV=1'
endif
if config_satasii
srcs += 'satasii.c'
+ need_libpci = true
+ need_raw_access = true
cargs += '-DCONFIG_SATASII=1'
endif
if config_serprog
@@ -270,12 +313,19 @@
endif
if config_usbblaster_spi
srcs += 'usbblaster_spi.c'
+ need_libftdi = true
cargs += '-DCONFIG_USBBLASTER_SPI=1'
endif
if config_stlinkv3_spi
srcs += 'stlinkv3_spi.c'
+ need_libusb = true
cargs += '-DCONFIG_STLINKV3_SPI=1'
endif
+if config_jlink_spi
+ srcs += 'jlink_spi.c'
+ cargs += '-DCONFIG_JLINK_SPI=1'
+ deps += dependency('libjaylink')
+endif
# bitbanging SPI infrastructure
if config_bitbang_spi
@@ -296,6 +346,25 @@
srcs += 'serial.c'
endif
+# some programmers require libftdi
+if need_libftdi
+ deps += dependency('libftdi1')
+endif
+
+# some programmers require libpci
+if need_libpci
+ srcs += 'pcidev.c'
+ deps += dependency('libpci')
+ cargs += '-DNEED_PCI=1'
+endif
+
+# some programmers require libusb
+if need_libusb
+ srcs += 'usbdev.c'
+ deps += dependency('libusb-1.0')
+endif
+
+
prefix = get_option('prefix')
sbindir = join_paths(prefix, get_option('sbindir'))
libdir = join_paths(prefix, get_option('libdir'))
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -1,5 +1,6 @@
-option('pciutils', type : 'boolean', value : true, description : 'use pciutils')
-option('usb', type : 'boolean', value : true, description : 'use libusb1')
+option('no_libftdi_programmers', type : 'boolean', value : false, description : 'disable all programmers depending on libftdi')
+option('no_libpci_programmers', type : 'boolean', value : false, description : 'disable all programmers depending on libpci')
+option('no_libusb_programmers', type : 'boolean', value : false, description : 'disable all programmers depending on libusb')
option('config_atahpt', type : 'boolean', value : false, description : 'Highpoint (HPT) ATA/RAID controllers')
option('config_atapromise', type : 'boolean', value : false, description : 'Promise ATA controller')
@@ -16,6 +17,7 @@
option('config_internal', type : 'boolean', value : true, description : 'internal/onboard')
option('config_internal_dmi', type : 'boolean', value : true, description : 'Use internal DMI parser')
option('config_it8212', type : 'boolean', value : true, description : 'ITE IT8212F PATA')
+option('config_jlink_spi', type : 'boolean', value : false, description : 'SEGGER J-Link and compatible')
option('config_linux_mtd', type : 'boolean', value : true, description : 'Linux MTD interfaces')
option('config_linux_spi', type : 'boolean', value : true, description : 'Linux spidev interfaces')
option('config_mstarddc_spi', type : 'boolean', value : false, description : 'MSTAR DDC support')
|