
extdesc="the PDFBox Extension"

full_setup=`pwd`/${BASH_SOURCE}
fulldir=${full_setup%/*}
fulldir=${fulldir%/.}

if [ "x$GEXT_PDFBOX" = "x" ] ; then
  export GEXT_PDFBOX=`pwd`

  if [ -d "$GEXT_PDFBOX/bin/script" ] ; then
    export PATH=$GEXT_PDFBOX/bin/script:$PATH
  fi

  if [ -d "$GEXT_PDFBOX/lib" ] ; then
    if [ "$GSDLOS" = "linux" ] ; then
      export LD_LIBRARY_PATH=$GEXT_PDFBOX/lib:$LD_LIBRARY_PATH
    elif [ "$GSDLOS" = "darwin" ] ; then
      export DYLD_LIBRARY_PATH=$GEXT_PDFBOX/lib:$DYLD_LIBRARY_PATH
    fi
  fi

  extdir=${GEXT_PDFBOX##*/}

  if [ "x$GSDLEXTS" = "x" ] ; then
    export GSDLEXTS=$extdir
  else 
    export GSDLEXTS=$GSDLEXTS:$extdir
  fi


  echo "+Your environment is now setup for $extdesc"
else
  echo "+Your environment is already setup for $extdesc"
fi
