# -*- python -*-
# ex: set syntax=python:

# This is a sample buildmaster config file. It must be installed as
# 'master.cfg' in your buildmaster's base directory (although the filename
# can be changed with the --basedir option to 'mktap buildbot master').

# It has one job: define a dictionary named BuildmasterConfig. This
# dictionary has a variety of keys to control different aspects of the
# buildmaster. They are documented in docs/config.xhtml .


# This is the dictionary that the buildmaster pays attention to. We also use
# a shorter alias to save typing.
c = BuildmasterConfig = {}

from master_secret import *
protected_settings(c)

####### BUILDSLAVES

# the 'slaves' list defines the set of allowable buildslaves. Each element is
# a BuildSlave object, which is created with bot-name, bot-password.  These
# correspond to values given to the buildslave's mktap invocation.
from buildbot.buildslave import BuildSlave
# these are set in master_secret.py
#c['slaves'] = [...]
#linux64full = [ ]
#linux64 = [ ]
#linux32 = [ ]
#windows = [ ]


# to limit to two concurrent builds on a slave, use
#  c['slaves'] = [BuildSlave("bot1name", "bot1passwd", max_builds=2)]


# 'slavePortnum' defines the TCP port to listen on. This must match the value
# configured into the buildslaves (with their --master option)

# this is set in master_secret.py
#c['slavePortnum'] = 9989

####### CHANGESOURCES

# the 'change_source' setting tells the buildmaster how it should find out
# about source code changes. Any class which implements IChangeSource can be
# put here: there are several in buildbot/changes/*.py to choose from.

#from buildbot.changes.pb import PBChangeSource
#c['change_source'] = PBChangeSource()

# For example, if you had CVSToys installed on your repository, and your
# CVSROOT/freshcfg file had an entry like this:
#pb = ConfigurationSet([
#    (None, None, None, PBService(userpass=('foo', 'bar'), port=4519)),
#    ])

# then you could use the following buildmaster Change Source to subscribe to
# the FreshCVS daemon and be notified on every commit:
#
#from buildbot.changes.freshcvs import FreshCVSSource
#fc_source = FreshCVSSource("cvs.example.com", 4519, "foo", "bar")
#c['change_source'] = fc_source

# or, use a PBChangeSource, and then have your repository's commit script run
# 'buildbot sendchange', or use contrib/svn_buildbot.py, or
# contrib/arch_buildbot.py :
#
#from buildbot.changes.pb import PBChangeSource
#c['change_source'] = PBChangeSource()

def split_file_branches(path):
         pieces = path.split('/')
         if pieces[0] == 'trunk':
             return (None, '/'.join(pieces[1:]))
         elif pieces[0] == 'branches':
             return ('/'.join(pieces[0:2]),
                     '/'.join(pieces[2:]))
         else:
             return None

from buildbot.changes.svnpoller import SVNPoller, split_file_branches
c['change_source'] = SVNPoller("https://stxxl.svn.sourceforge.net/svnroot/stxxl/",
                                    split_file=split_file_branches)

# If you wat to use SVNPoller, it might look something like
#  # Where to get source code changes
# from buildbot.changes.svnpoller import SVNPoller
# source_code_svn_url='https://svn.myproject.org/bluejay/trunk'
# svn_poller = SVNPoller(
#                    svnurl=source_code_svn_url,
#                    pollinterval=60*60, # seconds
#                    histmax=10,
#                    svnbin='/usr/bin/svn',
## )
# c['sources'] = [ svn_poller ]

####### SCHEDULERS

## configure the Schedulers

from buildbot.scheduler import Scheduler
from buildbot.scheduler import AnyBranchScheduler
c['schedulers'] = []
#c['schedulers'].append(Scheduler(name="all", branch=None,
#                                 treeStableTimer=2*60,
#                                 builderNames=["buildbot-full"]))

# SEE BELOW

####### BUILDERS

# the 'builders' list defines the Builders. Each one is configured with a
# dictionary, using the following keys:
#  name (required): the name used to describe this builder
#  slavename (required): which slave to use (must appear in c['bots'])
#  builddir (required): which subdirectory to run the builder in
#  factory (required): a BuildFactory to define how the build is run
#  periodicBuildTime (optional): if set, force a build every N seconds

# buildbot/process/factory.py provides several BuildFactory classes you can
# start with, which implement build processes for common targets (GNU
# autoconf projects, CPAN perl modules, etc). The factory.BuildFactory is the
# base class, and is configured with a series of BuildSteps. When the build
# is run, the appropriate buildslave is told to execute each Step in turn.

# the first BuildStep is typically responsible for obtaining a copy of the
# sources. There are source-obtaining Steps in buildbot/steps/source.py for
# CVS, SVN, and others.

#cvsroot = ":pserver:anonymous@cvs.sourceforge.net:/cvsroot/buildbot"
#cvsmodule = "buildbot"

from buildbot.process import factory
#from buildbot.steps.source import CVS
from buildbot.steps import source, shell
#from buildbot.steps.source import SVN
#from buildbot.steps.shell import Compile
from buildbot.steps.python_twisted import Trial
#f1 = factory.BuildFactory()
#f1.addStep(CVS(cvsroot=cvsroot, cvsmodule=cvsmodule, login="", mode="copy"))
#f1.addStep(Compile(command=["python", "./setup.py", "build"]))
#f1.addStep(Trial(testChanges=True, testpath="."))
#
#b1 = {'name': "buildbot-full",
#      'slavename': "bot1name",
#      'builddir': "full",
#      'factory': f1,
#      }
#c['builders'] = [b1]

c['builders'] = []

stxxl_full_builder_names = []
stxxl_trunk_builder_names = []
stxxl_parpipe_builder_names = []
stxxl_branch_builder_names = []
stxxl_trunk_builder_names_delayed = []
stxxl_parpipe_builder_names_delayed = []
stxxl_branch_builder_names_delayed = []

stxxl_svn_update = source.SVN(mode='update',
                     baseURL='https://stxxl.svn.sourceforge.net/svnroot/stxxl/',
                     defaultBranch='trunk')

stxxl_svn_copy = source.SVN(mode='copy',
                     baseURL='https://stxxl.svn.sourceforge.net/svnroot/stxxl/',
                     defaultBranch='trunk')

