SConstruct (4554:9beeb46559ec) SConstruct (4678:fd95d7ddd1ee)
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

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

62# options as well.
63#
64###################################################
65
66import sys
67import os
68import subprocess
69
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

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

62# options as well.
63#
64###################################################
65
66import sys
67import os
68import subprocess
69
70from os.path import join as joinpath
70from os.path import isdir, join as joinpath
71
72# Check for recent-enough Python and SCons versions. If your system's
73# default installation of Python is not recent enough, you can use a
74# non-default installation of the Python interpreter by either (1)
75# rearranging your PATH so that scons finds the non-default 'python'
76# first or (2) explicitly invoking an alternative interpreter on the
77# scons script, e.g., "/usr/local/bin/python2.4 `which scons` [args]".
78EnsurePythonVersion(2,4)

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

92ROOT = Dir('.').abspath
93
94# Path to the M5 source tree.
95SRCDIR = joinpath(ROOT, 'src')
96
97# tell python where to find m5 python code
98sys.path.append(joinpath(ROOT, 'src/python'))
99
71
72# Check for recent-enough Python and SCons versions. If your system's
73# default installation of Python is not recent enough, you can use a
74# non-default installation of the Python interpreter by either (1)
75# rearranging your PATH so that scons finds the non-default 'python'
76# first or (2) explicitly invoking an alternative interpreter on the
77# scons script, e.g., "/usr/local/bin/python2.4 `which scons` [args]".
78EnsurePythonVersion(2,4)

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

92ROOT = Dir('.').abspath
93
94# Path to the M5 source tree.
95SRCDIR = joinpath(ROOT, 'src')
96
97# tell python where to find m5 python code
98sys.path.append(joinpath(ROOT, 'src/python'))
99
100def check_style_hook(ui):
101 ui.readconfig(joinpath(ROOT, '.hg', 'hgrc'))
102 style_hook = ui.config('hooks', 'pretxncommit.style', None)
103
104 if not style_hook:
105 print """\
106You're missing the M5 style hook.
107Please install the hook so we can ensure that all code fits a common style.
108
109All you'd need to do is add the following lines to your repository .hg/hgrc
110or your personal .hgrc
111----------------
112
113[extensions]
114style = %s/util/style.py
115
116[hooks]
117pretxncommit.style = python:style.check_whitespace
118""" % (ROOT)
119 sys.exit(1)
120
121if isdir(joinpath(ROOT, '.hg')):
122 try:
123 from mercurial import ui
124 check_style_hook(ui.ui())
125 except ImportError:
126 pass
127
100###################################################
101#
102# Figure out which configurations to set up based on the path(s) of
103# the target(s).
104#
105###################################################
106
107# Find default configuration & binary.

--- 583 unchanged lines hidden ---
128###################################################
129#
130# Figure out which configurations to set up based on the path(s) of
131# the target(s).
132#
133###################################################
134
135# Find default configuration & binary.

--- 583 unchanged lines hidden ---