meson: Overhaul the print_wiki option

- Rename `print_wiki` to `classic_cli_print_wiki`
- Make it a meson feature type
- `classic_cli` must be enabled to enable `classic_cli_print_wiki`
- `classic_cli_print_wiki` is disabled by default

Change-Id: Ic6c959b8b64ec2756b4535bd1b3320860f836aa5
Signed-off-by: Thomas Heijligen <thomas.heijligen@secunet.com>
Original-Reviewed-on: https://review.coreboot.org/c/flashrom/+/66703
Original-Reviewed-by: Anastasia Klimchuk <aklm@chromium.org>
Original-Reviewed-by: Felix Singer <felixsinger@posteo.net>
Reviewed-on: https://review.coreboot.org/c/flashrom-stable/+/72356
Reviewed-by: Nico Huber <nico.h@gmx.de>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
diff --git a/meson.build b/meson.build
index 045b779..41335e5 100644
--- a/meson.build
+++ b/meson.build
@@ -72,9 +72,9 @@
 config_serprog = get_option('config_serprog')
 config_usbblaster_spi = get_option('config_usbblaster_spi')
 config_stlinkv3_spi = get_option('config_stlinkv3_spi')
+config_print_wiki = get_option('classic_cli_print_wiki')
 config_default_programmer_name = get_option('default_programmer_name')
 config_default_programmer_args = get_option('default_programmer_args')
-config_print_wiki= get_option('print_wiki')
 
 cargs = []
 deps = []
@@ -389,9 +389,15 @@
   endif
 endif
 
-if config_print_wiki
-  srcs += files('print_wiki.c')
-  cargs += '-DCONFIG_PRINT_WIKI=1'
+
+
+if config_print_wiki.enabled()
+  if get_option('classic_cli').disabled()
+    error('`classic_cli_print_wiki` can not be enabled without `classic_cli`')
+  else
+    srcs += files('print_wiki.c')
+    cargs += '-DCONFIG_PRINT_WIKI=1'
+  endif
 endif
 
 if config_default_programmer_name != ''
diff --git a/meson_options.txt b/meson_options.txt
index b883f6b..ea5dd56 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -1,10 +1,10 @@
 option('pciutils', type : 'boolean', value : true, description : 'use pciutils')
 option('usb', type : 'boolean', value : true, description : 'use libusb1')
 option('classic_cli', type : 'feature', value : 'enabled', description : 'classic flashrom cli binary')
+option('classic_cli_print_wiki', type : 'feature', value : 'disabled',  description : 'Print Wiki')
 option('default_programmer_name', type : 'string', description : 'default programmer')
 option('default_programmer_args', type : 'string', description : 'default programmer arguments')
 option('ich_descriptors_tool', type : 'feature', value : 'auto', description : 'Build ich_descriptors_tool')
-option('print_wiki', type : 'boolean', value : true,  description : 'Print Wiki')
 
 option('config_atahpt', type : 'boolean', value : false, description : 'Highpoint (HPT) ATA/RAID controllers')
 option('config_atapromise', type : 'boolean', value : false, description : 'Promise ATA controller')