stxxl_svn_export = source.SVN(mode='export',
                     baseURL='https://stxxl.svn.sourceforge.net/svnroot/stxxl/',
                     defaultBranch='trunk')
stxxl_autoconfigure_test	= shell.Configure(command=['misc/buildbot-test-autoconfig'], description='pre-config testing', descriptionDone='pre-config')

#stxxl_configure_gcc32		= shell.Configure(command=['misc/buildbot-configure', '--gcc=g++-3.2.x', '--with-werror'])
#stxxl_configure_gcc32_boost	= shell.Configure(command=['misc/buildbot-configure', '--gcc=g++-3.2.x', '--with-werror', '--with-boost'])
stxxl_configure_gcc33		= shell.Configure(command=['misc/buildbot-configure', '--gcc=g++-3.3.x', '--with-werror', '--without-unittest', '--without-btree'])
stxxl_configure_gcc33_boost	= shell.Configure(command=['misc/buildbot-configure', '--gcc=g++-3.3.x', '--with-werror', '--without-unittest', '--without-btree', '--with-boost'])
stxxl_configure_gcc34		= shell.Configure(command=['misc/buildbot-configure', '--gcc=g++-3.4.x', '--with-werror', '--without-unittest'])
stxxl_configure_gcc34_boost	= shell.Configure(command=['misc/buildbot-configure', '--gcc=g++-3.4.x', '--with-werror', '--without-unittest', '--with-boost'])
stxxl_configure_gcc40		= shell.Configure(command=['misc/buildbot-configure', '--gcc=g++-4.0.x', '--with-werror', '--without-unittest'])
stxxl_configure_gcc40_boost	= shell.Configure(command=['misc/buildbot-configure', '--gcc=g++-4.0.x', '--with-werror', '--without-unittest', '--with-boost'])
stxxl_configure_gcc41		= shell.Configure(command=['misc/buildbot-configure', '--gcc=g++-4.1.x', '--with-werror', '--without-unittest'])
stxxl_configure_gcc41_boost	= shell.Configure(command=['misc/buildbot-configure', '--gcc=g++-4.1.x', '--with-werror', '--without-unittest', '--with-boost'])
stxxl_configure_gcc42		= shell.Configure(command=['misc/buildbot-configure', '--gcc=g++-4.2',			'--with-mcstl', '--with-werror', '--with-tpie'])
stxxl_configure_gcc42_boost	= shell.Configure(command=['misc/buildbot-configure', '--gcc=g++-4.2',			'--with-mcstl', '--with-werror', '--with-tpie', '--with-boost'])
stxxl_configure_gcc42x		= shell.Configure(command=['misc/buildbot-configure', '--gcc=g++-4.2.x',		'--with-mcstl', '--with-werror', '--with-tpie'])
stxxl_configure_gcc42x_boost	= shell.Configure(command=['misc/buildbot-configure', '--gcc=g++-4.2.x',		'--with-mcstl', '--with-werror', '--with-tpie', '--with-boost'])
stxxl_configure_gcc43		= shell.Configure(command=['misc/buildbot-configure', '--gcc=g++-4.3 -std=c++0x',	'--with-pmode', '--with-werror', '--with-tpie'])
stxxl_configure_gcc43_boost	= shell.Configure(command=['misc/buildbot-configure', '--gcc=g++-4.3 -std=c++0x',	'--with-pmode', '--with-werror', '--with-tpie', '--with-boost'])
stxxl_configure_gcc43o		= shell.Configure(command=['misc/buildbot-configure', '--gcc=g++-4.3',			'--with-pmode', '--with-werror', '--with-tpie'])
stxxl_configure_gcc43o_boost	= shell.Configure(command=['misc/buildbot-configure', '--gcc=g++-4.3',			'--with-pmode', '--with-werror', '--with-tpie', '--with-boost'])
stxxl_configure_gcc43x		= shell.Configure(command=['misc/buildbot-configure', '--gcc=g++-4.3.x -std=c++0x',	'--with-pmode', '--with-werror', '--with-tpie'])
stxxl_configure_gcc43x_boost	= shell.Configure(command=['misc/buildbot-configure', '--gcc=g++-4.3.x -std=c++0x',	'--with-pmode', '--with-werror', '--with-tpie', '--with-boost'])
stxxl_configure_gcc44		= shell.Configure(command=['misc/buildbot-configure', '--gcc=g++-4.4 -std=c++0x',	'--with-pmode', '--with-werror', '--with-tpie'])
stxxl_configure_gcc44_boost	= shell.Configure(command=['misc/buildbot-configure', '--gcc=g++-4.4 -std=c++0x',	'--with-pmode', '--with-werror', '--with-tpie', '--with-boost'])
stxxl_configure_gcc44_verbose	= shell.Configure(command=['misc/buildbot-configure', '--gcc=g++-4.4 -std=c++0x',	'--with-pmode', '--with-werror', '--with-tpie', '--with-extraflags=-DSTXXL_FORCE_VERBOSE_LEVEL=9'])
stxxl_configure_gcc44_explicit_pmode = shell.Configure(command=['misc/buildbot-configure', '--gcc=g++-4.4 -std=c++0x',	'--with-pmode', '--with-werror', '--with-tpie', '--with-explicit-pmode'])
stxxl_configure_gcc44o		= shell.Configure(command=['misc/buildbot-configure', '--gcc=g++-4.4',			'--with-pmode', '--with-werror', '--with-tpie'])
stxxl_configure_gcc44o_boost	= shell.Configure(command=['misc/buildbot-configure', '--gcc=g++-4.4',			'--with-pmode', '--with-werror', '--with-tpie', '--with-boost'])
stxxl_configure_gcc44x		= shell.Configure(command=['misc/buildbot-configure', '--gcc=g++-4.4.x -std=c++0x',	'--with-pmode', '--with-werror', '--with-tpie'])
stxxl_configure_gcc44x_boost	= shell.Configure(command=['misc/buildbot-configure', '--gcc=g++-4.4.x -std=c++0x',	'--with-pmode', '--with-werror', '--with-tpie', '--with-boost'])
stxxl_configure_gcc45		= shell.Configure(command=['misc/buildbot-configure', '--gcc=g++-4.5 -std=c++0x',	'--with-pmode', '--with-werror', '--with-tpie'])
stxxl_configure_gcc45_boost	= shell.Configure(command=['misc/buildbot-configure', '--gcc=g++-4.5 -std=c++0x',	'--with-pmode', '--with-werror', '--with-tpie', '--with-boost'])
stxxl_configure_gcc45o		= shell.Configure(command=['misc/buildbot-configure', '--gcc=g++-4.5',			'--with-pmode', '--with-werror', '--with-tpie'])
stxxl_configure_gcc45o_boost	= shell.Configure(command=['misc/buildbot-configure', '--gcc=g++-4.5',			'--with-pmode', '--with-werror', '--with-tpie', '--with-boost'])
stxxl_configure_gcc45x		= shell.Configure(command=['misc/buildbot-configure', '--gcc=g++-4.5.x -std=c++0x',	'--with-pmode', '--with-werror', '--with-tpie'])
stxxl_configure_gcc45x_boost	= shell.Configure(command=['misc/buildbot-configure', '--gcc=g++-4.5.x -std=c++0x',	'--with-pmode', '--with-werror', '--with-tpie', '--with-boost'])
stxxl_configure_gcc46x		= shell.Configure(command=['misc/buildbot-configure', '--gcc=g++-trunk -std=c++0x',	'--with-pmode', '--with-tpie'])
stxxl_configure_gcc46x_boost	= shell.Configure(command=['misc/buildbot-configure', '--gcc=g++-trunk -std=c++0x',	'--with-pmode', '--with-tpie', '--with-boost'])

