get_makepars 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  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. *) trap "rm -f ws.c ws.o a.out t$$" 0 1 2 3 15
  16. cat > ws.c <<'EOF'
  17. #include <stdio.h>
  18. main()
  19. {
  20. printf("WS=%d ; PS=%d\n", sizeof(int), sizeof(char *));
  21. exit(0);
  22. }
  23. EOF
  24. if [ $TARGET_HOME = $UTIL_HOME ] && cc ws.c 2>/dev/null
  25. then
  26. : We can find out ourselves what the word-size and
  27. : the pointer-size of the target machine is.
  28. cc ws.c 2>/dev/null
  29. a.out > t$$
  30. . t$$
  31. rm -f t$$ a.out ws.[co]
  32. else
  33. : we will have to ask installer.
  34. echo $E_FLAG "Please give the word-size of the target-machine (sizeof(int)) in bytes: [$WS] $E_SFX"
  35. . $FDIR/get_answer
  36. case $ANS in
  37. '') ANS="$WS";;
  38. esac
  39. WS="$ANS"
  40. echo $E_FLAG "Please give the pointer-size of the target-machine (sizeof(char *)) in bytes: [$PS] $E_SFX"
  41. . $FDIR/get_answer
  42. case $ANS in
  43. '') ANS="$PS";;
  44. esac
  45. PS="$ANS"
  46. fi
  47. ;;
  48. esac
  49. echo "# Paths:
  50. SRC_HOME = $SRC_HOME
  51. TARGET_HOME = $TARGET_HOME
  52. UTIL_HOME = $UTIL_HOME
  53. # Machine independent part created?
  54. DO_MACHINE_INDEP = $DO_MACHINE_INDEP
  55. # Target machine, only needed for fast compilers
  56. MACH = $MACH
  57. " > make_macros
  58. if [ $TARGET_HOME = $UTIL_HOME ]
  59. then
  60. if [ -f /bin/ranlib -o -f /usr/bin/ranlib -o -f /usr/ucb/ranlib ]
  61. then
  62. sed "s/^COPTIONS.*\$/COPTIONS=-O -D_EM_WSIZE=$WS -D_EM_PSIZE=$PS -D__${MACH}__/" < $FDIR/target_comp >> make_macros
  63. else
  64. sed -e "s/^COPTIONS.*\$/COPTIONS=-O -D_EM_WSIZE=$WS -D_EM_PSIZE=$PS -D__${MACH}__/" -e "s/^# RANLIB=:/RANLIB=:/" < $FDIR/target_comp >> make_macros
  65. fi
  66. if [ -f /bin/arch ]
  67. then
  68. case `/bin/arch` in
  69. sun3|sun4)
  70. ed - make_macros <<'EOF'
  71. /cc-and-mkdep.sun/s/^..//
  72. w
  73. q
  74. EOF
  75. ;;
  76. esac
  77. fi
  78. cat $FDIR/util_comp >> make_macros
  79. else
  80. case $know_target in
  81. 1) sed -e "s/^COPTIONS.*\$/COPTIONS=-O -D_EM_WSIZE=$WS -D_EM_PSIZE=$PS -D__${MACH}__/" -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
  82. ;;
  83. *) if [ -f /bin/ranlib -o -f /usr/bin/ranlib -o -f /usr/ucb/ranlib ]
  84. then
  85. sed "s/^COPTIONS.*\$/COPTIONS=-O -D_EM_WSIZE=$WS -D_EM_PSIZE=$PS -D__${MACH}__/" < $FDIR/target_comp >> make_macros
  86. else
  87. sed -e "s/^COPTIONS.*\$/COPTIONS=-O -D_EM_WSIZE=$WS -D_EM_PSIZE=$PS -D__${MACH}__/" -e "s/^# RANLIB=:/RANLIB=:/" < $FDIR/target_comp >> make_macros
  88. fi
  89. ;;
  90. esac
  91. sed "s/^#U/U/" < $FDIR/util_comp >> make_macros
  92. fi
  93. cat $FDIR/lint_params >> make_macros
  94. echo "A file called 'make_macros' has been created. This file defines some
  95. 'make' variables that parameterize all Makefiles in ACK. You may want
  96. to check it before attempting to actually install ACK."
  97. case $know_target in
  98. 0) echo "In fact, this installation script does not know much about
  99. your target machine, so expect some things to be wrong"
  100. ;;
  101. esac