ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/makeall
Revision: 1.6
Committed: Thu May 29 17:46:35 2003 UTC (21 years, 5 months ago) by greg
Branch: MAIN
Changes since 1.5: +3 -2 lines
Log Message:
Attempted fix to AIX compile problems

File Contents

# User Rev Content
1 greg 1.1 #!/bin/csh -f
2 greg 1.2 # RCSid $Id$
3 greg 1.1 #
4     #Added macosX 2001-04-11 by Jean Brange
5     #Deleted obsolete systems 2001-04-18 by Greg Ward
6     #
7     # Make all the Radiance programs
8     #
9     if ( $#argv < 1 ) then
10     echo "Usage: makeall install [clean] [make options]"
11     echo " or: makeall clean"
12     echo " or: makeall library"
13     exit 1
14     endif
15     if ( "$1" == library ) then
16     source installib
17     echo ""
18     echo "Set the environment variable RAYPATH=.:$ldir"
19     echo 'For C-shell users, put the following into ~/.cshrc'
20     echo " setenv RAYPATH .:$ldir"
21     echo 'For Bourne shell users, put the following into $HOME/profile'
22     echo " RAYPATH=.:$ldir"
23     echo " export RAYPATH"
24     echo ""
25     exit 0
26     endif
27     set srcdirs=( common meta cv gen ot rt px hd util cal )
28     if ( "$1" == install ) then
29     cat << _EOF_
30    
31     `cat src/rt/VERSION` INSTALLATION
32    
33     This script rebuilds all of the Radiance programs and installs
34     them on your system. You should read the file README before running
35     this script. You can type ^C (followed by return) at any time to abort.
36    
37     You must first answer the following questions.
38    
39     _EOF_
40     if ( ! $?EDITOR ) then
41     echo -n "What is your preferred editor [vi]? "
42     set ans="$<"
43     if ( "$ans" != "" ) then
44     setenv EDITOR "$ans"
45     else
46     setenv EDITOR vi
47     endif
48     endif
49     again1:
50     echo -n "Where do you want the executables [/usr/local/bin]? "
51     set idir=$<
52     (echo $idir) >/dev/null
53 greg 1.4 if ( $status ) then
54     goto again1
55     endif
56 greg 1.1 set idir=$idir
57     if ( "$idir" == "" ) then
58     set idir=/usr/local/bin
59     else if ( "$idir" !~ /* ) then
60     echo "Directory must be relative to root, please reenter"
61     goto again1
62     endif
63     if ( ! -d $idir ) then
64     mkdir $idir
65     if ( $status ) then
66     echo "Cannot create directory, please reenter"
67     goto again1
68     endif
69     endif
70     if ( ! -d $idir/dev ) then
71     mkdir $idir/dev
72     if ( $status ) then
73     echo "Cannot create subdirectory, please reenter"
74     goto again1
75     endif
76     endif
77     set rmake=$idir/rmake
78 greg 1.4 if ( "`ls -tL $rmake $0 |& head -1`" == $rmake ) then
79     goto gotrmake
80     endif
81 greg 1.1 set newrmake
82     goto skiplicense
83     cat << _EOF_
84    
85     RADIANCE LICENSE AGREEMENT
86    
87     Radiance is a registered copyright of The Regents of the University of
88     California ("The Regents"). The Regents grant to you a nonexclusive,
89     nontransferable license ("License") to use Radiance source code without
90     fee. You may not sell or distribute Radiance to others without the
91     prior express written permission of The Regents. You may compile and
92     use this software on any machines to which you have personal access,
93     and may share its use with others who have access to the same machines.
94    
95     NEITHER THE UNITED STATES NOR THE UNITED STATES DEPARTMENT OF ENERGY, NOR ANY
96     OF THEIR EMPLOYEES, MAKES ANY WARRANTY, EXPRESS OR IMPLIED, OR ASSUMES ANY
97     LEGAL LIABILITY OR RESPONSIBILITY FOR THE ACCURACY, COMPLETENESS, OR USEFULNESS
98     OF ANY INFORMATION, APPARATUS, PRODUCT, OR PROCESS DISCLOSED, OR REPRESENTS
99     THAT ITS USE WOULD NOT INFRINGE PRIVATELY OWNED RIGHTS. By downloading, using
100     or copying this software, you agree to abide by the intellectual property laws
101     and all other applicable laws of the United States, and by the terms of this
102     License Agreement. Ownership of the software shall remain solely in The
103     Regents. The Regents shall have the right to terminate this License
104     immediately by written notice upon your breach of, or noncompliance with, any
105     of its terms. You shall be liable for any infringement or damages resulting
106     from your failure to abide by the terms of this License Agreement.
107    
108     _EOF_
109     echo -n "Do you understand and accept the terms of this agreement [n]? "
110     set ans="$<"
111     if ( "$ans" !~ [yY]* ) exit
112     echo -n "Are you a new Radiance user or with a new address [y]? "
113     set ans="$<"
114     if ( "$ans" !~ [nN]* ) then
115     csh -f newuser
116     else
117     echo `cat src/rt/VERSION` compiled by `whoami` | mail [email protected]
118     endif
119     skiplicense:
120     set special=
121     set arch=
122     set opt=
123     set mach=
124     set compat=
125     set extras=
126     cat << _EOF_
127    
128     Please select your system type from the following list:
129    
130     1) Sun Solaris
131     2) HP workstation
132     3) Silicon Graphics
133     4) AIX (RS/6000)
134     5) BSDI BSD/386
135     6) Linux
136     7) MacOS X
137     8) FreeBSD
138     9) Other
139    
140     _EOF_
141     echo -n "Choice? "
142     set arch="$<"
143     switch ("$arch")
144     case 1: # SPARC Station
145     set arch=sun
146 greg 1.4 set mach="-I/usr/openwin/include -L/usr/openwin/lib -DNOSTEREO"
147     set opt="-O -DSPEED=80"
148     set compat="bmalloc.o strcmp.o getpagesize.o"
149 greg 1.1 breaksw
150     case 2: # HP workstation
151     set mach=""
152     set opt="-O -DSPEED=80 -Aa -D_HPUX_SOURCE"
153 greg 1.3 set compat="bmalloc.o getpagesize.o strcmp.o"
154 greg 1.1 set arch=hpux
155     breaksw
156     case 3: # Silicon Graphics
157     set arch=sgi
158     switch (`uname -r`)
159     case 3.*:
160     set mach="-noprototypes"
161     set opt="-O -DSPEED=80"
162     set special="sgi"
163     set compat="malloc.o strcmp.o"
164     breaksw
165     case 4.*:
166     set mach=""
167     set opt="-O2 -DSPEED=100"
168     set compat="malloc.o strcmp.o"
169     set extras='"MLIB=-lfastm -lm"'
170     breaksw
171     default: # 5.x or later
172     ln -s `which wish` $idir/wish4.0
173     set path=($idir $path)
174     set mach="-w"
175     set opt="-O2 -DSPEED=200"
176     set special="ogl"
177 greg 1.3 set compat="bmalloc.o strcmp.o"
178 greg 1.1 breaksw
179     endsw
180     breaksw
181     case 4: # AIX
182     set opt="-O"
183 greg 1.6 set compat="bmalloc.o erf.o strcmp.o"
184     set arch=PowerPC
185 greg 1.1 breaksw
186     case 5: # BSDI BSD/386
187     set mach="-DBSD -L/usr/X11/lib -I/usr/X11/include"
188     set opt="-O -DSPEED=100"
189     set arch=IBMPC
190     set compat="malloc.o erf.o strcmp.o"
191     breaksw
192     case 6: # Linux
193     set mach="-Dlinux -L/usr/X11R6/lib -I/usr/include/X11 -DNOSTEREO"
194     set opt="-O2 -DSPEED=200"
195     set arch=IBMPC
196     set compat="bmalloc.o erf.o getpagesize.o"
197     set extras=CC=gcc
198     breaksw
199     case 7: # MacOS X
200     set mach="-DBSD -DNOSTEREO -Dfreebsd -I/usr/X11R6/include -L/usr/X11R6/lib"
201     set opt="-O2 -DSPEED=200"
202     set arch=PowerPC
203     set compat="bmalloc.o"
204     set extras="CC=cc CONFIGURE_ARCH=powerpc"
205     set special="ogl"
206     breaksw
207     case 8: # FreeBSD
208     set mach="-DBSD -DNOSTEREO -Dfreebsd -I/usr/X11R6/include -L/usr/X11R6/lib"
209     set opt="-O -DSPEED=200"
210     set compat="bmalloc.o erf.o"
211     set extras="CC=cc"
212     set arch=IBMPC
213     breaksw
214     case 9: # Other
215     set opt="-O"
216     set compat="bmalloc.o erf.o strcmp.o"
217     echo -n "Are you using the GNU C compiler [n]? "
218     if ( "$<" =~ [yY]* ) then
219     set extras="CC=gcc"
220     endif
221 greg 1.6 set arch=other
222 greg 1.1 breaksw
223     default:
224     echo "Illegal choice\!"
225     echo "Installation aborted."
226     exit 1
227     breaksw
228     endsw
229     source installib
230     sed 's/[ ]*$//' > $rmake << _EOF_
231     #!/bin/sh
232     exec make "SPECIAL=$special" \
233     "OPT=$opt" \
234     "MACH=$mach" \
235     ARCH=$arch "COMPAT=$compat" \
236     INSTDIR=$idir \
237     LIBDIR=$ldir \
238     $extras "\$@" -f Rmakefile
239     _EOF_
240     chmod 755 $rmake
241     chmod 644 src/*/Rmakefile src/rt/devtable.c
242     gotrmake:
243     echo "Current rmake command is:"
244     cat $rmake
245     echo -n "Do you want to change it? "
246     set ans="$<"
247     if ( "$ans" =~ [yY]* ) then
248     cp $rmake /tmp/rmake$$
249     $EDITOR $rmake
250     if ( `cat $rmake /tmp/rmake$$ | grep OPT= | uniq | wc -l` == 2 ) set newrmake
251     rm -f /tmp/rmake$$
252     endif
253     if ( ! -d src/lib ) then
254     mkdir src/lib
255     endif
256     if ( $?newrmake ) then
257     echo 'New rmake command -- running "makeall clean"...'
258     csh -f $0 clean
259     endif
260     cd src
261     echo "Making programs..."
262     set errs=0
263     foreach i ( $srcdirs )
264     pushd $i
265     echo "In directory $i..."
266     $rmake -k $*
267     @ errs += $status
268     popd
269     end
270     if ( $errs ) then
271     echo "There were some errors."
272     else
273     echo "Done."
274     endif
275     cd ..
276     if (! -d /usr/tmp) then
277     ln -s /tmp /usr/tmp
278     if ($status) then
279     echo ""
280     echo "IMPORTANT: Execute 'sudo ln -s /tmp /usr/tmp'"
281     echo ""
282     endif
283     endif
284     else
285     cd src
286     foreach i ( $srcdirs )
287     pushd $i
288     echo "In directory $i..."
289     make -f Rmakefile $*
290     popd
291     end
292     echo "Done."
293     cd ..
294     endif
295     foreach i ( $* )
296     if ( "$i" == clean ) then
297     echo "Removing library archives..."
298 greg 1.3 rm -f src/lib/*.[ao]
299 greg 1.1 endif
300     end
301     exit 0