get_makepars 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. know_target=0
  2. case $SYSNAME in
  3. vax*|i386|sun*|sparc|m68_sysV_0|m68020|mantra|pmds4|m68k4)
  4. WS=4 ; PS=4
  5. know_target=1
  6. ;;
  7. m68_unisoft|m68k2|minixST|pmds)
  8. WS=2 ; PS=4
  9. know_target=1
  10. ;;
  11. i86|minix|xenix3)
  12. WS=2 ; PS=2
  13. know_target=1
  14. ;;
  15. *) if [ $TARGET_HOME = $UTIL_HOME ]
  16. then
  17. : We can find out ourselves what the word-size and
  18. : the pointer-size of the target machine is.
  19. cat > ws.c <<'EOF'
  20. #include <stdio.h>
  21. main()
  22. {
  23. printf("WS=%d ; PS=%d\n", sizeof(int), sizeof(char *));
  24. exit(0);
  25. }
  26. EOF
  27. cc ws.c 2>/dev/null
  28. a.out > t$$
  29. . t$$
  30. rm -f t$$ a.out ws.[co]
  31. else
  32. : we will have to ask installer.
  33. ./echo -n "Please give the word-size of the target-machine (sizeof(int)) in bytes: [$WS] "
  34. . $FDIR/get_answer
  35. case $ANS in
  36. '') ANS="$WS";;
  37. esac
  38. WS="$ANS"
  39. ./echo -n "Please give the pointer-size of the target-machine (sizeof(char *)) in bytes: [$PS] "
  40. . $FDIR/get_answer
  41. case $ANS in
  42. '') ANS="$PS";;
  43. esac
  44. PS="$ANS"
  45. fi
  46. ;;
  47. esac
  48. echo "# Paths:
  49. SRC_HOME = $SRC_HOME
  50. TARGET_HOME = $TARGET_HOME
  51. UTIL_HOME = $UTIL_HOME
  52. # Machine independent part created?
  53. DO_MACHINE_INDEP = $DO_MACHINE_INDEP
  54. " > make_macros
  55. if [ $TARGET_HOME = $UTIL_HOME ]
  56. then
  57. sed "s/^COPTIONS.*\$/COPTIONS=-O -D_EM_WSIZE=$WS -D_EM_PSIZE=$PS/" < $FDIR/target_comp >> make_macros
  58. if [ -f /bin/arch ]
  59. then
  60. case `/bin/arch` in
  61. sun3|sun4)
  62. ed - make_macros <<'EOF'
  63. /cc-and-mkdep.sun/s/^..//
  64. w
  65. q
  66. EOF
  67. ;;
  68. esac
  69. fi
  70. cat $FDIR/util_comp >> make_macros
  71. else
  72. case $knowtarget in
  73. 1) sed -e "s/^COPTIONS.*\$/COPTIONS=-O -D_EM_WSIZE=$WS -D_EM_PSIZE=$PS/" -e "/cc-and-mkdep.ack/s/^..//" -e "s/^CC=cc/CC=acc -m$ACM" -e "s/^# AR=aal/AR=aal/" -e "s/^# RANLIB=:/RANLIB=:/" < $FDIR/target_comp >> make_macros
  74. ;;
  75. *) sed "s/^COPTIONS.*\$/COPTIONS=-O -D_EM_WSIZE=$WS -D_EM_PSIZE=$PS/" < $FDIR/target_comp >> make_macros
  76. ;;
  77. esac
  78. sed "s/^#U/U/" < $FDIR/util_comp >> make_macros
  79. fi
  80. cat $FDIR/lint_params >> make_macros
  81. echo "A file called 'make_macros' has been created. This file defines some
  82. 'make' variables that parameterize all Makefiles in ACK. You may want
  83. to check it before attempting to actually install ACK."
  84. case $knowtarget in
  85. 0) echo "In fact, this installation script does not know much about
  86. your target machine, so expect some things to be wrong"
  87. ;;
  88. esac