get_makepars 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  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. case $ACM in
  67. sun3|sparc)
  68. ed -s make_macros <<'EOF'
  69. /cc-and-mkdep.sun/s/^..//
  70. w
  71. q
  72. EOF
  73. ;;
  74. esac
  75. cat $FDIR/util_comp >> make_macros
  76. else
  77. case $know_target in
  78. 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
  79. ;;
  80. *) if [ -f /bin/ranlib -o -f /usr/bin/ranlib -o -f /usr/ucb/ranlib ]
  81. then
  82. sed "s/^COPTIONS.*\$/COPTIONS=-O -D_EM_WSIZE=$WS -D_EM_PSIZE=$PS -D__${MACH}__/" < $FDIR/target_comp >> make_macros
  83. else
  84. 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
  85. fi
  86. ;;
  87. esac
  88. sed "s/^#U/U/" < $FDIR/util_comp >> make_macros
  89. fi
  90. cat $FDIR/lint_params >> make_macros
  91. echo "A file called 'make_macros' has been created. This file defines some
  92. 'make' variables that parameterize all Makefiles in ACK. You may want
  93. to check it before attempting to actually install ACK."
  94. case $know_target in
  95. 0) echo "In fact, this installation script does not know much about
  96. your target machine, so expect some things to be wrong"
  97. ;;
  98. esac