stxxl_configure_icpc90		= shell.Configure(command=['misc/buildbot-configure', '--icpc=icpc-9.0 -gcc-name=gcc-3.4.x', '--without-unittest'])
#stxxl_configure_icpc91		= shell.Configure(command=['misc/buildbot-configure', '--icpc=icpc-9.1 -gcc-name=gcc-4.1.x', '--without-unittest'])
stxxl_configure_icpc91		= shell.Configure(command=['misc/buildbot-configure', '--icpc=icpc-9.1 -gcc-name=gcc-3.4.x', '--without-unittest'])
stxxl_configure_icpc100		= shell.Configure(command=['misc/buildbot-configure', '--icpc=icpc-10.0 -gcc-name=needsworkaround', '--with-mcstl'])
stxxl_configure_icpc100_boost	= shell.Configure(command=['misc/buildbot-configure', '--icpc=icpc-10.0 -gcc-name=needsworkaround', '--with-mcstl', '--with-boost'])
stxxl_configure_icpc101		= shell.Configure(command=['misc/buildbot-configure', '--icpc=icpc-10.1 -gcc-name=gcc-4.2.x', '--with-mcstl'])
stxxl_configure_icpc101_boost	= shell.Configure(command=['misc/buildbot-configure', '--icpc=icpc-10.1 -gcc-name=gcc-4.2.x', '--with-mcstl', '--with-boost'])
stxxl_configure_icpc110		= shell.Configure(command=['misc/buildbot-configure', '--icpc=icpc-11.0 -gcc-name=gcc-4.2.x', '--with-mcstl'])
stxxl_configure_icpc110_boost	= shell.Configure(command=['misc/buildbot-configure', '--icpc=icpc-11.0 -gcc-name=gcc-4.2.x', '--with-mcstl', '--with-boost'])
stxxl_configure_icpc111		= shell.Configure(command=['misc/buildbot-configure', '--icpc=icpc-11.1 -gcc-name=gcc-4.2.x', '--with-mcstl'])
stxxl_configure_icpc111_boost	= shell.Configure(command=['misc/buildbot-configure', '--icpc=icpc-11.1 -gcc-name=gcc-4.2.x', '--with-mcstl', '--with-boost'])
stxxl_configure_icpc120o	= shell.Configure(command=['misc/buildbot-configure', '--icpc=icpc-12.0 -gcc-name=gcc-4.2.x', '--with-mcstl'])
stxxl_configure_icpc120o_boost	= shell.Configure(command=['misc/buildbot-configure', '--icpc=icpc-12.0 -gcc-name=gcc-4.2.x', '--with-mcstl', '--with-boost'])
stxxl_configure_icpc120		= shell.Configure(command=['misc/buildbot-configure', '--icpc=icpc-12.0 -gcc-name=gcc-4.3.x -std=c++0x', '--with-pmode',                 '--with-extraflags=-D__aligned__=ignored'])
stxxl_configure_icpc120_boost	= shell.Configure(command=['misc/buildbot-configure', '--icpc=icpc-12.0 -gcc-name=gcc-4.3.x -std=c++0x', '--with-pmode', '--with-boost', '--with-extraflags=-D__aligned__=ignored'])
# -D__aligned__=ignored was suggested by http://software.intel.com/en-us/forums/showthread.php?t=65041 to work around some icpc issue with g++-4.3 headers

stxxl_compile			= shell.Compile(command=['make', '-f', 'GNUmakefile', '-k', 'lib', 'header-compile-test', 'tests', 'examples'], timeout=3600)
stxxl_compile2			= shell.Compile(command=['make', '-f', 'GNUmakefile', '-k', 'lib', 'tests', 'examples'], timeout=3600)

stxxl_doxygen			= shell.Compile(command=['make', '-f', 'GNUmakefile', 'clean_doxy', 'doxy'], description='doxygening', descriptionDone='doxygen')

stxxl_test_minimal		= shell.Test(command=['misc/buildbot-run-tests-minimal'])

stxxl_configure_msvc_x86	= shell.Configure(command=['echo', 'BOOST_ROOT=C:\\Progra~2\\boost\\current', '>', 'make.settings.local'])
#stxxl_configure_msvc_x86	= shell.Configure(command=['echo BOOST_ROOT="C:\\Program Files (x86)\\boost\\current" > make.settings.local'])
stxxl_configure_msvc_amd64	= shell.Configure(command=['echo', 'BOOST_ROOT=C:\\Progra~1\\boost\\current', '>', 'make.settings.local'])
#stxxl_configure_msvc_amd64	= shell.Configure(command=['echo BOOST_ROOT="C:\\Program Files\\boost\\current" > make.settings.local'])

