automake
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: ifdef in Makefile.am


From: Ralf Wildenhues
Subject: Re: ifdef in Makefile.am
Date: Thu, 3 Dec 2009 07:52:25 +0100
User-agent: Mutt/1.5.20 (2009-10-28)

Hello Joakim,

* Joakim Tjernlund wrote on Wed, Dec 02, 2009 at 11:59:11PM CET:
> I basicall want to do in a Makefile.am
> ifdef automake version > 1.4
>   AM_LDFLAGS=...
> else
>   LDFLAGS=...
> endif
> Because am version == 1.4 does not like
> some newer automake macros and I am moving a big project over
> to am 1.10. I need the 2 versions to coexist for a while
> until I have moved everything over.
> How can I do this? Tried lots of variants but no luck.

I'm afraid it's only possible by exploiting an undocumented internal
detail, namely that the Automake API version is stored in the
$am__api_version variable.

With that you create a conditional:
  AM_CONDITIONAL([NEWER_THAN_AUTOMAKE_1_4],
    [case $am__api_version in 0* | 1.[0-4]*) false;; *) true;; esac])

and then you can use that conditional in Makefile.am:
  if NEWER_THAN_AUTOMAKE_1_4
  AM_LDFLAGS=...
  else
  LDFLAGS=...
  fi

HTH.  Untested.

Cheers,
Ralf




reply via email to

[Prev in Thread] Current Thread [Next in Thread]