#!/bin/sh

if [ $# -ne 1 ]; then
    echo "Usage:  $0 locker"
    echo "   where locker is the name of the locker (e.g., \"gtk_v1.1\")"
    exit -1
fi

LOCKER=$1

GTKROOT=/mit/${LOCKER}
GTKCONF=/mit/${LOCKER}/bin/gtk-config
RPATH=`/afs/sipb/project/gtk/share/rpathconf/rpathconf ${GTKROOT}/lib /afs/sipb.mit.edu/project/gtk/${LOCKER}/lib` 

if [ ! -d ${GTKROOT} ]; then
	echo "Couldn't access ${GTKROOT}"
	exit -1;
fi

mv ${GTKCONF} ${GTKCONF}.orig

sed -e "s|-lgtk|${RPATH} -lgtk|" <${GTKCONF}.orig >${GTKCONF}

chmod 755 ${GTKCONF}

echo "Updated ${GTKCONF}"
