head	1.12;
access;
symbols
	perseant-exfatfs-base-20250801:1.12
	perseant-exfatfs-base-20240630:1.12
	cjep_sun2x:1.12.0.44
	cjep_sun2x-base:1.12
	cjep_staticlib_x-base1:1.12
	cjep_staticlib_x:1.12.0.42
	cjep_staticlib_x-base:1.12
	phil-wifi-20200421:1.12
	phil-wifi-20200411:1.12
	phil-wifi-20200406:1.12
	pgoyette-compat-merge-20190127:1.12
	pgoyette-compat-20190127:1.12
	pgoyette-compat-20190118:1.12
	pgoyette-compat-1226:1.12
	pgoyette-compat-1126:1.12
	pgoyette-compat-1020:1.12
	pgoyette-compat-0930:1.12
	pgoyette-compat-0906:1.12
	pgoyette-compat-0728:1.12
	pgoyette-compat-0625:1.12
	pgoyette-compat-0521:1.12
	pgoyette-compat-0502:1.12
	pgoyette-compat-0422:1.12
	pgoyette-compat-0415:1.12
	pgoyette-compat-0407:1.12
	pgoyette-compat-0330:1.12
	pgoyette-compat-0322:1.12
	pgoyette-compat-0315:1.12
	pgoyette-compat:1.12.0.40
	pgoyette-compat-base:1.12
	perseant-stdc-iso10646:1.12.0.38
	perseant-stdc-iso10646-base:1.12
	prg-localcount2-base3:1.12
	prg-localcount2-base2:1.12
	prg-localcount2-base1:1.12
	prg-localcount2:1.12.0.36
	prg-localcount2-base:1.12
	pgoyette-localcount-20170426:1.12
	bouyer-socketcan-base1:1.12
	pgoyette-localcount-20170320:1.12
	bouyer-socketcan:1.12.0.34
	bouyer-socketcan-base:1.12
	pgoyette-localcount-20170107:1.12
	pgoyette-localcount-20161104:1.12
	localcount-20160914:1.12
	pgoyette-localcount-20160806:1.12
	pgoyette-localcount-20160726:1.12
	pgoyette-localcount:1.12.0.32
	pgoyette-localcount-base:1.12
	netbsd-5-2-3-RELEASE:1.12
	netbsd-5-1-5-RELEASE:1.12
	yamt-pagecache-base9:1.12
	yamt-pagecache-tag8:1.12
	tls-earlyentropy:1.12.0.28
	tls-earlyentropy-base:1.12
	riastradh-xf86-video-intel-2-7-1-pre-2-21-15:1.12
	riastradh-drm2-base3:1.12
	netbsd-5-2-2-RELEASE:1.12
	netbsd-5-1-4-RELEASE:1.12
	netbsd-5-2-1-RELEASE:1.12
	netbsd-5-1-3-RELEASE:1.12
	agc-symver:1.12.0.30
	agc-symver-base:1.12
	tls-maxphys-base:1.12
	yamt-pagecache-base8:1.12
	netbsd-5-2:1.12.0.26
	yamt-pagecache-base7:1.12
	netbsd-5-2-RELEASE:1.12
	netbsd-5-2-RC1:1.12
	yamt-pagecache-base6:1.12
	yamt-pagecache-base5:1.12
	yamt-pagecache-base4:1.12
	netbsd-5-1-2-RELEASE:1.12
	netbsd-5-1-1-RELEASE:1.12
	yamt-pagecache-base3:1.12
	yamt-pagecache-base2:1.12
	yamt-pagecache:1.12.0.24
	yamt-pagecache-base:1.12
	bouyer-quota2-nbase:1.12
	bouyer-quota2:1.12.0.22
	bouyer-quota2-base:1.12
	matt-nb5-pq3:1.12.0.20
	matt-nb5-pq3-base:1.12
	netbsd-5-1:1.12.0.18
	netbsd-5-1-RELEASE:1.12
	netbsd-5-1-RC4:1.12
	netbsd-5-1-RC3:1.12
	netbsd-5-1-RC2:1.12
	netbsd-5-1-RC1:1.12
	netbsd-5-0-2-RELEASE:1.12
	netbsd-5-0-1-RELEASE:1.12
	jym-xensuspend-nbase:1.12
	netbsd-5-0:1.12.0.16
	netbsd-5-0-RELEASE:1.12
	netbsd-5-0-RC4:1.12
	netbsd-5-0-RC3:1.12
	netbsd-5-0-RC2:1.12
	jym-xensuspend:1.12.0.14
	jym-xensuspend-base:1.12
	netbsd-5-0-RC1:1.12
	netbsd-5:1.12.0.12
	netbsd-5-base:1.12
	mjf-devfs2:1.12.0.10
	mjf-devfs2-base:1.12
	yamt-pf42-base4:1.12
	yamt-pf42-base3:1.12
	hpcarm-cleanup-nbase:1.12
	yamt-pf42-base2:1.12
	yamt-pf42:1.12.0.8
	yamt-pf42-base:1.12
	keiichi-mipv6:1.12.0.6
	keiichi-mipv6-base:1.12
	cube-autoconf:1.12.0.4
	cube-autoconf-base:1.12
	hpcarm-cleanup:1.12.0.2
	hpcarm-cleanup-base:1.12
	netbsd-3-1-1-RELEASE:1.11
	netbsd-3-0-3-RELEASE:1.11
	netbsd-3-1:1.11.0.6
	netbsd-3-1-RELEASE:1.11
	netbsd-3-0-2-RELEASE:1.11
	netbsd-3-1-RC4:1.11
	netbsd-3-1-RC3:1.11
	netbsd-3-1-RC2:1.11
	netbsd-3-1-RC1:1.11
	netbsd-3-0-1-RELEASE:1.11
	netbsd-3-0:1.11.0.4
	netbsd-3-0-RELEASE:1.11
	netbsd-3-0-RC6:1.11
	netbsd-3-0-RC5:1.11
	netbsd-3-0-RC4:1.11
	netbsd-3-0-RC3:1.11
	netbsd-3-0-RC2:1.11
	netbsd-3-0-RC1:1.11
	netbsd-2-0-3-RELEASE:1.10
	netbsd-2-1:1.10.0.6
	netbsd-2-1-RELEASE:1.10
	netbsd-2-1-RC6:1.10
	netbsd-2-1-RC5:1.10
	netbsd-2-1-RC4:1.10
	netbsd-2-1-RC3:1.10
	netbsd-2-1-RC2:1.10
	netbsd-2-1-RC1:1.10
	netbsd-2-0-2-RELEASE:1.10
	netbsd-3:1.11.0.2
	netbsd-3-base:1.11
	sendmail-8-13-3:1.1.1.11
	netbsd-2-0-1-RELEASE:1.10
	netbsd-2:1.10.0.4
	netbsd-2-base:1.10
	netbsd-2-0-RELEASE:1.10
	netbsd-2-0-RC5:1.10
	netbsd-2-0-RC4:1.10
	netbsd-2-0-RC3:1.10
	netbsd-2-0-RC2:1.10
	netbsd-2-0-RC1:1.10
	netbsd-2-0:1.10.0.2
	netbsd-2-0-base:1.10
	sendmail-8-12-11:1.1.1.10
	netbsd-1-6-PATCH002-RELEASE:1.7
	netbsd-1-6-PATCH002:1.7
	netbsd-1-6-PATCH002-RC4:1.7
	netbsd-1-6-PATCH002-RC3:1.7
	netbsd-1-6-PATCH002-RC2:1.7
	netbsd-1-6-PATCH002-RC1:1.7
	sendmail-8-12-9:1.1.1.9
	netbsd-1-6-PATCH001:1.7
	netbsd-1-6-PATCH001-RELEASE:1.7
	sendmail-8-12-8:1.1.1.8
	netbsd-1-6-PATCH001-RC3:1.7
	netbsd-1-6-PATCH001-RC2:1.7
	netbsd-1-6-PATCH001-RC1:1.7
	fvdl_fs64_base:1.7
	netbsd-1-6-RELEASE:1.7
	netbsd-1-6-RC3:1.7
	netbsd-1-6-RC2:1.7
	netbsd-1-6-RC1:1.7
	netbsd-1-6:1.7.0.2
	netbsd-1-6-base:1.7
	netbsd-1-5-PATCH003:1.2.2.3
	sendmail-8-11-6:1.1.1.7
	netbsd-1-5-PATCH002:1.2.2.2
	sendmail-8-11-5:1.1.1.6
	netbsd-1-5-PATCH001:1.2.2.2
	sendmail-8-11-4:1.1.1.5
	sendmail-8-11-3:1.1.1.5
	sendmail-8-11-2:1.1.1.4
	netbsd-1-5-RELEASE:1.2.2.1
	netbsd-1-5-BETA2:1.2.2.1
	netbsd-1-5-BETA:1.2.2.1
	sendmail-8-11-1:1.1.1.3
	netbsd-1-5-ALPHA2:1.2
	sendmail-8-11-0:1.1.1.3
	netbsd-1-5:1.2.0.2
	netbsd-1-5-base:1.2
	sendmail-8-10-2:1.1.1.2
	sendmail-8-10-1:1.1.1.1
	SENDMAIL_INC:1.1.1;
