Hi,

Attached is a patch to include the gnulib's alloca-opt module to support
cross-building to MinGW.  As guile-websocket-0.2 added a dependency on
guile-gnutls, it's nice to have guile-gnutls.

For gnutls I'm using a gnutls-minimal, attached as tls.scm.

Greetings,
Janneke

>From 5541ba021e31e418a7b345996ada481505074f1c Mon Sep 17 00:00:00 2001
From: Janneke Nieuwenhuizen <jann...@gnu.org>
Date: Fri, 16 May 2025 10:47:18 +0200
Subject: [PATCH] maint: Fix MinGW cross-build by using alloca from gnulib.

---
 .gitignore            | 9 +++++++++
 Makefile.am           | 6 +++---
 bootstrap             | 3 +--
 configure.ac          | 5 ++++-
 guile/src/Makefile.am | 3 ++-
 5 files changed, 19 insertions(+), 7 deletions(-)

diff --git a/.gitignore b/.gitignore
index 7a068b4..716b07b 100644
--- a/.gitignore
+++ b/.gitignore
@@ -51,9 +51,18 @@
 /guile/tests/*.trs
 /lib
 /libtool
+/m4/00gnulib.m4
+/m4/alloca.m4
+/m4/gnulib-cache.m4
+/m4/gnulib-common.m4
+/m4/gnulib-comp.m4
+/m4/gnulib-tool.m4
+/m4/init-package-version.m4
 /m4/libtool.m4
 /m4/ltoptions.m4
 /m4/ltsugar.m4
 /m4/ltversion.m4
 /m4/lt~obsolete.m4
+/m4/zzgnulib.m4
+/gl
 /stamp-h1
diff --git a/Makefile.am b/Makefile.am
index 43c5de7..6a39f24 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,5 +1,5 @@
 ## Process this file with automake to produce Makefile.in
-# Copyright (C) 2007-2023 Free Software Foundation, Inc.
+# Copyright (C) 2007-2025 Free Software Foundation, Inc.
 #
 # Author: Ludovic Courtès
 #
@@ -23,9 +23,9 @@ AM_DISTCHECK_CONFIGURE_FLAGS = \
 	--with-guile-site-ccache-dir='$$(libdir)/guile/$$(GUILE_EFFECTIVE_VERSION)/site-ccache' \
 	--with-guile-extension-dir='$$(libdir)/guile/$$(GUILE_EFFECTIVE_VERSION)/extensions'
 
-SUBDIRS = guile doc
+SUBDIRS = gl guile doc
 
-EXTRA_DIST = cfg.mk CONTRIBUTING.md
+EXTRA_DIST = cfg.mk CONTRIBUTING.md m4/gnulib-cache.m4
 
 # git-version-gen
 EXTRA_DIST += $(top_srcdir)/.version
diff --git a/bootstrap b/bootstrap
index 99d5d29..0adf250 100755
--- a/bootstrap
+++ b/bootstrap
@@ -1,8 +1,7 @@
 #! /bin/sh
 
 if test -x gnulib/gnulib-tool; then
-    gnulib/gnulib-tool --no-changelog --aux-dir=build-aux --doc-base=doc --lib=libgl --m4-base=m4/ --source-base=gl/ --tests-base=tests --local-dir=gl --no-vc-files --libtool --import git-version-gen havelib gitlog-to-changelog readme-release update-copyright version-stamp
-    rm -fv gl/* m4/00gnulib.m4 m4/gnulib-common.m4 m4/zzgnulib.m4 m4/gnulib-cache.m4  m4/gnulib-comp.m4  m4/gnulib-tool.m4 m4/init-package-version.m4
+    gnulib/gnulib-tool --no-changelog --aux-dir=build-aux --doc-base=doc --lib=libgl --m4-base=m4/ --source-base=gl/ --tests-base=tests --local-dir=gl --no-vc-files --libtool --import git-version-gen havelib gitlog-to-changelog readme-release update-copyright version-stamp alloca-opt
 fi
 
 autoreconf -vif
diff --git a/configure.ac b/configure.ac
index 16e793c..8f7d3db 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,5 +1,5 @@
 dnl Process this file with autoconf to produce a configure script.
-# Copyright (C) 2000-2023 Free Software Foundation, Inc.
+# Copyright (C) 2000-2025 Free Software Foundation, Inc.
 #
 # Author: Ludovic Courtès, Simon Josefsson, Nikos Mavrogiannopoulos
 #
@@ -35,6 +35,8 @@ AC_CONFIG_HEADERS([config.h])
 
 dnl Checks for programs.
 AC_PROG_CC
+gl_EARLY
+gl_INIT
 AC_PROG_CPP
 AM_PROG_AR
 LT_INIT([disable-static])
@@ -522,6 +524,7 @@ AC_CONFIG_FILES([
   Makefile
   doc/Makefile
   doc/abs-top-srcdir.texi
+  gl/Makefile
   guile/Makefile
   guile/src/Makefile
 ])
diff --git a/guile/src/Makefile.am b/guile/src/Makefile.am
index e54d896..65e04b0 100644
--- a/guile/src/Makefile.am
+++ b/guile/src/Makefile.am
@@ -1,5 +1,5 @@
 # Guile-GnuTLS --- Guile bindings for GnuTLS.
-# Copyright (C) 2007-2023 Free Software Foundation, Inc.
+# Copyright (C) 2007-2025 Free Software Foundation, Inc.
 #
 # This file is part of Guile-GnuTLS.
 #
@@ -50,6 +50,7 @@ guile_gnutls_v_2_la_LIBADD = \
 	$(GUILE_LDFLAGS)
 
 AM_CPPFLAGS = \
+	-I$(top_srcdir)/gl \
 	-I$(top_srcdir)/lib/includes \
 	-I$(top_builddir)/lib/includes	\
 	-I$(top_srcdir)/extra/includes \
-- 
2.49.0

Attachment: tls.scm
Description: Binary data

-- 
Janneke Nieuwenhuizen <jann...@gnu.org>  | GNU LilyPond https://LilyPond.org
Freelance IT https://www.JoyOfSource.com | Avatar® https://AvatarAcademy.com

Reply via email to