#!/bin/csh -f
#			Build all WWW Code for this platform
#
# (c) COPYRIGHT MIT 1995.
# Please first read the full copyright statement in the file COPYRIGH.
#

# When BUILDing a SOCKSified httpd:
# Set this to the location of your ready-built SOCKS library
# setenv SOCKSLIB /xxxx/yyyy/libsocks.a
## Use this setting to enable SOCKS:
# setenv SOCKS_FLAGS -DSOCKS
## ..OR this setting to enable both SOCKS _and_ client access control:
# setenv SOCKS_FLAGS "-DSOCKS -DCLIENT_CONTROL"
## Note that cern_httpd's normal access control can be used instead.

set UNAME=""
if (-e /usr/bin/uname)		set UNAME=`/usr/bin/uname`
if (-e /bin/uname)		set UNAME=`/bin/uname`
if (-e /usr/apollo/bin)		set UNAME=`ver sys5.3 /bin/uname`
if (-e /usr/bin/ncrm)		set UNAME=ncr
if (-e /usr/bin/swconfig)	set UNAME=sco
if (-e /usr/lib/NextStep/software_version)	set UNAME=next
#
setenv UNAME $UNAME
setenv WWW_MACH ""

if ($UNAME == next)		setenv WWW_MACH	next
if ($UNAME == ncr)		setenv WWW_MACH	ncr
if ($UNAME == sco) then
	setenv WWW_MACH	sco
	setenv PATH "${PATH}:/usr/local/bin"
endif
if ($UNAME == "HP-UX") then
	set machine=`uname -m`
	if ($machine =~ 9000/[34]*) then
		setenv WWW_MACH hp300
	else
		setenv WWW_MACH snake
	endif
endif
if ($UNAME == "IRIX")		setenv WWW_MACH	sgi
if ($UNAME == "SunOS") then
	set arch=`arch`
	set revision=`uname -r`
	if ($revision =~ 5.* ) then
		setenv	WWW_MACH	${arch}-sol2
	else
		setenv	WWW_MACH	${arch}
	endif
endif
if ($UNAME == "ULTRIX")		setenv WWW_MACH	ultrix
if ($UNAME == "AIX")    	setenv WWW_MACH	aix
if ($UNAME == "OSF1")   	setenv WWW_MACH	osf1
if ($UNAME == "BSD/OS")		setenv WWW_MACH	unix
if ($UNAME == "Linux")		setenv WWW_MACH	linux
if ($UNAME == "FreeBSD")        setenv WWW_MACH freebsd
if ($UNAME == "NetBSD")		setenv WWW_MACH	netbsd
if ($UNAME == "A/UX")		setenv WWW_MACH	apple
if ($UNAME == "SMP_DC.OSx")	setenv WWW_MACH	pyramid
if ($UNAME == "uts") then
	# differentiate between UTS 2 (SVR3/BSD) and UTS 4 (SVR4)
	set version=`uname -v`
	if ($version =~ 2.*) then
		setenv WWW_MACH		uts2
	else
		setenv WWW_MACH		uts4
	endif
endif
if (-e /etc/conf/kconfig.d) then
	grep _POSIX_VERION /usr/include/sys/unistd.h >/dev/null
	if ($status) then
		setenv WWW_MACH		isc3.0		# Lauren
	endif
endif

#
# DELL Unix (How can I tell I'm running on DELL????)
#
# setenv WWW_MACH dell

#
# Unisys Unix (How can I tell I'm running on Unisys????)
#
# setenv WWW_MACH unisys

if ($WWW_MACH == "") then
	echo ""
	echo "The environment variable WWW_MACH could not be set to the"
	echo "architecture code for the machine you are working on."
	echo "This is normally due to that the BUILD script could not"
	echo "figure out your platform." 
	echo ""
	echo "Please read how to modify the BUILD script in the README file"
	echo ""
	echo "If you have problems or want to send back your modifications"
	echo "then please contact <libwww@w3.org>."
	echo ""
	echo "Online documentation is available from <URL:http://www.w3.org/>"
	echo ""
	exit -1
endif
echo "________________________________________________________________"
echo "WWW build for machine type:                            " $WWW_MACH

#	Now go do build

#	We don't want SHELL set to something funny to screw up make

(cd All/Implementation; unsetenv SHELL; make $1)
set stat = $status
echo
echo "WWW build for " $WWW_MACH  " done. status = " $stat
exit $stat