locks; strict;
comment	@# @;


1.12
date	2006.05.30.00.42.36;	author christos;	state dead;
branches;
next	1.11;

1.11
date	2005.03.15.02.14.16;	author atatat;	state Exp;
branches;
next	1.10;

1.10
date	2004.03.25.19.14.30;	author atatat;	state Exp;
branches;
next	1.9;

1.9
date	2003.06.01.14.06.56;	author atatat;	state Exp;
branches;
next	1.8;

1.8
date	2003.03.24.15.03.48;	author atatat;	state Exp;
branches;
next	1.7;

1.7
date	2001.08.21.07.13.24;	author itojun;	state Exp;
branches;
next	1.6;

1.6
date	2001.08.01.03.27.33;	author itojun;	state Exp;
branches;
next	1.5;

1.5
date	2001.02.28.04.12.08;	author itojun;	state Exp;
branches;
next	1.4;

1.4
date	2001.01.04.12.36.50;	author itojun;	state Exp;
branches;
next	1.3;

1.3
date	2000.07.23.14.24.52;	author itojun;	state Exp;
branches;
next	1.2;

1.2
date	2000.05.03.10.50.05;	author itojun;	state Exp;
branches
	1.2.2.1;
next	1.1;

1.1
date	2000.05.03.09.27.17;	author itojun;	state Exp;
branches
	1.1.1.1;
next	;

1.2.2.1
date	2000.08.13.16.49.20;	author itojun;	state Exp;
branches;
next	1.2.2.2;

1.2.2.2
date	2001.03.09.17.49.49;	author he;	state Exp;
branches;
next	1.2.2.3;

1.2.2.3
date	2002.02.20.23.12.15;	author he;	state Exp;
branches;
next	;

1.1.1.1
date	2000.05.03.09.27.17;	author itojun;	state Exp;
branches;
next	1.1.1.2;

1.1.1.2
date	2000.06.13.16.52.20;	author itojun;	state Exp;
branches;
next	1.1.1.3;

1.1.1.3
date	2000.07.23.14.07.33;	author itojun;	state Exp;
branches;
next	1.1.1.4;

1.1.1.4
date	2001.01.04.12.21.35;	author itojun;	state Exp;
branches;
next	1.1.1.5;

1.1.1.5
date	2001.02.28.03.57.35;	author itojun;	state Exp;
branches;
next	1.1.1.6;

1.1.1.6
date	2001.08.01.02.46.24;	author itojun;	state Exp;
branches;
next	1.1.1.7;

1.1.1.7
date	2001.08.21.06.57.35;	author itojun;	state Exp;
branches;
next	1.1.1.8;

1.1.1.8
date	2003.03.24.14.47.07;	author atatat;	state Exp;
branches;
next	1.1.1.9;

1.1.1.9
date	2003.06.01.14.01.14;	author atatat;	state Exp;
branches;
next	1.1.1.10;

1.1.1.10
date	2004.03.25.18.57.21;	author atatat;	state Exp;
branches;
next	1.1.1.11;

1.1.1.11
date	2005.03.15.02.05.33;	author atatat;	state Exp;
branches;
next	;


desc
@@


1.12
log
@Remove sendmail.
@
text
@#!/bin/sh

# Copyright (c) 1998-2002 Sendmail, Inc. and its suppliers.
#	All rights reserved.
# Copyright (c) 1993, 1996-1997 Eric P. Allman.  All rights reserved.
# Copyright (c) 1993
#	The Regents of the University of California.  All rights reserved.
#
# By using this file, you agree to the terms and conditions set
# forth in the LICENSE file which can be found at the top level of
# the sendmail distribution.
#
#
#	Id: Build,v 8.184 2003/08/20 18:08:35 gshapiro Exp
#	$NetBSD: Build,v 1.11 2005/03/15 02:14:16 atatat Exp $
#

#
#  A quick-and-dirty script to compile sendmail and related programs
#  in the presence of multiple architectures.  To use, just use
#  "sh Build".
#

trap "rm -f $obj/.settings$$; exit" 1 2 3 15

cflag=""
mflag=""
Mflag=""
Aflag=""
sflag=""
makeargs=""
libdirs=""
incdirs=""
libsrch=""
libpath=""
siteconfig=""
pfx=""
obj=""
oscf=""
arch=""
os=""
rel=""
mkdir="mkdir -p"
SENDMAIL_BUILD_FLAGS=""
EX_OK=0
EX_USAGE=64
EX_NOINPUT=66
EX_UNAVAILABLE=69
SHELL=/bin/sh

# default to a optimized build to behave like the old system.
build_variant="optimized"

full_src_dir=`pwd`
if [ -z "$src_dir" ]
then
	src_dir=`basename ${full_src_dir}`
fi
absolute_base_dir=`echo ${full_src_dir} | sed "s#${src_dir}\\$##"`
obj_rel_base_dir='../..'

