# The directories used by the build.
BUILD_DIR           = [ FDirName $(TOP) build ] ;
JAM_DIR             = [ FDirName $(BUILD_DIR) jam ] ;
SCRIPTS_DIR         = [ FDirName $(JAM_DIR) scripts ] ;
GENERATED_DIR       = [ FDirName $(TOP) generated ] ;
DISTRO_DIR          = [ FDirName $(TOP) generated distro ] ;
FULL_DISTRO_DIR     = [ FDirName $(TOP) generated fulldistro ] ;
PACKAGE_DIR	        = [ FDirName $(GENERATED_DIR) packages ] ;
PACKAGE_OBJECT_DIR  = [ FDirName $(PACKAGE_DIR) objects ] ;

##-------------------------------------------------------------------
## Defines
##-------------------------------------------------------------------
VERSION = 10 ;
DEFINES += VERSION=\"\\\"$(VERSION)\\\"\" ;
DEFINES += BUILD_DATE=\"\\\"$(JAMDATE)\\\"\" ;
CHGRP = ;
CHOWN = ;

# Include BuildConfig generated by configure
{
	local buildConfig = [ Glob $(GENERATED_DIR) : BuildConfig ] ;
	if $(buildConfig) {
		LOCATE on BuildConfig = $(GENERATED_DIR) ;
		include BuildConfig ;
	} else {
		Exit "Run ./configure first!" ;
	}
}

# Include UserBuildConfig
{
	local userBuildConfig = [ Glob $(JAM_DIR) : UserBuildConfig ] ;
	if $(userBuildConfig) {
		LOCATE on UserBuildConfig = $(JAM_DIR) ;
		include UserBuildConfig ;
	}
}

# Cache files for header scanning and jamfile caching.
HCACHEFILE = header_cache ;
JCACHEFILE = jamfile_cache ;
LOCATE on $(HCACHEFILE) $(JCACHEFILE) = $(GENERATED_DIR) ;

# Perform configuration checks
include [ FDirName $(JAM_DIR) CheckRules ] ;
CheckGccPlatform ;
CheckOpenSSL ;
if ! $(HAVE_OPENSSL) {
#	Echo "** MSN, GoogleTalk and OSCAR protocols are disabled for lack of OpenSSL" ;
}
CheckLibYahoo2 ;
if ! $(HAVE_LIBYAHOO2) {
#	Echo "** Yahoo protocol is disabled for lack of libyahoo2" ;
}
CheckInfoPopper ;
if ! $(HAVE_INFOPOPPER) {
#	Echo "** im_infopopper client is disabled for lack of InfoPopper" ;
}

# Include jam scripts
include [ FDirName $(JAM_DIR) HelperRules ] ;
include [ FDirName $(JAM_DIR) ConfigRules ] ;
include [ FDirName $(JAM_DIR) OverriddenJamRules ] ;
include [ FDirName $(JAM_DIR) MainBuildRules ] ;
include [ FDirName $(JAM_DIR) FileRules ] ;
include [ FDirName $(JAM_DIR) InstallRules ] ;
include [ FDirName $(JAM_DIR) PackageRules ] ;
include [ FDirName $(JAM_DIR) DistroRules ] ;
include [ FDirName $(JAM_DIR) BuildSettings ] ;