Deleted Added
sdiff udiff text old ( 5522:e56c3d89be79 ) new ( 5554:e6fabe023fe1 )
full compact
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

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

538params_file = File('params/params.i')
539names = sort_list(sim_objects.keys())
540env.Command(params_file, [ Value(v) for v in names ], buildParams)
541env.Depends(params_file, params_hh_files + params_i_files + depends)
542SwigSource('m5.objects', params_file)
543
544# Build all swig modules
545swig_modules = []
546for source,package in swig_sources:
547 filename = str(source)
548 assert filename.endswith('.i')
549
550 base = '.'.join(filename.split('.')[:-1])
551 module = basename(base)
552 cc_file = base + '_wrap.cc'
553 py_file = base + '.py'
554
555 env.Command([cc_file, py_file], source,
556 '$SWIG $SWIGFLAGS -outdir ${TARGETS[1].dir} '
557 '-o ${TARGETS[0]} $SOURCES')
558 env.Depends(py_file, source)
559 env.Depends(cc_file, source)
560
561 swig_modules.append(Value(module))
562 Source(cc_file)
563 PySource(package, py_file)
564
565# Generate the main swig init file
566def makeSwigInit(target, source, env):
567 f = file(str(target[0]), 'w')
568 print >>f, 'extern "C" {'
569 for module in source:
570 print >>f, ' void init_%s();' % module.get_contents()

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

940# environment 'env' with modified object suffix and optional stripped
941# binary. Additional keyword arguments are appended to corresponding
942# build environment vars.
943def makeEnv(label, objsfx, strip = False, **kwargs):
944 newEnv = env.Copy(OBJSUFFIX=objsfx)
945 newEnv.Label = label
946 newEnv.Append(**kwargs)
947
948 # First make a library of everything but main() so other programs can
949 # link against m5.
950 #
951 # SCons doesn't know to append a library suffix when there is a '.' in the
952 # name. Use '_' instead.
953 m5lib = newEnv.Library('m5_' + label, make_objs(cc_lib_sources, newEnv))
954
955 # Now link a stub with main() and the library.
956 exe = 'm5.' + label # final executable
957 objects = [newEnv.Object(s) for s in cc_bin_sources] + m5lib
958 if strip:
959 unstripped_exe = exe + '.unstripped'
960 newEnv.Program(unstripped_exe, objects)
961 if sys.platform == 'sunos5':
962 cmd = 'cp $SOURCE $TARGET; strip $TARGET'

--- 54 unchanged lines hidden ---