#!/bin/csh -f

if ( $#argv != 1 ) then
    echo "usage: RELINK <abs_path_to_your_vanilla_X.V11Rx_tree>"
    exit
endif

set cwd = `/bin/pwd`
set path = ($cwd/bin $path)

set xtree = $1

if (! ($cwd:t == $xtree:t)) then
	echo "You must run this script from the TOP of the X/PEX tree"
	echo "and you must link it with an X.V11Rx tree, sorry."
	exit
endif

if (!($xtree:t =~ X.V11R?) || !( -d $xtree)) then
	echo "Your X tree *must* have X.V11Rx at it's base, Sorry you deal with it now"
	echo "try moving this X/PEX tree to whatever your X tree starts at (not X.V11Rx)"
	echo "and change X.V11Rx in this script to that. and rerun."
	exit
endif

 cd ..
 linktree $xtree 
