GNU bug report logs - #8718
error when using nested conditionals

Previous Next

Package: automake;

Reported by: Bruno Haible <bruno <at> clisp.org>

Date: Sun, 22 May 2011 22:31:02 UTC

Severity: normal

Tags: wontfix

Done: Stefano Lattarini <stefano.lattarini <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


Message #32 received at 8718 <at> debbugs.gnu.org (full text, mbox):

From: Bruno Haible <bruno <at> clisp.org>
To: Stefano Lattarini <stefano.lattarini <at> gmail.com>
Cc: 8718 <at> debbugs.gnu.org
Subject: Re: bug#8718: error when using nested conditionals
Date: Fri, 10 Jun 2011 12:44:46 +0200
> Since the usual way to implement nestable behaviour in Autoconf is
> m4_pushdef / m4_popdef

Another idea would to be m4_pushdef AM_CONDITIONAL itself.

If you add a third parameter to AM_CONDITIONAL, denoting the conditions
in which the conditional needs to be defined, then gnulib could emit
code like this:

  m4_define([AM_CONDITIONAL_ORIG], m4_defn([AM_CONDITIONAL]))
  AC_DEFUN([gl_LENIENT_CONDITIONAL], [AM_CONDITIONAL_ORIG([$1],[$2],[USE_FOO])])
  m4_pushdef([AM_CONDITIONAL], [gl_LENIENT_CONDITIONAL])
  if test $enable_foo; then
    AM_CONDITIONAL([FOO], [:])
  fi
  m4_pushdef([AM_CONDITIONAL], [gl_LENIENT_CONDITIONAL])
  if test -n "$user_flag"; then 
    AM_CONDITIONAL([BAR], [test $user_flag = yes])
  fi
  m4_popdef([AM_CONDITIONAL])
  if test 0 = 1; then 
    AM_CONDITIONAL([BAZ], [:])
  fi
  m4_popdef([AM_CONDITIONAL])

But it certainly gets hairy...

Bruno
-- 
In memoriam Lamana Ould Bou <http://fr.wikipedia.org/wiki/Lamana_Ould_Bou>




This bug report was last modified 13 years and 345 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.