summaryrefslogtreecommitdiff
path: root/guile
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2019-11-11 21:30:48 +0100
committerLudovic Courtès <ludo@gnu.org>2019-11-11 21:30:48 +0100
commit676ae412aeea58fa2c6aa7960ec16223101556eb (patch)
tree779188b38288281a80ebef78674bd8d89aa86426 /guile
parent3d4928e4268bea40a37e796795e42353d4415a6d (diff)
downloadgnutls-676ae412aeea58fa2c6aa7960ec16223101556eb.tar.gz
guile: Do not attempt to load shared object when cross-compiling.
Reported by Helmut Grohne <helmut@subdivi.de> and Andreas Metzler <ametzler@bebt.de> at <https://bugs.debian.org/943905>. * configure.ac: Add 'CROSS_COMPILING' conditional. * guile/Makefile.am (CROSS_COMPILING_VARIABLE): New variable. (%.go): Use it. * guile/modules/gnutls.in <top level>: Do not call 'load-extension' when "GNUTLS_GUILE_CROSS_COMPILING" is defined. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
Diffstat (limited to 'guile')
-rw-r--r--guile/Makefile.am7
-rw-r--r--guile/modules/gnutls.in5
2 files changed, 10 insertions, 2 deletions
diff --git a/guile/Makefile.am b/guile/Makefile.am
index 0b19bad90f..13539eefbd 100644
--- a/guile/Makefile.am
+++ b/guile/Makefile.am
@@ -69,6 +69,12 @@ AM_V_GUILEC = $(AM_V_GUILEC_$(V))
AM_V_GUILEC_ = $(AM_V_GUILEC_$(AM_DEFAULT_VERBOSITY))
AM_V_GUILEC_0 = @echo " GUILEC " $@;
+if CROSS_COMPILING
+CROSS_COMPILING_VARIABLE = GNUTLS_GUILE_CROSS_COMPILING=yes
+else
+CROSS_COMPILING_VARIABLE =
+endif
+
# Make sure 'gnutls.scm' is built first.
# Unset 'GUILE_LOAD_COMPILED_PATH' so we can be sure that any .go file that we
# load comes from the build directory.
@@ -78,6 +84,7 @@ AM_V_GUILEC_0 = @echo " GUILEC " $@;
$(AM_V_GUILEC)$(MKDIR_P) "`dirname "$@"`" ; \
$(AM_V_P) && out=1 || out=- ; \
unset GUILE_LOAD_COMPILED_PATH ; LC_ALL=C \
+ $(CROSS_COMPILING_VARIABLE) \
GNUTLS_GUILE_EXTENSION_DIR="$(abs_top_builddir)/guile/src" \
$(GUILD) compile --target="$(host)" \
-L "$(top_builddir)/guile/modules" \
diff --git a/guile/modules/gnutls.in b/guile/modules/gnutls.in
index 7cd08f18f1..2c84d4c3e5 100644
--- a/guile/modules/gnutls.in
+++ b/guile/modules/gnutls.in
@@ -521,8 +521,9 @@
(or (getenv "GNUTLS_GUILE_EXTENSION_DIR")
"@guileextensiondir@"))
- (load-extension (string-append %libdir "/guile-gnutls-v-2")
- "scm_init_gnutls"))
+ (unless (getenv "GNUTLS_GUILE_CROSS_COMPILING")
+ (load-extension (string-append %libdir "/guile-gnutls-v-2")
+ "scm_init_gnutls")))
(cond-expand
((not guile-2)