Skip to content

Commit 1dab17a

Browse files
committed
Use system BDWGC 8.3.0 or later if possible
If BDWGC 8.3.0 or later exists, we use it directly.
1 parent ef02502 commit 1dab17a

File tree

12 files changed

+214
-187
lines changed

12 files changed

+214
-187
lines changed

.github/workflows/linux.yml

Lines changed: 36 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,15 @@ concurrency:
1111
group: ${{ github.head_ref || github.sha }}-${{ github.workflow }}
1212
cancel-in-progress: true
1313
jobs:
14-
setup:
15-
name: Setup
14+
libgcroots:
15+
name: libgcroots
16+
strategy:
17+
fail-fast: false
18+
matrix:
19+
libgcroots:
20+
- no
21+
- installed
22+
- tiny-subst
1623
runs-on: ubuntu-latest
1724
timeout-minutes: 10
1825
steps:
@@ -25,9 +32,35 @@ jobs:
2532
- name: Generate configure
2633
run: |
2734
./autogen.sh
35+
- name: "BDWGC: Checkout"
36+
if: matrix.libgcroots == 'installed'
37+
uses: actions/checkout@v6
38+
with:
39+
path: bdwgc
40+
repository: bdwgc/bdwgc
41+
- name: "BDWGC: Configure"
42+
if: matrix.libgcroots == 'installed'
43+
run: |
44+
cmake \
45+
-S bdwgc \
46+
-B bdwgc.build \
47+
-G Ninja \
48+
-DCMAKE_INSTALL_PREFIX=/usr
49+
- name: "BDWGC: Build"
50+
if: matrix.libgcroots == 'installed'
51+
run: |
52+
cmake --build bdwgc.build
53+
- name: "BDWGC: Install"
54+
if: matrix.libgcroots == 'installed'
55+
run: |
56+
sudo cmake --install bdwgc.build
2857
- name: Configure
2958
run: |
30-
./configure --enable-maintainer-mode
59+
./configure \
60+
--enable-conf=uim \
61+
--enable-maintainer-mode \
62+
--prefix=/usr \
63+
--with-libgcroots=${{ matrix.libgcroots }}
3164
- name: Build
3265
run: |
3366
make -j$(nproc)

.gitmodules

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
11
[submodule "libgcroots"]
22
path = libgcroots
33
url = https://github.com/uim/libgcroots.git
4-
[submodule "bdwgc"]
5-
path = bdwgc
6-
url = https://github.com/bdwgc/bdwgc.git

Makefile.am

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
ACLOCAL_AMFLAGS = -I m4
22

33
SUBDIRS = doc m4 tools
4-
if USE_BDWGC_BUNDLED
5-
SUBDIRS += bdwgc
6-
endif
74
if USE_LIBGCROOTS_BUNDLED
85
SUBDIRS += libgcroots
96
endif

autogen.sh

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,5 @@
33
set -eu
44

55
${AUTORECONF:-autoreconf} --force --install "$@"
6-
cd bdwgc
7-
./autogen.sh
8-
cd ../libgcroots
6+
cd libgcroots
97
./autogen.sh "$@"

bdwgc

Lines changed: 0 additions & 1 deletion
This file was deleted.

ci/release.sh

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,6 @@ set -x
77
rm -rf ~/source
88
cp -a /source ~/source
99
pushd ~/source
10-
pushd bdwgc
11-
./autogen.sh
12-
popd
1310
pushd libgcroots
1411
./autogen.sh
1512
popd

configure.ac

Lines changed: 19 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -267,10 +267,10 @@ AM_CONDITIONAL(WITH_MASTER_PKG, [test "x$with_master_pkg" != xno])
267267

268268
AC_ARG_WITH(libgcroots,
269269
AS_HELP_STRING([--with-libgcroots@<:@=WHICH@:>@],
270-
[use alternative libgcroots instead of
271-
package-bundled one.
272-
WHICH=(installed|tiny-subst)
273-
@<:@default=installed@:>@]))
270+
[use system BDWGC or alternative libgcroots
271+
instead of package-bundled libgcroots.
272+
WHICH=(no|installed|tiny-subst)
273+
@<:@default=no@:>@]))
274274