stxxl_compile_msvc8_x86		= shell.Compile(command=['c:\\Program Files (x86)\\Microsoft Visual Studio 8\\VC\\vcvarsall.bat',   'x86',   '&&', 'nmake', '/K', 'library_msvc', 'tests_msvc'])
stxxl_compile_msvc8_amd64	= shell.Compile(command=['c:\\Program Files (x86)\\Microsoft Visual Studio 8\\VC\\vcvarsall.bat',   'amd64', '&&', 'nmake', '/K', 'library_msvc', 'tests_msvc'])
stxxl_compile_msvc9_x86		= shell.Compile(command=['c:\\Program Files (x86)\\Microsoft Visual Studio 9.0\\VC\\vcvarsall.bat', 'x86',   '&&', 'nmake', '/K', 'library_msvc', 'tests_msvc'])
stxxl_compile_msvc9_amd64	= shell.Compile(command=['c:\\Program Files (x86)\\Microsoft Visual Studio 9.0\\VC\\vcvarsall.bat', 'amd64', '&&', 'nmake', '/K', 'library_msvc', 'tests_msvc'])
stxxl_compile_msvc10_x86	= shell.Compile(command=['c:\\Program Files (x86)\\Microsoft Visual Studio 10.0\\VC\\vcvarsall.bat', 'x86',   '&&', 'nmake', '/K', 'library_msvc', 'tests_msvc'])
stxxl_compile_msvc10_amd64	= shell.Compile(command=['c:\\Program Files (x86)\\Microsoft Visual Studio 10.0\\VC\\vcvarsall.bat', 'amd64', '&&', 'nmake', '/K', 'library_msvc', 'tests_msvc'])

f = factory.BuildFactory()
f.addStep(stxxl_svn_update)
f.addStep(stxxl_configure_gcc44)
f.addStep(stxxl_compile)
f.addStep(stxxl_doxygen)
f.addStep(stxxl_test_minimal)

#c['builders'].append(
#     {'name':'quick', 'slavenames':linux64full, 'builddir':'build-quick', 'factory':f, 'useProgress':False}
#)
#stxxl_trunk_builder_names.append("quick")

f = factory.BuildFactory()
f.addStep(stxxl_svn_copy)
f.addStep(stxxl_autoconfigure_test)
f.addStep(stxxl_configure_gcc44)
f.addStep(stxxl_compile)
f.addStep(stxxl_doxygen)
f.addStep(stxxl_test_minimal)

c['builders'].append(
     {'name':'trunk-linux-full', 'slavenames':linux64full, 'builddir':'trunk-linux-full', 'factory':f }
)
stxxl_full_builder_names.append('trunk-linux-full')

f = factory.BuildFactory()
f.addStep(stxxl_svn_export)
f.addStep(stxxl_configure_gcc44)
f.addStep(stxxl_compile)
f.addStep(stxxl_doxygen)
f.addStep(stxxl_test_minimal)

#c['builders'].append(
#     {'name':'export', 'slavenames':linux64full, 'builddir':'export', 'factory':f }
#)
#stxxl_full_builder_names.append('export')

f = factory.BuildFactory()
f.addStep(stxxl_svn_update)
f.addStep(stxxl_configure_gcc44_verbose)
f.addStep(stxxl_compile)
f.addStep(stxxl_test_minimal)

c['builders'].append(
     {'name':'trunk-linux-verbose', 'slavenames':linux64full, 'builddir':'trunk-linux-verbose', 'factory':f}
)
stxxl_trunk_builder_names.append('trunk-linux-verbose')

f = factory.BuildFactory()
f.addStep(stxxl_svn_update)
f.addStep(stxxl_configure_gcc44_explicit_pmode)
f.addStep(stxxl_compile)
f.addStep(stxxl_test_minimal)

c['builders'].append(
     {'name':'trunk-linux-explicit-pmode', 'slavenames':linux64full, 'builddir':'trunk-linux-explicit-pmode', 'factory':f}
)
stxxl_trunk_builder_names.append('trunk-linux-explicit-pmode')

trunk_builders = []
parpipe_builders = []
branch_builders = []
full_builders = []


def addbuilder(slaves, name, steps, progress=False, branches=False, later=False, pp=True, full=False):
	bf = factory.BuildFactory()
	for step in steps:
		bf.addStep(step)
	trunk_builders.append({'name':'trunk-'+name,		'slavenames':slaves, 'builddir':'trunk-'+name,		'factory':bf, 'useProgress':progress})
	if full:
		stxxl_full_builder_names.append('trunk-'+name)
	elif not later:
		stxxl_trunk_builder_names.append('trunk-'+name)
	else:
		stxxl_trunk_builder_names_delayed.append('trunk-'+name)
	if branches:
		if pp:
			parpipe_builders.append({'name':'parpipe-'+name,	'slavenames':slaves, 'builddir':'parpipe-'+name,	'factory':bf, 'useProgress':progress})
		branch_builders.append({'name':'branch-'+name,	'slavenames':slaves, 'builddir':'branch-'+name,	'factory':bf, 'useProgress':progress})
		if not later:
			if pp:
				stxxl_parpipe_builder_names.append('parpipe-'+name)
			stxxl_branch_builder_names.append('branch-'+name)
		else:
			if pp:
				stxxl_parpipe_builder_names_delayed.append('parpipe-'+name)
			stxxl_branch_builder_names_delayed.append('branch-'+name)
	return

