#! /usr/bin/env python
__version__="0.96.1"
__build__="D001"
__buildsys__="casablanca"
__date__="2004/08/23 09:55:29"
__developer__="knight"
import os
import os.path
import sys
script_dir=sys.path[0]
if script_dir in sys.path:
    sys.path.remove(script_dir)
libs=[]
if os.environ.has_key("SCONS_LIB_DIR"):
    libs.append(os.environ["SCONS_LIB_DIR"])
local='scons-local-' + __version__
if script_dir:
    local=os.path.join(script_dir, local)
libs.append(local)
scons_version='scons-%s' % __version__
prefs=[]
if script_dir=='bin':
    prefs.append(os.getcwd())
else:
    if script_dir=='.' or script_dir=='':
        script_dir=os.getcwd()
    head, tail=os.path.split(script_dir)
    if tail=="bin":
        prefs.append(head)
head, tail=os.path.split(sys.prefix)
if tail=="usr":
    prefs.append(sys.prefix)
    prefs.append(os.path.join(sys.prefix, "local"))
elif tail=="local":
    h, t=os.path.split(head)
    if t=="usr":
        prefs.append(sys.prefix)
        prefs.append(head)
    else:
        prefs.append(sys.prefix)
else:
    prefs.append(sys.prefix)
temp=map(lambda x: os.path.join(x, 'lib'), prefs)
temp.extend(map(lambda x: os.path.join(x, 'lib', 'python' + sys.version[:3], 'site-packages'), prefs))
prefs=temp
libs.extend(map(lambda x: os.path.join(x, scons_version), prefs))
libs.extend(map(lambda x: os.path.join(x, 'scons'), prefs))
sys.path=libs + sys.path
import SCons.Script
SCons.Script.main()
