###########################################
## pynac
###########################################

export CXXFLAGS="-O2 -g $CXXFLAGS"

WORKDIR=${PWD}/src
PYNACDIR=${WORKDIR}

build_pynac()
{
    cd ${PYNACDIR}
    PKG_CONFIG_PATH=${SAGE_LOCAL}/lib/pkgconfig; export PKG_CONFIG_PATH
    sdh_configure --disable-static --with-giac=no PYTHON=sage-python23
    sdh_make
    cd ${WORKDIR}
}

install_pynac()
{
    rm ${SAGE_LOCAL}/lib/*ginac*
    rm ${SAGE_LOCAL}/lib/*pynac*
    rm -rf ${SAGE_LOCAL}/include/ginac
    rm -rf ${SAGE_LOCAL}/include/pynac
    cd ${PYNACDIR}
    sdh_make_install
    cd ${WORKDIR}
}

clean_pynac()
{
    true
}


cd src

echo "Starting build..."
echo "Running build_pynac..."
build_pynac
echo "Done build_pynac."

echo "Installing pynac..."
install_pynac
echo "Done installing pynac."
