# -*- shell-script -*-

###########################################################################
#
#  Set some environment variables for Sage.
#  This file is generated from sage-env-config.in by configure.
#
#  NOTES:
#  - You must *source* this script instead of executing.
#  - Use "return" instead of "exit" to signal a failure.  Since this
#    file is sourced, an "exit" here will actually exit src/bin/sage,
#    which is probably not intended.
#  - All environment variables set here should be *exported*, otherwise
#    they won't be available in child programs.
#
##########################################################################

# SAGE_LOCAL is the installation prefix and can be customized by using
# ./configure --prefix
export SAGE_LOCAL="/usr/lib64/sagemath/local"

#######################################
# Compilers set at configuration time
#######################################
export CONFIGURED_CC="gcc"
export CONFIGURED_CXX="g++"
export CONFIGURED_FC="gfortran"
export CONFIGURED_OBJC="gcc"
export CONFIGURED_OBJCXX="g++"

#######################################
# Other configuration
#######################################
export SAGE_PYTHON_VERSION=3
if [ "$SAGE_PYTHON_VERSION" = 3 ]; then
    export SAGE_PYTHON3=yes
fi

# This is usually blank if the system GMP is used, or $SAGE_LOCAL otherwise
export SAGE_GMP_PREFIX=""
export SAGE_GMP_INCLUDE="/usr/include"
if [ -n "$SAGE_GMP_PREFIX" ]; then
    # Many packages that depend on GMP accept a --with-gmp=<prefix> flag to
    # their ./configure scripts.  When using the system's GMP this is not
    # generally necessary, but when using the GMP package installed in
    # SAGE_LOCAL it is useful to pass it.  We define this variable to
    # pass to these packages' ./configure scripts.  When using the system
    # GMP its value is just blank (for many of these packages passing
    # --with-gmp without an argument is actually a bug)
    export SAGE_CONFIGURE_GMP="--with-gmp=$SAGE_GMP_PREFIX"
fi

# The MPFR case is very close to the GMP case above
# This is usually blank if the system MPFR is used, or $SAGE_LOCAL otherwise
export SAGE_MPFR_PREFIX=""
if [ -n "$SAGE_MPFR_PREFIX" ]; then
    # Some packages that depend on MPFR accept a --with-mpfr=<prefix> flag to
    # their ./configure scripts. Thus we deal with this just as with GMP above. 
    export SAGE_CONFIGURE_MPFR="--with-mpfr=$SAGE_MPFR_PREFIX"
fi

# The MPC case is very close to the MPFR case above
# This is usually blank if the system MPC is used, or $SAGE_LOCAL otherwise
export SAGE_MPC_PREFIX=""
if [ -n "$SAGE_MPC_PREFIX" ]; then
    # Some packages that depend on MPC accept a --with-mpc=<prefix> flag to
    # their ./configure scripts. Thus we deal with this just as with GMP above. 
    export SAGE_CONFIGURE_MPC="--with-mpc=$SAGE_MPC_PREFIX"
fi

# This is usually blank if the system NTL is used, or $SAGE_LOCAL otherwise
export SAGE_NTL_PREFIX=""
if [ -n "$SAGE_NTL_PREFIX" ]; then
    # Many packages that depend on NTL accept a --with-ntl=<prefix> flag to
    # their ./configure scripts.  When using the system's NTL this is not
    # generally necessary, but when using the NTL package installed in
    # SAGE_LOCAL it is useful to pass it.
    export SAGE_CONFIGURE_NTL="--with-ntl=$SAGE_NTL_PREFIX"
fi
