diff options
author | Ludovic Courtès <ludo@gnu.org> | 2019-11-11 21:30:48 +0100 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2019-11-11 21:30:48 +0100 |
commit | 676ae412aeea58fa2c6aa7960ec16223101556eb (patch) | |
tree | 779188b38288281a80ebef78674bd8d89aa86426 | |
parent | 3d4928e4268bea40a37e796795e42353d4415a6d (diff) | |
download | gnutls-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>
-rw-r--r-- | configure.ac | 1 | ||||
-rw-r--r-- | guile/Makefile.am | 7 | ||||
-rw-r--r-- | guile/modules/gnutls.in | 5 |
3 files changed, 11 insertions, 2 deletions
diff --git a/configure.ac b/configure.ac index 73c560406e..30dd517437 100644 --- a/configure.ac +++ b/configure.ac @@ -1000,6 +1000,7 @@ fi AM_CONDITIONAL([HAVE_GUILE], [test "$opt_guile_bindings" = "yes"]) AM_CONDITIONAL([HAVE_GUILD], [test "x$GUILD" != "x"]) +AM_CONDITIONAL([CROSS_COMPILING], [test "x$cross_compiling" = "xyes"]) LIBGNUTLS_LIBS="-L${libdir} -lgnutls $LIBS" LIBGNUTLS_CFLAGS="-I${includedir}" 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) |