SConscript (9175:8083b5195207) | SConscript (9225:d40bbb9f8698) |
---|---|
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 --- 917 unchanged lines hidden (view full) --- 926 MakeAction(cmd, Transform("STRIP"))) 927 928 new_env.Command(secondary_exename, exename, 929 MakeAction('ln $SOURCE $TARGET', Transform("HARDLINK"))) 930 931 new_env.M5Binary = targets[0] 932 envList.append(new_env) 933 | 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 --- 917 unchanged lines hidden (view full) --- 926 MakeAction(cmd, Transform("STRIP"))) 927 928 new_env.Command(secondary_exename, exename, 929 MakeAction('ln $SOURCE $TARGET', Transform("HARDLINK"))) 930 931 new_env.M5Binary = targets[0] 932 envList.append(new_env) 933 |
934# Debug binary 935ccflags = {} | 934# Start out with the compiler flags common to all compilers, 935# i.e. they all use -g for opt and -g -pg for prof 936ccflags = {'debug' : [], 'opt' : ['-g'], 'fast' : [], 'prof' : ['-g', '-pg']} 937 938# Start out with the linker flags common to all linkers, i.e. -pg for prof. 939ldflags = {'debug' : [], 'opt' : [], 'fast' : [], 'prof' : ['-pg']} 940 |
936if env['GCC']: 937 if sys.platform == 'sunos5': | 941if env['GCC']: 942 if sys.platform == 'sunos5': |
938 ccflags['debug'] = '-gstabs+' | 943 ccflags['debug'] += ['-gstabs+'] |
939 else: | 944 else: |
940 ccflags['debug'] = '-ggdb3' 941 ccflags['opt'] = '-g -O3' 942 ccflags['fast'] = '-O3' 943 ccflags['prof'] = '-O3 -g -pg' | 945 ccflags['debug'] += ['-ggdb3'] 946 ldflags['debug'] += ['-O0'] 947 # opt, fast and prof all share the same cc flags 948 for target in ['opt', 'fast', 'prof']: 949 ccflags[target] += ['-O3'] |
944elif env['SUNCC']: | 950elif env['SUNCC']: |
945 ccflags['debug'] = '-g0' 946 ccflags['opt'] = '-g -O' 947 ccflags['fast'] = '-fast' 948 ccflags['prof'] = '-fast -g -pg' | 951 ccflags['debug'] += ['-g0'] 952 ccflags['opt'] += ['-O'] 953 ccflags['fast'] += ['-fast'] 954 ccflags['prof'] += ['-fast'] |
949elif env['ICC']: | 955elif env['ICC']: |
950 ccflags['debug'] = '-g -O0' 951 ccflags['opt'] = '-g -O' 952 ccflags['fast'] = '-fast' 953 ccflags['prof'] = '-fast -g -pg' | 956 ccflags['debug'] += ['-g', '-O0'] 957 ccflags['opt'] += ['-O'] 958 ccflags['fast'] += ['-fast'] 959 ccflags['prof'] += ['-fast'] |
954elif env['CLANG']: | 960elif env['CLANG']: |
955 ccflags['debug'] = '-g -O0' 956 ccflags['opt'] = '-g -O3' 957 ccflags['fast'] = '-O3' 958 ccflags['prof'] = '-O3 -g -pg' | 961 ccflags['debug'] += ['-g', '-O0'] 962 ccflags['opt'] += ['-O3'] 963 ccflags['fast'] += ['-O3'] 964 ccflags['prof'] += ['-O3'] |
959else: 960 print 'Unknown compiler, please fix compiler options' 961 Exit(1) 962 963 964# To speed things up, we only instantiate the build environments we 965# need. We try to identify the needed environment for each target; if 966# we can't, we fall back on instantiating all the environments just to --- 15 unchanged lines hidden (view full) --- 982needed_envs = [identifyTarget(target) for target in BUILD_TARGETS] 983if 'all' in needed_envs: 984 needed_envs += target_types 985 986# Debug binary 987if 'debug' in needed_envs: 988 makeEnv('debug', '.do', 989 CCFLAGS = Split(ccflags['debug']), | 965else: 966 print 'Unknown compiler, please fix compiler options' 967 Exit(1) 968 969 970# To speed things up, we only instantiate the build environments we 971# need. We try to identify the needed environment for each target; if 972# we can't, we fall back on instantiating all the environments just to --- 15 unchanged lines hidden (view full) --- 988needed_envs = [identifyTarget(target) for target in BUILD_TARGETS] 989if 'all' in needed_envs: 990 needed_envs += target_types 991 992# Debug binary 993if 'debug' in needed_envs: 994 makeEnv('debug', '.do', 995 CCFLAGS = Split(ccflags['debug']), |
990 CPPDEFINES = ['DEBUG', 'TRACING_ON=1']) | 996 CPPDEFINES = ['DEBUG', 'TRACING_ON=1'], 997 LINKFLAGS = Split(ldflags['debug'])) |
991 992# Optimized binary 993if 'opt' in needed_envs: 994 makeEnv('opt', '.o', 995 CCFLAGS = Split(ccflags['opt']), | 998 999# Optimized binary 1000if 'opt' in needed_envs: 1001 makeEnv('opt', '.o', 1002 CCFLAGS = Split(ccflags['opt']), |
996 CPPDEFINES = ['TRACING_ON=1']) | 1003 CPPDEFINES = ['TRACING_ON=1'], 1004 LINKFLAGS = Split(ldflags['opt'])) |
997 998# "Fast" binary 999if 'fast' in needed_envs: 1000 makeEnv('fast', '.fo', strip = True, 1001 CCFLAGS = Split(ccflags['fast']), | 1005 1006# "Fast" binary 1007if 'fast' in needed_envs: 1008 makeEnv('fast', '.fo', strip = True, 1009 CCFLAGS = Split(ccflags['fast']), |
1002 CPPDEFINES = ['NDEBUG', 'TRACING_ON=0']) | 1010 CPPDEFINES = ['NDEBUG', 'TRACING_ON=0'], 1011 LINKFLAGS = Split(ldflags['fast'])) |
1003 1004# Profiled binary 1005if 'prof' in needed_envs: 1006 makeEnv('prof', '.po', 1007 CCFLAGS = Split(ccflags['prof']), 1008 CPPDEFINES = ['NDEBUG', 'TRACING_ON=0'], | 1012 1013# Profiled binary 1014if 'prof' in needed_envs: 1015 makeEnv('prof', '.po', 1016 CCFLAGS = Split(ccflags['prof']), 1017 CPPDEFINES = ['NDEBUG', 'TRACING_ON=0'], |
1009 LINKFLAGS = '-pg') | 1018 LINKFLAGS = Split(ldflags['prof'])) |
1010 1011Return('envList') | 1019 1020Return('envList') |