From: Danny Milosavljevic <dannym@scratchpost.org>
To: guix-devel <guix-devel@gnu.org>
Subject: Cross-compiling parts and not cross-compiling other parts of a package
Date: Mon, 4 Sep 2017 15:57:31 +0200 [thread overview]
Message-ID: <20170904155731.117569c4@scratchpost.org> (raw)
Hi,
I've now needed custom modifications in order to enable cross-compilation of a part of a package in two packages, sunxi-tools and rustc.
Both have this part in a custom phase:
(define (cross? x)
(string-contains x "cross-"))
(setenv "CROSS_C_INCLUDE_PATH" (getenv "C_INCLUDE_PATH"))
(setenv "CROSS_CPLUS_INCLUDE_PATH" (getenv "CPLUS_INCLUDE_PATH"))
(setenv "CROSS_LIBRARY_PATH" (getenv "LIBRARY_PATH"))
(for-each
(lambda (env-name)
(let* ((env-value (getenv env-name))
(search-path (search-path-as-string->list env-value))
(new-search-path (filter (lambda (e) (not (cross? e)))
search-path))
(new-env-value (list->search-path-as-string
new-search-path ":")))
(setenv env-name new-env-value)))
'("C_INCLUDE_PATH" "CPLUS_INCLUDE_PATH" "LIBRARY_PATH"))
Would it be possible and advisable to have this as a default phase one day?
Regardless of whether default or not, it can then be used like this:
(native-inputs
...
("cross-gcc" ,(cross-gcc "i686-linux-gnu"
#:xbinutils (cross-binutils "i686-linux-gnu")
#:libc (cross-libc "i686-linux-gnu")))
("cross-libc" ,(cross-libc "i686-linux-gnu")))))
The cross-* compilers would use the CROSS_* environment variables and the native compiler would use the non-CROSS_* environment variables.
next reply other threads:[~2017-09-04 13:57 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-09-04 13:57 Danny Milosavljevic [this message]
2017-09-05 12:32 ` Cross-compiling parts and not cross-compiling other parts of a package Ludovic Courtès
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://guix.gnu.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170904155731.117569c4@scratchpost.org \
--to=dannym@scratchpost.org \
--cc=guix-devel@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/guix.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).