patches/Python-02-pycc.diff
changeset 8944 a63e00e81443
parent 8162 ab63e00d2219
--- a/patches/Python-02-pycc.diff	Tue Jan 09 17:42:22 2007 +0000
+++ b/patches/Python-02-pycc.diff	Tue Jan 09 19:49:14 2007 +0000
@@ -1,6 +1,6 @@
---- /dev/null	2006-08-24 06:34:26.000000000 -0700
-+++ Python-2.4.2-new/pycc	2006-08-24 06:37:41.077704000 -0700
-@@ -0,0 +1,156 @@
+--- /dev/null	2007-01-09 14:33:27.000000000 -0500
++++ Python-2.4.4-new/pycc	2007-01-09 14:34:30.248866916 -0500
+@@ -0,0 +1,172 @@
 +#!/bin/ksh
 +#
 +# Script for running the C/C++ compiler when building python modules
@@ -41,12 +41,19 @@
 +# name of the env variable for setting the compiler path
 +CVAR='CC'
 +
++if [ "x$PYCC_CC" != x ]; then
++    CC="$PYCC_CC"
++fi
++
 +if [ "x$MYNAME" = xpyCC ]; then
 +    CCEXE='CC'
 +    GCCEXE='g++'
 +    CLANG='C++'
 +    CC="$CXX"
 +    CVAR='CXX'
++    if [ "x$PYCC_CXX" != x ]; then
++        CC="$PYCC_CXX"
++    fi
 +fi
 +
 +SAVED_IFS="$IFS"
@@ -54,6 +61,15 @@
 +
 +# check if the CC env variable is set
 +if [ "x$CC" != x ]; then
++    # verify that it doesn't point to this script
++    if /usr/bin/cmp -s "$CC" $0; then
++        echo "WARNING: "$CVAR" is set to this script; ignoring this value to avoid an infinite loop"
++	CC=
++    fi
++fi
++
++# check again if the CC env variable is set
++if [ "x$CC" != x ]; then
 +    case "$CC" in
 +	/* )
 +	    # $CC is an absolute path name