while [ ! -z "$1" ]
do
	case $1
	in
	  -src)	# Specify pathname of source directory relative to
		# root of cvs tree.  This relative pathname may have
		# multiple components, as in 'foo/bar/baz', and will also
		# be used to form the pathname of the object directory.
		shift
		arg=$1
		if [ -z "$arg" ]
		then
			echo "Missing arg for -src" >&2
			exit $EX_USAGE
		fi
		case $arg
		in
		  /*)	echo "Arg for -src must not begin with / ($arg)" >&2
			exit $EX_USAGE
			;;
		esac
		src_dir="$arg"
		absolute_base_dir=`echo ${full_src_dir} | sed "s;/${src_dir}$;;"`
		obj_rel_base_dir=`echo x/${src_dir} | sed "s;[^/][^/]*;..;g"`
		SMROOT=${absolute_base_dir}
		shift
		;;
	  -c)	# clean out existing $obj tree
		cflag=1
		SENDMAIL_BUILD_FLAGS="$SENDMAIL_BUILD_FLAGS $1"
		shift
		;;

	  -m)	# show Makefile name only
		mflag=1
		shift
		;;

	  -M)	# show the name of the obj. directory
		Mflag=1
		shift
		;;

	  -A)   # show the name of the architecture
		Aflag=1
		shift
		;;

	  -E*)	# environment variables to pass into Build
		arg=`echo $1 | sed 's/^-E//'`
		if [ -z "$arg" ]
		then
			shift   # move to argument
			arg=$1
		fi
		if [ -z "$arg" ]
		then
			echo "Empty -E flag" >&2
			exit $EX_USAGE
		else
			case $arg
			in
			  *=*)	# check format
				eval $arg
				export `echo $arg | sed 's;=.*;;'`
				SENDMAIL_BUILD_FLAGS="$SENDMAIL_BUILD_FLAGS -E \"$arg\""
				;;
			  *)	# bad format
				echo "Bad format for -E argument ($arg)" >&2
				exit $EX_USAGE
				;;
			esac
			shift
		fi
		;;

	  -L*)	# set up LIBDIRS
		libdirs="$libdirs $1"
		SENDMAIL_BUILD_FLAGS="$SENDMAIL_BUILD_FLAGS $1"
		shift
		;;

	  -I*)	# set up INCDIRS
		incdirs="$incdirs $1"
		SENDMAIL_BUILD_FLAGS="$SENDMAIL_BUILD_FLAGS $1"
		shift
		;;

	  -f*)	# select site config file
		arg=`echo $1 | sed 's/^-f//'`
		if [ -z "$arg" ]
		then
			shift   # move to argument
			arg=$1
		fi
		if [ "$pfx" ]
		then
			echo "May not use -f and -Q together"
			exit $EX_USAGE
		fi
		if [ "$siteconfig" ]
		then
			echo "Only one -f flag allowed" >&2
			exit $EX_USAGE
		else
			siteconfig=$arg
			if [ -z "$siteconfig" ]
			then
				echo "Missing argument for -f flag" >&2
				exit $EX_USAGE
			elif [ ! -f "$siteconfig" ]
			then
				echo "${siteconfig}: File not found"
				exit $EX_NOINPUT
			else
				shift	# move past argument
				case $arg
				in
					/*)
					SENDMAIL_BUILD_FLAGS="$SENDMAIL_BUILD_FLAGS -f \"$siteconfig\""
					;;
					*)
					SENDMAIL_BUILD_FLAGS="$SENDMAIL_BUILD_FLAGS -f \"${full_src_dir}/$siteconfig\""
					;;
				esac
			fi
		fi
		;;

	  -O*) # Set object directory manually.
		arg="`echo $1 | sed 's/^-O//'`"
		if [ -z "$arg" ]
		then
			shift   # move to argument
			arg="$1"
		fi
		case $arg
		in
			/*)
			OBJ_ROOT="$arg"
			SENDMAIL_BUILD_FLAGS="$SENDMAIL_BUILD_FLAGS -O \"$OBJ_ROOT\""
			obj_rel_base_dir=$absolute_base_dir
			;;
			*)
			echo "Absolute directory path required for -O flag" >&2
			exit $EX_USAGE
			;;
		esac
		shift
		;;

	  -S)	# skip auto-configure
		sflag="-s"
		SENDMAIL_BUILD_FLAGS="$SENDMAIL_BUILD_FLAGS $1"
		shift
		;;

	  -Q*)	# Select a prefix for the Site/*.config.m4 file
		arg=`echo $1 | sed 's/^-Q//'`
		if [ -z "$arg" ]
		then
			shift   # move to argument
			arg=$1
		fi
		if [ -z "$arg" ]
		then
			echo "Empty -Q flag" >&2
			exit $EX_USAGE
		elif [ "$siteconfig" ]
		then
			echo "May not use -Q and -f together" >&2
			exit $EX_USAGE
		elif [ "$pfx" ]
		then
			echo "Only one -Q allowed" >&2
			exit $EX_USAGE
		else
			pfx=$arg
			SENDMAIL_BUILD_FLAGS="$SENDMAIL_BUILD_FLAGS -Q \"$pfx\""
		fi
		shift
		;;

	  -v)	# Select a build variant: debug, optimized, purify, whatever.
		shift
		build_variant=$1
		if [ -z "$build_variant" ]
		then
			echo "Usage error with \"-v\" <build_variant>"  >&2
			echo "You must specify exactly one build variant of debug|optimized|purify"  >&2
			exit $EX_USAGE
		fi
		shift
		;;

	  *)	# pass argument to make
		makeargs="$makeargs \"$1\""
		#SENDMAIL_BUILD_FLAGS="$SENDMAIL_BUILD_FLAGS \"$1\""
		shift
		;;
	esac
done

# process selected build variant.
case $build_variant in
	debug)
		M4_BLDVARIANT_FLAGS="-DconfBLDVARIANT=DEBUG"
		;;
	optimized)
		M4_BLDVARIANT_FLAGS="-DconfBLDVARIANT=OPTIMIZED"
		;;
	purify)
		M4_BLDVARIANT_FLAGS="-DconfBLDVARIANT=PURIFY"
		echo "Sorry, the purify build variant has not been plumbed yet. (Bummer.)"  >&2
		exit $EX_USAGE
		;;
	*)
		exit $EX_USAGE
		;;
esac


#
#  Do heuristic guesses !ONLY! for machines that do not have uname
#
if [ -d /NextApps -a ! -f /bin/uname -a ! -f /usr/bin/uname ]
then
	# probably a NeXT box
	arch=`hostinfo | sed -n 's/.*Processor type: \([^ ]*\).*/\1/p'`
	os=NeXT
	rel=`hostinfo | sed -n 's/.*NeXT Mach \([0-9\.]*\).*/\1/p'`
elif [ -f /usr/sony/bin/machine -a -f /etc/osversion ]
then
	# probably a Sony NEWS 4.x
	os=NEWS-OS
	rel=`awk '{ print $3}' /etc/osversion`
	arch=`/usr/sony/bin/machine`
elif [ -d /usr/omron -a -f /bin/luna ]
then
	# probably a Omron LUNA
	os=LUNA
	if [ -f /bin/luna1 ] && /bin/luna1
	then
		rel=unios-b
		arch=luna1
	elif [ -f /bin/luna2 ] && /bin/luna2
	then
		rel=Mach
		arch=luna2
	elif [ -f /bin/luna88k ] && /bin/luna88k
	then
		rel=Mach
		arch=luna88k
	fi