addbuilder(linux64, 'linux-amd64-gcc45-pmode',		[stxxl_svn_update, stxxl_configure_gcc45, 		stxxl_compile, stxxl_doxygen, stxxl_test_minimal], branches=True)
#addbuilder(linux64, 'linux-amd64-gcc45-pmode-boost',	[stxxl_svn_update, stxxl_configure_gcc45_boost,		stxxl_compile, stxxl_test_minimal], branches=True)
addbuilder(linux64, 'linux-amd64-gcc44-pmode',		[stxxl_svn_update, stxxl_configure_gcc44, 		stxxl_compile, stxxl_doxygen, stxxl_test_minimal], branches=True)
addbuilder(linux64, 'linux-amd64-gcc44-pmode-boost',	[stxxl_svn_update, stxxl_configure_gcc44_boost,		stxxl_compile, stxxl_test_minimal], branches=True)
addbuilder(linux64, 'linux-amd64-gcc43-pmode',		[stxxl_svn_update, stxxl_configure_gcc43, 		stxxl_compile, stxxl_doxygen, stxxl_test_minimal], branches=True)
addbuilder(linux64, 'linux-amd64-gcc43-pmode-boost',	[stxxl_svn_update, stxxl_configure_gcc43_boost,		stxxl_compile, stxxl_test_minimal], branches=True)
addbuilder(linux64, 'linux-amd64-gcc42-mcstl',		[stxxl_svn_update, stxxl_configure_gcc42, 		stxxl_compile, stxxl_test_minimal], branches=True)
addbuilder(linux64, 'linux-amd64-gcc42-mcstl-boost',	[stxxl_svn_update, stxxl_configure_gcc42_boost,		stxxl_compile, stxxl_test_minimal], branches=True)
addbuilder(linux64, 'linux-amd64-gcc43x-pmode',		[stxxl_svn_update, stxxl_configure_gcc43x, 		stxxl_compile, stxxl_test_minimal], branches=True)
addbuilder(linux64, 'linux-amd64-gcc43x-pmode-boost',	[stxxl_svn_update, stxxl_configure_gcc43x_boost,	stxxl_compile, stxxl_test_minimal], branches=True)
addbuilder(linux64, 'linux-amd64-gcc44x-pmode',		[stxxl_svn_update, stxxl_configure_gcc44x, 		stxxl_compile, stxxl_test_minimal], branches=True)
addbuilder(linux64, 'linux-amd64-gcc44x-pmode-boost',	[stxxl_svn_update, stxxl_configure_gcc44x_boost,	stxxl_compile, stxxl_test_minimal], branches=True)
addbuilder(linux64, 'linux-amd64-gcc45x-pmode',		[stxxl_svn_update, stxxl_configure_gcc45x, 		stxxl_compile, stxxl_test_minimal], later=True, branches=True)
#addbuilder(linux64, 'linux-amd64-gcc45x-pmode-boost',	[stxxl_svn_update, stxxl_configure_gcc45x_boost,	stxxl_compile, stxxl_test_minimal], later=True, branches=True)
addbuilder(linux64, 'linux-amd64-gcc46x-pmode',		[stxxl_svn_update, stxxl_configure_gcc46x, 		stxxl_compile, stxxl_test_minimal], later=True, branches=True)
#addbuilder(linux64, 'linux-amd64-gcc46x-pmode-boost',	[stxxl_svn_update, stxxl_configure_gcc46x_boost,	stxxl_compile, stxxl_test_minimal], later=True, branches=True)
addbuilder(linux64, 'linux-amd64-gcc45o-pmode',		[stxxl_svn_update, stxxl_configure_gcc45o, 		stxxl_compile, stxxl_test_minimal], later=True)
#addbuilder(linux64, 'linux-amd64-gcc45o-pmode-boost',	[stxxl_svn_update, stxxl_configure_gcc45o_boost,	stxxl_compile, stxxl_test_minimal], later=True)
addbuilder(linux64, 'linux-amd64-gcc44o-pmode',		[stxxl_svn_update, stxxl_configure_gcc44o, 		stxxl_compile, stxxl_test_minimal], later=True)
addbuilder(linux64, 'linux-amd64-gcc44o-pmode-boost',	[stxxl_svn_update, stxxl_configure_gcc44o_boost,	stxxl_compile, stxxl_test_minimal], later=True)
#addbuilder(linux64, 'linux-amd64-gcc43o-pmode', 	[stxxl_svn_update, stxxl_configure_gcc43o, 		stxxl_compile, stxxl_test_minimal], later=True)
#addbuilder(linux64, 'linux-amd64-gcc43o-pmode-boost',	[stxxl_svn_update, stxxl_configure_gcc43o_boost,	stxxl_compile, stxxl_test_minimal], later=True)
addbuilder(linux64, 'linux-amd64-gcc42x-mcstl',		[stxxl_svn_update, stxxl_configure_gcc42x, 		stxxl_compile, stxxl_test_minimal], later=True, branches=True)
addbuilder(linux64, 'linux-amd64-gcc42x-mcstl-boost',	[stxxl_svn_update, stxxl_configure_gcc42x_boost,	stxxl_compile, stxxl_test_minimal], later=True, branches=True)
addbuilder(linux64, 'linux-amd64-gcc41',		[stxxl_svn_update, stxxl_configure_gcc41, 		stxxl_compile, stxxl_test_minimal], later=True)
#addbuilder(linux64, 'linux-amd64-gcc41-boost',		[stxxl_svn_update, stxxl_configure_gcc41_boost,		stxxl_compile, stxxl_test_minimal], later=True)
addbuilder(linux64, 'linux-amd64-gcc34',		[stxxl_svn_update, stxxl_configure_gcc34, 		stxxl_compile, stxxl_test_minimal], later=True)
#addbuilder(linux64, 'linux-amd64-gcc34-boost',		[stxxl_svn_update, stxxl_configure_gcc34_boost,		stxxl_compile, stxxl_test_minimal], later=True)

