unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
From: Maxim Cournoyer <maxim.cournoyer@gmail.com>
To: guile-devel@gnu.org
Cc: Maxim Cournoyer <maxim.cournoyer@gmail.com>
Subject: [PATCH devel 5/6] build: Add support for cross-compilation.
Date: Thu,  4 Mar 2021 21:35:23 -0500	[thread overview]
Message-ID: <20210305023524.15317-5-maxim.cournoyer@gmail.com> (raw)
In-Reply-To: <20210305023524.15317-1-maxim.cournoyer@gmail.com>

From: Christopher Baines <mail@cbaines.net>

This enables cross-compiling for systems different than the build
machine.

* configure.ac (GUILE_TARGET): New variable.
* am/guile.mk (.scm.go): Use it.

Signed-off-by: Maxim Cournoyer <maxim.cournoyer@gmail.com>
---
 am/guile.mk  | 2 +-
 configure.ac | 5 +++++
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/am/guile.mk b/am/guile.mk
index 6ab0750..11cd250 100644
--- a/am/guile.mk
+++ b/am/guile.mk
@@ -47,4 +47,4 @@ GUILE_WARNINGS = -Wunbound-variable -Warity-mismatch -Wformat
 SUFFIXES = .scm .go
 .scm.go:
 	$(AM_V_GEN)$(top_builddir)/pre-inst-env \
-	$(GUILD) compile $(GUILE_WARNINGS) -o "$@" "$<"
+	$(GUILD) compile $(GUILE_WARNINGS) $(GUILE_TARGET) -o "$@" "$<"
diff --git a/configure.ac b/configure.ac
index 07be121..da741ba 100644
--- a/configure.ac
+++ b/configure.ac
@@ -67,6 +67,11 @@ GUILE_GLOBAL_SITE_DIR
 GUILE_SITE_CCACHE_DIR
 GUILE_FLAGS
 
+dnl This argument is passed to guild; it ensures cross-compiling uses
+dnl the right target.
+if test -n "$host_alias"; then
+   AC_SUBST([GUILE_TARGET], [--target=$host_alias])
+fi
 
 AC_ARG_WITH(
   [guile-site],
-- 
2.30.1




  parent reply	other threads:[~2021-03-05  2:35 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-05  2:14 [PATCH devel 0/6] Parameterize the parent constraints in htmlprag & varia Maxim Cournoyer
2021-03-05  2:35 ` [PATCH devel 1/6] Revert "When using guile-3.0, compile src/md5.scm using -O0" Maxim Cournoyer
2021-03-05  2:35   ` [PATCH devel 2/6] Work around Guile 3.0.0 miscompilation at -O2 Maxim Cournoyer
2021-03-05  2:35   ` [PATCH devel 3/6] Add a HACK file Maxim Cournoyer
2021-03-05  2:35   ` [PATCH devel 4/6] htmlprag: Allow users to parameterize the parent constraints Maxim Cournoyer
2021-03-05  2:35   ` Maxim Cournoyer [this message]
2021-03-05  2:35   ` [PATCH devel 6/6] configure.ac: Standardize default installation directory Maxim Cournoyer

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://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210305023524.15317-5-maxim.cournoyer@gmail.com \
    --to=maxim.cournoyer@gmail.com \
    --cc=guile-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.
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).