elif [ -d /usr/apollo -a -d \`node_data ]
then
	# probably a Apollo/DOMAIN
	os=DomainOS
	arch=$ISP
	rel=`/usr/apollo/bin/bldt | grep Domain | awk '{ print $4 }' | sed -e 's/,//g'`
fi

if [ ! "$arch" -a ! "$os" -a ! "$rel" ]
then
	arch=`uname -m | sed -e 's/ //g' -e 's/\//-/g'`
	os=`uname -s | sed -e 's/\//-/g' -e 's/ //g'`
	rel=`uname -r | sed -e 's/(/-/g' -e 's/)//g' -e 's/ //g'`
fi

#
#  Tweak the values we have already got.  PLEASE LIMIT THESE to
#  tweaks that are absolutely necessary because your system uname
#  routine doesn't return something sufficiently unique.  Don't do
#  it just because you don't like the name that is returned.  You
#  can combine the architecture name with the os name to create a
#  unique Makefile name.
#

# tweak machine architecture
case $arch
in
  sun4*)	arch=sun4;;

  9000/*)	arch=`echo $arch | sed -e 's/9000.//' -e 's/..$/xx/'`;;

  DS/907000)	arch=ds90;;

  NILE*)	arch=NILE
		os=`uname -v`;;

  CRAYT3E)	os=UNICOS-mk;;
		
  CRAY[CJT]90*|CRAYTS|CRAYSV1*|CRAYY-MP)
		os=UNICOS;;
esac

# tweak operating system type and release
node=`uname -n | sed -e 's/\//-/g' -e 's/ //g'`
if [ "$os" = "$node" -a "$arch" = "i386" -a "$rel" = 3.2 -a "`uname -v`" = 2 ]
then
	# old versions of SCO UNIX set uname -s the same as uname -n
	os=SCO_SV
fi
if [ "$rel" = 4.0 ]
then
	case $arch in
	  3[34]??|3[34]??,*|3[34]??[A-Z]|4[48]??|56??)
		if [ -d /usr/sadm/sysadm/add-ons/WIN-TCP ]
		then
			os=NCR.MP-RAS
			rel=2.x
			arch=i486
		elif [ -d /usr/sadm/sysadm/add-ons/inet ]
		then
			os=NCR.MP-RAS
			rel=3.x
			arch=i486
		fi
		;;
	esac
fi

case $os
in
  DYNIX-ptx)	os=PTX;;
  Paragon*)	os=Paragon;;
  HP-UX)	rel=`echo $rel | sed -e 's/^[^.]*\.0*//'`;;
  AIX)		osl=""
		if [ -x /bin/lslpp ]
		then
			osl=`/bin/lslpp -Lcq bos.rte | cut -f3 -d: | cut -f1-3 -d. 2>/dev/null`
			if [ $? = 0  -a -n "$osl" ]
			then
				rel=$osl
			else
				# command failed; fall back to old method
				osl=""
			fi
		fi
		# check whether it worked
		if [ -z "$osl" ]
		then
			rela=$rel
			rel=`uname -v`
			rel=$rel.$rela
		fi
		arch=PPC
		;;
  BSD-386)	os=BSD-OS;;
  SCO_SV)	os=SCO; rel=`uname -X | sed -n 's/Release = 3.2v//p'`;;
  UNIX_System_V) if [ "$arch" = "ds90" ]
		then
			os="UXPDS"
			rel=`uname -v | sed -e 's/\(V.*\)L.*/\1/'`
		fi;;
  ReliantUNIX-?|SINIX-?)	os=SINIX;;
  DomainOS)	case $rel in
		  10.4*)	rel=10.4;;
		esac
		;;
  IRIX*)	rel=`echo $rel | sed -e 's/-.*$//'`;;
  NeXT)		mkdir="mkdirs";;
  UNICOSMK)	rel=`echo $rel | sed -e 's/\(.*\)\.\(.*\)\.\(.*\)\..*$/\1.\2.\3/'`;;
  UNICOS*)	rel=`echo $rel | sed -e 's/\(.*\)\.\(.*\)\..*$/\1.\2/'`;;
esac

# get "base part" of operating system release
rroot=`echo $rel | sed -e 's/\.[^.]*$//'`
rbase=`echo $rel | sed -e 's/\..*//'`
if [ "$rroot" = "$rbase" ]
then
	rroot=$rel
fi

# heuristic tweaks to clean up names -- PLEASE LIMIT THESE!
if [ "$os" = "unix" ]
then
	# might be Altos System V
	case $rel
	in
	  5.3*)		os=Altos;;
	esac
elif [ -r /unix -a -r /usr/lib/libseq.a -a -r /lib/cpp ]
then
	# might be a DYNIX/ptx 2.x system, which has a broken uname
	if strings /lib/cpp | grep _SEQUENT_ > /dev/null
	then
		os=PTX
	fi
elif [ -d /usr/nec ]
then
	# NEC machine -- what is it running?
	if [ "$os" = "UNIX_System_V" ]
	then
		os=EWS-UX_V
	elif [ "$os" = "UNIX_SV" ]
	then
		os=UX4800
	fi
elif [ "$arch" = "mips" ]
then
	case $rel
	in
	  4_*)
		if [ `uname -v` = "UMIPS" ]
		then
			os=RISCos
		fi;;
	esac
fi

# see if there is a "user suffix" specified
if [ "${SENDMAIL_SUFFIX-}x" = "x" ]
then
	sfx=""
else
	sfx=".${SENDMAIL_SUFFIX}"
fi

if [ ! -n "$Mflag" -a ! -n "$Aflag" ]
then
	echo "Configuration: pfx=$pfx, os=$os, rel=$rel, rbase=$rbase, rroot=$rroot, arch=$arch, sfx=$sfx, variant=$build_variant"
fi

SMROOT=${SMROOT-`(cd ..;pwd)`}
BUILDTOOLS=${BUILDTOOLS-$SMROOT/devtools}
export SMROOT BUILDTOOLS

# see if we are in a Build-able directory
if [ ! -f Makefile.m4 -a ! -n "$Aflag" ]; then
	echo "Makefile.m4 not found.  Build can only be run from a source directory."
	exit $EX_UNAVAILABLE
fi

incdirs="$incdirs -I\${SRCDIR}/include"

if [ -z "$OBJ_ROOT" ]; then
	OBJ_ROOT=${SMROOT}
fi

if [ "${pfx}x" = "x" ]
then
	prefix=""
else
	prefix=".$pfx"
fi

# Print out the architecture (to build up an obj dir path) and exit
if [ -n "$Aflag" ]
then
	echo "$os.$rel.$arch$sfx"
	exit $EX_OK
fi

# now try to find a reasonable object directory
if [ -r ${OBJ_ROOT}/obj${prefix}.$os.$rel.$arch$sfx ]; then
	abs_obj_dir=${OBJ_ROOT}/obj${prefix}.$os.$rel.$arch$sfx
elif [ -r ${OBJ_ROOT}/obj${prefix}.$os.$rroot.$arch$sfx ]; then
	abs_obj_dir=${OBJ_ROOT}/obj${prefix}.$os.$rroot.$arch$sfx
elif [ -r ${OBJ_ROOT}/obj${prefix}.$os.$rbase.x.$arch$sfx ]; then
	abs_obj_dir=${OBJ_ROOT}/obj${prefix}.$os.$rbase.x.$arch$sfx
elif [ -r ${OBJ_ROOT}/obj${prefix}.$os.$rel$sfx ]; then
	abs_obj_dir=${OBJ_ROOT}/obj${prefix}.$os.$rel$sfx
elif [ -r ${OBJ_ROOT}/obj${prefix}.$os.$rbase.x$sfx ]; then
	abs_obj_dir=${OBJ_ROOT}/obj${prefix}.$os.$rbase.x$sfx
elif [ -r ${OBJ_ROOT}/obj${prefix}.$os.$arch$sfx ]; then
	abs_obj_dir=${OBJ_ROOT}/obj${prefix}.$os.$arch$sfx
elif [ -r ${OBJ_ROOT}/obj${prefix}.$rel.$arch$sfx ]; then
	abs_obj_dir=${OBJ_ROOT}/obj${prefix}.$rel.$arch$sfx
elif [ -r ${OBJ_ROOT}/obj${prefix}.$rbase.x.$arch$sfx ]; then
	abs_obj_dir=${OBJ_ROOT}/obj${prefix}.$rbase.x.$arch$sfx
elif [ -r ${OBJ_ROOT}/obj${prefix}.$os$sfx ]; then
	abs_obj_dir=${OBJ_ROOT}/obj${prefix}.$os$sfx
elif [ -r ${OBJ_ROOT}/obj${prefix}.$arch$sfx ]; then
	abs_obj_dir=${OBJ_ROOT}/obj${prefix}.$arch$sfx
elif [ -r ${OBJ_ROOT}/obj${prefix}.$rel$sfx ]; then
	abs_obj_dir=${OBJ_ROOT}/obj${prefix}.$rel$sfx
elif [ -r ${OBJ_ROOT}/obj${prefix}.$sfx ]; then
	abs_obj_dir=${OBJ_ROOT}/obj${prefix}.$sfx
fi

if [ -n "$abs_obj_dir" ]
then
	obj=${abs_obj_dir}/${src_dir}
fi

# Print the directory which would be used for the build and exit
if [ -n "$Mflag" ]
then
	if [ ! -n "$obj" ]
	then
		obj=${OBJ_ROOT}/obj.$os.$rel.$arch$sfx/${src_dir}
	fi
	echo "$obj"
	exit $EX_OK
fi

# Check if trying to use -f with an existing obj directory
if [ -n "$siteconfig" -a -n "$obj" -a -d "$obj" -a -z "$cflag" ]
then
	echo "Can not use Build's -f flag with an existing object tree."
	echo "If you wish to change configuration information, use the -c flag to clear"
	echo "the existing $obj tree."
	exit $EX_USAGE
fi

# Check if trying to use -Q with an existing obj directory
if [ -n "$pfx" -a -n "$obj" -a -d "$obj" -a -z "$cflag" ]
then
	echo "Can not use Build's -Q flag with an existing object tree."
	echo "If you wish to change configuration information, use the -c flag to clear"
	echo "the existing $obj tree."
	exit $EX_USAGE
fi


# Clean out the directory before building.
if [ "$cflag" ]
then
	if [ -n "$obj" ]
	then
		echo "Clearing out existing $obj tree"
		rm -rf $obj
	fi
fi

# If we didn't detect an existing obj directory, makeup a new obj name.
if [ -z "$obj" ]
then
	abs_obj_dir=${OBJ_ROOT}/obj${prefix}.$os.$rel.$arch$sfx
	obj=${abs_obj_dir}/${src_dir}
fi

# Check if obj directory exists
if [ ! -r "$obj" ]
then
	if [ -r $BUILDTOOLS/OS/$os.$rel.$arch$sfx ]; then
		oscf=$os.$rel.$arch$sfx
	elif [ -r $BUILDTOOLS/OS/$os.$rel.$arch ]; then
		oscf=$os.$rel.$arch
	elif [ -r $BUILDTOOLS/OS/$os.$rroot.$arch$sfx ]; then
		oscf=$os.$rroot.$arch$sfx
	elif [ -r $BUILDTOOLS/OS/$os.$rroot.$arch ]; then
		oscf=$os.$rroot.$arch
	elif [ -r $BUILDTOOLS/OS/$os.$rbase.x.$arch$sfx ]; then
		oscf=$os.$rbase.x.$arch$sfx
	elif [ -r $BUILDTOOLS/OS/$os.$rbase.x.$arch ]; then
		oscf=$os.$rbase.x.$arch
	elif [ -r $BUILDTOOLS/OS/$os.$rel$sfx ]; then
		oscf=$os.$rel$sfx
	elif [ -r $BUILDTOOLS/OS/$os.$rel ]; then
		oscf=$os.$rel
	elif [ -r $BUILDTOOLS/OS/$os.$rroot$sfx ]; then
		oscf=$os.$rroot$sfx
	elif [ -r $BUILDTOOLS/OS/$os.$rroot ]; then
		oscf=$os.$rroot
	elif [ -r $BUILDTOOLS/OS/$os.$rbase.x$sfx ]; then
		oscf=$os.$rbase.x$sfx
	elif [ -r $BUILDTOOLS/OS/$os.$rbase.x ]; then
		oscf=$os.$rbase.x
	elif [ -r $BUILDTOOLS/OS/$os.$arch$sfx ]; then
		oscf=$os.$arch$sfx
	elif [ -r $BUILDTOOLS/OS/$os.$arch ]; then
		oscf=$os.$arch
	elif [ -r $BUILDTOOLS/OS/$rel.$arch$sfx ]; then
		oscf=$rel.$arch$sfx
	elif [ -r $BUILDTOOLS/OS/$rel.$arch ]; then
		oscf=$rel.$arch
	elif [ -r $BUILDTOOLS/OS/$rroot.$arch$sfx ]; then
		oscf=$rroot.$arch$sfx
	elif [ -r $BUILDTOOLS/OS/$rroot.$arch ]; then
		oscf=$rroot.$arch
	elif [ -r $BUILDTOOLS/OS/$rbase.x.$arch$sfx ]; then
		oscf=$rbase.x.$arch$sfx
	elif [ -r $BUILDTOOLS/OS/$rbase.x.$arch ]; then
		oscf=$rbase.x.$arch
	elif [ -r $BUILDTOOLS/OS/$os$sfx ]; then
		oscf=$os$sfx
	elif [ -r $BUILDTOOLS/OS/$os ]; then
		oscf=$os
	elif [ -r $BUILDTOOLS/OS/$arch$sfx ]; then
		oscf=$arch$sfx
	elif [ -r $BUILDTOOLS/OS/$arch ]; then
		oscf=$arch
	elif [ -r $BUILDTOOLS/OS/$rel$sfx ]; then
		oscf=$rel$sfx
	elif [ -r $BUILDTOOLS/OS/$rel ]; then
		oscf=$rel
	elif [ -r $BUILDTOOLS/OS/$rel$sfx ]; then
		oscf=$rel$sfx
	else
		echo "Cannot determine how to support $os.$rel.$arch" >&2
		exit $EX_UNAVAILABLE
	fi
	M4=`$SHELL $BUILDTOOLS/bin/find_m4.sh`
	ret=$?
	if [ $ret -ne 0 ]
	then
		exit $ret
	fi
	echo "Using M4=$M4"
	export M4
	if [ "$mflag" ]
	then
		echo "Will run in virgin $obj using $BUILDTOOLS/OS/$oscf"
		exit $EX_OK
	fi

	echo "Creating $obj using $BUILDTOOLS/OS/$oscf"
	${mkdir} $obj

		ln="ln -s"
		(cd $obj
		# This glob doesn't actually glob to something everywhere,
		# thus the protective measures.
		for i in ${obj_rel_base_dir}/${src_dir}/*.[chly13458]
		do
			if [ -f $i ]
			then
				$ln $i .
			fi
		done
		# This glob doesn't actually glob to something everywhere,
		# thus the protective measures.
		for i in ${obj_rel_base_dir}/${src_dir}/*.0
		do
			if [ -f $i ]
			then
				$ln $i `basename $i`.dist
			fi
		done)
		if [ -f helpfile ]
		then
			(cd $obj; $ln ${obj_rel_base_dir}/${src_dir}/helpfile .)
		fi

	rm -f $obj/.settings$$
	echo 'divert(-1)' > $obj/.settings$$
	cat $BUILDTOOLS/M4/header.m4 >> $obj/.settings$$
	echo "define(\`bldOS', \`\`$os'')" >> $obj/.settings$$
	echo "define(\`bldREL', \`\`$rel'')" >> $obj/.settings$$
	echo "define(\`bldARCH', \`\`$arch'')" >> $obj/.settings$$
	cat $BUILDTOOLS/OS/$oscf >> $obj/.settings$$

	cur_dir=`pwd`
	cd $obj/..
	absolute_obj_dir=`pwd`


	cd $cur_dir
	echo "ifdef(\`bldABS_OBJ_DIR',,\`define(\`bldABS_OBJ_DIR', \`$absolute_obj_dir')')" >> $obj/.settings$$
	rel_src_dir="$obj_rel_base_dir/$src_dir"
	echo "define(\`bldSRC_NAME', \`$src_dir')" >> $obj/.settings$$
	echo "define(\`bldREL_SRC_DIR', \`$rel_src_dir')" >> $obj/.settings$$

	if [ ! -z "$pfx" ]
	then
		# They gave us a specific prefix, let's try it out.
		if [ -f $BUILDTOOLS/Site/$pfx.$oscf$sfx.m4 ]
		then
			siteconfig=$BUILDTOOLS/Site/$pfx.$oscf$sfx.m4
		elif [ -f $BUILDTOOLS/Site/$pfx.$oscf.m4 ]
		then
			siteconfig=$BUILDTOOLS/Site/$pfx.$oscf.m4
		fi
		if [ -f $BUILDTOOLS/Site/$pfx.config.m4 ]
		then
			siteconfig="$BUILDTOOLS/Site/$pfx.config.m4 $siteconfig"
		fi
	elif [ -z "$siteconfig" ]
	then
		# none specified, use defaults
		if [ -f $BUILDTOOLS/Site/site.$oscf$sfx.m4 ]
		then
			siteconfig=$BUILDTOOLS/Site/site.$oscf$sfx.m4
		elif [ -f $BUILDTOOLS/Site/site.$oscf.m4 ]
		then
			siteconfig=$BUILDTOOLS/Site/site.$oscf.m4
		fi
		if [ -f $BUILDTOOLS/Site/site.config.m4 ]
		then
			siteconfig="$BUILDTOOLS/Site/site.config.m4 $siteconfig"
		fi
		if [ -f $BUILDTOOLS/Site/site.post.m4 ]
		then
			siteconfig="$siteconfig $BUILDTOOLS/Site/site.post.m4"
		fi
	fi
	if [ ! -z "$siteconfig" ]
	then
		echo "Including $siteconfig"
		cat $siteconfig >> $obj/.settings$$
	fi
	if [ "$libdirs" ]
	then
		echo "define(\`confLIBDIRS', confLIBDIRS \`\`$libdirs'')" >> $obj/.settings$$
	fi
	if [ "$incdirs" ]
	then
		echo "define(\`confINCDIRS', \`\`$incdirs'' confINCDIRS)" >> $obj/.settings$$
	fi
	echo "define(\`_SRC_PATH_', \`\`$obj_rel_base_dir'')" >> $obj/.settings$$
	echo "define(\`bldSRC_PATH', \`\`$obj_rel_base_dir'')" >> $obj/.settings$$
	echo 'divert(0)dnl' >> $obj/.settings$$
	libdirs=`(cat $obj/.settings$$; echo "_SRIDBIL_= confLIBDIRS" ) | \
		sed -e 's/\(.\)include/\1_include_/g' -e 's/#define/#_define_/g' | \
		${M4} ${M4_BLDVARIANT_FLAGS} -DconfBUILDTOOLSDIR=$BUILDTOOLS - | \
		grep "^_SRIDBIL_=" | \
		sed -e 's/#_define_/#define/g' -e 's/_include_/include/g' -e "s/^_SRIDBIL_=//"`
	libsrch=`(cat $obj/.settings$$; echo "_HCRSBIL_= confLIBSEARCH" ) | \
		sed -e 's/\(.\)include/\1_include_/g' -e 's/#define/#_define_/g' | \
		${M4}  ${M4_BLDVARIANT_FLAGS} -DconfBUILDTOOLSDIR=$BUILDTOOLS - | \
		grep "^_HCRSBIL_=" | \
		sed -e 's/#_define_/#define/g' -e 's/_include_/include/g' -e "s/^_HCRSBIL_=//"`
	libpath=`(cat $obj/.settings$$; echo "_HCRSBIL_= confLIBSEARCHPATH" ) | \
		sed -e 's/\(.\)include/\1_include_/g' -e 's/#define/#_define_/g' | \
		${M4} ${M4_BLDVARIANT_FLAGS} -DconfBUILDTOOLSDIR=$BUILDTOOLS - | \
		grep "^_HCRSBIL_=" | \
		sed -e 's/#_define_/#define/g' -e 's/_include_/include/g' -e "s/^_HCRSBIL_=//"`
	echo 'divert(-1)' >> $obj/.settings$$
	LIBDIRS="$libdirs" LIBSRCH="$libsrch" LIBPATH="$libpath" SITECONFIG="$siteconfig" $SHELL $BUILDTOOLS/bin/configure.sh $sflag $oscf >> $obj/.settings$$
	echo 'divert(0)dnl' >> $obj/.settings$$
	sed -e 's/\(.\)include/\1_include_/g' -e 's/#define/#_define_/g' -e 's///g' $obj/.settings$$ | \
		${M4}  ${M4_BLDVARIANT_FLAGS} -DconfBUILDTOOLSDIR=$BUILDTOOLS - Makefile.m4 | \
		sed -e 's/#_define_/#define/g' -e 's/_include_/include/g' -e 's///g' > $obj/Makefile
	# That ^M up there was added by quoting it in emacs.
	# Make has problems if lines end in ^M^M, but not in ^M apparently
	if [ $? -ne 0 -o ! -s $obj/Makefile ]
	then
		echo "ERROR: ${M4} failed; You may need a newer version of M4, at least as new as System V or GNU" 1>&2
		rm -rf $obj
		exit $EX_UNAVAILABLE
	fi
	rm -f $obj/.settings$$
	echo "Making dependencies in $obj"
	(cd $obj; ${MAKE-make} depend)
fi

if [ "$mflag" ]
then
	makefile=`ls -l $obj/Makefile | sed 's/.* //'`
	if [ -z "$makefile" ]
	then
		echo "ERROR: $obj exists but has no Makefile" >&2
		exit $EX_NOINPUT
	fi
	echo "Will run in existing $obj using $makefile"
	exit $EX_OK
fi

echo "Making in $obj"
cd $obj
eval exec ${MAKE-make} SENDMAIL_BUILD_FLAGS=\"$SENDMAIL_BUILD_FLAGS\" $makeargs
@


1.11
log
@resolve conflicts, pull 8.13.3 to head, make it build
@
text
@d15 1
a15 1
#	$NetBSD$
@


1.10
log
@resolve conflicts, pull 8.12.11 to head
@
text
@d14 2
a15 2
#	Id: Build,v 8.179.2.4 2003/08/20 18:08:07 gshapiro Exp
#	$NetBSD: Build,v 1.1.1.10 2004/03/25 18:57:21 atatat Exp $
d352 4
a355 3
  CRAYT3E|CRAYTS)
		os=$arch;;

d424 2
d677 1
a677 1
		for i in ${obj_rel_base_dir}/${src_dir}/*.[ch13458]
@


1.9
log
@Pull sendmail 8.12.9 to the head, resolve the import conflict, and
make it build.  Now we have $NetBSD$ tags.
@
text
@d14 2
a15 2
#	Id: Build,v 8.179.2.3 2002/12/23 23:02:37 ca Exp
#	$NetBSD: Build,v 1.1.1.9 2003/06/01 14:01:14 atatat Exp $
d49 1
d653 1
a653 1
	M4=`sh $BUILDTOOLS/bin/find_m4.sh`
d779 1
a779 1
	LIBDIRS="$libdirs" LIBSRCH="$libsrch" LIBPATH="$libpath" SITECONFIG="$siteconfig" sh $BUILDTOOLS/bin/configure.sh $sflag $oscf >> $obj/.settings$$
@


1.8
log
@Pull sendmail 8.12.8 to the head, resolve the import conflicts, and
make it build.
@
text
@d15 1
@


1.7
log
@upgrade to 8.11.6.  fixes security issue in command line parsing.
@
text
@d3 1
a3 1
# Copyright (c) 1998-2001 Sendmail, Inc. and its suppliers.
d14 1
a14 1
#	Id: Build,v 8.155.4.11 2001/08/16 02:13:48 geir Exp
d64 23
d243 1
a243 1
  	  -v)	# Select a build variant: debug, optimized, purify, whatever.
d386 19
a404 2
  AIX)		rela=$rel
		rel=`uname -v`
a405 1
		rel=$rel.$rela
d481 1
a481 1
SMROOT=${SMROOT-..}
d513 1
a513 1
	obj=${OBJ_ROOT}/obj${prefix}.$os.$rel.$arch$sfx
d515 1
a515 1
	obj=${OBJ_ROOT}/obj${prefix}.$os.$rroot.$arch$sfx
d517 1
a517 1
	obj=${OBJ_ROOT}/obj${prefix}.$os.$rbase.x.$arch$sfx
d519 1
a519 1
	obj=${OBJ_ROOT}/obj${prefix}.$os.$rel$sfx
d521 1
a521 1
	obj=${OBJ_ROOT}/obj${prefix}.$os.$rbase.x$sfx
d523 1
a523 1
	obj=${OBJ_ROOT}/obj${prefix}.$os.$arch$sfx
d525 1
a525 1
	obj=${OBJ_ROOT}/obj${prefix}.$rel.$arch$sfx
d527 1
a527 1
	obj=${OBJ_ROOT}/obj${prefix}.$rbase.x.$arch$sfx
d529 1
a529 1
	obj=${OBJ_ROOT}/obj${prefix}.$os$sfx
d531 1
a531 1
	obj=${OBJ_ROOT}/obj${prefix}.$arch$sfx
d533 1
a533 1
	obj=${OBJ_ROOT}/obj${prefix}.$rel$sfx
d535 1
a535 1
	obj=${OBJ_ROOT}/obj${prefix}.$sfx
d538 1
a538 1
if [ -n "$obj" ]
d540 1
a540 1
	obj=${obj}/${src_dir}
d586 2
a587 1
	obj=${OBJ_ROOT}/obj${prefix}.$os.$rel.$arch$sfx/${src_dir}
d648 1
a648 1
		echo "Cannot determine how to support $arch.$os.$rel" >&2
d709 1
d759 1
@


1.6
log
@sync with 8.11.5.
@
text
@d14 1
a14 1
#	Id: Build,v 8.155.4.10 2001/06/05 22:03:36 gshapiro Exp
d661 9
a669 7
		cur_dir=`pwd`
		cd $obj/..
		absolute_obj_dir=`pwd`
		cd $cur_dir
		echo "ifdef(\`bldABS_OBJ_DIR',,\`define(\`bldABS_OBJ_DIR', \`$absolute_obj_dir')')" >> $obj/.settings$$
		rel_src_dir="$obj_rel_base_dir/$src_dir"
		echo "define(\`bldREL_SRC_DIR', \`$rel_src_dir')" >> $obj/.settings$$
@


1.5
log
@sync with 8.11.3.
@
text
@d14 1
a14 1
#       Id: Build,v 8.155.4.7 2001/01/22 19:00:15 gshapiro Exp
d89 2
a90 2
		    shift   # move to argument
		    arg=$1
d129 2
a130 2
		    shift   # move to argument
		    arg=$1
d170 2
a171 2
		    shift   # move to argument
		    arg="$1"
d198 2
a199 2
		    shift   # move to argument
		    arg=$1
d224 4
a227 4
		then 
		    echo "Usage error with \"-v\" <build_variant>"  >&2
		    echo "You must specify exactly one build variant of debug|optimized|purify"  >&2
		    exit $EX_USAGE
d242 14
a255 14
    debug)
	M4_BLDVARIANT_FLAGS="-DconfBLDVARIANT=DEBUG"
	;;
    optimized)
	M4_BLDVARIANT_FLAGS="-DconfBLDVARIANT=OPTIMIZED"
	;;
    purify)
	M4_BLDVARIANT_FLAGS="-DconfBLDVARIANT=PURIFY"
	echo "Sorry, the purify build variant has not been plumbed yet. (Bummer.)"  >&2
	exit $EX_USAGE
	;;
    *)
	exit $EX_USAGE
	;;
a628 1
		(cd $obj; $ln ${obj_rel_base_dir}/${src_dir}/*.[ch13458] .)
d632 15
a646 6
		for i in ${obj_rel_base_dir}/${src_dir}/*.0 
		do 
			if [ -f $i ] 
			then 
				$ln $i `basename $i`.dist 
			fi 
@


1.4
log
@upgrade to sendmail 8.11.2.
@
text
@d3 1
a3 1
# Copyright (c) 1998-2000 Sendmail, Inc. and its suppliers.
d14 1
a14 1
#       Id: Build,v 8.155.4.5 2000/12/27 00:44:35 gshapiro Exp
d234 1
a234 1
		SENDMAIL_BUILD_FLAGS="$SENDMAIL_BUILD_FLAGS \"$1\""
@


1.3
log
@sync with 8.11.0. (relatively large amount of changes are due to
rcs-id rewrites)
@
text
@d14 1
a14 1
#       Id: Build,v 8.155.4.3 2000/07/14 05:30:15 gshapiro Exp
a296 6
elif [ `uname` = "CYGWIN_NT-4.0" -o `uname` = "CYGWIN_NT-5.0" ]
then
	# Windows NT 4.0 or Windows 2000
	arch=`uname -m | sed -e 's/ //g' -e 's/\//-/g'`
	os=`uname -s | sed -e 's/CYG//g' -e 's/ //g' -e 's/_//g' -e 's/-/./g'`
	rel=`uname -r | sed -e 's/(/_/g' -e 's/)//g' -e 's/ //g' -e 's/\//-/g'` 
a627 4
	# If this is WINNT then compile with relative paths
	# (based on REL_SRC_DIR), so we don't need to do any "linking"
	if [ ! $os = "WINNT.4.0" -a ! $os = "WINNT.5.0" -a ! $os = "WINNT" ]
	then
a643 1
	fi
d648 3
a650 3
	echo "define(\`OS', \`\`$os'')" >> $obj/.settings$$
	echo "define(\`REL', \`\`$rel'')" >> $obj/.settings$$
	echo "define(\`ARCH', \`\`$arch'')" >> $obj/.settings$$
a652 22
	if [ $os = "WINNT.4.0" -o $os = "WINNT.5.0" -o $os = "WINNT" ]
	then
		# Append C: onto pwd's which don't have the preceding //
		# so that we can compile on non-network drives.
		# (Is there a way to get the real drive letter?)

		dir_prefix=`echo $absolute_base_dir | sed 's#\(..\).*#\1#'`
		if [ ! $dir_prefix = "//" ]
		then
			absolute_base_dir="//C$absolute_base_dir"
		fi

	        # Convert sh's //X to X: drive letters to make make (and cl) happy
		obj_rel_base_dir=`echo $absolute_base_dir | sed 's#^//\([a-zA-Z]\)#\1:#'`
		cur_dir=`pwd`
		cd $obj/..
		absolute_obj_dir=`pwd | sed 's#/#\\\\\\\\#g'`
		cd $cur_dir
		echo "ifdef(\`bldABS_OBJ_DIR',,\`define(\`bldABS_OBJ_DIR', \`$absolute_obj_dir')')" >> $obj/.settings$$
		rel_src_dir="$obj_rel_base_dir/$src_dir"
		echo "define(\`bldREL_SRC_DIR', \`$rel_src_dir')" >> $obj/.settings$$
	else
a659 1
	fi
@


1.2
log
@for gnu/dist/sendmail, prevent rewrite of $Id$, $Revision$ and $Date$.
supply sendmail2netbsd for future imports.
remove 8.9.x files.

populate sendmail 8.10.1 build tree under gnu/usr.sbin/sendmail.
@
text
@d14 1
a14 1
#       Id: Build,v 8.153 2000/04/06 20:30:40 son Exp
d301 1
a301 1
	os=`uname -s | sed -e 's/CYG//g' -e 's/ //g' -e 's/[_-]//g'`
d636 1
a636 1
	if [ ! $os = "WINNT4.0" -a ! $os = "WINNT5.0" -a ! $os = "WINNT" ]
d659 3
d664 1
a664 1
	if [ $os = "WINNT4.0" -o $os = "WINNT5.0" -o $os = "WINNT" ]
@


1.2.2.1
log
@pullup (approved by releng-1-5)

switch to sendmail 8.11.0.

see the following email for the list of files/tags:
http://mail-index.netbsd.org/source-changes/2000/07/23/0048.html
@
text
@d14 1
a14 1
#       Id: Build,v 8.155.4.3 2000/07/14 05:30:15 gshapiro Exp
d301 1
a301 1
	os=`uname -s | sed -e 's/CYG//g' -e 's/ //g' -e 's/_//g' -e 's/-/./g'`
d636 1
a636 1
	if [ ! $os = "WINNT.4.0" -a ! $os = "WINNT.5.0" -a ! $os = "WINNT" ]
a658 3
	echo "define(\`OS', \`\`$os'')" >> $obj/.settings$$
	echo "define(\`REL', \`\`$rel'')" >> $obj/.settings$$
	echo "define(\`ARCH', \`\`$arch'')" >> $obj/.settings$$
d661 1
a661 1
	if [ $os = "WINNT.4.0" -o $os = "WINNT.5.0" -o $os = "WINNT" ]
@


1.2.2.2
log
@Pull up revisions 1.4-1.5 (requested by itojun):
  Upgrade to sendmail 8.11.3.
@
text
@d3 1
a3 1
# Copyright (c) 1998-2001 Sendmail, Inc. and its suppliers.
d14 1
a14 1
#       Id: Build,v 8.155.4.7 2001/01/22 19:00:15 gshapiro Exp
d234 1
a234 1
		#SENDMAIL_BUILD_FLAGS="$SENDMAIL_BUILD_FLAGS \"$1\""
d297 6
d634 4
d654 1
d659 3
a661 3
	echo "define(\`bldOS', \`\`$os'')" >> $obj/.settings$$
	echo "define(\`bldREL', \`\`$rel'')" >> $obj/.settings$$
	echo "define(\`bldARCH', \`\`$arch'')" >> $obj/.settings$$
d664 22
d693 1
@


1.2.2.3
log
@Pull up revisions 1.6-1.7 (requested by itojun):
  Upgrade to sendmail version 8.11.6.
@
text
@d14 1
a14 1
#	Id: Build,v 8.155.4.11 2001/08/16 02:13:48 geir Exp
d89 2
a90 2
			shift   # move to argument
			arg=$1
d129 2
a130 2
			shift   # move to argument
			arg=$1
d170 2
a171 2
			shift   # move to argument
			arg="$1"
d198 2
a199 2
			shift   # move to argument
			arg=$1
d224 4
a227 4
		then
			echo "Usage error with \"-v\" <build_variant>"  >&2
			echo "You must specify exactly one build variant of debug|optimized|purify"  >&2
			exit $EX_USAGE
d242 14
a255 14
	debug)
		M4_BLDVARIANT_FLAGS="-DconfBLDVARIANT=DEBUG"
		;;
	optimized)
		M4_BLDVARIANT_FLAGS="-DconfBLDVARIANT=OPTIMIZED"
		;;
	purify)
		M4_BLDVARIANT_FLAGS="-DconfBLDVARIANT=PURIFY"
		echo "Sorry, the purify build variant has not been plumbed yet. (Bummer.)"  >&2
		exit $EX_USAGE
		;;
	*)
		exit $EX_USAGE
		;;
d629 1
d633 6
a638 15
		for i in ${obj_rel_base_dir}/${src_dir}/*.[ch13458]
		do
			if [ -f $i ]
			then
				$ln $i .
			fi
		done
		# This glob doesn't actually glob to something everywhere,
		# thus the protective measures.
		for i in ${obj_rel_base_dir}/${src_dir}/*.0
		do
			if [ -f $i ]
			then
				$ln $i `basename $i`.dist
			fi
d653 7
a659 9
	cur_dir=`pwd`
	cd $obj/..
	absolute_obj_dir=`pwd`


	cd $cur_dir
	echo "ifdef(\`bldABS_OBJ_DIR',,\`define(\`bldABS_OBJ_DIR', \`$absolute_obj_dir')')" >> $obj/.settings$$
	rel_src_dir="$obj_rel_base_dir/$src_dir"
	echo "define(\`bldREL_SRC_DIR', \`$rel_src_dir')" >> $obj/.settings$$
@


1.1
log
@Initial revision
@
text
@d14 1
a14 1
#       $Id: Build,v 8.153 2000/04/06 20:30:40 son Exp $
@


1.1.1.1
log
@sendmail 8.10.1
@
text
@@


1.1.1.2
log
@sendmail 8.10.2
@
text
@d14 1
a14 1
#       Id: Build,v 8.153 2000/04/06 20:30:40 son Exp
@


1.1.1.3
log
@sendmail 8.11.0
@
text
@d14 1
a14 1
#       Id: Build,v 8.155.4.3 2000/07/14 05:30:15 gshapiro Exp
d301 1
a301 1
	os=`uname -s | sed -e 's/CYG//g' -e 's/ //g' -e 's/_//g' -e 's/-/./g'`
d636 1
a636 1
	if [ ! $os = "WINNT.4.0" -a ! $os = "WINNT.5.0" -a ! $os = "WINNT" ]
a658 3
	echo "define(\`OS', \`\`$os'')" >> $obj/.settings$$
	echo "define(\`REL', \`\`$rel'')" >> $obj/.settings$$
	echo "define(\`ARCH', \`\`$arch'')" >> $obj/.settings$$
d661 1
a661 1
	if [ $os = "WINNT.4.0" -o $os = "WINNT.5.0" -o $os = "WINNT" ]
@


1.1.1.4
log
@sendmail 8.11.2
@
text
@d14 1
a14 1
#       Id: Build,v 8.155.4.5 2000/12/27 00:44:35 gshapiro Exp
d297 6
d634 4
d654 1
d659 3
a661 3
	echo "define(\`bldOS', \`\`$os'')" >> $obj/.settings$$
	echo "define(\`bldREL', \`\`$rel'')" >> $obj/.settings$$
	echo "define(\`bldARCH', \`\`$arch'')" >> $obj/.settings$$
d664 22
d693 1
@


1.1.1.5
log
@sendmail 8.11.3
@
text
@d3 1
a3 1
# Copyright (c) 1998-2001 Sendmail, Inc. and its suppliers.
d14 1
a14 1
#       Id: Build,v 8.155.4.7 2001/01/22 19:00:15 gshapiro Exp
d234 1
a234 1
		#SENDMAIL_BUILD_FLAGS="$SENDMAIL_BUILD_FLAGS \"$1\""
@


1.1.1.6
log
@sendmail 8.11.5
@
text
@d14 1
a14 1
#	Id: Build,v 8.155.4.10 2001/06/05 22:03:36 gshapiro Exp
d89 2
a90 2
			shift   # move to argument
			arg=$1
d129 2
a130 2
			shift   # move to argument
			arg=$1
d170 2
a171 2
			shift   # move to argument
			arg="$1"
d198 2
a199 2
			shift   # move to argument
			arg=$1
d224 4
a227 4
		then
			echo "Usage error with \"-v\" <build_variant>"  >&2
			echo "You must specify exactly one build variant of debug|optimized|purify"  >&2
			exit $EX_USAGE
d242 14
a255 14
	debug)
		M4_BLDVARIANT_FLAGS="-DconfBLDVARIANT=DEBUG"
		;;
	optimized)
		M4_BLDVARIANT_FLAGS="-DconfBLDVARIANT=OPTIMIZED"
		;;
	purify)
		M4_BLDVARIANT_FLAGS="-DconfBLDVARIANT=PURIFY"
		echo "Sorry, the purify build variant has not been plumbed yet. (Bummer.)"  >&2
		exit $EX_USAGE
		;;
	*)
		exit $EX_USAGE
		;;
d629 1
d633 6
a638 15
		for i in ${obj_rel_base_dir}/${src_dir}/*.[ch13458]
		do
			if [ -f $i ]
			then
				$ln $i .
			fi
		done
		# This glob doesn't actually glob to something everywhere,
		# thus the protective measures.
		for i in ${obj_rel_base_dir}/${src_dir}/*.0
		do
			if [ -f $i ]
			then
				$ln $i `basename $i`.dist
			fi
@


1.1.1.7
log
@sendmail 8.11.6
@
text
@d14 1
a14 1
#	Id: Build,v 8.155.4.11 2001/08/16 02:13:48 geir Exp
d661 7
a667 9
	cur_dir=`pwd`
	cd $obj/..
	absolute_obj_dir=`pwd`


	cd $cur_dir
	echo "ifdef(\`bldABS_OBJ_DIR',,\`define(\`bldABS_OBJ_DIR', \`$absolute_obj_dir')')" >> $obj/.settings$$
	rel_src_dir="$obj_rel_base_dir/$src_dir"
	echo "define(\`bldREL_SRC_DIR', \`$rel_src_dir')" >> $obj/.settings$$
@


1.1.1.8
log
@sendmail 8.12.8
@
text
@d3 1
a3 1
# Copyright (c) 1998-2002 Sendmail, Inc. and its suppliers.
d14 1
a14 1
#	Id: Build,v 8.179.2.3 2002/12/23 23:02:37 ca Exp
a63 23
	  -src)	# Specify pathname of source directory relative to
		# root of cvs tree.  This relative pathname may have
		# multiple components, as in 'foo/bar/baz', and will also
		# be used to form the pathname of the object directory.
		shift
		arg=$1
		if [ -z "$arg" ]
		then
			echo "Missing arg for -src" >&2
			exit $EX_USAGE
		fi
		case $arg
		in
		  /*)	echo "Arg for -src must not begin with / ($arg)" >&2
			exit $EX_USAGE
			;;
		esac
		src_dir="$arg"
		absolute_base_dir=`echo ${full_src_dir} | sed "s;/${src_dir}$;;"`
		obj_rel_base_dir=`echo x/${src_dir} | sed "s;[^/][^/]*;..;g"`
		SMROOT=${absolute_base_dir}
		shift
		;;
d220 1
a220 1
	  -v)	# Select a build variant: debug, optimized, purify, whatever.
d363 2
a364 19
  AIX)		osl=""
		if [ -x /bin/lslpp ]
		then
			osl=`/bin/lslpp -Lcq bos.rte | cut -f3 -d: | cut -f1-3 -d. 2>/dev/null`
			if [ $? = 0  -a -n "$osl" ]
			then
				rel=$osl
			else
				# command failed; fall back to old method
				osl=""
			fi
		fi
		# check whether it worked
		if [ -z "$osl" ]
		then
			rela=$rel
			rel=`uname -v`
			rel=$rel.$rela
		fi
d366 1
d442 1
a442 1
SMROOT=${SMROOT-`(cd ..;pwd)`}
d474 1
a474 1
	abs_obj_dir=${OBJ_ROOT}/obj${prefix}.$os.$rel.$arch$sfx
d476 1
a476 1
	abs_obj_dir=${OBJ_ROOT}/obj${prefix}.$os.$rroot.$arch$sfx
d478 1
a478 1
	abs_obj_dir=${OBJ_ROOT}/obj${prefix}.$os.$rbase.x.$arch$sfx
d480 1
a480 1
	abs_obj_dir=${OBJ_ROOT}/obj${prefix}.$os.$rel$sfx
d482 1
a482 1
	abs_obj_dir=${OBJ_ROOT}/obj${prefix}.$os.$rbase.x$sfx
d484 1
a484 1
	abs_obj_dir=${OBJ_ROOT}/obj${prefix}.$os.$arch$sfx
d486 1
a486 1
	abs_obj_dir=${OBJ_ROOT}/obj${prefix}.$rel.$arch$sfx
d488 1
a488 1
	abs_obj_dir=${OBJ_ROOT}/obj${prefix}.$rbase.x.$arch$sfx
d490 1
a490 1
	abs_obj_dir=${OBJ_ROOT}/obj${prefix}.$os$sfx
d492 1
a492 1
	abs_obj_dir=${OBJ_ROOT}/obj${prefix}.$arch$sfx
d494 1
a494 1
	abs_obj_dir=${OBJ_ROOT}/obj${prefix}.$rel$sfx
d496 1
a496 1
	abs_obj_dir=${OBJ_ROOT}/obj${prefix}.$sfx
d499 1
a499 1
if [ -n "$abs_obj_dir" ]
d501 1
a501 1
	obj=${abs_obj_dir}/${src_dir}
d547 1
a547 2
	abs_obj_dir=${OBJ_ROOT}/obj${prefix}.$os.$rel.$arch$sfx
	obj=${abs_obj_dir}/${src_dir}
d608 1
a608 1
		echo "Cannot determine how to support $os.$rel.$arch" >&2
a668 1
	echo "define(\`bldSRC_NAME', \`$src_dir')" >> $obj/.settings$$
a717 1
	echo "define(\`bldSRC_PATH', \`\`$obj_rel_base_dir'')" >> $obj/.settings$$
@


1.1.1.9
log
@sendmail 8.12.9
@
text
@a14 1
#	$NetBSD$
@


1.1.1.10
log
@sendmail 8.12.11
@
text
@d14 1
a14 1
#	Id: Build,v 8.179.2.4 2003/08/20 18:08:07 gshapiro Exp
a48 1
SHELL=/bin/sh
d652 1
a652 1
	M4=`$SHELL $BUILDTOOLS/bin/find_m4.sh`
d778 1
a778 1
	LIBDIRS="$libdirs" LIBSRCH="$libsrch" LIBPATH="$libpath" SITECONFIG="$siteconfig" $SHELL $BUILDTOOLS/bin/configure.sh $sflag $oscf >> $obj/.settings$$
@


1.1.1.11
log
@sendmail 8.13.3
@
text
@d14 1
a14 1
#	Id: Build,v 8.184 2003/08/20 18:08:35 gshapiro Exp
d352 3
a354 4
  CRAYT3E)	os=UNICOS-mk;;
		
  CRAY[CJT]90*|CRAYTS|CRAYSV1*|CRAYY-MP)
		os=UNICOS;;
a422 2
  UNICOSMK)	rel=`echo $rel | sed -e 's/\(.*\)\.\(.*\)\.\(.*\)\..*$/\1.\2.\3/'`;;
  UNICOS*)	rel=`echo $rel | sed -e 's/\(.*\)\.\(.*\)\..*$/\1.\2/'`;;
d674 1
a674 1
		for i in ${obj_rel_base_dir}/${src_dir}/*.[chly13458]
@


