diff options
author | Tim Rühsen <tim.ruehsen@gmx.de> | 2019-11-15 11:27:55 +0000 |
---|---|---|
committer | Tim Rühsen <tim.ruehsen@gmx.de> | 2019-11-15 11:27:55 +0000 |
commit | 6ace855ba7c55181644b5911f4e9ba62b8cee047 (patch) | |
tree | 8a2997c73407df9a364593e4cfba46325c65b273 | |
parent | 5330fe5a6436e5e83f7cc628720d82338ce259c6 (diff) | |
parent | 3b6c6420ac5d1e58334bc3055af4a85222c481b8 (diff) | |
download | gnutls-6ace855ba7c55181644b5911f4e9ba62b8cee047.tar.gz |
Merge branch 'wip-cross-compilation' into 'master'
Fix cross-compilation of the Guile bindings
See merge request gnutls/gnutls!1120
-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..a6185aae7b 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 \ + GUILE_AUTO_COMPILE=0 $(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) |