configure: avoid some code repetitions thanks to m4_{push,pop}def