#!/bin/sh NeXtMidas shell instantiation script must be sourced.
#
# @author  J. Czechowski IV
# @version $Id: nmprofile.sh,v 1.1 2015/06/05 18:14:19 jxc Exp $
#

if [ -n "$NM_PROFILER_FLAGS" ]; then
  echo "Starting NeXtMidas with profiler flags:"
  echo "    $NM_PROFILER_FLAGS"
  echo ""
  export NM_SAVE_FLAGS "$NM_JVM_FLAGS"
  export NM_JVM_FLAGS  "$NM_SAVE_FLAGS $NM_PROFILER_FLAGS"
  . $NM_OS/nm
  export NM_JVM_FLAGS  "$NM_SAVE_FLAGS"
  unset NM_SAVE_FLAGS
else
  echo "ERROR: No profiler flags set. Use the following to set the profiler flags"
  echo "       for this session only:"
  echo ""
  echo "           > export NM_PROFILER_FLAGS=[flags]"
  echo ""
  echo "       If NM_USER_PROFILER_FLAGS is set in .bashrc it will be picked up"
  echo "       by nmstart."
  echo ""
fi
