# The IDE part of this collection has a runtime dependency on
# the java-common collection, so enable it if present
if test -e /opt/rh/rh-java-common/enable ; then
  . scl_source enable rh-java-common
fi

# General environment variables
export PATH=/opt/rh/devtoolset-4/root/usr/bin${PATH:+:${PATH}}
export MANPATH=/opt/rh/devtoolset-4/root/usr/share/man:${MANPATH}
export INFOPATH=/opt/rh/devtoolset-4/root/usr/share/info${INFOPATH:+:${INFOPATH}}

# Needed by Java Packages Tools to locate java.conf
export JAVACONFDIRS="/opt/rh/devtoolset-4/root/etc/java:${JAVACONFDIRS:-/etc/java}"

# Required by XMvn to locate its configuration files
export XDG_CONFIG_DIRS="/opt/rh/devtoolset-4/root/etc/xdg:${XDG_CONFIG_DIRS:-/etc/xdg}"
export XDG_DATA_DIRS="/opt/rh/devtoolset-4/root/usr/share:${XDG_DATA_DIRS:+${XDG_DATADIRS}:}/usr/local/share:/usr/share"

export PCP_DIR=/opt/rh/devtoolset-4/root
# Some perl Ext::MakeMaker versions install things under /usr/lib/perl5
# even though the system otherwise would go to /usr/lib64/perl5.
export PERL5LIB=/opt/rh/devtoolset-4/root//usr/lib64/perl5/vendor_perl:/opt/rh/devtoolset-4/root/usr/lib/perl5:/opt/rh/devtoolset-4/root//usr/share/perl5/vendor_perl${PERL5LIB:+:${PERL5LIB}}
# bz847911 workaround:
# we need to evaluate rpm's installed run-time % { _libdir }, not rpmbuild time
# or else /etc/ld.so.conf.d files?
rpmlibdir=$(rpm --eval "%{_libdir}")
# bz1017604: On 64-bit hosts, we should include also the 32-bit library path.
if [ "$rpmlibdir" != "${rpmlibdir/lib64/}" ]; then
  rpmlibdir32=":/opt/rh/devtoolset-4/root${rpmlibdir/lib64/lib}"
fi
export LD_LIBRARY_PATH=/opt/rh/devtoolset-4/root$rpmlibdir$rpmlibdir32${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}
# duplicate python site.py logic for sitepackages
pythonvers=2.7
export PYTHONPATH=/opt/rh/devtoolset-4/root/usr/lib64/python$pythonvers/site-packages:/opt/rh/devtoolset-4/root/usr/lib/python$pythonvers/site-packages${PYTHONPATH:+:${PYTHONPATH}}
