#! /bin/sh
# $Id: configure,v 1.12 2006/07/17 04:37:47 lloydwood Exp $

echo
echo "SaVi: You need to read the savi-dev/README file."
echo "A brief getting-started summary is given here:"
echo "  cd savi-dev; make ARCH=linux; ./savi"
echo "Replace ARCH value with the name of another platform"
echo "(sun, irix, cygwin or freebsd) if needed."

if [ -f /etc/debian_version ]; then
  echo "This appears to be Debian Linux. Try building SaVi with:"
  echo "  make ARCH=debian"
  echo "You may need to edit savi-dev/src/Makefile_defs_debian to build."
elif [ -f /vmlinuz -o -f /boot/vmlinuz ]; then
  echo "This appears to be a Linux operating system. Try building SaVi with:"
  echo "  make ARCH=linux"
  echo "You may need to edit savi-dev/src/Makefile_defs_linux to build."
elif [ -d /devices ]; then
  echo "This appears to be a Sun Solaris operating system. Try building SaVi with:"
  echo "  make ARCH=sun"
  echo "You may need to edit savi-dev/src/Makefile_defs_sun to build."
elif [ -d /usr/bsd -a -d /usr/sbin ]; then
  echo "This may be an Irix operating system. Try building SaVi with:"
  echo "  make ARCH=irix"
  echo "You may need to edit savi-dev/src/Makefile_defs_irix to build."
elif [ -d /cygdrive ]; then
  echo "This appears to be using Cygwin. Try building SaVi with:"
  echo "  make ARCH=cygwin"
  echo "You may need to edit savi-dev/src/Makefile_defs_cygwin to build."
elif [ -d /sys/boot ]; then
  echo "This appears to be a FreeBSD operating system. Try building SaVi with:"
  echo "make ARCH=freebsd"
  echo "You may need to edit savi-dev/src/Makefile_defs_freebsd to build."
  echo "You may also need to edit savi-dev/tcl/Makefile where commented."
else
  echo "This system isn't familiar. You could try building SaVi with just:"
  echo "  make"
  echo "You may need to edit the generic savi-dev/src/Makefile_defs_ to build."
fi

if [ -f /usr/include/zlib.h -o -f /usr/local/include/zlib.h ] ; then
  echo
  echo "zlib appears to be installed on this system."
  echo "You can edit savi-dev/src/Makefile to remove the -DNO_ZLIB flag."
  echo "This improves texturemapping performance with Geomview, as described"
  echo "in the README-COVERAGE-TEXTUREMAP file."
fi

echo
echo "You will also need to edit the savi-dev/savi wrapper script that runs"
echo "the SaVi binary to set environment variables appropriately."
echo "You may need to edit the Tcl/Tk library locations set in this ./savi"
echo "script by TCL_LIBRARY and TK_LIBRARY when building dynamically."
echo
echo "The ./savi wrapper script sets \$SAVI to the location"
echo "of the savi-dev/ directory that contains files all SaVi"
echo "binaries need, and also contains the README file that you"
echo "need to read. Always run SaVi with the ./savi wrapper script."
echo
echo -n "Welcome to SaVi development! "
echo "Enjoy playing with SaVi!"
