- [2.49b-alt12.qa1] cherry-picked to fix linking plugins with -lm (thx Dmitry V. Levin).
- Backport new version to c7 branch - Disable build with python3