Files
Ross Burton 401364d06f flashrom: recipe cleanup
Use Meson to build instead of the bare Makefiles, as the Meson build also
generates pkgconfig files which are needed fwupd.

Add PACKAGECONFIG options for the platform dependencies (libpci, libusb,
libftdi).  Add a patch to the meson.build to ensure that these options
work as intended.

Fix LICENSE, as this is GPLv2-or-later.

Replace 0001-typecast-enum-conversions-explicitly.patch with upstreamed
patch.

Drop 0001-Makefile-Check-for-last-line-only-from-preprocessed-.patch as
this is only needed for the Makefile build.

Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
2021-03-30 12:38:55 -07:00

69 lines
2.0 KiB
Diff

Add a ftdi option alongside USB and PCI to control the external dependency, and
ensure that the build is successful in all combinations of options.
Upstream-Status: Pending
Signed-off-by: Ross Burton <ross.burton@arm.com>
diff --git a/meson.build b/meson.build
index 375089c..0df9d69 100644
--- a/meson.build
+++ b/meson.build
@@ -91,6 +91,8 @@ else
config_digilent_spi = false
config_developerbox_spi = false
config_pickit2_spi = false
+ config_stlinkv3_spi = false
+ config_usbblaster_spi = false
endif
# some programmers require libpci
@@ -118,6 +120,21 @@ else
config_satasii = false
endif
+# some programmers require libftdi
+if get_option('ftdi')
+ deps += dependency('libftdi1')
+else
+ config_ft2232_spi = false
+ config_usbblaster_spi = false
+endif
+
+if not (target_machine.cpu_family() == 'x86' or target_machine.cpu_family() == 'x86_64')
+ config_satamv = false
+ config_nic3com = false
+ config_rayer_spi = false
+ config_nicrealtek = false
+endif
+
# set defines for configured programmers
if config_atahpt
srcs += 'atahpt.c'
@@ -163,7 +180,6 @@ endif
if config_ft2232_spi
srcs += 'ft2232_spi.c'
cargs += '-DCONFIG_FT2232_SPI=1'
- deps += dependency('libftdi1')
cargs += '-DHAVE_FT232H=1'
endif
if config_gfxnvidia
@@ -216,6 +232,7 @@ endif
if config_nicintel
srcs += 'nicintel.c'
cargs += '-DCONFIG_NICINTEL=1'
+ need_raw_access = true
endif
if config_nicintel_eeprom
srcs += 'nicintel_eeprom.c'
diff --git a/meson_options.txt b/meson_options.txt
index ea87311..b6b842d 100644
--- 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('ftdi', type : 'boolean', value : true, description : 'use libftdi')
option('config_atahpt', type : 'boolean', value : false, description : 'Highpoint (HPT) ATA/RAID controllers')
option('config_atapromise', type : 'boolean', value : false, description : 'Promise ATA controller')