Signed-off-by: Jose E. Marchesi <[email protected]>
gcc/algol68/ChangeLog
PR algol68/123733
* README: Mention minimum version of libgc.
libga68/ChangeLog
PR algol68/123733
* configure.ac: Check for GC_is_init_called in libgc.
* configure: Regenerate.
---
gcc/algol68/README | 8 ++++++++
libga68/configure | 11 ++++++-----
libga68/configure.ac | 9 ++++++---
3 files changed, 20 insertions(+), 8 deletions(-)
diff --git a/gcc/algol68/README b/gcc/algol68/README
index 9d1595ad8d8..5e9660b6ec0 100644
--- a/gcc/algol68/README
+++ b/gcc/algol68/README
@@ -26,6 +26,14 @@ The compiler proper is called `a681'.
Programs built by this compiler make use of the libga68 run-time
library.
+Dependencies
+============
+
+The Algol 68 run-time relies on the Boehm-Demers-Weiser conservative
+garbage collector libgc, version 7.6.2 or later. If for whatever
+reason a recent enough of libgc is not available for some target then
+you can configure GCC with --disable-algol68-gc.
+
Building
========
diff --git a/libga68/configure b/libga68/configure
index fb14f39eb2b..01dc61e2d59 100755
--- a/libga68/configure
+++ b/libga68/configure
@@ -13660,7 +13660,7 @@ GC_init()
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
- if test "$cross_compiling" = yes; then :
+ if test "$cross_compiling" = yes; then :
system_bdw_gc_found=no
else
@@ -13669,7 +13669,8 @@ else
#include <gc/gc.h>
int main() {
- GC_init();
+ if (!GC_is_init_called ())
+ GC_init();
return 0;
}
@@ -13692,11 +13693,11 @@ rm -f core conftest.err conftest.$ac_objext \
CFLAGS=$save_CFLAGS
LIBS=$save_LIBS
if test x$enable_algol68_gc = xauto && test x$system_bdw_gc_found = xno;
then
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: system bdw-gc not
found, building libga68 with no GC support" >&5
-$as_echo "$as_me: WARNING: system bdw-gc not found, building libga68 with no
GC support" >&2;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: usable system bdw-gc
not found, building libga68 with no GC support" >&5
+$as_echo "$as_me: WARNING: usable system bdw-gc not found, building libga68
with no GC support" >&2;}
use_bdw_gc=no
elif test x$enable_algol68_gc = xyes && test x$system_bdw_gc_found = xno;
then
- as_fn_error $? "system bdw-gc required but not found" "$LINENO" 5
+ as_fn_error $? "usable system bdw-gc required but not found" "$LINENO" 5
else
use_bdw_gc=yes
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: found" >&5
diff --git a/libga68/configure.ac b/libga68/configure.ac
index 244ca1d8cb2..96b23f4a89b 100644
--- a/libga68/configure.ac
+++ b/libga68/configure.ac
@@ -356,10 +356,13 @@ no)
AC_LINK_IFELSE(
[AC_LANG_PROGRAM([#include <gc/gc.h>],[GC_init()])],
[
+ dnl Make sure to include GC_is_init_called and any other
+ dnl feature that may require a "recent" libgc.
AC_RUN_IFELSE([AC_LANG_SOURCE([[
#include <gc/gc.h>
int main() {
- GC_init();
+ if (!GC_is_init_called ())
+ GC_init();
return 0;
}
]])],
@@ -373,10 +376,10 @@ no)
CFLAGS=$save_CFLAGS
LIBS=$save_LIBS
if test x$enable_algol68_gc = xauto && test x$system_bdw_gc_found = xno;
then
- AC_MSG_WARN([system bdw-gc not found, building libga68 with no GC
support])
+ AC_MSG_WARN([usable system bdw-gc not found, building libga68 with no GC
support])
use_bdw_gc=no
elif test x$enable_algol68_gc = xyes && test x$system_bdw_gc_found = xno;
then
- AC_MSG_ERROR([system bdw-gc required but not found])
+ AC_MSG_ERROR([usable system bdw-gc required but not found])
else
use_bdw_gc=yes
AC_MSG_RESULT([found])
--
2.39.5