ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/makeall
Revision: 1.4
Committed: Tue Apr 29 15:27:49 2003 UTC (20 years, 11 months ago) by greg
Branch: MAIN
Changes since 1.3: +9 -13 lines
Log Message:
Took "ogl" special compile away for Solaris, which doesn't seem to support it

File Contents

# Content
1 #!/bin/csh -f
2 # RCSid $Id$
3 #
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 if ( $status ) then
54 goto again1
55 endif
56 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 if ( "`ls -tL $rmake $0 |& head -1`" == $rmake ) then
79 goto gotrmake
80 endif
81 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 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 breaksw
150 case 2: # HP workstation
151 set mach=""
152 set opt="-O -DSPEED=80 -Aa -D_HPUX_SOURCE"
153 set compat="bmalloc.o getpagesize.o strcmp.o"
154 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 set compat="bmalloc.o strcmp.o"
178 breaksw
179 endsw
180 breaksw
181 case 4: # AIX
182 set mach="-Dvoid=char -D_NO_PROTO -DINCL_SEL_H"
183 set opt="-O"
184 set compat="bmalloc.o erf.o"
185 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 breaksw
222 default:
223 echo "Illegal choice\!"
224 echo "Installation aborted."
225 exit 1
226 breaksw
227 endsw
228 # We don't seem to have any more cramped machines out there, so...
229 set mem="-DBIGMEM"
230 if ( $?mem ) then
231 set mach="$mach $mem"
232 else
233 echo -n "Does the target machine have more than 24 Mbytes of RAM? "
234 set ans="$<"
235 if ( "$ans" =~ [yY]* ) then
236 echo -n "More than 96 Mbytes? "
237 set ans="$<"
238 if ( "$ans" =~ [yY]* ) then
239 set mach="$mach -DBIGMEM"
240 set sizemod="huge models (100,000+ surfaces)"
241 else
242 set sizemod="very large models (30,000+ surfaces)"
243 endif
244 else
245 set sizemod="large models (10,000+ surfaces)"
246 endif
247 endif
248 # echo "Do you expect to be rendering $sizemod?"
249 # echo -n '(Answering "yes" may adversly affect rendering time and geometric accuracy) '
250 # set ans="$<"
251 # if ( "$ans" =~ [yY]* ) then
252 # set opt="$opt -DSMLFLT"
253 # endif
254 # echo -n "Do you have X10 support [n]? "
255 # if ( "$<" =~ [yY]* ) then
256 # set special="$special x10"
257 # endif
258 source installib
259 sed 's/[ ]*$//' > $rmake << _EOF_
260 #!/bin/sh
261 exec make "SPECIAL=$special" \
262 "OPT=$opt" \
263 "MACH=$mach" \
264 ARCH=$arch "COMPAT=$compat" \
265 INSTDIR=$idir \
266 LIBDIR=$ldir \
267 $extras "\$@" -f Rmakefile
268 _EOF_
269 chmod 755 $rmake
270 chmod 644 src/*/Rmakefile src/rt/devtable.c
271 gotrmake:
272 echo "Current rmake command is:"
273 cat $rmake
274 echo -n "Do you want to change it? "
275 set ans="$<"
276 if ( "$ans" =~ [yY]* ) then
277 cp $rmake /tmp/rmake$$
278 $EDITOR $rmake
279 if ( `cat $rmake /tmp/rmake$$ | grep OPT= | uniq | wc -l` == 2 ) set newrmake
280 rm -f /tmp/rmake$$
281 endif
282 if ( ! -d src/lib ) then
283 mkdir src/lib
284 endif
285 if ( $?newrmake ) then
286 echo 'New rmake command -- running "makeall clean"...'
287 csh -f $0 clean
288 endif
289 cd src
290 echo "Making programs..."
291 set errs=0
292 foreach i ( $srcdirs )
293 pushd $i
294 echo "In directory $i..."
295 $rmake -k $*
296 @ errs += $status
297 popd
298 end
299 if ( $errs ) then
300 echo "There were some errors."
301 else
302 echo "Done."
303 endif
304 cd ..
305 if (! -d /usr/tmp) then
306 ln -s /tmp /usr/tmp
307 if ($status) then
308 echo ""
309 echo "IMPORTANT: Execute 'sudo ln -s /tmp /usr/tmp'"
310 echo ""
311 endif
312 endif
313 else
314 cd src
315 foreach i ( $srcdirs )
316 pushd $i
317 echo "In directory $i..."
318 make -f Rmakefile $*
319 popd
320 end
321 echo "Done."
322 cd ..
323 endif
324 foreach i ( $* )
325 if ( "$i" == clean ) then
326 echo "Removing library archives..."
327 rm -f src/lib/*.[ao]
328 endif
329 end
330 exit 0