home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 3: Developer Tools / Linux Cubed Series 3 - Developer Tools.iso / devel / lang / forth / pfe-0.000 / pfe-0 / pfe-0.9.13 / src / config.sh < prev    next >
Encoding:
Linux/UNIX/POSIX Shell Script  |  1995-05-20  |  2.9 KB  |  130 lines

  1. #!/bin/sh
  2. #
  3. # config.sh ---    Script to configure the Portable Forth Environment
  4. #        automatically.
  5. #
  6. # Please execute `config.sh' like this:
  7. #
  8. #    sh ./config.sh [system]
  9. #
  10. #   If your `sh' doesn't know shell functions, then use ksh or one of
  11. #   the many free shells ash, bash, pd-ksh or zsh.
  12. #   On OS/2 I used bash112 (ms_shell doesn't work) but I got errors as
  13. #   long as this script contained carriage returns. After changing all
  14. #   CF/LF to LF only (recode ibmpc:latin1) everything was fine.
  15. #
  16. #   If no system is specified:
  17. #
  18. #    the script tries to detect what kind of system you use,
  19. #    using the command uname (available on most unices) or
  20. #    by testing certain system specific environment variables.
  21. #    The system name must be a single word that can be used in
  22. #    a `#define name' statement.
  23. #
  24. #   Available system names are: (* detected automatically)
  25. #
  26. #    * Linux
  27. #      FreeBSD    FreeBSD(*) or BSD386 or NetBSD
  28. #    * EMX        DOS or OS/2 with gcc and EMX DOS extender
  29. #      WATCOM    Watcom C, set TARGET in the Makefile!
  30. #    * AIX1        AIX version 1.2 on PS/2
  31. #    * AIX3        AIX version 3.x on RS/6000
  32. #    * HPUX        HP-UX 8.x or later on HP9000/4x or HP9000/[78]x
  33. #    * NeXTstep    for Intel
  34. #    * SunOS        SunOS 4.3, maybe also Solaris 2.4 but not 2.3
  35. #    * ULTRIX    DEC ULTRIX RISC 4.3 on DecStation
  36. #    * OSF1        DEC OSF1 2.x on DEC Alpha workstation
  37. #
  38. # Check if the two files generated by this script:
  39. #
  40. #    Makefile
  41. #    config.h
  42. #
  43. # describe your system adequately. Maybe Makefile contains more compilation
  44. # hints and user settable options (at least a PREFIX indicating where pfe
  45. # should look for help files). Please read Makefile before making.
  46. #
  47. # Then build pfe by typing `make'. Good luck.
  48. #
  49. # (duz 15Mar95)
  50. #
  51.  
  52.  
  53. #until [ $# -eq 0 ]
  54. #do
  55. #  case $1 in
  56. #    PREFIX=*|--prefix=*)
  57. #    PREFIX=`echo $1 | cut -d'=' -f2` ;;
  58. #    *)
  59. #    break ;;
  60. #  esac
  61. #  shift
  62. #done
  63.  
  64. case $# in
  65.   0)
  66.     if [ -n "$OS2_SHELL" ]; then system=EMX
  67.     elif uname > /dev/null; then system=`uname`; unamea=`uname -a`
  68.     elif [ -n "$OSTYPE" ];  then system=$OSTYPE
  69.     else
  70.       echo "What kind of system do you use? "
  71.       read system
  72.     fi ;;
  73.   1)
  74.     system=$1 ;;
  75.   *)
  76.     echo "usage: sh ./config.sh [ --prefix=directory ] [system]" >&2
  77.     exit ;;
  78. esac
  79.  
  80.  
  81. case $system in
  82.   AIX)
  83.     # two versions are supported
  84.     case `uname -m` in
  85.       i?86) system=AIX1 ;;
  86.       *)    system=AIX3 ;;
  87.     esac
  88.     ;;
  89.   HP-UX)
  90.     case `uname -m` in
  91.       9000/[34]*) system=HPUX68K  ;;
  92.       9000/[78]*) system=HPUXRISC ;;
  93.     esac
  94.     ;;
  95.   NeXTStep)
  96.     # Convert uname output for NeXTStep on Next hardware.
  97.     system=NeXTstep ;;
  98. esac
  99. echo "Configuring pfe for $system..." >&2
  100.  
  101.  
  102. #
  103. # Create `Makefile':
  104. #
  105.  
  106. for part in header basics options rules depend
  107. do
  108.   if [ -f config/$system/$part.mk ]
  109.   then
  110.     cat config/$system/$part.mk
  111.   else
  112.     cat config/default/$part.mk
  113.   fi
  114. done > Makefile
  115.  
  116.  
  117. #
  118. # Create `config.h'
  119. #
  120.  
  121. if [ -f config/$system/config.h ]
  122. then
  123.   cp -p config/$system/config.h .
  124. else
  125.   . ./guesscfg.sh $system
  126. fi
  127.  
  128. echo "Configuration created." >&2
  129. exit 0
  130.