Daniel Campello has uploaded this change for review.

View Change

meson: add missing meson options from ebuild

This change adds missing meson options from chromiumos-overlay flashrom
ebuild in order to migrate to meson.

Signed-off-by: Daniel Campello <campello@chromium.org>
Change-Id: I97d2fd687aa21533b86f9af446038bfe3da1f7d3
---
M meson.build
M meson_options.txt
2 files changed, 48 insertions(+), 21 deletions(-)

git pull ssh://review.coreboot.org:29418/flashrom refs/changes/52/51552/1
diff --git a/meson.build b/meson.build
index 73df722..71dfa06 100644
--- a/meson.build
+++ b/meson.build
@@ -68,6 +68,8 @@
config_stlinkv3_spi = get_option('config_stlinkv3_spi')
config_lspcon_i2c_spi = get_option('config_lspcon_i2c_spi')
config_realtek_mst_i2c_spi = get_option('config_realtek_mst_i2c_spi')
+config_print_wiki= get_option('print_wiki')
+config_static= get_option('static')

cargs = []
deps = []
@@ -91,7 +93,7 @@
if get_option('usb')
srcs += 'usbdev.c'
srcs += 'usb_device.c'
- deps += dependency('libusb-1.0')
+ deps += dependency('libusb-1.0', static : config_static)
else
config_ch341a_spi = false
config_dediprog = false
@@ -103,7 +105,7 @@
# some programmers require libpci
if get_option('pciutils')
srcs += 'pcidev.c'
- deps += dependency('libpci')
+ deps += dependency('libpci', static : config_static)
cargs += '-DNEED_PCI=1'
else
config_atahpt = false
@@ -163,7 +165,7 @@
if config_jlink_spi
srcs += 'jlink_spi.c'
cargs += '-DCONFIG_JLINK_SPI=1'
- deps += dependency('libjaylink')
+ deps += dependency('libjaylink', static : config_static)
endif
if config_drkaiser
srcs += 'drkaiser.c'
@@ -176,7 +178,7 @@
if config_ft2232_spi
srcs += 'ft2232_spi.c'
cargs += '-DCONFIG_FT2232_SPI=1'
- deps += dependency('libftdi1')
+ deps += dependency('libftdi1', static : config_static)
cargs += '-DHAVE_FT232H=1'
endif
if config_gfxnvidia
@@ -377,23 +379,41 @@

mapfile = 'libflashrom.map'
vflag = '-Wl,--version-script,@0@/@1@'.format(meson.current_source_dir(), mapfile)
-flashrom = shared_library(
- 'flashrom',
- sources : [
- srcs,
- ],
- soversion : lt_current,
- version : lt_version,
- dependencies : [
- deps,
- ],
- c_args : [
- cargs,
- ],
- install : true,
- link_args : vflag,
- link_depends : mapfile,
-)
+if config_static
+ flashrom = static_library(
+ 'flashrom',
+ sources : [
+ srcs,
+ ],
+ dependencies : [
+ deps,
+ ],
+ c_args : [
+ cargs,
+ ],
+ install : true,
+ link_args : vflag,
+ link_depends : mapfile,
+ )
+else
+ flashrom = shared_library(
+ 'flashrom',
+ sources : [
+ srcs,
+ ],
+ soversion : lt_current,
+ version : lt_version,
+ dependencies : [
+ deps,
+ ],
+ c_args : [
+ cargs,
+ ],
+ install : true,
+ link_args : vflag,
+ link_depends : mapfile,
+ )
+endif

version = meson.project_version()
#strip leading characters
@@ -429,6 +449,11 @@
dependencies : deps
)

+if config_print_wiki
+ srcs += 'print_wiki.c'
+ cargs += '-DCONFIG_PRINT_WIKI=1'
+endif
+
# we can't just link_with libflashrom as we require all the internal symbols...
executable(
'flashrom',
diff --git a/meson_options.txt b/meson_options.txt
index b599d66..5f6c7d3 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -1,5 +1,7 @@
option('pciutils', type : 'boolean', value : true, description : 'use pciutils')
option('usb', type : 'boolean', value : true, description : 'use libusb1')
+option('print_wiki', type : 'boolean', value : true, description : 'Print Wiki')
+option('static', type : 'boolean', value : false, description : 'static')

option('config_atahpt', type : 'boolean', value : false, description : 'Highpoint (HPT) ATA/RAID controllers')
option('config_atapromise', type : 'boolean', value : false, description : 'Promise ATA controller')

To view, visit change 51552. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: I97d2fd687aa21533b86f9af446038bfe3da1f7d3
Gerrit-Change-Number: 51552
Gerrit-PatchSet: 1
Gerrit-Owner: Daniel Campello <campello@chromium.org>
Gerrit-MessageType: newchange