addbuilder(linux64, 'linux-amd64-icpc120-pmode',	[stxxl_svn_update, stxxl_configure_icpc120, 		stxxl_compile, stxxl_test_minimal], branches=True)
addbuilder(linux64, 'linux-amd64-icpc120-pmode-boost',	[stxxl_svn_update, stxxl_configure_icpc120_boost, 	stxxl_compile, stxxl_test_minimal], branches=True)
addbuilder(linux64, 'linux-amd64-icpc120-mcstl',	[stxxl_svn_update, stxxl_configure_icpc120o, 		stxxl_compile, stxxl_test_minimal], branches=True)
addbuilder(linux64, 'linux-amd64-icpc120-mcstl-boost',	[stxxl_svn_update, stxxl_configure_icpc120o_boost, 	stxxl_compile, stxxl_test_minimal], branches=True)
addbuilder(linux64, 'linux-amd64-icpc111-mcstl',	[stxxl_svn_update, stxxl_configure_icpc111, 		stxxl_compile, stxxl_test_minimal], branches=True)
addbuilder(linux64, 'linux-amd64-icpc111-mcstl-boost',	[stxxl_svn_update, stxxl_configure_icpc111_boost, 	stxxl_compile, stxxl_test_minimal], branches=True)
addbuilder(linux64, 'linux-amd64-icpc110-mcstl',	[stxxl_svn_update, stxxl_configure_icpc110, 		stxxl_compile, stxxl_test_minimal], later=True, branches=True)
addbuilder(linux64, 'linux-amd64-icpc110-mcstl-boost',	[stxxl_svn_update, stxxl_configure_icpc110_boost, 	stxxl_compile, stxxl_test_minimal], later=True, branches=True)
addbuilder(linux64, 'linux-amd64-icpc101-mcstl',	[stxxl_svn_update, stxxl_configure_icpc101, 		stxxl_compile, stxxl_test_minimal], branches=True)
addbuilder(linux64, 'linux-amd64-icpc101-mcstl-boost',	[stxxl_svn_update, stxxl_configure_icpc101_boost, 	stxxl_compile, stxxl_test_minimal], branches=True)
addbuilder(linux64, 'linux-amd64-icpc100-mcstl',	[stxxl_svn_update, stxxl_configure_icpc100, 		stxxl_compile, stxxl_test_minimal], later=True, branches=True)
addbuilder(linux64, 'linux-amd64-icpc100-mcstl-boost',	[stxxl_svn_update, stxxl_configure_icpc100_boost, 	stxxl_compile, stxxl_test_minimal], later=True, branches=True)
addbuilder(linux64, 'linux-amd64-icpc091',		[stxxl_svn_update, stxxl_configure_icpc91, 		stxxl_compile, stxxl_test_minimal], later=True)
addbuilder(linux64, 'linux-amd64-icpc090',		[stxxl_svn_update, stxxl_configure_icpc90, 		stxxl_compile, stxxl_test_minimal], later=True)

addbuilder(linux32, 'linux-x86-gcc45-pmode',		[stxxl_svn_update, stxxl_configure_gcc45, 		stxxl_compile, stxxl_doxygen, stxxl_test_minimal], branches=True)
#addbuilder(linux32, 'linux-x86-gcc45-pmode-boost',	[stxxl_svn_update, stxxl_configure_gcc45_boost,		stxxl_compile, stxxl_test_minimal], branches=True)
addbuilder(linux32, 'linux-x86-gcc44-pmode',		[stxxl_svn_update, stxxl_configure_gcc44, 		stxxl_compile, stxxl_doxygen, stxxl_test_minimal], branches=True)
addbuilder(linux32, 'linux-x86-gcc44-pmode-boost',	[stxxl_svn_update, stxxl_configure_gcc44_boost,		stxxl_compile, stxxl_test_minimal], branches=True)
addbuilder(linux32, 'linux-x86-gcc43-pmode',		[stxxl_svn_update, stxxl_configure_gcc43, 		stxxl_compile, stxxl_doxygen, stxxl_test_minimal], branches=True)
addbuilder(linux32, 'linux-x86-gcc43-pmode-boost',	[stxxl_svn_update, stxxl_configure_gcc43_boost,		stxxl_compile, stxxl_test_minimal], branches=True)
addbuilder(linux32, 'linux-x86-gcc42-mcstl',		[stxxl_svn_update, stxxl_configure_gcc42, 		stxxl_compile, stxxl_test_minimal], branches=True)
addbuilder(linux32, 'linux-x86-gcc42-mcstl-boost',	[stxxl_svn_update, stxxl_configure_gcc42_boost,		stxxl_compile, stxxl_test_minimal], branches=True)
addbuilder(linux32, 'linux-x86-gcc43x-pmode',		[stxxl_svn_update, stxxl_configure_gcc43x, 		stxxl_compile, stxxl_test_minimal], branches=True)
addbuilder(linux32, 'linux-x86-gcc43x-pmode-boost',	[stxxl_svn_update, stxxl_configure_gcc43x_boost,	stxxl_compile, stxxl_test_minimal], branches=True)
addbuilder(linux32, 'linux-x86-gcc44x-pmode',		[stxxl_svn_update, stxxl_configure_gcc44x, 		stxxl_compile, stxxl_test_minimal], branches=True)
addbuilder(linux32, 'linux-x86-gcc44x-pmode-boost',	[stxxl_svn_update, stxxl_configure_gcc44x_boost,	stxxl_compile, stxxl_test_minimal], branches=True)
addbuilder(linux32, 'linux-x86-gcc45x-pmode',		[stxxl_svn_update, stxxl_configure_gcc45x, 		stxxl_compile, stxxl_test_minimal], later=True, branches=True)
#addbuilder(linux32, 'linux-x86-gcc45x-pmode-boost',	[stxxl_svn_update, stxxl_configure_gcc45x_boost,	stxxl_compile, stxxl_test_minimal], later=True, branches=True)
addbuilder(linux32, 'linux-x86-gcc46x-pmode',		[stxxl_svn_update, stxxl_configure_gcc46x, 		stxxl_compile, stxxl_test_minimal], later=True, branches=True)
#addbuilder(linux32, 'linux-x86-gcc46x-pmode-boost',	[stxxl_svn_update, stxxl_configure_gcc46x_boost,	stxxl_compile, stxxl_test_minimal], later=True, branches=True)
addbuilder(linux32, 'linux-x86-gcc45o-pmode',		[stxxl_svn_update, stxxl_configure_gcc45o, 		stxxl_compile, stxxl_test_minimal], later=True)
#addbuilder(linux32, 'linux-x86-gcc45o-pmode-boost',	[stxxl_svn_update, stxxl_configure_gcc45o_boost,	stxxl_compile, stxxl_test_minimal], later=True)
addbuilder(linux32, 'linux-x86-gcc44o-pmode',		[stxxl_svn_update, stxxl_configure_gcc44o, 		stxxl_compile, stxxl_test_minimal], later=True)
addbuilder(linux32, 'linux-x86-gcc44o-pmode-boost',	[stxxl_svn_update, stxxl_configure_gcc44o_boost,	stxxl_compile, stxxl_test_minimal], later=True)
#addbuilder(linux32, 'linux-x86-gcc43o-pmode',		[stxxl_svn_update, stxxl_configure_gcc43o, 		stxxl_compile, stxxl_test_minimal], later=True)
#addbuilder(linux32, 'linux-x86-gcc43o-pmode-boost',	[stxxl_svn_update, stxxl_configure_gcc43o_boost,	stxxl_compile, stxxl_test_minimal], later=True)
addbuilder(linux32, 'linux-x86-gcc42x-mcstl',		[stxxl_svn_update, stxxl_configure_gcc42x, 		stxxl_compile, stxxl_test_minimal], later=True, branches=True)
addbuilder(linux32, 'linux-x86-gcc42x-mcstl-boost',	[stxxl_svn_update, stxxl_configure_gcc42x_boost,	stxxl_compile, stxxl_test_minimal], later=True, branches=True)
addbuilder(linux32, 'linux-x86-gcc41',			[stxxl_svn_update, stxxl_configure_gcc41, 		stxxl_compile, stxxl_test_minimal], later=True)
#addbuilder(linux32, 'linux-x86-gcc41-boost',		[stxxl_svn_update, stxxl_configure_gcc41_boost,		stxxl_compile, stxxl_test_minimal], later=True)
addbuilder(linux32, 'linux-x86-gcc40',			[stxxl_svn_update, stxxl_configure_gcc40, 		stxxl_compile, stxxl_test_minimal], later=True)
#addbuilder(linux32, 'linux-x86-gcc40-boost',		[stxxl_svn_update, stxxl_configure_gcc40_boost,		stxxl_compile, stxxl_test_minimal], later=True)
addbuilder(linux32, 'linux-x86-gcc34',			[stxxl_svn_update, stxxl_configure_gcc34, 		stxxl_compile, stxxl_test_minimal], later=True)
#addbuilder(linux32, 'linux-x86-gcc34-boost',		[stxxl_svn_update, stxxl_configure_gcc34_boost,		stxxl_compile, stxxl_test_minimal], later=True)
addbuilder(linux32, 'linux-x86-gcc33',			[stxxl_svn_update, stxxl_configure_gcc33, 		stxxl_compile2, stxxl_test_minimal], later=True)
#addbuilder(linux32, 'linux-x86-gcc33-boost',		[stxxl_svn_update, stxxl_configure_gcc33_boost,		stxxl_compile2, stxxl_test_minimal], later=True)
#addbuilder(linux32, 'linux-x86-gcc32',			[stxxl_svn_update, stxxl_configure_gcc32, 		stxxl_compile, stxxl_test_minimal], later=True)
#addbuilder(linux32, 'linux-x86-gcc32-boost',		[stxxl_svn_update, stxxl_configure_gcc32_boost,		stxxl_compile, stxxl_test_minimal], later=True)

