From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id wAxiJo/xz17nfwAA0tVLHw (envelope-from ) for ; Thu, 28 May 2020 17:14:55 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id EJtuIo/xz15xYQAA1q6Kng (envelope-from ) for ; Thu, 28 May 2020 17:14:55 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id D9F03940983 for ; Thu, 28 May 2020 17:14:54 +0000 (UTC) Received: from localhost ([::1]:43810 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jeM7I-0000hy-Cj for larch@yhetil.org; Thu, 28 May 2020 13:14:52 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48410) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jeM6U-00089f-Sw for guix-patches@gnu.org; Thu, 28 May 2020 13:14:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:41406) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jeM6U-00033d-KA for guix-patches@gnu.org; Thu, 28 May 2020 13:14:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jeM6U-0006a6-G8 for guix-patches@gnu.org; Thu, 28 May 2020 13:14:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#41579] [PATCH 1/2] utils: Add 'cc-for-target'. References: <20200528171137.29146-1-marius@gnu.org> In-Reply-To: <20200528171137.29146-1-marius@gnu.org> Resent-From: Marius Bakke Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 28 May 2020 17:14:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 41579 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 41579@debbugs.gnu.org Received: via spool by 41579-submit@debbugs.gnu.org id=B41579.159068599925230 (code B ref 41579); Thu, 28 May 2020 17:14:02 +0000 Received: (at 41579) by debbugs.gnu.org; 28 May 2020 17:13:19 +0000 Received: from localhost ([127.0.0.1]:52949 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jeM5m-0006Ys-Rz for submit@debbugs.gnu.org; Thu, 28 May 2020 13:13:19 -0400 Received: from eggs.gnu.org ([209.51.188.92]:40938) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jeM5l-0006Yc-QS for 41579@debbugs.gnu.org; Thu, 28 May 2020 13:13:18 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:37316) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jeM5g-0002m0-KI for 41579@debbugs.gnu.org; Thu, 28 May 2020 13:13:12 -0400 Received: from ti0006q161-2604.bb.online.no ([84.202.68.75]:42596 helo=localhost) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1jeM5f-0002Gr-Hp for 41579@debbugs.gnu.org; Thu, 28 May 2020 13:13:12 -0400 From: Marius Bakke Date: Thu, 28 May 2020 19:13:08 +0200 Message-Id: <20200528171309.29346-1-marius@gnu.org> X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-Spam-Score: -3.3 (---) X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: "Guix-patches" X-Scanner: scn0 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Spam-Score: -0.01 X-TUID: +FGadF3d3n2b * guix/utils.scm (cc-for-target): New procedure. --- guix/utils.scm | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/guix/utils.scm b/guix/utils.scm index d7b197fa44..69e3f0a934 100644 --- a/guix/utils.scm +++ b/guix/utils.scm @@ -6,7 +6,7 @@ ;;; Copyright © 2016 Mathieu Lirzin ;;; Copyright © 2015 David Thompson ;;; Copyright © 2017 Mathieu Othacehe -;;; Copyright © 2018 Marius Bakke +;;; Copyright © 2018, 2020 Marius Bakke ;;; ;;; This file is part of GNU Guix. ;;; @@ -78,6 +78,8 @@ target-aarch64? target-arm? target-64bit? + cc-for-target + version-compare version>? version>=? @@ -506,6 +508,11 @@ a character other than '@'." (%current-system)))) (any (cut string-prefix? <> system) '("x86_64" "aarch64" "mips64" "ppc64"))) +(define* (cc-for-target #:optional (target (%current-target-system))) + (if target + (string-append target "-gcc") + "gcc")) + (define version-compare (let ((strverscmp (let ((sym (or (dynamic-func "strverscmp" (dynamic-link)) -- 2.26.2