Build: configure: make compatible with autoconf 2.70
It's never been supported to use shell control constructs like if and case
with m4 macros inside, but changes in autoconf 2.70 made it more likely to
cause problems, so use AS_IF() and AS_CASE() wherever appropriate.
Also, avoid newly obsolete syntax.