* 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 found.
* lib/Automake/Variable.pm (%_ac_macro_for_var): Add entries for GA68
and GA68FLAGS.
* t/a68-demo.sh: New test.
* doc/automake.texi (Algol 68 Support): New section.
* NEWS: Add entry for Algol 68.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
New in 1.x:
+* New supported languages
+
+ - Support for Algol 68 added, based on the GNU Algol 68 compiler.
+
* Miscellaneous changes
- Only require the presence of an ABOUT-NLS file at the 'gnits'
'pure' => 1,
'extensions' => ['.java', '.class', '.zip', '.jar']);
+# Algol 68 in GCC
+register_language ('name' => 'a68',
+ 'Name' => 'Algol 68',
+ 'config_vars' => ['A68'],
+ 'linker' => 'A68LINK',
+ 'link' => '$(A68LD) $(AM_A68FLAGS) $(A68FLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@',
+ 'flags' => ['A68FLAGS'],
+ 'compile' => '$(A68) $(AM_A68FLAGS) $(A68FLAGS)',
+ 'ccer' => 'A68',
+ 'compiler' => 'A68COMPILE',
+ 'compile_flag' => '-c',
+ 'output_flag' => '-o',
+ 'libtool_tag' => 'A68',
+ 'lder' => 'A68LD',
+ 'ld' => '$(A68)',
+ 'pure' => 1,
+ 'extensions' => ['.a68']);
+
################################################################
# Error reporting functions.
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,
+ A68 => 1);
}
}
}
{
my (%linkers) = @_;
- foreach my $l (qw(GCJLINK OBJCXXLINK CXXLINK F77LINK FCLINK OBJCLINK UPCLINK))
+ foreach my $l (qw(GCJLINK OBJCXXLINK CXXLINK F77LINK FCLINK
+ OBJCLINK UPCLINK A68LINK))
{
return $l if defined $linkers{$l};
}
(
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__fastdepA68 => 'AM_PROG_A68',
am__fastdepOBJC => 'AC_PROG_OBJC',
am__fastdepOBJCXX => 'AC_PROG_OBJCXX',
am__fastdepUPC => 'AM_PROG_UPC'
_AM_SKIP_COMP_TESTS([GNU Fortran 77])])
fi
+# GNU Algol 68 compiler.
+AC_ARG_VAR([GNU_A68], [GNU Algol 68 compiler])
+AC_ARG_VAR([GNU_A68FLAGS], [GNU Algol 68 compiler flags])
+AC_CHECK_TOOLS([GNU_A68], [ga68], [false])
+if test "$GNU_A68" != false; then
+ AS_IF([AM_RUN_LOG([$GNU_A68 --version && $GNU_A68 -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])
* Fortran 9x Support:: Compiling Fortran 9x sources
* Java Support with gcj:: Compiling Java sources using gcj
* Vala Support:: Compiling Vala sources
+* Algol 68 Support:: Compiling Algol 68 sources
* Support for Other Languages:: Compiling other languages
* Dependencies:: Automatic dependency tracking
* EXEEXT:: Support for executable extensions
* Fortran 9x Support:: Compiling Fortran 9x sources
* Java Support with gcj:: Compiling Java sources using gcj
* Vala Support:: Compiling Vala sources
+* Algol 68 Support:: Compiling Algol 68 sources
* Support for Other Languages:: Compiling other languages
* Dependencies:: Automatic dependency tracking
* EXEEXT:: Support for executable extensions
(@pxref{Renamed Objects}) to produce different C files from one Vala
source file.
+@node Algol 68 Support
+@section Algol 68 Support
+
+@cindex Algol 68 support
+@cindex Support for Algol 68
+
+Automake includes support for Algol 68, using GCC.
+
+Any package including Algol 68 code must define the output variable
+@code{A68} in @file{configure.ac}; the simplest way to do this is to use
+the @code{AC_PROG_A68} macro (@pxref{Particular Programs, , Particular
+Program Checks, autoconf, The Autoconf Manual}).
+
+A few additional variables are defined when a Fortran 77 source file is
+seen:
+
+@vtable @code
+@item A68
+The name of the Algol 68 compiler.
+
+@item A68FLAGS
+Any flags to pass to the Algol 68 compiler.
+
+@item AM_A68FLAGS
+The maintainer's variant of @code{A68FLAGS}.
+
+@item A68COMPILE
+The command used to compile an Algol 68 source file. The file name is
+appended to form the complete command line.
+
+@item A68LINK
+The command used to link a pure Algol 68 program or shared library.
+
+@end vtable
@node Support for Other Languages
@comment node-name, next, previous, up
CXX => 'AC_PROG_CXX',
CXXFLAGS => 'AC_PROG_CXX',
F77 => 'AC_PROG_F77',
+ A68 => 'AC_PROG_A68',
+ A68FLAGS => 'AC_PROG_A68',
FFLAGS => 'AC_PROG_F77',
FC => 'AC_PROG_FC',
FCFLAGS => 'AC_PROG_FC',
--- /dev/null
+#! /bin/sh
+# Copyright (C) 2025 Free Software Foundation, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <https://www.gnu.org/licenses/>.
+
+# Basic check for Algol 68 support.
+
+required=ga68
+am_create_testdir=empty
+. test-init.sh
+
+cat > configure.ac << 'END'
+AC_INIT([GNU Algol 68 Demo], [1.0], [bug-automake@gnu.org])
+AC_CONFIG_SRCDIR([play.a68])
+AC_CONFIG_AUX_DIR([build-aux])
+AM_INIT_AUTOMAKE
+AC_PROG_A68
+AC_CONFIG_FILES([Makefile])
+AC_OUTPUT
+END
+
+cat > Makefile.am << 'END'
+AUTOMAKE_OPTIONS = subdir-objects
+
+bin_PROGRAMS = work play
+play_SOURCES = play.a68
+work_SOURCES = work.a68
+
+.PHONY: test-objs
+check-local: test-objs
+test-objs:
+ test -f play.$(OBJEXT)
+ test -f work.$(OBJEXT)
+END
+
+mkdir sub build-aux
+
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE --add-missing
+
+cat > work.a68 << 'END'
+PROGRAM (puts ("We are working :-(\n"); 0)
+END
+
+cat > play.a68 << 'END'
+PROGRAM (puts ("We are playing :-)\n"); 0)
+END
+
+./configure
+$MAKE
+$MAKE test-objs
+
+if ! cross_compiling; then
+ unindent > exp.play << 'END'
+ We are playing :-)
+END
+ unindent > exp.work << 'END'
+ We are working :-(
+END
+ for p in play work; do
+ # The program must run correctly (exit status = 0).
+ ./$p
+ # And it must have the expected output. Note that we strip extra
+ # CR characters (if any), to cater to MinGW programs on MSYS.
+ # See automake bug#14493.
+ ./$p | tr -d '\015' > got.$p || { cat got.$p; exit 1; }
+ cat exp.$p
+ cat got.$p
+ diff exp.$p got.$p
+ done
+fi
+
+$MAKE distcheck
+
+: