summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNikos Mavrogiannopoulos <nmav@gnutls.org>2020-01-01 08:31:28 +0000
committerNikos Mavrogiannopoulos <nmav@gnutls.org>2020-01-01 08:31:28 +0000
commitfeb8e5e0254568d52f807c41e0c935907454629a (patch)
tree3e8a6bb89aaeb68ce1eb6620a81f872844bae2e1
parent05e1cdf3f4d4cef6b2194ecab93ab2f4628be5cb (diff)
parentfba9533e260d98e1152bd263ec893458d5f81fd2 (diff)
downloadgnutls-feb8e5e0254568d52f807c41e0c935907454629a.tar.gz
Merge branch 'wip-arch-independent-scm' into 'master'
guile: Arrange to make 'gnutls.scm' architecture-independent. Closes #838 See merge request gnutls/gnutls!1121
-rw-r--r--configure.ac10
-rw-r--r--guile/Makefile.am2
-rw-r--r--guile/modules/gnutls.in9
3 files changed, 18 insertions, 3 deletions
diff --git a/configure.ac b/configure.ac
index 7f27ae6932..2ac620688d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -919,6 +919,7 @@ AC_ARG_WITH([guile-extension-dir], AS_HELP_STRING([--with-guile-extension-dir=DI
AC_SUBST([guilesitedir])
AC_SUBST([guilesiteccachedir])
AC_SUBST([guileextensiondir])
+maybe_guileextensiondir="\"$guileextensiondir\""
if test "$opt_guile_bindings" = "yes"; then
AC_MSG_RESULT([***
@@ -990,6 +991,14 @@ if test "$opt_guile_bindings" = "yes"; then
AC_CHECK_FUNCS([scm_gc_malloc_pointerless])
CFLAGS="$save_CFLAGS"
LIBS="$save_LIBS"
+
+ # Do we need to hard-code $guileextensiondir in gnutls.scm?
+ # This is not necessary when $guileextensiondir is equal to
+ # Guile's 'extensiondir' as specified in 'guile-MAJOR.MINOR.pc'.
+ if test "$guileextensiondir" = "`$PKG_CONFIG guile-$GUILE_EFFECTIVE_VERSION --variable extensiondir`" \
+ || test "$guileextensiondir" = '$(GUILE_EXTENSION)'; then
+ maybe_guileextensiondir='#f'
+ fi
else
AC_MSG_RESULT([no])
AC_MSG_WARN([A sufficiently recent GNU Guile not found. Guile bindings not built.])
@@ -998,6 +1007,7 @@ if test "$opt_guile_bindings" = "yes"; then
fi
fi
+AC_SUBST([maybe_guileextensiondir])
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"])
diff --git a/guile/Makefile.am b/guile/Makefile.am
index a6185aae7b..4f82a9fa9d 100644
--- a/guile/Makefile.am
+++ b/guile/Makefile.am
@@ -44,7 +44,7 @@ CLEANFILES = modules/gnutls.scm
.in.scm:
$(AM_V_GEN)$(MKDIR_P) "`dirname "$@"`" ; cat "$^" | \
- $(SED) -e's|[@]guileextensiondir[@]|$(guileextensiondir)|g' \
+ $(SED) -e's|[@]maybe_guileextensiondir[@]|$(maybe_guileextensiondir)|g' \
> "$@.tmp"
$(AM_V_at)mv "$@.tmp" "$@"
diff --git a/guile/modules/gnutls.in b/guile/modules/gnutls.in
index 2c84d4c3e5..6461c404a2 100644
--- a/guile/modules/gnutls.in
+++ b/guile/modules/gnutls.in
@@ -519,10 +519,15 @@
(eval-when (expand load eval)
(define %libdir
(or (getenv "GNUTLS_GUILE_EXTENSION_DIR")
- "@guileextensiondir@"))
+
+ ;; The .scm file is supposed to be architecture-independent. Thus,
+ ;; save 'extensiondir' only if it's different from what Guile expects.
+ @maybe_guileextensiondir@))
(unless (getenv "GNUTLS_GUILE_CROSS_COMPILING")
- (load-extension (string-append %libdir "/guile-gnutls-v-2")
+ (load-extension (if %libdir
+ (string-append %libdir "/guile-gnutls-v-2")
+ "guile-gnutls-v-2")
"scm_init_gnutls")))
(cond-expand