[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Testing the value of a variable defined with m4_define (configure.ac
From: |
Gary V. Vaughan |
Subject: |
Re: Testing the value of a variable defined with m4_define (configure.ac) |
Date: |
Sat, 5 Nov 2011 22:49:18 +0700 |
On 5 Nov 2011, at 21:10, Thomas Adam wrote:
> previously defined:
>
> if test x"$ISRELEASED" = "xyes"; then
> VAR="somevalue"
> VAR2="somevalue2"
> fi
>
> Now, though, the shell script I mentioned is instead setting ISRELEAED
> like this:
>
> m4_define([ISRELEASED], [$VALUE_OF_RELEASE_STATUS])
>
> So my question is, how can I change the if test above to now test the
> value of ISRELEASED
Comparing an expansion at m4 time to insert shell code conditionally:
m4_if(ISRELEASED, [yes], [VAR=somevalue; VAR2=somevalue2])
Generating code to compare the expansion at shell-time:
if yes = "ISRELEASED"; then VAR=somevalue; VAR2=somevalue2; fi
HTH,
--
Gary V. Vaughan (gary AT gnu DOT org)