[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[bug#75807] [PATCH,WIP] Support for the Algol 68 language
From: |
Jose E. Marchesi |
Subject: |
[bug#75807] [PATCH,WIP] Support for the Algol 68 language |
Date: |
Fri, 24 Jan 2025 01:23:47 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) |
Hello.
This patch adds support for the Algol 68 programming language to
Automake. It is based on the Algol 68 GCC front-end, which is currently
under development [1]. A WIP series got sent to gcc-patches in January
[2], and the front-end is temporarily hosted in the sourceware forge
until integration in GCC is completed [3].
The full language is (almost) already implemented, the compiler is
useful and I plan to send official patches for inclusion in GCC 16 very
soon.
In the meanwhile, I would like to have both autoconf and automake
support ready to be added upstream once the front-end lands.
This WIP seems to work for me: make, make install, make dist, etc. With
a Makefile.am like this:
----
bin_PROGRAMS = program
godcc_SOURCES = program.a68
----
But I am not familiar with the Automake internals and it is likely I am
missing something and/or doing something wrong. Comments are welcome.
A patch adding Algol 68 support to autoconf has been sent to
autoconf-patches@.
Salud!
[1] https://gcc.gnu.org/wiki/Algol68FrontEnd
[2]
https://inbox.sourceware.org/gcc-patches/20250101020952.18404-1-jose.marchesi@oracle.com/T/#t
[3] https://forge.sourceforge.org/jemarch/a68-gcc
Add support for the Algol 68 programming language.
* NEWS: Add entry for Algol 68.
* bin/automake.in: Call register_language for Algol 68.
(resolve_linker): handle A68LINK.
(%_am_macro_for_cond): Add entry for am__fastdepGA68.
* configure.ac: Look for ga68 and set GNU_GA68 and GNU_A68FLAGS if fuond.
* lib/Automake/Variable.pm (%_ac_macro_for_var): Add entries for GA68
and GA68FLAGS.
diff --git a/NEWS b/NEWS
index b4c50ffc6..9da978c39 100644
--- a/NEWS
+++ b/NEWS
@@ -4,6 +4,10 @@ please see NEWS-future and start following the advice there
now.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
New in 1.x:
+* New supported languages:
+
+ - Support for Algol 68 has been added; based on the GNU Algol 68 compiler.
+
* Miscellaneous changes
- Only require the presence of an ABOUT-NLS file at the 'gnits'
diff --git a/bin/automake.in b/bin/automake.in
index 5d3e7c766..bc5c3838a 100644
--- a/bin/automake.in
+++ b/bin/automake.in
@@ -1023,6 +1023,24 @@ register_language ('name' => 'java',
'pure' => 1,
'extensions' => ['.java', '.class', '.zip', '.jar']);
+# Algol 68 in GCC
+register_language ('name' => 'a68',
+ 'Name' => 'Algol 68',
+ 'config_vars' => ['GA68'],
+ 'linker' => 'A68LINK',
+ 'link' => '$(A68LD) $(AM_A68FLAGS) $(A68FLAGS)
$(AM_LDFLAGS) $(LDFLAGS) -o $@',
+ 'flags' => ['A68FLAGS'],
+ 'compile' => '$(GA68) $(AM_A68FLAGS) $(A68FLAGS)',
+ 'ccer' => 'GA68',
+ 'compiler' => 'A68COMPILE',
+ 'compile_flag' => '-c',
+ 'output_flag' => '-o',
+ 'libtool_tag' => 'GA68',
+ 'lder' => 'A68LD',
+ 'ld' => '$(GA68)',
+ 'pure' => 1,
+ 'extensions' => ['.a68']);
+
################################################################
# Error reporting functions.
@@ -5564,7 +5582,7 @@ EOF
if (0 == keys %libtool_tags)
{
# Hardcode the tags supported by Libtool 1.5.
- %libtool_tags = (CC => 1, CXX => 1, GCJ => 1, F77 => 1);
+ %libtool_tags = (CC => 1, CXX => 1, GCJ => 1, F77 => 1, GA68 =>
1);
}
}
}
@@ -6057,7 +6075,7 @@ sub resolve_linker
{
my (%linkers) = @_;
- foreach my $l (qw(GCJLINK OBJCXXLINK CXXLINK F77LINK FCLINK OBJCLINK
UPCLINK))
+ foreach my $l (qw(GCJLINK A68LINK OBJCXXLINK CXXLINK F77LINK FCLINK
OBJCLINK UPCLINK))
{
return $l if defined $linkers{$l};
}
@@ -6176,11 +6194,12 @@ my %_am_macro_for_cond =
(
AMDEP => "one of the compiler tests\n"
. " AC_PROG_CC, AC_PROG_CXX, AC_PROG_OBJC, AC_PROG_OBJCXX,\n"
- . " AM_PROG_AS, AM_PROG_GCJ, AM_PROG_UPC",
+ . " AM_PROG_AS, AM_PROG_GCJ, AM_PROG_UPC, AM_PROG_A68",
am__fastdepCC => 'AC_PROG_CC',
am__fastdepCCAS => 'AM_PROG_AS',
am__fastdepCXX => 'AC_PROG_CXX',
am__fastdepGCJ => 'AM_PROG_GCJ',
+ am__fastdepGA68 => 'AM_PROG_GA68',
am__fastdepOBJC => 'AC_PROG_OBJC',
am__fastdepOBJCXX => 'AC_PROG_OBJCXX',
am__fastdepUPC => 'AM_PROG_UPC'
diff --git a/configure.ac b/configure.ac
index 0a9e1904e..295bd2749 100644
--- a/configure.ac
+++ b/configure.ac
@@ -565,6 +565,16 @@ if test "$GNU_F77" != false; then
_AM_SKIP_COMP_TESTS([GNU Fortran 77])])
fi
+# GNU Algol 68 compiler.
+AC_ARG_VAR([GNU_GA68], [GNU Algol 68 compiler])
+AC_ARG_VAR([GNU_A68FLAGS], [GNU Algol 68 compiler flags])
+AC_CHECK_TOOLS([GNU_GA68], [ga68], [false])
+if test "$GNU_GA68" != false; then
+ AS_IF([AM_RUN_LOG([$GNU_GA68 --version && $GNU_GA68 -v])], [],
+ [AC_MSG_WARN([botched installation for GNU Algol 68 compiler])
+ _AM_SKIP_COMP_TESTS([GNU Algol 68])])
+fi
+
# GNU Java compiler.
AC_ARG_VAR([GNU_GCJ], [GNU Java compiler])
AC_ARG_VAR([GNU_GCJFLAGS], [GNU Java compiler flags])
diff --git a/lib/Automake/Variable.pm b/lib/Automake/Variable.pm
index 6e90b81f2..ccf065803 100644
--- a/lib/Automake/Variable.pm
+++ b/lib/Automake/Variable.pm
@@ -183,6 +183,8 @@ my %_ac_macro_for_var =
CXX => 'AC_PROG_CXX',
CXXFLAGS => 'AC_PROG_CXX',
F77 => 'AC_PROG_F77',
+ GA68 => 'AC_PROG_GA68',
+ A68FLAGS => 'AC_PROG_GA68',
FFLAGS => 'AC_PROG_F77',
FC => 'AC_PROG_FC',
FCFLAGS => 'AC_PROG_FC',
- [bug#75807] [PATCH,WIP] Support for the Algol 68 language,
Jose E. Marchesi <=