#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements.  See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership.  The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License.  You may obtain a copy of the License at
# 
#   http://www.apache.org/licenses/LICENSE-2.0
# 
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied.  See the License for the
# specific language governing permissions and limitations
# under the License.
#

# Environment variables substituted by configure/cmake.
$srcdir="@abs_srcdir@"
$builddir="@abs_builddir@"
$top_srcdir="@abs_top_srcdir@"
$top_builddir="@abs_top_builddir@"
$moduledir="$top_builddir\src@builddir_lib_suffix@"
$testmoduledir="$builddir@builddir_lib_suffix@"

# Python paths and directories
$PYTHON_DIR="$builddir\python"
$QPID_PYTHON_TEST="$PYTHON_DIR\commands\qpid-python-test"
if ( !(Test-Path "$PYTHON_DIR") -and (Test-Path "$top_srcdir\..\python")) {
    $PYTHON_DIR="$top_srcdir\..\python"
    $QPID_PYTHON_TEST="$PYTHON_DIR\qpid-python-test"
}
$QPID_TESTS="$top_srcdir\..\tests"
$QPID_TESTS_PY="$QPID_TESTS\src\py"
$QPID_TOOLS="$top_srcdir\..\tools"
$QPID_TOOLS_LIBS="$QPID_TOOLS\src\py"
$QMF_LIB="$top_srcdir\..\extras\qmf\src\py"
$PYTHON_COMMANDS="$QPID_TOOLS\src\py"
$env:PYTHONPATH="$srcdir;$PYTHON_DIR;$PYTHON_COMMANDS;$QPID_TESTS_PY;$QPID_TOOLS_LIBS;$QMF_LIB;$env:PYTHONPATH"
$QPID_CONFIG_EXEC="$PYTHON_COMMANDS\qpid-config"
$QPID_ROUTE_EXEC="$PYTHON_COMMANDS\qpid-route"
$QPID_CLUSTER_EXEC="$PYTHON_COMMANDS\qpid-cluster"
$QPID_HA_TOOL_EXEC="$PYTHON_COMMANDS\qpid-ha-tool"

# Executables
$env:QPIDD_EXEC="$top_builddir\src\qpidd"
$env:QPID_WATCHDOG_EXEC="$top_builddir\src\qpidd_watchdog"

# Test executables
$QPID_TEST_EXEC_DIR="$builddir"
$RECEIVER_EXEC="$QPID_TEST_EXEC_DIR\receiver"
$SENDER_EXEC="$QPID_TEST_EXEC_DIR\sender"

# Path
$env:PATH="$top_builddir\src;$builddir;$srcdir;$PYTHON_COMMANDS;$QPID_TEST_EXEC_DIR;$env:PATH"

# Modules
$env:TEST_STORE_LIB="$testmoduledir\test_store.so"

#exportmodule() { test -f $moduledir/$2 && eval "export $1=$moduledir/$2"; }
#exportmodule ACL_LIB acl.so
#exportmodule CLUSTER_LIB cluster.so
#exportmodule REPLICATING_LISTENER_LIB replicating_listener.so
#exportmodule REPLICATION_EXCHANGE_LIB replication_exchange.so
#exportmodule SSLCONNECTOR_LIB sslconnector.so
#exportmodule SSL_LIB ssl.so
#exportmodule WATCHDOG_LIB watchdog.so
#exportmodule XML_LIB xml.so

# Qpid options
$env:QPID_NO_MODULE_DIR="1"	# Don't accidentally load installed modules
$env:QPID_DATA_DIR= 		# Default to no data dir, not ~/.qpidd

# Options for boost test framework
$env:BOOST_TEST_SHOW_PROGRESS="yes"
$env:BOOST_TEST_CATCH_SYSTEM_ERRORS="no"
