From patchwork Tue Mar 8 14:36:05 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxim Cournoyer X-Patchwork-Id: 37648 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 92C7527BBEB; Tue, 8 Mar 2022 14:37:11 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-3.7 required=5.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FROM,MAILING_LIST_MULTI, RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 5174027BBE9 for ; Tue, 8 Mar 2022 14:37:11 +0000 (GMT) Received: from localhost ([::1]:34186 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nRaxa-000608-DF for patchwork@mira.cbaines.net; Tue, 08 Mar 2022 09:37:10 -0500 Received: from eggs.gnu.org ([209.51.188.92]:59094) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nRaxT-0005zo-3m for guix-patches@gnu.org; Tue, 08 Mar 2022 09:37:03 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:33502) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nRaxS-0005Nu-Pl for guix-patches@gnu.org; Tue, 08 Mar 2022 09:37:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nRaxS-0001rj-NE for guix-patches@gnu.org; Tue, 08 Mar 2022 09:37:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#54235] [PATCH v3 2/4] utils: Add ar-for-target and ld-for-target procedures. Resent-From: Maxim Cournoyer Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 08 Mar 2022 14:37:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 54235 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 54235@debbugs.gnu.org Cc: maximedevos@telenet.be, Maxim Cournoyer Received: via spool by 54235-submit@debbugs.gnu.org id=B54235.16467501917093 (code B ref 54235); Tue, 08 Mar 2022 14:37:02 +0000 Received: (at 54235) by debbugs.gnu.org; 8 Mar 2022 14:36:31 +0000 Received: from localhost ([127.0.0.1]:55625 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nRaww-0001qK-QP for submit@debbugs.gnu.org; Tue, 08 Mar 2022 09:36:30 -0500 Received: from mail-qt1-f182.google.com ([209.85.160.182]:38521) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nRawv-0001px-Ik for 54235@debbugs.gnu.org; Tue, 08 Mar 2022 09:36:29 -0500 Received: by mail-qt1-f182.google.com with SMTP id bc10so16253556qtb.5 for <54235@debbugs.gnu.org>; Tue, 08 Mar 2022 06:36:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=X6Kz0Z4PZDyvFsAuoyyFT0UfuJFn0eLvClhkVbyPOIE=; b=Um6TkgTIBBTKdLXqYI1Y8NoZ/ofc/s3N/rgzJqIBWucHi1oPEPacy3gig++NCQkfnU Cb/egq+DWbjJJrnrjDO/24UZ7mqDqIojAWiwZmyINC/FKJ4eAA2SSBUz/C094QfsR85n nXO79S7UctmvaVarGduBNSp99g1k53WXQ1Ki8QXyGAFbdK83K+1dtQK/RNH3n/4/nqIw w64PMpJKxt6eaeviC9ASfBwB8/6h0iaSNmhfTLwpLR8dChpzwC0rCmylhUHrWL4KAlfS fC46wrp68cJIVT9aD5czhO4tJcRjh0EovEKU3upD3WS3HIgoQMR+xrbE4gkhdK362agS NzDQ== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=X6Kz0Z4PZDyvFsAuoyyFT0UfuJFn0eLvClhkVbyPOIE=; b=e5ltcLthnnv683SLDpUmLG2X5SDjcnOC/42/A1hKTpU4k8+4yiOwPYQ/vJVv78dK5U Yc53KzpG18gfwmqnBMUrBS45HGcAo6umzVi5/sIsMHGi3qOq5NtN07IjZqnVI9ovjD/J IXogD9E69JfgVhaKEK5CLJ/OvdSOjeTkKcdlAqvJuFsCJuUTdEWYlt8M7Dtkhf2kGW6U e42eNcakzl9m6R9GhifzG9JzmND7Pmn4c7EbIKgjs/VkwUuX5jS8QE+TqYuwf6MD1UJd zRg7COBLX2cmkwDuctJYfhnX+iN0JIzpA2T9PIC3E1qUqDyvAaMtWeNYsobMq8SCxGXI KgRw== X-Gm-Message-State: AOAM533orowUElK0rD9IT1HkrLjQcJaQFfzHcVKfI2uxL2Wsk9ucRIwT j53HflWpgWoqp5+re4J7nv4jI/CnWt4= X-Google-Smtp-Source: ABdhPJyJw8byGTMGSwb5sb3MakuSasd75GhOh2yiTTiM3gNtTnGZeBr/8wKSvQqAfWKNO13eMyILPQ== X-Received: by 2002:ac8:7c4b:0:b0:2d1:bff6:e9ef with SMTP id o11-20020ac87c4b000000b002d1bff6e9efmr13822321qtv.22.1646750183602; Tue, 08 Mar 2022 06:36:23 -0800 (PST) Received: from localhost.localdomain (dsl-205-151-56-54.b2b2c.ca. [205.151.56.54]) by smtp.gmail.com with ESMTPSA id e9-20020ac85989000000b002de2bfc8f94sm10338847qte.88.2022.03.08.06.36.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Mar 2022 06:36:23 -0800 (PST) From: Maxim Cournoyer Date: Tue, 8 Mar 2022 09:36:05 -0500 Message-Id: <20220308143607.7449-2-maxim.cournoyer@gmail.com> X-Mailer: git-send-email 2.34.0 In-Reply-To: <20220308143607.7449-1-maxim.cournoyer@gmail.com> References: <20220308143607.7449-1-maxim.cournoyer@gmail.com> MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches * guix/utils.scm (ar-for-target, ld-for-target): New procedures. --- guix/utils.scm | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/guix/utils.scm b/guix/utils.scm index a0ca9b9070..44c46cb4a9 100644 --- a/guix/utils.scm +++ b/guix/utils.scm @@ -99,8 +99,10 @@ (define-module (guix utils) target-powerpc? target-riscv64? target-64bit? + ar-for-target cc-for-target cxx-for-target + ld-for-target pkg-config-for-target version-compare @@ -715,6 +717,11 @@ (define* (target-64bit? #:optional (system (or (%current-target-system) (any (cut string-prefix? <> system) '("x86_64" "aarch64" "mips64" "powerpc64" "riscv64"))) +(define* (ar-for-target #:optional (target (%current-target-system))) + (if target + (string-append target "-ar") + "ar")) + (define* (cc-for-target #:optional (target (%current-target-system))) (if target (string-append target "-gcc") @@ -725,6 +732,11 @@ (define* (cxx-for-target #:optional (target (%current-target-system))) (string-append target "-g++") "g++")) +(define* (ld-for-target #:optional (target (%current-target-system))) + (if target + (string-append target "-ld") + "ld")) + (define* (pkg-config-for-target #:optional (target (%current-target-system))) (if target (string-append target "-pkg-config")