#!/bin/sh
#*=====================================================================*/
#*    serrano/prgm/project/bigloo/autoconf/unix                        */
#*    -------------------------------------------------------------    */
#*    Author      :  Manuel Serrano                                    */
#*    Creation    :  Wed Oct 22 11:07:08 1997                          */
#*    Last change :  Wed Jul 18 08:00:14 2001 (serrano)                */
#*    -------------------------------------------------------------    */
#*    Setting bigloo.h up for Unix parameters.                         */
#*=====================================================================*/
fmt=c

#*---------------------------------------------------------------------*/
#*    We parse the arguments                                           */
#*---------------------------------------------------------------------*/
while : ; do
  case $1 in
    "")
      break;;

    --user=*)
      user="`echo $1 | sed 's/^[-a-z]*=//'`";;

    --cc=*|-cc=*)
      cc="`echo $1 | sed 's/^[-a-z]*=//'`";;

    --cflags=*|-cflags=*)
      cflags="`echo $1 | sed 's/^[-a-z]*=//'`";;

    --jvm|-jvm)
      fmt="jvm";;

    -*)
      echo "Unknown option \"$1\", ignored" >&2;;
  esac
  shift
done

#*---------------------------------------------------------------------*/
#*    Uname parameters                                                 */
#*---------------------------------------------------------------------*/
if eval 'uname > /dev/null 2> /dev/null'; then
  osname=`uname -s`
  osarch=`uname -m`
  osversion=`uname -r`
else
  osname="unknown"
  osarch="unknown"
  osversion="unknown"
fi

if [ $fmt = "c" ]; then
  # the kind of OS, Unix of course
  echo "#define OS_CLASS \"unix\""
  
  # The name of the OS
  echo "#define OS_NAME \"$osname\""
  
  # The architecture
  echo "#define OS_ARCH \"$osarch\""
  
  # the Os version
  echo "#define OS_VERSION \"$osversion\""
  
  # the temporary directory
  echo "#define OS_TMP \"/tmp\""
  
  # the file separator
  echo "#define FILE_SEPARATOR '/'"
  
  # the path separator
  echo "#define PATH_SEPARATOR ':'"
  
  # the static library suffixes
  echo "#define STATIC_LIB_SUFFIX \"a\""
  
  # the shard library suffixes
  echo "#define SHARED_LIB_SUFFIX \"so\""
  
  # Is it possible to directly print UCS2 characters
  echo "#define UCS2_DISPLAYABLE 0"
else
  # the kind of OS, Unix of course
  echo "  static public byte[] OS_CLASS = \"unix\".getBytes();"
  
  # The name of the OS
  echo "  static public byte[] OS_NAME = \"$osname\".getBytes();"
  
  # The architecture
  echo "  static public byte[] OS_ARCH = \"$osarch\".getBytes();"
  
  # the Os version
  echo "  static public byte[] OS_VERSION = \"$osversion\".getBytes();"
  
  # the temporary directory
  echo "  static public byte[] OS_TMP = \"/tmp\".getBytes();"
  
  # the file separator
  echo "  static public byte FILE_SEPARATOR = (byte)'/';"
  
  # the path separator
  echo "  static public byte PATH_SEPARATOR = (byte)':';"
  
  # the static library suffixes
  echo "  static public byte[] STATIC_LIB_SUFFIX = \"a\".getBytes();"
  
  # the shard library suffixes
  echo "  static public byte[] SHARED_LIB_SUFFIX = \"so\".getBytes();"
  
  # Is it possible to directly print UCS2 characters
  echo "  static public boolean UCS2_DISPLAYABLE = true;"
fi

