GNOME Bugzilla – Bug 681413
build: Switch back to using AS_IF for conditionals
Last modified: 2012-08-08 14:38:34 UTC
See https://bugzilla.gnome.org/show_bug.cgi?id=674483
Created attachment 220609 [details] [review] build: Switch back to using AS_IF for conditionals
I just can't deal with AS_IF - too much ([]) noise. When I want to write an if, I'll write 'if'.
The problem with using plain 'if' is that you don't get proper dependency lifting for macros inside the if. Look at bug 674483 for an example of what happens there.
There's a lot of noise on that other bug, so TL;DR: often macros will pull in one-time initialisation magic (for things like determining certain compiler flags, etc). m4 can't really tell if you're doing that inside of an 'if' so the first time it happens it assumes that those variables have been defined... If you were inside of an 'if' and that code didn't run then those variables are unset. AS_IF() lifts those one-time operations outside of the 'if' so that they always happen.
(In reply to comment #2) > I just can't deal with AS_IF - too much ([]) noise. > When I want to write an if, I'll write 'if'. I hate m4 and shell script just as much (if not more) than you do, but the fact is it solved actual problems. I didn't just make the changes for fun.
Oh, I would never claim that you write m4 for fun :-) Anyway, I know what AS_IF does.
Review of attachment 220609 [details] [review]: .
Attachment 220609 [details] pushed as ddfcfa6 - build: Switch back to using AS_IF for conditionals