addbuilder(linux32, 'linux-x86-icpc120-pmode',		[stxxl_svn_update, stxxl_configure_icpc120, 		stxxl_compile, stxxl_test_minimal], branches=True)
addbuilder(linux32, 'linux-x86-icpc120-pmode-boost',	[stxxl_svn_update, stxxl_configure_icpc120_boost, 	stxxl_compile, stxxl_test_minimal], branches=True)
addbuilder(linux32, 'linux-x86-icpc120-mcstl',		[stxxl_svn_update, stxxl_configure_icpc120o, 		stxxl_compile, stxxl_test_minimal], branches=True)
addbuilder(linux32, 'linux-x86-icpc120-mcstl-boost',	[stxxl_svn_update, stxxl_configure_icpc120o_boost, 	stxxl_compile, stxxl_test_minimal], branches=True)
addbuilder(linux32, 'linux-x86-icpc111-mcstl',		[stxxl_svn_update, stxxl_configure_icpc111, 		stxxl_compile, stxxl_test_minimal], branches=True)
addbuilder(linux32, 'linux-x86-icpc111-mcstl-boost',	[stxxl_svn_update, stxxl_configure_icpc111_boost, 	stxxl_compile, stxxl_test_minimal], branches=True)
addbuilder(linux32, 'linux-x86-icpc110-mcstl',		[stxxl_svn_update, stxxl_configure_icpc110, 		stxxl_compile, stxxl_test_minimal], later=True, branches=True)
addbuilder(linux32, 'linux-x86-icpc110-mcstl-boost',	[stxxl_svn_update, stxxl_configure_icpc110_boost, 	stxxl_compile, stxxl_test_minimal], later=True, branches=True)
addbuilder(linux32, 'linux-x86-icpc101-mcstl',		[stxxl_svn_update, stxxl_configure_icpc101, 		stxxl_compile, stxxl_test_minimal], branches=True)
addbuilder(linux32, 'linux-x86-icpc101-mcstl-boost',	[stxxl_svn_update, stxxl_configure_icpc101_boost, 	stxxl_compile, stxxl_test_minimal], branches=True)
addbuilder(linux32, 'linux-x86-icpc100-mcstl',		[stxxl_svn_update, stxxl_configure_icpc100, 		stxxl_compile, stxxl_test_minimal], later=True, branches=True)
addbuilder(linux32, 'linux-x86-icpc100-mcstl-boost',	[stxxl_svn_update, stxxl_configure_icpc100_boost, 	stxxl_compile, stxxl_test_minimal], later=True, branches=True)
addbuilder(linux32, 'linux-x86-icpc091',		[stxxl_svn_update, stxxl_configure_icpc91, 		stxxl_compile, stxxl_test_minimal], later=True)
addbuilder(linux32, 'linux-x86-icpc090',		[stxxl_svn_update, stxxl_configure_icpc90, 		stxxl_compile, stxxl_test_minimal], later=True)

