$NetBSD: patch-aa,v 1.3 2005/02/17 00:38:37 jschauma Exp $

Make this script run non-interactively.

--- makeall.orig	2003-12-14 12:24:09.000000000 -0500
+++ makeall	2005-02-15 17:41:37.000000000 -0500
@@ -36,17 +36,10 @@
 
 _EOF_
 if ( ! $?EDITOR ) then
-	echo -n "What is your preferred editor [vi]? "
-	set ans="$<"
-	if ( "$ans" != "" ) then
-		setenv EDITOR "$ans"
-	else
 		setenv EDITOR vi
-	endif
 endif
 again1:
-echo -n "Where do you want the executables [/usr/local/bin]? "
-set idir=$<
+set idir=@WRKSRC@/radiance/bin
 (echo $idir) >/dev/null
 if ( $status ) then
 	goto again1
@@ -54,19 +47,16 @@
 set idir=$idir
 if ( "$idir" == "" ) then
 	set idir=/usr/local/bin
-else if ( "$idir" !~ /* ) then
-	echo "Directory must be relative to root, please reenter"
-	goto again1
 endif
 if ( ! -d $idir ) then
-	mkdir $idir
+	mkdir -p $idir
 	if ( $status ) then
 		echo "Cannot create directory, please reenter"
 		goto again1
 	endif
 endif
-if ( ! -d $idir/dev ) then
-	mkdir $idir/dev
+if ( ! -d $idir/../dev ) then
+	mkdir -p $idir/../dev
 	if ( $status ) then
 		echo "Cannot create subdirectory, please reenter"
 		goto again1
@@ -84,10 +74,6 @@
 	goto gotrmake
 endif
 set newrmake
-more src/common/copyright.h
-echo -n "Do you understand and accept the terms of this agreement [n]? "
-set ans="$<"
-if ( "$ans" !~ [yY]* ) exit
 set special=
 set arch=
 set opt=
@@ -95,24 +81,7 @@
 set compat=
 set extras=
 set esuffix=
-cat << _EOF_
-
-Please select your system type from the following list:
-
-	1)	Sun Solaris
-	2)	HP workstation
-	3)	Silicon Graphics
-	4)	AIX (RS/6000)
-	5)	BSDI BSD/386
-	6)	Linux
-	7)	MacOS X
-	8)	FreeBSD
-	9)	Cygwin
-	10)	Other
-
-_EOF_
-echo -n "Choice? "
-set arch="$<"
+set arch=@PKGSRC_ARCH@
 switch ("$arch")
 case 1:			# SPARC Station
 	set arch=sun
@@ -163,7 +132,7 @@
 	set compat="malloc.o erf.o strcmp.o"
 	breaksw
 case 6:			# Linux
-	set mach="-Dlinux -D_FILE_OFFSET_BITS=64 -L/usr/X11R6/lib -I/usr/include/X11 -DNOSTEREO"
+	set mach="-Dlinux -D_FILE_OFFSET_BITS=64 -L/usr/X11R6/lib -I/usr/X11R6/include -DNOSTEREO"
 	set opt="-O2 -DSPEED=200"
 	set arch=IBMPC
 	set compat="bmalloc.o erf.o getpagesize.o"
@@ -181,11 +150,16 @@
 	set mach="-DBSD -DNOSTEREO -Dfreebsd -I/usr/X11R6/include -L/usr/X11R6/lib"
 	set opt="-O -DSPEED=200"
 	set compat="bmalloc.o erf.o"
-	set extras="CC=cc"
 	set arch=IBMPC
 	breaksw
-case 9:			# Cygwin
-	set mach="-Dfreebsd -L/usr/lib -L/usr/X11R6/lib -I/usr/include/X11 -I/usr/X11R6/include -DNOSTEREO"
+case 9:			# NetBSD
+	set mach="-DBSD -DNOSTEREO -Dnetbsd -I/usr/X11R6/include -L/usr/X11R6/lib"
+	set opt="-O -DSPEED=200"
+	set compat="bmalloc.o erf.o"
+	set arch=IBMPC
+	breaksw
+case 10:			# Cygwin
+	set mach="-Dfreebsd -L/usr/lib -L/usr/X11R6 -I/usr/X11R6/include -DNOSTEREO"
 	set opt="-O2 -DSPEED=200"
 	set arch=IBMPC
 	set compat="bmalloc.o erf.o getpagesize.o"
@@ -193,7 +167,7 @@
 	set special="ogl"
 	set esuffix=".exe"
 	breaksw
-case 10:			# Other
+case 11:			# Other
 	set opt="-O"
 	set compat="bmalloc.o erf.o strcmp.o"
 	echo -n "Are you using the GNU C compiler [n]? "
@@ -211,7 +185,7 @@
 source installib
 sed 's/[ 	]*$//' > $rmake << _EOF_
 #!/bin/sh
-exec make "SPECIAL=$special" \
+exec @MAKE@ "SPECIAL=$special" \
 	"OPT=$opt" \
 	"MACH=$mach" \
 	ARCH=$arch "COMPAT=$compat" \
@@ -225,28 +199,16 @@
 gotrmake:
 echo "Current rmake command is:"
 cat $rmake
-echo -n "Do you want to change it? "
-set ans="$<"
-if ( "$ans" =~ [yY]* ) then
-	cp $rmake /tmp/rmake$$
-	$EDITOR $rmake
-	if ( `cat $rmake /tmp/rmake$$ | grep OPT= | uniq | wc -l` == 2 ) set newrmake
-	rm -f /tmp/rmake$$
-endif
 if ( ! -d src/lib ) then
 	mkdir src/lib
 endif
-if ( $?newrmake ) then
-	echo 'New rmake command -- running "makeall clean"...'
-	csh -f $0 clean
-endif
 cd src
 echo "Making programs..."
 set errs=0
 foreach i ( $srcdirs )
 	pushd $i
 	echo "In directory $i..."
-	$rmake -k $*
+	$rmake $*
 	@ errs += $status
 	popd
 end
@@ -256,22 +218,6 @@
 	echo "Done."
 endif
 cd ..
-if (! $inpath ) then
-	echo ""
-	echo "Add $idir to the beginning of your execution path:"
-	echo 'For C-shell users, put the following into ~/.cshrc'
-	echo "	set path=( $idir "'$path )'
-	echo 'For Bourne shell users, put the following into $HOME/profile'
-	echo "	PATH=$idir"':$PATH'
-	echo "	export PATH"
-endif
-if (! -d /usr/tmp) then
-	ln -s /tmp /usr/tmp
-	if ($status) then
-		echo ""
-		echo "IMPORTANT: Execute 'sudo ln -s /tmp /usr/tmp'"
-	endif
-endif
 else
 cd src
 foreach i ( $srcdirs )
