#! /bin/sh
#
# ch_gm setup
#
# Unpack device_args
#
for arg in $device_args $@; do
    case $arg in 
     -echo) set -x 
       ;;
      -listenersig=*)
         listener_sig=`echo A$arg|sed -e 's/A-listenersig=//g'`
         ;;

      -listener_sig=*)
         listener_sig=`echo A$arg|sed -e 's/A-listener_sig=//g'`
         ;;

     -u | -usage | --usage | --usag | --usa | --us | --u | -help | --help )
        cat >&2 <<EOF
--with-device=$DEVICE[:-listener_sig=SIGNALNAME][-dlast][-socksize=BYTES]

The option '-listener_sig' applies to the $DEVICE device, and changes the
signal that is used to signal that a new connection should be made.  By
default, SIGUSR1 is used.

EOF
	exit 0;
	;;
     *) if test -n "$arg" ; then
	    echo "unrecognized argument $arg"
	    exit 1
	fi
	;;
    esac
done

if [ -z "$top_srcdir" ] ; then 
    top_srcdir="."
fi

echo "About to do ch_gm device"
DEVICE_KIND=network
#
echo "Configuring ch_gm subsystem..."
# Make sure that the lib Makefile gets remade
if test -n "$configure_echo" ; then
    otherargs="$otherargs -echo"
fi
if test -n "$rshnol" ; then
    otherargs="$otherargs -rshnol"
fi
if test -n "$listener_sig" ; then
    otherargs="$otherargs -listenersig=$listener_sig"
fi
#
# Run configure in the device directory
# What is this here for?  It is:
#     For the timer stuff
#     for an rsh command
#     To check whether shared-memory works
RSHCOMMAND="${RSHCOMMAND-$rshcommand}"
export CC ; export RSHCOMMAND 
# Remove the configuration file if present
rm -f $top_srcdir/mpid/ch_gm/mpich-mpid.h mpid/ch_gm/mpich-mpid.h
(cd mpid/ch_gm ; $top_srcdir/mpid/ch_gm/configure) # --srcdir=$srcdir)
# Variable assignments from configure are in localdefs
. mpid/ch_gm/localdefs
#
if test -n "$rshcommand" ; then
    otherargs="$otherargs -rsh='"$rshcommand"'"
elif test -n "$RSHCOMMAND" ; then 
    otherargs="$otherargs -rsh='"$RSHCOMMAND"'"
fi

export VPATH

IS_HETERO=0










