Reputation: 6081
I am trying to do this in automake
platform=$(uname)
ifeq ($(platform), Darwin)
stmt = ...
else
stmt1 = ...
endif
But I get
error: else without if
error: endif without if
What am I doing wrong?
Upvotes: 2
Views: 2416
Reputation: 57920
With Automake conditionals, you first have to define a conditional variable in your configure script, like this:
AM_CONDITIONAL([DARWIN], [test $(uname) -eq "Darwin"])
then in the Automake file, do this:
if DARWIN
stmt = ...
else
stmt1 = ...
endif
Alternatively, just write the if statement in bash script as the body of a rule in your Automake file.
Upvotes: 5