Replaced most (but not all) obsolete macros.
Fixed a couple of minor errors which caused compiler flags to be invalid, thereby causing configuration to fail.
More simplifications and formatting cleanup. Changed all comments to 'dnl' comments to avoid issues with '#' in the generated configure script.
Fixed a variable which wasn't being set as it should.
Replaced the rest of the obsolete macros.