]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
Algol68: do not clobber A68FLAGS in AC_PROG_A68 (sr #111382)
authorJose E. Marchesi <jemarch@gnu.org>
Mon, 9 Feb 2026 14:18:35 +0000 (09:18 -0500)
committerZack Weinberg <zack@owlfolio.org>
Mon, 9 Feb 2026 14:21:16 +0000 (09:21 -0500)
The AC_PROG_A68 macro should honor the A68FLAGS set by the user at
configure time.

Fixes <https://savannah.gnu.org/support/?111382>.

* lib/autoconf/a68.m4: Do not clobber A68FLAGS in AC_PROG_A68.
  Simplify sequence of AC_CHECK_TOOL/AC_CHECK_PROGS operations;
  this macro does not have the backward compatibility constraints
  that AC_PROG_CC does.

lib/autoconf/a68.m4

index 96aee3fceaacacba77569fcae6ccad534a99d358..7c62524b381bafe0e972ab0dac0eb5010bda366a 100644 (file)
@@ -124,23 +124,11 @@ AC_DEFUN([AC_LANG_COMPILER(Algol 68)],
 AN_MAKEVAR([A68], [AC_PROG_A68])
 AN_PROGRAM([ga68], [AC_PROG_A68])
 AC_DEFUN([AC_PROG_A68],
-[AC_LANG_PUSH(Algol 68)dnl
+[AC_LANG_PUSH([Algol 68])dnl
 AC_ARG_VAR([A68], [Algol 68 compiler command])dnl
 AC_ARG_VAR([A68FLAGS], [Algol 68 compiler flags])dnl
 _AC_ARG_VAR_LDFLAGS()dnl
-m4_ifval([$1],
-      [AC_CHECK_TOOLS(A68, [$1])],
-[AC_CHECK_TOOL(A68, ga68)
-if test -z "$A68"; then
-  if test -n "$ac_tool_prefix"; then
-    AC_CHECK_PROG(A68, [${ac_tool_prefix}ga68], [$ac_tool_prefix}ga68])
-  fi
-fi
-if test -z "$A68"; then
-  AC_CHECK_PROG(A68, ga68, ga68, , , false)
-fi
-])
-
+AC_CHECK_TOOLS([A68], [m4_default([$1], [ga68 a68])])
 # Provide some information about the compiler.
 _AS_ECHO_LOG([checking for _AC_LANG compiler version])
 set X $ac_compile
@@ -148,6 +136,7 @@ ac_compiler=$[2]
 _AC_DO_LIMIT([$ac_compiler --version >&AS_MESSAGE_LOG_FD])
 m4_expand_once([_AC_COMPILER_EXEEXT])[]dnl
 m4_expand_once([_AC_COMPILER_OBJEXT])[]dnl
-A68FLAGS="-g -O2"
-AC_LANG_POP(Algol 68)dnl
+# Default value for A68FLAGS
+: ${A68FLAGS:="-g -O2"}
+AC_LANG_POP([Algol 68])dnl
 ])# AC_PROG_A68