import sys
import os
sys.path.append('build')
from osync_support import *


#Define the default values for some variables. Take note, that they might
#get overwriten by the scons files in the build directory


class BuildConfig:
	version = "0.31"
	plugin_version = 1
	path_sep = r"/"

config = BuildConfig()

# Get our configuration options:
env = Environment(ENV = os.environ)
opts = Options('msynctool.conf')
opts.Add(BoolOption('debug', 'Should debugging be enabled?', 1))

target_dir = SelectBuildDir('build')
sys.path.append(target_dir)
from osync_build import *
target_dir = '#' + target_dir
configure(opts)
SConsignFile()

opts.Update(env)
opts.Save('msynctool.conf', env)
opts.Add("DESTDIR", 'Set the root directory to install into ( /path/to/DESTDIR )', "")
opts.Update(env)

Help("""
++++++++++++++++++++++++++++++++++++
Welcome to the msynctool Help System!


You can set the following options:
""" + opts.GenerateHelpText(env))

testenv = check(env, config)

install_prefix = '${DESTDIR}$prefix'
install_bin    = '${DESTDIR}$prefix/bin'

Export('env opts testenv install_prefix install_bin')

SConscript(['tools/SConscript'])
BuildDir(target_dir, 'msynctool', duplicate=0)
