SConstruct (5341:4efeab4cc2a5) | SConstruct (5342:c19e3a1a607c) |
---|---|
1# -*- mode:python -*- 2 3# Copyright (c) 2004-2005 The Regents of The University of Michigan 4# All rights reserved. 5# 6# Redistribution and use in source and binary forms, with or without 7# modification, are permitted provided that the following conditions are 8# met: redistributions of source code must retain the above copyright --- 52 unchanged lines hidden (view full) --- 61# file), you can use 'scons -h' to print all the M5-specific build 62# options as well. 63# 64################################################### 65 66import sys 67import os 68 | 1# -*- mode:python -*- 2 3# Copyright (c) 2004-2005 The Regents of The University of Michigan 4# All rights reserved. 5# 6# Redistribution and use in source and binary forms, with or without 7# modification, are permitted provided that the following conditions are 8# met: redistributions of source code must retain the above copyright --- 52 unchanged lines hidden (view full) --- 61# file), you can use 'scons -h' to print all the M5-specific build 62# options as well. 63# 64################################################### 65 66import sys 67import os 68 |
69from os.path import isdir, join as joinpath | 69from os.path import isdir, isfile, join as joinpath |
70 71import SCons 72 73# Check for recent-enough Python and SCons versions. If your system's 74# default installation of Python is not recent enough, you can use a 75# non-default installation of the Python interpreter by either (1) 76# rearranging your PATH so that scons finds the non-default 'python' 77# first or (2) explicitly invoking an alternative interpreter on the --- 438 unchanged lines hidden (view full) --- 516nonsticky_opts = Options(args=ARGUMENTS) 517Export('nonsticky_opts') 518 519# Walk the tree and execute all SConsopts scripts that wil add to the 520# above options 521for base_dir in base_dir_list: 522 for root, dirs, files in os.walk(base_dir): 523 if 'SConsopts' in files: | 70 71import SCons 72 73# Check for recent-enough Python and SCons versions. If your system's 74# default installation of Python is not recent enough, you can use a 75# non-default installation of the Python interpreter by either (1) 76# rearranging your PATH so that scons finds the non-default 'python' 77# first or (2) explicitly invoking an alternative interpreter on the --- 438 unchanged lines hidden (view full) --- 516nonsticky_opts = Options(args=ARGUMENTS) 517Export('nonsticky_opts') 518 519# Walk the tree and execute all SConsopts scripts that wil add to the 520# above options 521for base_dir in base_dir_list: 522 for root, dirs, files in os.walk(base_dir): 523 if 'SConsopts' in files: |
524 print "Reading", os.path.join(root, 'SConsopts') 525 SConscript(os.path.join(root, 'SConsopts')) | 524 print "Reading", joinpath(root, 'SConsopts') 525 SConscript(joinpath(root, 'SConsopts')) |
526 527all_isa_list.sort() 528all_cpu_list.sort() 529default_cpus.sort() 530 531sticky_opts.AddOptions( 532 EnumOption('TARGET_ISA', 'Target ISA', 'alpha', all_isa_list), 533 BoolOption('FULL_SYSTEM', 'Full-system support', False), --- 173 unchanged lines hidden (view full) --- 707 env = base_env.Copy() 708 709 # Set env options according to the build directory config. 710 sticky_opts.files = [] 711 # Options for $BUILD_ROOT/$BUILD_DIR are stored in 712 # $BUILD_ROOT/options/$BUILD_DIR so you can nuke 713 # $BUILD_ROOT/$BUILD_DIR without losing your options settings. 714 current_opts_file = joinpath(build_root, 'options', build_dir) | 526 527all_isa_list.sort() 528all_cpu_list.sort() 529default_cpus.sort() 530 531sticky_opts.AddOptions( 532 EnumOption('TARGET_ISA', 'Target ISA', 'alpha', all_isa_list), 533 BoolOption('FULL_SYSTEM', 'Full-system support', False), --- 173 unchanged lines hidden (view full) --- 707 env = base_env.Copy() 708 709 # Set env options according to the build directory config. 710 sticky_opts.files = [] 711 # Options for $BUILD_ROOT/$BUILD_DIR are stored in 712 # $BUILD_ROOT/options/$BUILD_DIR so you can nuke 713 # $BUILD_ROOT/$BUILD_DIR without losing your options settings. 714 current_opts_file = joinpath(build_root, 'options', build_dir) |
715 if os.path.isfile(current_opts_file): | 715 if isfile(current_opts_file): |
716 sticky_opts.files.append(current_opts_file) 717 print "Using saved options file %s" % current_opts_file 718 else: 719 # Build dir-specific options file doesn't exist. 720 721 # Make sure the directory is there so we can create it later 722 opt_dir = os.path.dirname(current_opts_file) | 716 sticky_opts.files.append(current_opts_file) 717 print "Using saved options file %s" % current_opts_file 718 else: 719 # Build dir-specific options file doesn't exist. 720 721 # Make sure the directory is there so we can create it later 722 opt_dir = os.path.dirname(current_opts_file) |
723 if not os.path.isdir(opt_dir): | 723 if not isdir(opt_dir): |
724 os.mkdir(opt_dir) 725 726 # Get default build options from source tree. Options are 727 # normally determined by name of $BUILD_DIR, but can be 728 # overriden by 'default=' arg on command line. 729 default_opts_file = joinpath('build_opts', 730 ARGUMENTS.get('default', build_dir)) | 724 os.mkdir(opt_dir) 725 726 # Get default build options from source tree. Options are 727 # normally determined by name of $BUILD_DIR, but can be 728 # overriden by 'default=' arg on command line. 729 default_opts_file = joinpath('build_opts', 730 ARGUMENTS.get('default', build_dir)) |
731 if os.path.isfile(default_opts_file): | 731 if isfile(default_opts_file): |
732 sticky_opts.files.append(default_opts_file) 733 print "Options file %s not found,\n using defaults in %s" \ 734 % (current_opts_file, default_opts_file) 735 else: 736 print "Error: cannot find options file %s or %s" \ 737 % (current_opts_file, default_opts_file) 738 Exit(1) 739 --- 67 unchanged lines hidden --- | 732 sticky_opts.files.append(default_opts_file) 733 print "Options file %s not found,\n using defaults in %s" \ 734 % (current_opts_file, default_opts_file) 735 else: 736 print "Error: cannot find options file %s or %s" \ 737 % (current_opts_file, default_opts_file) 738 Exit(1) 739 --- 67 unchanged lines hidden --- |