From nobody Mon Feb 9 09:49:05 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=gmail.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1656085357226713.2133379960077; Fri, 24 Jun 2022 08:42:37 -0700 (PDT) Received: from localhost ([::1]:38764 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o4lS8-00080e-5u for importer@patchew.org; Fri, 24 Jun 2022 11:42:36 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40830) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o4lQX-0005Fu-NU for qemu-devel@nongnu.org; Fri, 24 Jun 2022 11:40:57 -0400 Received: from mail-pl1-x62c.google.com ([2607:f8b0:4864:20::62c]:45013) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1o4lQV-0000l0-Rg for qemu-devel@nongnu.org; Fri, 24 Jun 2022 11:40:57 -0400 Received: by mail-pl1-x62c.google.com with SMTP id l6so2420682plg.11 for ; Fri, 24 Jun 2022 08:40:55 -0700 (PDT) Received: from localhost.localdomain ([2400:4050:c360:8200:80ba:2fd0:a1d1:c891]) by smtp.gmail.com with ESMTPSA id t6-20020a170902b20600b0016a1e2d148csm1993785plr.32.2022.06.24.08.40.51 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 24 Jun 2022 08:40:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=UrYp6BtTmV01k+BVuCbUQLaqB0tJ0DIjyqxHmDWKB3o=; b=Qv29mOP9nNTNG3zTgvmQxmkqiODhAL/0ZcpzblKPLlthmbWLE45CNFNgbehriMi+hH klJX0ONbkQHcIUrZYOFoSJeRAhJNYdyxvROpTfQ98jSmuvij26HRbcgRb9BP91dMqINd 3jtxzX67RswVddhfvTD3etFOY5hljjme5z+1ZENKsxAFKt+MlMyXV+uDt03XFNtfRkb5 iwLWY1oqHExVlbeJBxzoQ2jDh5eglSrleNjy5lfBuNHAyQ36Z6ufVYplUSXes6/vGP75 qseIuGGeui8HlNlunJTyhDnqieorQBAyTli7fyW2LPX2fyO7PjxXkU8KeH+A5Xn5MSuR SKvA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=UrYp6BtTmV01k+BVuCbUQLaqB0tJ0DIjyqxHmDWKB3o=; b=lb7v2urYAUGBfAgpzB76hc7nhD9p1DrqqYeE9LFGL/AhbDEty6imFBr2bFBUPEUySK BcsrlbFOwAm6zla3LzU3ebAQVa3ops3Na8sBhyzXQ89XL9ENlWIBcqYvzIWAZwTCasz7 2Fq0xF/ijbwvaM9ASb6iSTay3huZLk3seNllFOxNJFioFDftBW6JZ3chodUA7zACFBaZ UzYXHdKDm7IVsQoRpjxqUPR2gMZ3Mg+u9Yjs1h9N7nnDVEZ/CIDhPg+SywwJL6NqOBaF MEApzMtBfYbgU16yjhDRNo1IEVvQfzzfFElUQYeC7Yqx+740V3csOIaXcDy3oWbtd9L9 WZow== X-Gm-Message-State: AJIora8hq9wDYZB+stbvKB2vxqaVImJ6f3//9/khFuGHbmpff4PTI4QW ueRDEnZaS0X7UhFzRihrSe8= X-Google-Smtp-Source: AGRyM1twv41n7YWKUpvZ2rgHjiwlwzyFqwRPtqeAzjT5a5/xacqt2YrXy/53gSduaw+mfOlBiUh70A== X-Received: by 2002:a17:902:ce8b:b0:16a:4a3e:4fa1 with SMTP id f11-20020a170902ce8b00b0016a4a3e4fa1mr13232069plg.167.1656085254224; Fri, 24 Jun 2022 08:40:54 -0700 (PDT) From: Akihiko Odaki To: Cc: =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Thomas Huth , Wainer dos Santos Moschetta , Beraldo Leal , "Daniel P . Berrange" , John Snow , Cleber Rosa , qemu-devel@nongnu.org, Akihiko Odaki Subject: [PATCH] meson: Prefix each element of firmware path Date: Sat, 25 Jun 2022 00:40:42 +0900 Message-Id: <20220624154042.51512-1-akihiko.odaki@gmail.com> X-Mailer: git-send-email 2.32.1 (Apple Git-133) MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::62c; envelope-from=akihiko.odaki@gmail.com; helo=mail-pl1-x62c.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1656085358284100001 Content-Type: text/plain; charset="utf-8" Signed-off-by: Akihiko Odaki --- configure | 23 +++++++++++++++++++++++ meson.build | 10 ++++++++-- meson_options.txt | 2 +- scripts/meson-buildoptions.py | 7 +++++-- scripts/meson-buildoptions.sh | 6 +++--- softmmu/datadir.c | 8 +++++--- 6 files changed, 45 insertions(+), 11 deletions(-) diff --git a/configure b/configure index 4b12a8094ca..ab952e7ce3b 100755 --- a/configure +++ b/configure @@ -675,6 +675,29 @@ fi =20 werror=3D"" =20 +meson_option_build_array() { + local a + local ifs + + if test "$targetos" =3D=3D windows; then + ifs=3D\; + else + ifs=3D: + fi + + echo -n "[" + + while IFS=3D"$ifs" read -ra a; do + for e in "${a[@]}"; do + echo -n '"""' + echo -n "$e" | sed 's/\\/\\\\/g; s/"/\\"/g' + echo -n '"""', + done + done <<< "$1" + + echo "]" +} + . $source_path/scripts/meson-buildoptions.sh =20 meson_options=3D diff --git a/meson.build b/meson.build index 0c2e11ff071..40111ce4053 100644 --- a/meson.build +++ b/meson.build @@ -1684,7 +1684,13 @@ config_host_data.set_quoted('CONFIG_PREFIX', get_opt= ion('prefix')) config_host_data.set_quoted('CONFIG_QEMU_CONFDIR', get_option('prefix') / = qemu_confdir) config_host_data.set_quoted('CONFIG_QEMU_DATADIR', get_option('prefix') / = qemu_datadir) config_host_data.set_quoted('CONFIG_QEMU_DESKTOPDIR', get_option('prefix')= / qemu_desktopdir) -config_host_data.set_quoted('CONFIG_QEMU_FIRMWAREPATH', get_option('prefix= ') / get_option('qemu_firmwarepath')) + +qemu_firmwarepath =3D '' +foreach k : get_option('qemu_firmwarepath') + qemu_firmwarepath +=3D '"' + get_option('prefix') / k + '", ' +endforeach +config_host_data.set('CONFIG_QEMU_FIRMWAREPATH', qemu_firmwarepath) + config_host_data.set_quoted('CONFIG_QEMU_HELPERDIR', get_option('prefix') = / get_option('libexecdir')) config_host_data.set_quoted('CONFIG_QEMU_ICONDIR', get_option('prefix') / = qemu_icondir) config_host_data.set_quoted('CONFIG_QEMU_LOCALEDIR', get_option('prefix') = / get_option('localedir')) @@ -3622,7 +3628,7 @@ endif summary_info =3D {} summary_info +=3D {'Install prefix': get_option('prefix')} summary_info +=3D {'BIOS directory': qemu_datadir} -summary_info +=3D {'firmware path': get_option('prefix') / get_option(= 'qemu_firmwarepath')} +summary_info +=3D {'firmware path': qemu_firmwarepath} summary_info +=3D {'binary directory': get_option('prefix') / get_option(= 'bindir')} summary_info +=3D {'library directory': get_option('prefix') / get_option(= 'libdir')} summary_info +=3D {'module directory': qemu_moddir} diff --git a/meson_options.txt b/meson_options.txt index 0e8197386b9..8ad5cd73819 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -6,7 +6,7 @@ option('qemu_suffix', type : 'string', value: 'qemu', description: 'Suffix for QEMU data/modules/config directories (can = be empty)') option('docdir', type : 'string', value : 'share/doc', description: 'Base directory for documentation installation (can be= empty)') -option('qemu_firmwarepath', type : 'string', value : 'qemu-firmware', +option('qemu_firmwarepath', type : 'array', value : ['qemu-firmware'], description: 'search PATH for firmware files') option('pkgversion', type : 'string', value : '', description: 'use specified string as sub-version of the package') diff --git a/scripts/meson-buildoptions.py b/scripts/meson-buildoptions.py index e624c16b01a..3e2b4785388 100755 --- a/scripts/meson-buildoptions.py +++ b/scripts/meson-buildoptions.py @@ -156,7 +156,7 @@ def cli_metavar(opt): if opt["type"] =3D=3D "string": return "VALUE" if opt["type"] =3D=3D "array": - return "CHOICES" + return "CHOICES" if "choices" in opt else "VALUES" return "CHOICE" =20 =20 @@ -199,7 +199,10 @@ def print_parse(options): key =3D cli_option(opt) name =3D opt["name"] if require_arg(opt): - print(f' --{key}=3D*) quote_sh "-D{name}=3D$2" ;;') + if opt["type"] =3D=3D "array" and not "choices" in opt: + print(f' --{key}=3D*) quote_sh "-D{name}=3D$(meson_opti= on_build_array $2)" ;;') + else: + print(f' --{key}=3D*) quote_sh "-D{name}=3D$2" ;;') elif opt["type"] =3D=3D "boolean": print(f' --enable-{key}) printf "%s" -D{name}=3Dtrue ;;') print(f' --disable-{key}) printf "%s" -D{name}=3Dfalse ;;') diff --git a/scripts/meson-buildoptions.sh b/scripts/meson-buildoptions.sh index 1fc1d2e2c36..238bab162bd 100644 --- a/scripts/meson-buildoptions.sh +++ b/scripts/meson-buildoptions.sh @@ -42,12 +42,12 @@ meson_options_help() { printf "%s\n" ' --enable-trace-backends=3DCHOICES' printf "%s\n" ' Set available tracing backends= [log] (choices:' printf "%s\n" ' dtrace/ftrace/log/nop/simple/s= yslog/ust)' - printf "%s\n" ' --firmwarepath=3DVALUE search PATH for firmware fil= es [qemu-firmware]' + printf "%s\n" ' --firmwarepath=3DVALUES search PATH for firmware fil= es [qemu-firmware]' printf "%s\n" ' --iasl=3DVALUE Path to ACPI disassembler' printf "%s\n" ' --includedir=3DVALUE Header file directory [inclu= de]' printf "%s\n" ' --interp-prefix=3DVALUE where to find shared librari= es etc., use %M for' printf "%s\n" ' cpu name [/usr/gnemul/qemu-%M]' - printf "%s\n" ' --libdir=3DVALUE Library directory [lib64]' + printf "%s\n" ' --libdir=3DVALUE Library directory [lib]' printf "%s\n" ' --libexecdir=3DVALUE Library executable directory= [libexec]' printf "%s\n" ' --localedir=3DVALUE Locale data directory [share= /locale]' printf "%s\n" ' --localstatedir=3DVALUE Localstate data directory [/= var/local]' @@ -356,7 +356,7 @@ _meson_option_parse() { --disable-qcow1) printf "%s" -Dqcow1=3Ddisabled ;; --enable-qed) printf "%s" -Dqed=3Denabled ;; --disable-qed) printf "%s" -Dqed=3Ddisabled ;; - --firmwarepath=3D*) quote_sh "-Dqemu_firmwarepath=3D$2" ;; + --firmwarepath=3D*) quote_sh "-Dqemu_firmwarepath=3D$(meson_option_bui= ld_array $2)" ;; --enable-qga-vss) printf "%s" -Dqga_vss=3Denabled ;; --disable-qga-vss) printf "%s" -Dqga_vss=3Ddisabled ;; --enable-qom-cast-debug) printf "%s" -Dqom_cast_debug=3Dtrue ;; diff --git a/softmmu/datadir.c b/softmmu/datadir.c index 160cac999a6..fd24629c543 100644 --- a/softmmu/datadir.c +++ b/softmmu/datadir.c @@ -105,15 +105,17 @@ static char *find_datadir(void) =20 void qemu_add_default_firmwarepath(void) { - char **dirs; + static const char * const dirs[] =3D { + CONFIG_QEMU_FIRMWAREPATH + NULL + }; + size_t i; =20 /* add configured firmware directories */ - dirs =3D g_strsplit(CONFIG_QEMU_FIRMWAREPATH, G_SEARCHPATH_SEPARATOR_S= , 0); for (i =3D 0; dirs[i] !=3D NULL; i++) { qemu_add_data_dir(get_relocated_path(dirs[i])); } - g_strfreev(dirs); =20 /* try to find datadir relative to the executable path */ qemu_add_data_dir(find_datadir()); --=20 2.32.1 (Apple Git-133)