diff -Naur Python-2.7.2/Makefile.pre.in Python-2.7.2.patch/Makefile.pre.in
--- Python-2.7.2/Makefile.pre.in	2011-10-26 01:53:09.752305358 +0200
+++ Python-2.7.2.patch/Makefile.pre.in	2011-10-26 01:57:20.158587315 +0200
@@ -410,8 +410,8 @@
 # Build the shared modules
 sharedmods: $(BUILDPYTHON)
 	@case $$MAKEFLAGS in \
-	*s*) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' PYTHONXCPREFIX='$(DESTDIR)$(prefix)' $(HOSTPYTHON) -E $(srcdir)/setup.py -q build;; \
-	*) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' PYTHONXCPREFIX='$(DESTDIR)$(prefix)' $(HOSTPYTHON) -E $(srcdir)/setup.py build;; \
+	*s*) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' PYTHONXCPREFIX='$(DESTDIR)$(prefix)' CONFIG_ARGS="$(CONFIG_ARGS)" $(HOSTPYTHON) -E $(srcdir)/setup.py -q build;; \
+	*) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' PYTHONXCPREFIX='$(DESTDIR)$(prefix)' CONFIG_ARGS="$(CONFIG_ARGS)" $(HOSTPYTHON) -E $(srcdir)/setup.py build;; \
 	esac
 
 # Build static library
@@ -1053,7 +1053,7 @@
 # This goes into $(exec_prefix)
 sharedinstall: sharedmods
 	CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' \
-	$(RUNSHARED) $(HOSTPYTHON) -E $(srcdir)/setup.py install \
+	$(RUNSHARED) CONFIG_ARGS="$(CONFIG_ARGS)" $(HOSTPYTHON) -E $(srcdir)/setup.py install \
 		--skip-build \
 	   	--prefix=$(prefix) \
 		--install-scripts=$(BINDIR) \
diff -Naur Python-2.7.2/setup.py Python-2.7.2.patch/setup.py
--- Python-2.7.2/setup.py	2011-10-26 01:53:16.014387508 +0200
+++ Python-2.7.2.patch/setup.py	2011-10-26 01:53:46.158782904 +0200
@@ -20,6 +20,9 @@
 # Were we compiled --with-pydebug or with #define Py_DEBUG?
 COMPILED_WITH_PYDEBUG = hasattr(sys, 'gettotalrefcount')
 
+sysconfig.get_config_vars()
+sysconfig._CONFIG_VARS.update(os.environ)
+
 # This global variable is used to hold the list of modules to be disabled.
 try:
 	disabled_module_list = os.environ["PYTHON_DISABLE_MODULES"].split()
diff -Naur Python-2.7.2/setup.py.orig Python-2.7.2.patch/setup.py.orig