275275
case "${with_libgcroots:=no}" in
276276
no)
@@ -287,46 +287,38 @@ case "${with_libgcroots:=no}" in
287287
GCROOTS_REQ=gcroots
288288
;;
289289
yes|installed)
290-
PKG_CHECK_MODULES(GCROOTS, [gcroots >= 0.2.3],
291-
[],
292-
[AC_MSG_ERROR([installed libgcroots is not found.])])
293-
use_libgcroots="installed one"
294-
GCROOTS_REQ=gcroots
290+
PKG_CHECK_MODULES(
291+
BDWGC, [bdw-gc >= 8.3.0],
292+
[BDWGC_REQ=bdw-gc
293+
AC_DEFINE(SCM_WITH_BDWGC, 1, [Define to 1 to use BDWGC.])
294+
use_libgcroots="installed BDWGC"],
295+
[PKG_CHECK_MODULES(
296+
GCROOTS, [gcroots >= 0.2.3],
297+
[GCROOTS_REQ=gcroots
298+
use_libgcroots="installed one"],
299+
[AC_MSG_ERROR([neither BDWGC nor libgcroots was found.])])])
295300
;;
296301
tiny-subst)
297302
# use src/gcroots/gcroots.[hc]
298303
with_libgcroots=tiny_subst
299304
GCROOTS_CFLAGS='-I$(sscm_abs_top_srcdir)/src/gcroots'
300305
use_libgcroots="tiny substitution in src/gcroots"
301306
;;
302-
bundled-bdwgc)
303-
# use src/gcroots/gcroots.[hc] but redirecting to bundled bdwgc
304-
with_libgcroots=tiny_subst_bdwgc
305-
GCROOTS_CFLAGS='-I$(sscm_abs_top_srcdir)/src/gcroots -I$(sscm_abs_top_srcdir)/bdwgc/include'
306-
AC_DEFINE(SCM_WITH_BDWGC, 1, [Define to 1 to use bdwgc library.])
307-
use_libgcroots="based on bundled bdwgc"
308-
309-
ac_configure_args="$ac_configure_args --disable-threads"
310-
AC_CONFIG_SUBDIRS([bdwgc])
311-
GCROOTS_LIBS='$(sscm_abs_top_builddir)/bdwgc/libgc.la'
312-
;;
313307
*)
314308
AC_MSG_ERROR([invalid argument for --with-libgcroots.])
315309
;;
316310
esac
317311

312+
AC_SUBST(BDWGC_REQ)
313+
AC_SUBST(BDWGC_LIBS)
314+
AC_SUBST(BDWGC_CFLAGS)
318315
AC_SUBST(GCROOTS_REQ)
319316
AC_SUBST(GCROOTS_LIBS)
320317
AC_SUBST(GCROOTS_CFLAGS)
321-
AM_CONDITIONAL(USE_BDWGC_BUNDLED,
322-
[test "x$with_libgcroots" = xtiny_subst_bdwgc])
323-
AM_CONDITIONAL(USE_LIBGCROOTS,
324-
[test "x$with_libgcroots" != xtiny_subst \
325-
-a "x$with_libgcroots" != xtiny_subst_bdwgc])
318+
AM_CONDITIONAL(USE_LIBGCROOTS, [test "x$with_libgcroots" != xtiny_subst])
326319
AM_CONDITIONAL(USE_LIBGCROOTS_BUNDLED, [test "x$with_libgcroots" = xno])
327320
AM_CONDITIONAL(USE_LIBGCROOTS_TINY_SUBST,
328-
[test "x$with_libgcroots" = xtiny_subst \
329-
-o "x$with_libgcroots" = xtiny_subst_bdwgc])
321+
[test "x$with_libgcroots" = xtiny_subst])
330322

331323

332324
########################################

sigscheme.pc.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,6 @@ sscm_debug=@use_debug@
6767
Name: @PACKAGE_NAME@
6868
Description: Scheme interpreter for embedded use
6969
Version: @VERSION@
70-
Requires: @GCROOTS_REQ@
70+
Requires.private: @BDWGC_REQ@ @GCROOTS_REQ@
7171
Libs: -L${libdir} -lsscm
7272
Cflags: -I${includedir}

src/Makefile.am

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -369,20 +369,20 @@ endif
369369

370370
if USE_LIBSSCM
371371
libsscm_la_SOURCES = $(libsscm_sources)
372-
libsscm_la_LIBADD = $(LIBOBJS) @GCROOTS_LIBS@
372+
libsscm_la_LIBADD = $(LIBOBJS) @BDWGC_LIBS@ @GCROOTS_LIBS@
373373
libsscm_la_LDFLAGS = -version-info $(libsscm_version)
374374
# To take precedence over installed gcroots.h by the bundled
375375
# libgcroots/include/gcroots.h, @GCROOTS_CFLAGS@ must be placed here.
376-
libsscm_la_CPPFLAGS = -I$(top_builddir)/include @GCROOTS_CFLAGS@ \
377-
-DSCM_COMPILING_LIBSSCM=1
376+
libsscm_la_CPPFLAGS = -I$(top_builddir)/include @BDWGC_CFLAGS@ \
377+
@GCROOTS_CFLAGS@ -DSCM_COMPILING_LIBSSCM=1
378378
libsscm_la_CFLAGS =
379379
endif
380380

381381
if USE_SHELL
382382
bin_PROGRAMS = sscm
383383
sscm_SOURCES = main.c
384-
sscm_LDADD = libsscm.la @GCROOTS_LIBS@
385-
sscm_CPPFLAGS = -I$(top_builddir)/include @GCROOTS_CFLAGS@
384+
sscm_LDADD = libsscm.la @BDWGC_LIBS@ @GCROOTS_LIBS@
385+
sscm_CPPFLAGS = -I$(top_builddir)/include @BDWGC_CFLAGS@ @GCROOTS_CFLAGS@
386386
sscm_CFLAGS =
387387
endif
388388

0 commit comments

Comments
 (0)