GNU bug report logs - #74387
Cannot use ifdef and other Make conditionals

Previous Next

Package: automake;

Reported by: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>

Date: Sun, 17 Nov 2024 04:09:02 UTC

Severity: normal

Done: Karl Berry <karl <at> freefriends.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
To: 74387 <at> debbugs.gnu.org
Subject: bug#74387: Cannot use Make conditionals (was: Cannot nest Make conditionals inside Automake conditionals)
Date: Sun, 17 Nov 2024 13:56:34 +0900
Hi,

The problem appears simpler than I first thought; it seems Automake is
hard-coded to expect 'endif' to be matched with its own 'if'; causing parsing
errors when attempting to use Make's conditional such as ifdef, ifeq,
etc. that also end with 'endif'.

This was reported 23 years ago here: https://lists.gnu.org/archive/html/bug-automake/2001-11/msg00015.html

There is workaround proposed that makes use of an output variable to hide the
'endif' behind it:

--8<---------------cut here---------------start------------->8---
ENDIF=endif
AC_SUBST(ENDIF)

and to apply this in Makefile.am:
ifdef f
        ..
@ENDIF@
--8<---------------cut here---------------end--------------->8---

I've tested the above and it appear to work, but perhaps Automake could
accommodate Make snippets better?

-- 
Thanks,
Maxim




This bug report was last modified 141 days ago.

Previous Next


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