addbuilder(windows, 'win32-msvc8',			[stxxl_svn_update, stxxl_configure_msvc_x86,	stxxl_compile_msvc8_x86],	branches=True, pp=True)
addbuilder(windows, 'win64-msvc8',			[stxxl_svn_update, stxxl_configure_msvc_amd64,	stxxl_compile_msvc8_amd64],	branches=True, pp=True)
addbuilder(windows, 'win32-msvc9',			[stxxl_svn_update, stxxl_configure_msvc_x86,	stxxl_compile_msvc9_x86],	branches=True, pp=True)
addbuilder(windows, 'win64-msvc9',			[stxxl_svn_update, stxxl_configure_msvc_amd64,	stxxl_compile_msvc9_amd64],	branches=True, pp=True)
addbuilder(windows, 'win32-msvc10',			[stxxl_svn_update, stxxl_configure_msvc_x86,	stxxl_compile_msvc10_x86],	branches=True, pp=True)
addbuilder(windows, 'win64-msvc10',			[stxxl_svn_update, stxxl_configure_msvc_amd64,	stxxl_compile_msvc10_amd64],	branches=True, pp=True)
addbuilder(windows, 'win64-msvc9-full',			[stxxl_svn_copy,   stxxl_configure_msvc_amd64,	stxxl_compile_msvc9_amd64],	pp=False, full=True)

c['builders'].extend(trunk_builders)
c['builders'].extend(parpipe_builders)
c['builders'].extend(branch_builders)

#f = factory.BuildFactory()
#f.addStep(stxxl_svn_update)
#f.addStep(shell.Compile(command=['nmake', 'library_msvc', 'tests_msvc']))
#c['builders'].append({'name':'win64-msvc9', 'slavenames':windows, 'builddir':'win64-msvc9', 'factory':f })
#stxxl_trunk_builder_names.append('win64-msvc9')
#c['builders'].append({'name':'branch-win64-msvc9', 'slavenames':windows, 'builddir':'branch-win64-msvc9', 'factory':f })
#stxxl_branch_builder_names.append('branch-win64-msvc9')

branches = [
	'branches/comparison_based_stable_sort',
	'branches/unordered_map',
	'branches/posixaio',
	'branches/kernelaio',
	'branches/matrix',
]

# svn puller @ 10 minutes
c['schedulers'].append(Scheduler(name="full builds", branch=None,
                                 treeStableTimer=66*60,
                                 builderNames=stxxl_full_builder_names))
c['schedulers'].append(Scheduler(name="trunk builds", branch=None,
                                 treeStableTimer=1*60,
                                 builderNames=stxxl_trunk_builder_names))
c['schedulers'].append(Scheduler(name="trunk builds delayed", branch=None,
                                 treeStableTimer=91*60,
                                 builderNames=stxxl_trunk_builder_names_delayed))
c['schedulers'].append(AnyBranchScheduler(name="parpipe builds", branches=["branches/parallel_pipelining", 'branches/parallel_pipelining_integration'],
                                 treeStableTimer=1*60,
                                 builderNames=stxxl_parpipe_builder_names))
c['schedulers'].append(AnyBranchScheduler(name="parpipe builds delayed", branches=["branches/parallel_pipelining", 'branches/parallel_pipelining_integration'],
                                 treeStableTimer=121*60,
                                 builderNames=stxxl_parpipe_builder_names_delayed))
c['schedulers'].append(AnyBranchScheduler(name="branch builds", branches=branches,
                                 treeStableTimer=11*60,
                                 builderNames=stxxl_branch_builder_names))
c['schedulers'].append(AnyBranchScheduler(name="branch builds delayed", branches=branches,
                                 treeStableTimer=121*60,
                                 builderNames=stxxl_branch_builder_names_delayed))

####### STATUS TARGETS

# 'status' is a list of Status Targets. The results of each build will be
# pushed to these targets. buildbot/status/*.py has a variety to choose from,
# including web pages, email senders, and IRC bots.

c['status'] = []

# Use allowForce=True (boolean, not a string. ie: not 'True') to allow
# Forcing Builds in the Web User Interface. The default is False.
# from buildbot.status import html
# c['status'].append(html.WebStatus(http_port=8010,allowForce=True))

from buildbot.status import html
#c['status'].append(html.WebStatus(http_port=8010))
c['status'].append(html.WebStatus(http_port="tcp:8010:interface=127.0.0.1", allowForce=False))
c['status'].append(html.WebStatus(http_port="tcp:8011:interface=127.0.0.1", allowForce=True))

# from buildbot.status import mail
# c['status'].append(mail.MailNotifier(fromaddr="buildbot@localhost",
#                                      extraRecipients=["builds@example.com"],
#                                      sendToInterestedUsers=False))
#
# from buildbot.status import words
# c['status'].append(words.IRC(host="irc.example.com", nick="bb",
#                              channels=["#example"]))
#
# from buildbot.status import client
# c['status'].append(client.PBListener(9988))


####### DEBUGGING OPTIONS

# if you set 'debugPassword', then you can connect to the buildmaster with
# the diagnostic tool in contrib/debugclient.py . From this tool, you can
# manually force builds and inject changes, which may be useful for testing
# your buildmaster without actually committing changes to your repository (or
# before you have a functioning 'sources' set up). The debug tool uses the
# same port number as the slaves do: 'slavePortnum'.

# this is set in master_secret.py
#c['debugPassword'] = "debugpassword"

# if you set 'manhole', you can ssh into the buildmaster and get an
# interactive python shell, which may be useful for debugging buildbot
# internals. It is probably only useful for buildbot developers. You can also
# use an authorized_keys file, or plain telnet.
#from buildbot import manhole
#c['manhole'] = manhole.PasswordManhole("tcp:9999:interface=127.0.0.1",
#                                       "admin", "password")


####### PROJECT IDENTITY

# the 'projectName' string will be used to describe the project that this
# buildbot is working on. For example, it is used as the title of the
# waterfall HTML page. The 'projectURL' string will be used to provide a link
# from buildbot HTML pages to your project's home page.

c['projectName'] = "STXXL"
c['projectURL'] = "http://stxxl.sourceforge.net/"

# the 'buildbotURL' string should point to the location where the buildbot's
# internal web server (usually the html.Waterfall page) is visible. This
# typically uses the port number set in the Waterfall 'status' entry, but
# with an externally-visible host name which the buildbot cannot figure out
# without some help.

c['buildbotURL'] = "http://localhost:8010/"
