[Zope-Checkins] CVS: Zope - configure:1.1.2.2

Matt Behrens matt@zigg.com
Mon, 20 May 2002 09:14:26 -0400


Update of /cvs-repository/Zope
In directory cvs.zope.org:/tmp/cvs-serv30241

Modified Files:
      Tag: zigg_unix-install-control-config-branch
	configure 
Log Message:
portability and other fixes (testing on Solaris this morning) :-)


=== Zope/configure 1.1.2.1 => 1.1.2.2 ===
 
 # Special hook for make distclean target.
-if test $1 = --subst-files; then
+if test x$1 = x--subst-files; then
     echo $SUBST_FILES
     exit 0
 fi
 
+# Work around portability issues with 'which'.
+_which()
+{
+    if which $1 2>&1 > /dev/null; then
+        _result=`which $1 2>&1`
+	if test -f $_result; then
+	    echo $_result
+	    return 0
+	fi
+    fi
+    return 1
+}
+
 echo Zope source distribution configuration utility
 echo Copyright \(c\) 2002 Zope Corporation and Contributors. All Rights
 echo Reserved.  This software is subject to the provisions of the Zope
@@ -49,8 +62,8 @@
 # Look for and query an existing zope control utility first, as we may want
 # to override what it says with command-line options.
 echo Searching for existing zope control utility...
-if which zope >/dev/null 2>&1; then
-    ZOPE=`which zope`
+if _which zope >/dev/null 2>&1; then
+    ZOPE=`_which zope`
     if test -x $ZOPE; then
 	echo Found $ZOPE, which says your current configuration is:
 	$ZOPE config
@@ -126,27 +139,27 @@
 done
 
 # Search for an acceptable Python binary.
-if test x$OVERRIDE_PYTHON == x; then
+if test x$OVERRIDE_PYTHON = x; then
     echo Searching for Python binary \(version $SUPPORTED_VERSION, minimum patchlevel $SUPPORTED_PATCHLEVEL\)...
     for search_python in $SEARCH_PYTHONS; do
-    	if which $search_python >/dev/null 2>&1; then
-	    python=`which $search_python`
-	    echo -n "$python is "
+    	if _which $search_python >/dev/null 2>&1; then
+	    python=`_which $search_python`
+	    echo $python is \\\c
 	    if $python inst/acceptable_version.py $SUPPORTED_VERSION $SUPPORTED_PATCHLEVEL; then
 		PYTHON=$python
 	    fi
 	fi
     done
-    if test x$PYTHON == x; then
+    if test x$PYTHON = x; then
 	echo Could not find an acceptable Python binary.  You may wish to specify
 	echo a path to one with the --with-python option.  See doc/INSTALL.txt
 	echo for details.
 	exit 1
     fi
 else
-    if which $OVERRIDE_PYTHON >/dev/null 2>&1; then
-    	PYTHON=`which $OVERRIDE_PYTHON`
-	echo -n "$PYTHON is "
+    if _which $OVERRIDE_PYTHON >/dev/null 2>&1; then
+    	PYTHON=`_which $OVERRIDE_PYTHON`
+	echo $PYTHON is \\\c
     	if $PYTHON inst/acceptable_version.py $SUPPORTED_VERSION $SUPPORTED_PATCHLEVEL; then
 	    echo This is an acceptable version of Python for this version of Zope.
 	else
@@ -162,8 +175,8 @@
 echo
 
 # Establish a software name.
-if test x$OVERRIDE_SOFTWARE_NAME == x; then
-    if test x$TMPDIR == x; then
+if test x$OVERRIDE_SOFTWARE_NAME = x; then
+    if test x$TMPDIR = x; then
 	TMPDIR=/tmp
     fi
     $PYTHON inst/software_name.py > $TMPDIR/configure.$$
@@ -174,7 +187,7 @@
     REGISTER_DEFAULT=0
 fi
 echo Installing this version of Zope with the software name $SOFTWARE_NAME.
-if test $REGISTER_DEFAULT == 1; then
+if test x$REGISTER_DEFAULT = x1; then
     echo This version of Zope will be registered as your system\'s default Zope 
     echo version.
 fi