From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Christopher Baines Newsgroups: gmane.lisp.guile.devel Subject: [PATCH] Support cross compilation Date: Sun, 14 Feb 2021 09:16:46 +0000 Message-ID: <20210214091646.9776-1-mail@cbaines.net> Mime-Version: 1.0 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="16844"; mail-complaints-to="usenet@ciao.gmane.io" To: guile-devel@gnu.org Original-X-From: guile-devel-bounces+guile-devel=m.gmane-mx.org@gnu.org Sun Feb 14 10:17:04 2021 Return-path: Envelope-to: guile-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lBDWZ-0004BX-Gx for guile-devel@m.gmane-mx.org; Sun, 14 Feb 2021 10:17:03 +0100 Original-Received: from localhost ([::1]:49324 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lBDWY-0002p3-Im for guile-devel@m.gmane-mx.org; Sun, 14 Feb 2021 04:17:02 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:43986) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lBDWN-0002nO-8u for guile-devel@gnu.org; Sun, 14 Feb 2021 04:16:51 -0500 Original-Received: from mira.cbaines.net ([2a01:7e00:e000:2f8:fd4d:b5c7:13fb:3d27]:40575) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lBDWL-0005Wp-0J for guile-devel@gnu.org; Sun, 14 Feb 2021 04:16:51 -0500 Original-Received: from localhost (unknown [IPv6:2a02:8010:68c1:0:8ac0:b4c7:f5c8:7caa]) by mira.cbaines.net (Postfix) with ESMTPSA id A732027BC2E for ; Sun, 14 Feb 2021 09:16:46 +0000 (GMT) Original-Received: from localhost (localhost [local]) by localhost (OpenSMTPD) with ESMTPA id 83adf59c for ; Sun, 14 Feb 2021 09:16:46 +0000 (UTC) X-Mailer: git-send-email 2.30.0 Received-SPF: pass client-ip=2a01:7e00:e000:2f8:fd4d:b5c7:13fb:3d27; envelope-from=mail@cbaines.net; helo=mira.cbaines.net X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, UNPARSEABLE_RELAY=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-devel-bounces+guile-devel=m.gmane-mx.org@gnu.org Original-Sender: "guile-devel" Xref: news.gmane.io gmane.lisp.guile.devel:20665 Archived-At: With these changes, I was able to cross-compile guile-lib to the GNU Hurd, and use part of the library at least. * configure.ac: Set GUILE_TARGET when cross compiling. * am/guile.mk: Pass GUILE_TARGET to guild compile. --- am/guile.mk | 2 +- configure.ac | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/am/guile.mk b/am/guile.mk index 3adfc4f..f08e58d 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_TARGET) $(GUILE_WARNINGS) -o "$@" "$<" diff --git a/configure.ac b/configure.ac index 07be121..0aa812f 100644 --- a/configure.ac +++ b/configure.ac @@ -67,6 +67,10 @@ GUILE_GLOBAL_SITE_DIR GUILE_SITE_CCACHE_DIR GUILE_FLAGS +if test \"$cross_compiling\" != no; then + GUILE_TARGET=\"--target=$host_alias\" + AC_SUBST([GUILE_TARGET]) +fi AC_ARG_WITH( [guile-site], -- 2.30.0