SConstruct (8152:a6052f50deed) SConstruct (8267:06f3a4cbd585)
1# -*- mode:python -*-
2
3# Copyright (c) 2011 Advanced Micro Devices, Inc.
4# Copyright (c) 2009 The Hewlett-Packard Development Company
5# Copyright (c) 2004-2005 The Regents of The University of Michigan
6# All rights reserved.
7#
8# Redistribution and use in source and binary forms, with or without

--- 953 unchanged lines hidden (view full) ---

962
963 # Make sure the directory is there so we can create it later
964 opt_dir = dirname(current_vars_file)
965 if not isdir(opt_dir):
966 mkdir(opt_dir)
967
968 # Get default build variables from source tree. Variables are
969 # normally determined by name of $VARIANT_DIR, but can be
1# -*- mode:python -*-
2
3# Copyright (c) 2011 Advanced Micro Devices, Inc.
4# Copyright (c) 2009 The Hewlett-Packard Development Company
5# Copyright (c) 2004-2005 The Regents of The University of Michigan
6# All rights reserved.
7#
8# Redistribution and use in source and binary forms, with or without

--- 953 unchanged lines hidden (view full) ---

962
963 # Make sure the directory is there so we can create it later
964 opt_dir = dirname(current_vars_file)
965 if not isdir(opt_dir):
966 mkdir(opt_dir)
967
968 # Get default build variables from source tree. Variables are
969 # normally determined by name of $VARIANT_DIR, but can be
970 # overriden by 'default=' arg on command line.
970 # overridden by '--default=' arg on command line.
971 default = GetOption('default')
971 default = GetOption('default')
972 if not default:
973 default = variant_dir
974 default_vars_file = joinpath('build_opts', default)
975 if isfile(default_vars_file):
972 opts_dir = joinpath(main.root.abspath, 'build_opts')
973 if default:
974 default_vars_files = [joinpath(build_root, 'variables', default),
975 joinpath(opts_dir, default)]
976 else:
977 default_vars_files = [joinpath(opts_dir, variant_dir)]
978 existing_files = filter(isfile, default_vars_files)
979 if existing_files:
980 default_vars_file = existing_files[0]
976 sticky_vars.files.append(default_vars_file)
977 print "Variables file %s not found,\n using defaults in %s" \
978 % (current_vars_file, default_vars_file)
979 else:
981 sticky_vars.files.append(default_vars_file)
982 print "Variables file %s not found,\n using defaults in %s" \
983 % (current_vars_file, default_vars_file)
984 else:
980 print "Error: cannot find variables file %s or %s" \
981 % (current_vars_file, default_vars_file)
985 print "Error: cannot find variables file %s or " \
986 "default file(s) %s" \
987 % (current_vars_file, ' or '.join(default_vars_files))
982 Exit(1)
983
984 # Apply current variable settings to env
985 sticky_vars.Update(env)
986
987 help_texts["local_vars"] += \
988 "Build variables for %s:\n" % variant_dir \
989 + sticky_vars.GenerateHelpText(env)

--- 55 unchanged lines hidden ---
988 Exit(1)
989
990 # Apply current variable settings to env
991 sticky_vars.Update(env)
992
993 help_texts["local_vars"] += \
994 "Build variables for %s:\n" % variant_dir \
995 + sticky_vars.GenerateHelpText(env)

--- 55 unchanged lines hidden ---