Index: setup.py =================================================================== --- setup.py (revision 83123) +++ setup.py (working copy) @@ -2041,4 +2041,13 @@ # --install-platlib if __name__ == '__main__': + import os + + # the makefile adds a number of variables to the environment that mirror + # the defition in the Makefile. Distutils will append the values from the + # environment to the ones in the Makefile, and that can confuse compilers + # that don't like duplicate command-line arguments. + for name in ('CC', 'LDFLAGS', 'OPT'): + if name in os.environ: + del os.environ[name] main()