From mboxrd@z Thu Jan 1 00:00:00 1970 From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) Subject: Re: 'guix build --target=' handling questions Date: Mon, 06 Mar 2017 17:04:18 +0100 Message-ID: <87y3wiqtml.fsf@gnu.org> References: <20170221214035.6cd9f180@sf> <20170222225422.2d1020ba@sf> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:47280) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ckv7Z-0002bN-JQ for guix-devel@gnu.org; Mon, 06 Mar 2017 11:04:27 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ckv7U-0003Up-SC for guix-devel@gnu.org; Mon, 06 Mar 2017 11:04:25 -0500 In-Reply-To: <20170222225422.2d1020ba@sf> (Sergei Trofimovich's message of "Wed, 22 Feb 2017 22:54:22 +0000") List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: "Guix-devel" To: Sergei Trofimovich Cc: guix-devel@gnu.org Sergei Trofimovich skribis: >> Question time: >>=20 >> - Is there a way to run 'guix environment --target=3D' in the same way a= s 'guix build --target=3D' >> sets it up? I'd like to see how both compilers are supposed to be pres= ent in there. >> >> - Why default g++ in PATH is the host g++ and not target g++? >> Target seems to make most sense if no explicit compiler is specified. >>=20 >> - How to actually set CXX to point to target g++? >> It looks like implicitly there already both host (through native-input= s) >> and target (through build-inputs) compilers available. >> I would expect something like >> #:make-flags (list (string-append "CXX=3D" <.?.>))=20 >> What should be in place of that "<.?.>" to refer to target g++? > > I think I've found a workaround at least for my third question. > > Both host and target compilers are available as g++ and ${target}-g++. > > Thus the following workaround seems to work: > > diff --git a/gnu/packages/regex.scm b/gnu/packages/regex.scm > index f04cba706..a8fa689ab 100644 > --- a/gnu/packages/regex.scm > +++ b/gnu/packages/regex.scm > @@ -20,11 +20,13 @@ > > (define-module (gnu packages regex) > #:use-module ((guix licenses) #:prefix license:) > #:use-module (guix packages) > #:use-module (guix download) > - #:use-module (guix build-system gnu)) > + #:use-module (guix build-system gnu) > + #:use-module (guix utils) ; for %current-target-system > + ) > > (define-public re2 > (package > (name "re2") > (version "2017-01-01") > @@ -40,11 +42,15 @@ > "0yij1ajh66h3pj3kfz7y0ldrsww8rlpjzaavyr5lchl98as1jq74")= ))) > (build-system gnu-build-system) > (arguments > `(#:test-target "test" > ;; There is no configure step, but the Makefile respects a prefi= x. > - #:make-flags (list (string-append "prefix=3D" %output)) > + #:make-flags (list (string-append "prefix=3D" %output) > + (string-append "CXX=3D" ,(string-append (if (= %current-target-system) > + (st= ring-append (%current-target-system) "-") > + "") > + "g++"))) As John wrote, this is the right fix for this package. If you can send it with =E2=80=98git send-email=E2=80=99 (see ), I=E2=80=99ll apply it right away. Otherwise I can do it on your behalf. Thanks! Ludo=E2=80=99.