$NetBSD: patch-aa,v 1.4 2006/02/26 21:26:32 joerg Exp $

--- makeall.orig	2003-12-14 17:24:09.000000000 +0000
+++ makeall
@@ -36,17 +36,10 @@ You must first answer the following ques
 
 _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 @@ endif
 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 @@ if ( "`ls -tL $rmake $0 |& head -1`" == 
 	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 mach=
 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,14 +132,14 @@ case 5:			# BSDI BSD/386
 	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${X11BASE}/lib -I${X11BASE}/include -DNOSTEREO"
 	set opt="-O2 -DSPEED=200"
 	set arch=IBMPC
 	set compat="bmalloc.o erf.o getpagesize.o"
 	set extras=CC=gcc
 	breaksw
 case 7:			# MacOS X
-	set mach="-DBSD -DNOSTEREO -Dfreebsd -I/usr/X11R6/include -L/usr/X11R6/lib"
+	set mach="-DBSD -DNOSTEREO -Dfreebsd -I${X11BASE}/include -L${X11BASE}/lib"
 	set opt="-O2 -DSPEED=200"
 	set arch=PowerPC
 	set compat="bmalloc.o"
@@ -178,14 +147,19 @@ case 7:			# MacOS X
 	set special="ogl"
 	breaksw
 case 8:			# FreeBSD
-	set mach="-DBSD -DNOSTEREO -Dfreebsd -I/usr/X11R6/include -L/usr/X11R6/lib"
+	set mach="-DBSD -DNOSTEREO -Dfreebsd -I${X11BASE}/include -L${X11BASE}/lib"
+	set opt="-O -DSPEED=200"
+	set compat="bmalloc.o erf.o"
+	set arch=IBMPC
+	breaksw
+case 9:			# NetBSD
+	set mach="-DBSD -DNOSTEREO -Dnetbsd -I${X11BASE}/include -L${X11BASE}/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 10:			# Cygwin
+	set mach="-Dfreebsd -L/usr/lib -L${X11BASE} -I${X11BASE}/include -DNOSTEREO"
 	set opt="-O2 -DSPEED=200"
 	set arch=IBMPC
 	set compat="bmalloc.o erf.o getpagesize.o"
@@ -193,7 +167,7 @@ case 9:			# Cygwin
 	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]? "
@@ -202,6 +176,12 @@ case 10:			# Other
 	endif
 	set arch=other
 	breaksw
+case 12:			# DragonFly
+	set mach="-DBSD -DNOSTEREO -Ddragonfly -I${X11BASE}/include -L${X11BASE}/lib"
+	set opt="-O -DSPEED=200"
+	set compat="bmalloc.o erf.o"
+	set arch=IBMPC
+	breaksw
 default:
 	echo "Illegal choice\!"
 	echo "Installation aborted."
@@ -211,7 +191,7 @@ endsw
 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 +205,16 @@ chmod 644 src/*/Rmakefile src/rt/devtabl
 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 +224,6 @@ else
 	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 )
