Separate CFLAGS and CPPFLAGS.  CFLAGS should not contain preprocessor
directives, which is the role of CPPFLAGS.  Closes SF patch #414991.
diff --git a/Makefile.pre.in b/Makefile.pre.in
index 103a36b..0354849 100644
--- a/Makefile.pre.in
+++ b/Makefile.pre.in
@@ -55,7 +55,8 @@
 # Compiler options
 OPT=		@OPT@
 DEFS=		@DEFS@
-CFLAGS=		$(OPT) -I. -I$(srcdir)/Include $(DEFS)
+CFLAGS=		$(OPT)
+CPPFLAGS=	-I. -I$(srcdir)/Include $(DEFS)
 LDFLAGS=	@LDFLAGS@
 LDLAST=		@LDLAST@
 SGI_ABI=	@SGI_ABI@
@@ -64,7 +65,7 @@
 # Extra C flags added for building the interpreter object files.
 CFLAGSFORSHARED=@CFLAGSFORSHARED@
 # C flags used for building the interpreter object files
-PY_CFLAGS=	$(CFLAGS) $(CFLAGSFORSHARED)
+PY_CFLAGS=	$(CFLAGS) $(CPPFLAGS) $(CFLAGSFORSHARED)
 
 
 # Machine-dependent subdirectories
@@ -283,7 +284,8 @@
 
 # Build the shared modules
 sharedmods: $(PYTHON)
-	PYTHONPATH= ./$(PYTHON) $(srcdir)/setup.py build
+	unset PYTHONPATH PYTHONHOME PYTHONSTARTUP; \
+		./$(PYTHON) $(srcdir)/setup.py build
 
 # buildno should really depend on something like LIBRARY_SRC
 buildno: $(PARSER_OBJS) \
@@ -399,10 +401,10 @@
 Python/compile.o Python/symtable.o: $(GRAMMAR_H)
 
 Python/getplatform.o: $(srcdir)/Python/getplatform.c
-		$(CC) -c $(CFLAGS) -DPLATFORM='"$(MACHDEP)"' -o $@ $(srcdir)/Python/getplatform.c
+		$(CC) -c $(CFLAGS) $(CPPFLAGS) -DPLATFORM='"$(MACHDEP)"' -o $@ $(srcdir)/Python/getplatform.c
 
 Python/importdl.o: $(srcdir)/Python/importdl.c
-		$(CC) -c $(CFLAGS) -I$(DLINCLDIR) -o $@ $(srcdir)/Python/importdl.c
+		$(CC) -c $(CFLAGS) $(CPPFLAGS) -I$(DLINCLDIR) -o $@ $(srcdir)/Python/importdl.c
 
 Objects/object.o: $(srcdir)/Objects/object.c $(srcdir)/Objects/obmalloc.c