Changeset 9371c30 in mainline
- Timestamp:
- 2005-12-06T20:53:03Z (19 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 36e7b6c3
- Parents:
- 090e7ea1
- Files:
-
- 5 deleted
- 6 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
Makefile
r090e7ea1 r9371c30 37 37 RELEASE = $(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION) 38 38 39 ## Make some default assumptions39 ## Include configuration 40 40 # 41 41 42 ifndef ARCH 43 ARCH = ia32 44 endif 42 include Makefile.config 45 43 46 44 ## Common compiler flags … … 59 57 # 60 58 61 include Makefile.config62 59 include arch/$(ARCH)/Makefile.inc 63 60 include genarch/Makefile.inc -
arch/ia32/Makefile.inc
r090e7ea1 r9371c30 39 39 # 40 40 41 ifndef CPU42 CPU = pentium441 ifndef IA32_CPU 42 IA32_CPU = pentium4 43 43 endif 44 44 45 DEFS += -D_CPU=${ CPU}45 DEFS += -D_CPU=${IA32_CPU} 46 46 47 47 ## Accepted CPUs 48 48 # 49 49 50 ifeq ($( CPU),athlon-xp)50 ifeq ($(IA32_CPU),athlon-xp) 51 51 CFLAGS += -march=athlon-xp -mmmx -msse -m3dnow 52 52 DEFS += -DCONFIG_FENCES_P3 … … 54 54 CONFIG_HT = n 55 55 endif 56 ifeq ($( CPU),athlon-mp)56 ifeq ($(IA32_CPU),athlon-mp) 57 57 CFLAGS += -march=athlon-mp -mmmx -msse -m3dnow 58 58 DEFS += -DCONFIG_FENCES_P3 59 59 CONFIG_HT = n 60 60 endif 61 ifeq ($( CPU),pentium3)61 ifeq ($(IA32_CPU),pentium3) 62 62 CFLAGS += -march=pentium3 -mmmx -msse 63 63 DEFS += -DCONFIG_FENCES_P3 64 64 CONFIG_HT = n 65 65 endif 66 ifeq ($( CPU),prescott)66 ifeq ($(IA32_CPU),prescott) 67 67 CFLAGS += -march=pentium4 -mfpmath=sse -mmmx -msse -msse2 -msse3 68 68 DEFS += -DCONFIG_FENCES_P4 69 69 endif 70 ifeq ($( CPU),pentium4)70 ifeq ($(IA32_CPU),pentium4) 71 71 CFLAGS += -march=pentium4 -mfpmath=sse -mmmx -msse -msse2 72 72 DEFS += -DCONFIG_FENCES_P4 -
arch/mips32/Makefile.inc
r090e7ea1 r9371c30 37 37 # 38 38 39 ifndef M ACHINE40 M ACHINE = msim39 ifndef MIPS_MACHINE 40 MIPS_MACHINE = msim 41 41 endif 42 42 … … 45 45 INIT_SIZE = 65536 46 46 CFLAGS += -mno-abicalls -G 0 -fno-zero-initialized-in-bss 47 DEFS += -DMACHINE=${M ACHINE} -DKERNEL_LOAD_ADDRESS=${KERNEL_LOAD_ADDRESS} -DINIT_ADDRESS=${INIT_ADDRESS} -DINIT_SIZE=${INIT_SIZE}47 DEFS += -DMACHINE=${MIPS_MACHINE} -DKERNEL_LOAD_ADDRESS=${KERNEL_LOAD_ADDRESS} -DINIT_ADDRESS=${INIT_ADDRESS} -DINIT_SIZE=${INIT_SIZE} 48 48 49 49 ## Accepted MACHINEs 50 50 # 51 51 52 ifeq ($(M ACHINE),indy)52 ifeq ($(MIPS_MACHINE),indy) 53 53 # GCC 4.0.1 compiled for mipsEL has problems compiling in 54 54 # BigEndian mode with the swl/swr/lwl/lwr instructions. … … 62 62 CFLAGS += -EB -DBIG_ENDIAN -DHAVE_FPU -march=r4600 63 63 endif 64 ifeq ($(M ACHINE),lgxemul)64 ifeq ($(MIPS_MACHINE),lgxemul) 65 65 BFD_NAME=elf32-tradlittlemips 66 66 BFD = ecoff-littlemips 67 67 CFLAGS += -DHAVE_FPU -mips3 68 68 endif 69 ifeq ($(M ACHINE),bgxemul)69 ifeq ($(MIPS_MACHINE),bgxemul) 70 70 BFD_NAME=elf32-bigmips 71 71 BFD = ecoff-bigmips … … 74 74 CFLAGS += -EB -DBIG_ENDIAN -DHAVE_FPU -mips3 75 75 endif 76 ifeq ($(M ACHINE),msim4kc)76 ifeq ($(MIPS_MACHINE),msim4kc) 77 77 # MSIM needs lwl/swl patch & 4kc instruction patch to work 78 78 # otherwise add -mmemcpy -mips3 … … 82 82 CFLAGS += -mhard-float -march=4kc 83 83 endif 84 ifeq ($(M ACHINE),simics)84 ifeq ($(MIPS_MACHINE),simics) 85 85 # SIMICS 4kc emulation is broken, although for instructions 86 86 # that do not bother us … … 90 90 CFLAGS += -mhard-float -mips3 91 91 endif 92 ifeq ($(M ACHINE),msim)92 ifeq ($(MIPS_MACHINE),msim) 93 93 BFD_NAME = elf32-tradlittlemips 94 94 BFD = binary 95 95 CFLAGS += -mhard-float -mips3 96 96 endif 97 98 ## Own configuration directives99 #100 101 CONFIG_OFW = y102 97 103 98 ## Accepted configuration directives -
kernel.config
r090e7ea1 r9371c30 1 1 ## General configuration directives 2 3 # Architecture 4 @ "ia32" Intel IA32 5 @ "amd64" Intel ET64/AMD64 6 @ "ia64" Intel IA64 7 @ "mips32" MIPS 32-bit 8 @ "ppc32" PowerPC 32-bit 9 @ "sparc64" Sun UltraSparc 64-bit 10 ! ARCH (choice) 11 12 %ASKDEFAULT 13 14 # IA32 Compiler 15 @ "cross" Cross-compiler 16 @ "native" Native 17 ! [ARCH=ia32] IA32_COMPILER (choice) 18 % [ARCH=ia32] SAVEAS IA32_COMPILER COMPILER 19 20 # AMD64 Compiler 21 @ "cross" Cross-compiler 22 @ "native" Native 23 ! [ARCH=amd64] AMD64_COMPILER (choice) 24 % [ARCH=amd64] SAVEAS AMD64_COMPILER COMPILER 25 26 # Compiler 27 @ "cross" Cross-compiler 28 @ "native" Native 29 ! [(ARCH!=amd64)&(ARCH!=ia32)] OTHER_COMPILER (choice) 30 % [(ARCH!=amd64)&(ARCH!=ia32)] SAVEAS OTHER_COMPILER COMPILER 31 32 33 # CPU type 34 @ "pentium4" Pentium 4 35 @ "pentium3" Pentium 3 36 @ "athlon-xp" Athlon XP 37 @ "athlon-mp" Athlon MP 38 @ "prescott" Prescott 39 ! [ARCH=ia32] IA32_CPU (choice) 2 40 3 41 # Support for SMP … … 5 43 6 44 # Improved support for hyperthreading 7 ! [ ARCH=ia32|ARCH=amd64] CONFIG_HT (y/n)45 ! [(ARCH=ia32|ARCH=amd64)&CONFIG_SMP=y] CONFIG_HT (y/n) 8 46 9 47 # Lazy FPU context switching 10 48 ! CONFIG_FPU_LAZY (y/n) 49 50 # MIPS Machine Type 51 @ "msim" MSIM Simulator 52 @ "msim4kc" MSIM Simulator with 4kc instruction set 53 @ "simics" Virtutech Simics simulator 54 @ "lgxemul" GXEmul Little Endian 55 @ "bgxemul" GXEmul Big Endian 56 @ "indy" SGI Indy 57 ! [ARCH=mips32] MIPS_MACHINE (choice) 11 58 12 59 ## Debugging configuration directives -
tools/build
r090e7ea1 r9371c30 3 3 function syntax { 4 4 echo "Syntax:" 5 echo " build.<arch> [-compiler <compiler>] [-cpu <cpu>] [-machine <machine>]" 6 echo 7 echo "<arch> ... amd64, ia32, ia64, mips32, ppc32, sparc64" 8 echo "<compiler> ... native, *cross" 9 echo "<cpu> ... for ia32: athlon-xp, athlon-mp, pentium3, *pentium4, prescott" 10 echo "<machine> ... for mips32: *msim, msim4kc, simics, lgxemul, bgxemul, indy" 5 echo " build " 11 6 echo 12 7 } 13 14 ARCH="`basename "$0" | awk -F. '{ if (NF > 1) print \$NF }'`"15 if [ -z "$ARCH" ]; then16 syntax17 exit 118 fi19 8 20 9 ARGS="" 21 10 while [ "$#" -gt 0 ]; do 22 11 case "$1" in 23 -compiler)24 if [ -z "$2" ]; then25 syntax26 exit 127 fi28 ARGS="$ARGS COMPILER=$2"29 shift30 ;;31 -cpu)32 if [ -z "$2" ]; then33 syntax34 exit 135 fi36 ARGS="$ARGS CPU=$2"37 shift38 ;;39 -machine)40 if [ -z "$2" ]; then41 syntax42 exit 143 fi44 ARGS="$ARGS MACHINE=$2"45 shift46 ;;47 12 *) 48 13 syntax … … 61 26 fi 62 27 63 tools/config.py $ARCHdefault64 make all " ARCH=$ARCH" "TAG=$TAG" $ARGS28 tools/config.py default 29 make all "TAG=$TAG" $ARGS -
tools/config.py
r090e7ea1 r9371c30 187 187 188 188 def check_condition(text, defaults): 189 "Check that the condition specified on input line is True" 190 result = False 189 result = True 190 conds = text.split('&') 191 for cond in conds: 192 if cond.startswith('(') and cond.endswith(')'): 193 cond = cond[1:-1] 194 if not check_dnf(cond, defaults): 195 return False 196 return True 197 198 def check_dnf(text, defaults): 199 """ 200 Check that the condition specified on input line is True 201 202 only CNF is supported 203 """ 191 204 conds = text.split('|') 192 205 for cond in conds: 193 condname,condval = cond.split('=') 206 res = re.match(r'^(.*?)(!?=)(.*)$', cond) 207 if not res: 208 raise RuntimeError("Invalid condition: %s" % cond) 209 condname = res.group(1) 210 oper = res.group(2) 211 condval = res.group(3) 194 212 if not defaults.has_key(condname): 195 213 raise RuntimeError("Condition var %s does not exist: %s" % \ 196 (condname, line))197 # None means wildcard 198 if defaults[condname] is None:214 (condname,text)) 215 216 if oper=='=' and condval == defaults[condname]: 199 217 return True 200 if condval == defaults[condname]:218 if oper == '!=' and condval != defaults[condname]: 201 219 return True 202 220 return False … … 214 232 default = None 215 233 choices = [] 216 for line in f: 234 for line in f: 235 if line.startswith('%'): 236 res = re.match(r'^%\s*(?:\[(.*?)\])?\s*(.*)$', line) 237 if not res: 238 raise RuntimeError('Invalid command: %s' % line) 239 if res.group(1): 240 if not check_condition(res.group(1), defaults): 241 continue 242 args = res.group(2).strip().split(' ') 243 cmd = args[0].lower() 244 args = args[1:] 245 if cmd == 'askdefault': 246 if isinstance(dlg, DefaultDialog): 247 continue 248 res = dlg.noyes('Change kernel configuration') 249 if res == 'n': 250 dlg = DefaultDialog(dlg) 251 elif cmd == 'saveas': 252 outf.write('%s = %s\n' % (args[1],defaults[args[0]])) 253 254 continue 255 217 256 if line.startswith('!'): 218 257 # Ask a question … … 229 268 if default is not None: 230 269 outf.write('#!# %s = %s\n' % (varname, default)) 270 # Clear cumulated values 271 comment = '' 272 default = None 273 choices = [] 231 274 continue 232 275 … … 278 321 279 322 def main(): 280 defaults = { 'ARCH':None}323 defaults = {} 281 324 try: 282 325 dlg = Dialog() … … 286 329 # Default run will update the configuration file 287 330 # with newest options 288 if len(sys.argv) >= 2: 289 defaults['ARCH'] = sys.argv[1] 290 if len(sys.argv) == 3 and sys.argv[2]=='default': 331 if len(sys.argv) == 2 and sys.argv[1]=='default': 291 332 dlg = DefaultDialog(dlg) 292 333
Note:
See TracChangeset
for help on using the changeset viewer.