From nobody Mon May 20 19:42:20 2024 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 ARC-Seal: i=1; a=rsa-sha256; t=1645133888; cv=none; d=zohomail.com; s=zohoarc; b=mcooWtV6DdWPzt46fLYJvWeAHbSodluLCJQ3KIokFlXR0M9bdlWaI6pTYoEJp0pGNL1DYng5LfXD+hwe3iat9ncb6iQxCCNH8fI+prtAhcvH6pbW/QLg/6LO5LuAtv4rrAZ+d7XZ1V3owPzqvknZZ5GrjooUBF1cT+U3VoQB0c4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1645133888; h=Content-Type:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=NJ1TbyXRdWRoNbrHprkOeyKSjtDCgSO9ZG41674G78g=; b=Kur3SICpHYvfCP+1Cj3mwiSSUN0gZ+LjDeogPoCfhucV+J1EQMI6t5nmXBXtAQAkhWH/455KS9IwDyi0i+vzzPzQhRHJVDItWed822XS23HZVwJhAkmAFQEZ+/UfzzwwJmo8orhodJVKKTL9fq/vlRDpx7D8s5ONPn8JwZCkVTY= ARC-Authentication-Results: i=1; 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 header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1645133888644425.94092941009944; Thu, 17 Feb 2022 13:38:08 -0800 (PST) Received: from localhost ([::1]:39920 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nKoTX-0005jc-Hi for importer@patchew.org; Thu, 17 Feb 2022 16:38:07 -0500 Received: from eggs.gnu.org ([209.51.188.92]:47620) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nKlk9-0007NY-2Z; Thu, 17 Feb 2022 13:43:05 -0500 Received: from [2a00:1450:4864:20::633] (port=36772 helo=mail-ej1-x633.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nKlk7-0007N2-CR; Thu, 17 Feb 2022 13:43:04 -0500 Received: by mail-ej1-x633.google.com with SMTP id a23so9410444eju.3; Thu, 17 Feb 2022 10:43:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:from:date:message-id:subject:to:cc; bh=NJ1TbyXRdWRoNbrHprkOeyKSjtDCgSO9ZG41674G78g=; b=j8HKAgWVcQtG9kETJy7BFqbncYD/XtDQGpPMFmzWh5Uk0BACNfkM561kXN30lOwUP6 yMf+z3V9yy7OlnRVmupt0xicxDlSs2B4HXjzobJz7Yat72Gy+DJKm8ACrAFp19ak4KK0 roGfOw91Jpw3cltr7VjqglbOuJ6oKALZ2yyRl2bpS5KK4Q6eeAx9D+gNHPw4KxMOB2N7 cbqTvcfaf1F3nuY4p5cNtqj3qe+wHL87CccrbVsWR6rHaooSZ0X9Pm0edxo6YybBNkly Fv1NAcbL5oGsk5EGXmonGhJNvZPJOUBP6jMhWkEO2d6bj1Ck2hjJARBT1+BIZfku8xh+ qaRw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:from:date:message-id:subject:to:cc; bh=NJ1TbyXRdWRoNbrHprkOeyKSjtDCgSO9ZG41674G78g=; b=W6XjJs5RSfAA4/zotiZwVm/F19rTyfGzAlYdsNc5Bn8pyKl8HBR/266FkTXIBHA8wg NcaSSWijRG3haRlTY+fxhEBuGlCvtsmt9IsVyY2dTLkCL6yU/JkGsakBb+hQnrOGLSQf ezoQ9U3s8JYKHmuWKYIaC/DH3m3Ffih6Wnicnm8XXxqV57vGjpHVFOAsOGGZ1IJiF7vZ RWMDxzKXXi8lzI4HlpgFCkbwsBdFjQefgnz/83L4eygu6MjaPrs0tk7a2ZGQTCOf9pMH H6WTyVhzSZgvBr9b9g0brhjtyU0DKP7UbGADI1GWvNoe4RBW4kYB5KfRpZUAuwxfybev +fqg== X-Gm-Message-State: AOAM530HJPuBAUOyn293+RHSa8xtHSe9Mmiqohrc0/tSQmd9WA9C57Kw OZy3k7rHX0cijJK1XtKf/lVhJIgvoRQYSfjPfKh1y4GUfz8= X-Google-Smtp-Source: ABdhPJyjR3IDrSAjKe2brosrV4CKyW+kOLstmufwM8AgwidQenE5lcIclWk9NAiIj4XYhbq9Nr2iaVk6VzzSSbFEZ8A= X-Received: by 2002:a17:906:a10:b0:6ce:7107:598b with SMTP id w16-20020a1709060a1000b006ce7107598bmr3373847ejf.653.1645123378840; Thu, 17 Feb 2022 10:42:58 -0800 (PST) MIME-Version: 1.0 From: Joshua Seaton Date: Thu, 17 Feb 2022 10:42:47 -0800 Message-ID: Subject: [PATCH] configure: Support empty prefixes To: qemu-devel@nongnu.org X-Host-Lookup-Failed: Reverse DNS lookup failed for 2a00:1450:4864:20::633 (failed) 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=2a00:1450:4864:20::633; envelope-from=josh.a.seaton@gmail.com; helo=mail-ej1-x633.google.com X-Spam_score_int: -6 X-Spam_score: -0.7 X-Spam_bar: / X-Spam_report: (-0.7 / 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, PDS_HP_HELO_NORDNS=0.659, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Thu, 17 Feb 2022 16:33:57 -0500 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: , Cc: qemu-trivial@nongnu.org, geist@foobox.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1645133890659100001 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" At least as of v5 (before the meson build), empty `--prefix` values were supported; this seems to have fallen out along the way. This change reintroduces support. Tested locally with empty and non-empty values of `--prefix`. Signed-off-by: Joshua Seaton --- configure | 33 ++++++++++++++++++++++++--------- 1 file changed, 24 insertions(+), 9 deletions(-) diff --git a/configure b/configure index 3a29eff5cc..87a32e52e4 100755 --- a/configure +++ b/configure @@ -1229,20 +1229,30 @@ case $git_submodules_action in ;; esac -libdir=3D"${libdir:-$prefix/lib}" -libexecdir=3D"${libexecdir:-$prefix/libexec}" -includedir=3D"${includedir:-$prefix/include}" +# Emits a relative path in the case of an empty prefix. +prefix_subdir() { + dir=3D"$1" + if test -z "$prefix" ; then + echo "$dir" + else + echo "$prefix/$dir" + fi +} + +libdir=3D"${libdir:-$(prefix_subdir lib)}" +libexecdir=3D"${libexecdir:-$(prefix_subdir libexec)}" +includedir=3D"${includedir:-$(prefix_subdir include)}" if test "$mingw32" =3D "yes" ; then bindir=3D"${bindir:-$prefix}" else - bindir=3D"${bindir:-$prefix/bin}" + bindir=3D"${bindir:-$(prefix_subdir bin)}" fi -mandir=3D"${mandir:-$prefix/share/man}" -datadir=3D"${datadir:-$prefix/share}" -docdir=3D"${docdir:-$prefix/share/doc}" -sysconfdir=3D"${sysconfdir:-$prefix/etc}" -local_statedir=3D"${local_statedir:-$prefix/var}" +mandir=3D"${mandir:-$(prefix_subdir share/man)}" +datadir=3D"${datadir:-$(prefix_subdir share)}" +docdir=3D"${docdir:-$(prefix_subdir share/doc)}" +sysconfdir=3D"${sysconfdir:-$(prefix_subdir etc)}" +local_statedir=3D"${local_statedir:-$(prefix_subdir var)}" firmwarepath=3D"${firmwarepath:-$datadir/qemu-firmware}" localedir=3D"${localedir:-$datadir/locale}" @@ -3763,6 +3773,11 @@ if test "$skip_meson" =3D no; then mv $cross config-meson.cross rm -rf meson-private meson-info meson-logs + + # Workaround for a meson bug preventing empty prefixes: + # see https://github.com/mesonbuild/meson/issues/6946. + prefix=3D"${prefix:-/}" + run_meson() { NINJA=3D$ninja $meson setup \ --prefix "$prefix" \ -- 2.35.1.265.g69c8d7142f-goog