1# $FreeBSD$ 2 3# Set default baseline values of CPUTYPE based on MACHINE_ARCH -- this is 4# the minimum CPU type we support for each architecture 5 6.if ${MACHINE_ARCH} == "i386" 7CPUTYPE ?= i386 8.elif ${MACHINE_ARCH} == "alpha" 9CPUTYPE ?= ev4 10.elif ${MACHINE_ARCH} == "ia64" 11CPUTYPE ?= itanium 12.endif 13 14# Handle aliases (not documented in make.conf to avoid user confusion 15# between e.g. i586 and pentium) 16 17.if ${MACHINE_ARCH} == "i386" 18. if ${CPUTYPE} == "pentiumpro" 19CPUTYPE = i686 20. elif ${CPUTYPE} == "pentium" 21CPUTYPE = i586 22. elif ${CPUTYPE} == "athlon" 23CPUTYPE = k7 24. endif 25.endif 26 27# Logic to set up correct gcc optimization flag. This must be included 28# after /etc/make.conf so it can react to the local value of CPUTYPE 29# defined therein. 30 31.if !defined(NO_CPU_CFLAGS) || !defined(NO_CPU_COPTFLAGS) 32. if ${MACHINE_ARCH} == "i386" 33. if ${CPUTYPE} == "k7" 34_CPUCFLAGS = -march=k6 # gcc doesn't support athlon yet, but it will 35. elif ${CPUTYPE} == "k6-2" 36_CPUCFLAGS = -march=k6 37. elif ${CPUTYPE} == "k6" 38_CPUCFLAGS = -march=k6 39. elif ${CPUTYPE} == "k5" 40_CPUCFLAGS = -march=pentium 41. elif ${CPUTYPE} == "p4" 42_CPUCFLAGS = -march=pentiumpro 43. elif ${CPUTYPE} == "p3" 44_CPUCFLAGS = -march=pentiumpro 45. elif ${CPUTYPE} == "p2" 46_CPUCFLAGS = -march=pentiumpro 47. elif ${CPUTYPE} == "i686" 48_CPUCFLAGS = -march=pentiumpro 49. elif ${CPUTYPE} == "i586/mmx" 50_CPUCFLAGS = -march=pentium 51. elif ${CPUTYPE} == "i586" 52_CPUCFLAGS = -march=pentium 53. elif ${CPUTYPE} == "i486" 54_CPUCFLAGS = -m486 55. endif 56. elif ${MACHINE_ARCH} == "alpha" 57. if ${CPUTYPE} == "ev6" 58_CPUCFLAGS = -mcpu=ev6 59. elif ${CPUTYPE} == "pca56" 60_CPUCFLAGS = -mcpu=pca56 61. elif ${CPUTYPE} == "ev56" 62_CPUCFLAGS = -mcpu=ev56 63. elif ${CPUTYPE} == "ev5" 64_CPUCFLAGS = -mcpu=ev5 65. elif ${CPUTYPE} == "ev45" 66_CPUCFLAGS = -mcpu=ev4 # No -mcpu=ev45 for gcc 67. elif ${CPUTYPE} == "ev4" 68_CPUCFLAGS = -mcpu=ev4 69. endif 70. endif 71.endif 72 73# NB: COPTFLAGS is handled in /usr/src/sys/conf/Makefile.<arch> 74 75.if !defined(NO_CPU_CFLAGS) 76CFLAGS += ${_CPUCFLAGS} 77.endif 78 79# Set up the list of CPU features based on the CPU type. This is an 80# unordered list to make it easy for client makefiles to test for the 81# presence of a CPU feature. 82 83.if ${MACHINE_ARCH} == "i386" 84. if ${CPUTYPE} == "k7" 85MACHINE_CPU = k7 3dnow mmx k6 k5 i586 i486 i386 86. elif ${CPUTYPE} == "k6-2" 87MACHINE_CPU = 3dnow mmx k6 k5 i586 i486 i386 88. elif ${CPUTYPE} == "k6" 89MACHINE_CPU = mmx k6 k5 i586 i486 i386 90. elif ${CPUTYPE} == "k5" 91MACHINE_CPU = k5 i586 i486 i386 92. elif ${CPUTYPE} == "p4" 93MACHINE_CPU = sse i686 mmx i586 i486 i386 94. elif ${CPUTYPE} == "p3" 95MACHINE_CPU = sse i686 mmx i586 i486 i386 96. elif ${CPUTYPE} == "p2" 97MACHINE_CPU = i686 mmx i586 i486 i386 98. elif ${CPUTYPE} == "i686" 99MACHINE_CPU = i686 i586 i486 i386 100. elif ${CPUTYPE} == "i586/mmx" 101MACHINE_CPU = mmx i586 i486 i386 102. elif ${CPUTYPE} == "i586" 103MACHINE_CPU = i586 i486 i386 104. elif ${CPUTYPE} == "i486" 105MACHINE_CPU = i486 i386 106. elif ${CPUTYPE} == "i386" 107MACHINE_CPU = i386 108. endif 109.elif ${MACHINE_ARCH} == "alpha" 110. if ${CPUTYPE} == "ev6" 111MACHINE_CPU = ev6 ev56 pca56 ev5 ev45 ev4 112. elif ${CPUTYPE} == "pca56" 113MACHINE_CPU = pca56 ev56 ev5 ev45 ev4 114. elif ${CPUTYPE} == "ev56" 115MACHINE_CPU = ev56 ev5 ev45 ev4 116. elif ${CPUTYPE} == "ev5" 117MACHINE_CPU = ev5 ev45 ev4 118. elif ${CPUTYPE} == "ev45" 119MACHINE_CPU = ev45 ev4 120. elif ${CPUTYPE} == "ev4" 121MACHINE_CPU = ev4 122. endif 123.elif ${MACHINE_ARCH} == "ia64" 124. if ${CPUTYPE} == "itanium" 125MACHINE_CPU = itanium 126. endif 127.endif 128