home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 3 / AACD03.BIN / AACD / Programming / sofa / archive / SmallEiffel.lha / SmallEiffel / misc / GC.SH < prev    next >
Linux/UNIX/POSIX Shell Script  |  1999-06-05  |  1KB  |  61 lines

  1. #!/bin/sh
  2. #
  3. # Try to choose automatically the good SmallEiffel/sys/gc_lib/*.c
  4. # file for the Garbage Collector on a Unix system.
  5. #
  6. sed=${SmallEiffel:=1}
  7. if [ ${sed} = 1 ];  then 
  8.    echo Please set the environment Variable \'SmallEiffel\' with
  9.    echo the absolute path of file SmallEiffel/sys/system.se
  10.    exit 1
  11. fi
  12. if [ -d ${SmallEiffel} ]; then 
  13.    echo Since release -0.79 the value of the environment
  14.    echo variable SmallEiffel should be the absolute path of
  15.    echo file SmallEiffel/sys/system.se
  16.    echo Trying to fix this automatically.
  17.    SmallEiffel=${SmallEiffel}/sys/system.se
  18. fi
  19. if [ ! -f ${SmallEiffel} ]; then
  20.    echo File ${SmallEiffel} not found.
  21.    echo Please check the value of the environment Variable
  22.    echo \'SmallEiffel\' wich must be the absolute path of 
  23.    echo the file SmallEiffel/sys/system.se
  24.    exit 1
  25. fi
  26. SE=`dirname $SmallEiffel`
  27. SE=`dirname $SE`
  28. if [ -f ${SE} ]; then
  29.    echo ${SE} "not found."
  30.    exit 1
  31. fi
  32. cd ${SE}/sys
  33. if [ `uname` = Linux ]
  34.  then
  35.   gc=linux.c
  36. elif [ `uname` = FreeBSD ]
  37.  then
  38.   gc=freebsd.c
  39. elif [ `uname` = SunOS ]
  40.  then
  41.   gc=sparc.c
  42. elif [ `uname` = OSF1 ]
  43.  then
  44.   gc=alpha.c
  45. elif [ `uname` = HP-UX ]
  46.  then
  47.   gc=hp-pa.c
  48. elif [ `uname` = AIX ]
  49.  then
  50.   gc=aix.c
  51. else
  52.   echo GC is not supported for this architecture.
  53.   echo Read file ${SE}/sys/gc to try to fix this.
  54.   gc="NONE"
  55. fi
  56. echo GC for ${gc} selected \(${SE}/sys/gc updated\).
  57. /bin/rm -rf gc_tmp
  58. echo ${gc} > gc_tmp
  59. cat gc >> gc_tmp
  60. mv -f gc_tmp gc
  61.