site_init.py revision 12245:ad6fa75d2aba
16899SN/A# Copyright (c) 2013, 2015-2017 ARM Limited 26899SN/A# All rights reserved. 36899SN/A# 46899SN/A# The license below extends only to copyright in the software and shall 56899SN/A# not be construed as granting a license to any other intellectual 66899SN/A# property including but not limited to intellectual property relating 76899SN/A# to a hardware implementation of the functionality of the software 86899SN/A# licensed hereunder. You may use the software subject to the license 96899SN/A# terms below provided that you ensure that this notice is replicated 106899SN/A# unmodified and in its entirety in all distributions of the software, 116899SN/A# modified or unmodified, in source code or in binary form. 126899SN/A# 136899SN/A# Copyright (c) 2011 Advanced Micro Devices, Inc. 146899SN/A# Copyright (c) 2009 The Hewlett-Packard Development Company 156899SN/A# Copyright (c) 2004-2005 The Regents of The University of Michigan 166899SN/A# All rights reserved. 176899SN/A# 186899SN/A# Redistribution and use in source and binary forms, with or without 196899SN/A# modification, are permitted provided that the following conditions are 206899SN/A# met: redistributions of source code must retain the above copyright 216899SN/A# notice, this list of conditions and the following disclaimer; 226899SN/A# redistributions in binary form must reproduce the above copyright 236899SN/A# notice, this list of conditions and the following disclaimer in the 246899SN/A# documentation and/or other materials provided with the distribution; 256899SN/A# neither the name of the copyright holders nor the names of its 266899SN/A# contributors may be used to endorse or promote products derived from 276899SN/A# this software without specific prior written permission. 286899SN/A# 296899SN/A# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 307056SN/A# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 317632SBrad.Beckmann@amd.com# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 327632SBrad.Beckmann@amd.com# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 338232Snate@binkert.org# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 346899SN/A# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 358932SBrad.Beckmann@amd.com# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 368932SBrad.Beckmann@amd.com# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 378932SBrad.Beckmann@amd.com# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 386899SN/A# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 397053SN/A# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 407053SN/A 416899SN/Afrom gem5_python_paths import extra_python_paths 427053SN/A 437053SN/A# Check for recent-enough Python and SCons versions. 446899SN/Atry: 457053SN/A # Really old versions of scons only take two options for the 467053SN/A # function, so check once without the revision and once with the 477053SN/A # revision, the first instance will fail for stuff other than 487053SN/A # 0.98, and the second will fail for 0.98.0 497053SN/A EnsureSConsVersion(0, 98) 507053SN/A EnsureSConsVersion(0, 98, 1) 517053SN/Aexcept SystemExit, e: 527053SN/A print """ 536899SN/AFor more details, see: 547053SN/A http://gem5.org/Dependencies 557053SN/A""" 567053SN/A raise 577053SN/A 587053SN/A# pybind11 requires python 2.7 597053SN/Atry: 607053SN/A EnsurePythonVersion(2, 7) 617053SN/Aexcept SystemExit, e: 627053SN/A print """ 636899SN/AYou can use a non-default installation of the Python interpreter by 647053SN/Arearranging your PATH so that scons finds the non-default 'python' and 657053SN/A'python-config' first. 667053SN/A 677053SN/AFor more details, see: 687053SN/A http://gem5.org/wiki/index.php/Using_a_non-default_Python_installation 697053SN/A""" 707053SN/A raise 716899SN/A 726899SN/Asys.path[1:1] = extra_python_paths 736899SN/A