Skip to content

Commit

Permalink
Prevent sourcing the script multiple times.
Browse files Browse the repository at this point in the history
  • Loading branch information
mithro committed Aug 18, 2015
1 parent 624e6bc commit 7d68eb6
Showing 1 changed file with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions scripts/setup-env.sh
Expand Up @@ -13,24 +13,25 @@ MIGEN_DIR=$BUILD_DIR/migen
MISOC_DIR=$BUILD_DIR/misoc
MAKESTUFF_DIR=$BUILD_DIR/makestuff

echo " This script is: $SETUP_SRC"
echo " Firmware directory: $TOP_DIR"
echo " Build directory is: $BUILD_DIR"
#echo " gnu toolchain installed at: $GNU_DIR"
#echo " migen found at: $MIGEN_DIR"
#echo " misoc found at: $MISOC_DIR"
#echo " fpgalink found at: $MAKESTUFF_DIR"

if [ $SOURCED = 0 ]; then
echo "You must source this script, rather then try and run it."
echo ". $SETUP_SRC"
exit 1
fi

if [ ! -z $MISOC_ENV ]; then
echo "Already have misoc environment."
exit 1
if [ ! -z $HDMI2USB_ENV ]; then
echo "Already sourced this file."
return
fi
HDMI2USB_ENV=1

echo " This script is: $SETUP_SRC"
echo " Firmware directory: $TOP_DIR"
echo " Build directory is: $BUILD_DIR"
#echo " gnu toolchain installed at: $GNU_DIR"
#echo " migen found at: $MIGEN_DIR"
#echo " misoc found at: $MISOC_DIR"
#echo " fpgalink found at: $MAKESTUFF_DIR"

export LD_LIBRARY_PATH=$MAKESTUFF_DIR/libs/libfpgalink/lin.x64/rel:$LD_LIBRARY_PATH
export PYTHONPATH=$MIGEN_DIR:$MISOC_DIR:$MAKESTUFF_DIR/libs/libfpgalink/examples/python/:$PYTHONPATH
Expand Down

0 comments on commit 7d68eb6

Please sign in to comment.