"Jose E. Marchesi" <[email protected]> writes:

> [Sam James found this issue while packaging godcc for Gentoo:
>  https://packages.gentoo.org/packages/dev-util/godcc.  Would be nice if
>  we could have this fixed in autoconf 2.73.]
>
> The AC_PROG_A68 macro should honor the A68FLAGS set by the user at
> configure time.
>
> Note that a similar fix may be needed in AC_PROG_GO.  I have not fixed
> that one because it may be intentional there? (unlikely, but just in
> case.)
>
> Signed-off-by: Jose E. Marchesi <[email protected]>
>
>       * lib/autoconf/a68.m4: Do not clobber A68FLAGS in AC_PROG_A68.
> ---
>  lib/autoconf/a68.m4 | 10 ++++++++--
>  1 file changed, 8 insertions(+), 2 deletions(-)
>
> diff --git a/lib/autoconf/a68.m4 b/lib/autoconf/a68.m4
> index 96aee3fc..462199a3 100644
> --- a/lib/autoconf/a68.m4
> +++ b/lib/autoconf/a68.m4
> @@ -124,7 +124,9 @@ 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_test_A68FLAGS=${A68FLAGS+y}
> +ac_save_A68FLAGS=$A68FLAGS
> +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
> @@ -148,6 +150,10 @@ 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"
> +if test $ac_test_A68FLAGS; then

Note that this may fail wrongly:

  ~$ ac_test_A68FLAGS='-e 123'
  ~$ test $ac_test_A68FLAGS || echo fail
  fail

Probably, what you want is: test x"$ac_test_A68FLAGS" != x

See (autoconf)Limitations of Builtins

> +  A68FLAGS=$ac_save_A68FLAGS
> +else
> +  A68FLAGS="-g -O2"
> +fi
>  AC_LANG_POP(Algol 68)dnl
>  ])# AC_PROG_A68

-- 
Arsen Arsenović

Attachment: signature.asc
Description: PGP signature

Reply via email to