ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/util/tradinstall.csh
Revision: 2.11
Committed: Thu Aug 27 17:46:52 2020 UTC (3 years, 7 months ago) by greg
Content type: application/x-csh
Branch: MAIN
CVS Tags: rad5R4, rad5R3, HEAD
Changes since 2.10: +4 -1 lines
Log Message:
chore(trad): getting trad to install properly with cmake (thanks to Mingbo)

File Contents

# User Rev Content
1 greg 2.3 #!/bin/csh -fe
2 greg 2.11 # RCSid: $Id: tradinstall.csh,v 2.10 2019/05/01 16:47:54 greg Exp $
3 greg 2.1 # Install correct version of trad for wish or wish4.0
4     #
5     set instdir = $1
6     set libdir = $2
7    
8 greg 2.11 # Need to execute in containing directory:
9     if ($0:h != $0) cd $0:h
10    
11 greg 2.2 set TLIBFILES = ( *[a-z].tcl *.hlp trad.icon tclIndex )
12 greg 2.1
13     set TDIFFS = (`ls | sed -n 's/3\.6\.tcl$//p'`)
14    
15 greg 2.9 set WISHCOMS = ( wish4.{3,2,1,0} wish8.{6,5,4,3,2,1,0} wish )
16 greg 2.4
17     foreach w ( $WISHCOMS )
18 greg 2.1 foreach d ($path)
19 greg 2.4 if (-x $d/$w) then
20     set wishcom = $d/$w
21 greg 2.1 break
22     endif
23     end
24 greg 2.4 if ( $?wishcom ) break
25     end
26     if (! $?wishcom) then
27     echo "Cannot find wish executable in current path -- trad not installed."
28     exit 1
29 greg 2.1 endif
30 greg 2.8 if ("`file $wishcom`" =~ "*shell script*") then
31     set wishcom="/bin/sh"
32     endif
33 greg 2.1
34     echo "Installing trad using $wishcom"
35    
36 greg 2.10 sed -e "1s|/usr/bin/wish|$wishcom|" \
37 greg 2.1 -e "s|^set radlib .*|set radlib $libdir|" trad.wsh > $instdir/trad
38     chmod 755 $instdir/trad
39 greg 2.3 if (! -d $libdir) then
40     mkdir $libdir
41     endif
42 greg 2.1 (cd $libdir ; rm -f $TLIBFILES)
43     cp $TLIBFILES $libdir