# Copyright (c) 1993 Eric P. Allman
# Copyright (c) 1993 The Regents of the University of California.
# %sccs.include.redist.sh%
# @(#)makesendmail 8.13 (Berkeley) %G%
# A quick-and-dirty script to compile sendmail in the presence of
# multiple architectures and Makefiles.
# determine machine architecture
arch
=`uname -m | sed -e 's/ //g'`
9000/*) arch
=`echo $arch | sed -e 's/9000.//' -e 's/..$/xx/'`;;
# determine operating system type
# determine operating system release
rbase
=`echo $rel | sed 's/\..*//''`
# heuristic tweaks to clean up names
# might be Altos System V
if [ -r /unix
-a -r /usr
/lib
/libseq.a
-a -r /lib
/cpp
]
# might be a DYNIX/ptx 2.x system, which has a broken uname
if strings /lib
/cpp |
grep _SEQUENT_
> /dev
/null
# now try to find a reasonable object directory
if [ -r obj.
$os.
$arch.
$rel ]; then
elif [ -r obj.
$os.
$arch.
$rbase.x
]; then
obj
=obj.
$os.
$arch.
$rbase.x
elif [ -r obj.
$os.
$rel ]; then
elif [ -r obj.
$os.
$rbase.x
]; then
elif [ -r obj.
$os.
$arch ]; then
elif [ -r obj.
$arch.
$rel ]; then
elif [ -r obj.
$arch.
$rbase.x
]; then
elif [ -r obj.
$os ]; then
elif [ -r obj.
$arch ]; then
elif [ -r obj.
$rel ]; then
# no existing obj directory -- try to create one if Makefile found
if [ -r Makefiles
/Makefile.
$os.
$arch.
$rel ]; then
makefile
=Makefile.
$os.
$arch.
$rel
elif [ -r Makefiles
/Makefile.
$os.
$arch.
$rbase.x
]; then
makefile
=Makefile.
$os.
$arch.
$rbase.x
elif [ -r Makefiles
/Makefile.
$os.
$rel ]; then
makefile
=Makefile.
$os.
$rel
elif [ -r Makefiles
/Makefile.
$os.
$rbase.x
]; then
makefile
=Makefile.
$os.
$rbase.x
elif [ -r Makefiles
/Makefile.
$os.
$arch ]; then
makefile
=Makefile.
$os.
$arch
elif [ -r Makefiles
/Makefile.
$arch.
$rel ]; then
makefile
=Makefile.
$arch.
$rel
elif [ -r Makefiles
/Makefile.
$arch.
$rbase.x
]; then
makefile
=Makefile.
$arch.
$rbase.x
elif [ -r Makefiles
/Makefile.
$os ]; then
elif [ -r Makefiles
/Makefile.
$arch ]; then
elif [ -r Makefiles
/Makefile.
$rel ]; then
echo "Cannot determine how to support $arch.$os.$rel"
echo "Creating $obj using $makefile"
(cd $obj; ln -s ..
/*.
[ch158
] ..
/sendmail.hf .
; ln -s ..
/Makefiles
/$makefile Makefile
)