# -*-sh-*-
#ident	"@(#)smail:RELEASE-3_2_0_115:EDITME-proven,v 1.7 2003/05/06 19:37:42 woods Exp"
#
# proven -- a netbsd install under "$PREFIX" with lots of options
#
# This should also work for FreeBSD and OpenBSD, or by hand with
# $PREFIX set in the environment (which is what the pkgsrc do-build
# target does).  Note though that you'll probably want the
# "mailwrapper" program too since this package explictly does *not*
# replace sendmail directly but installs in $PREFIX/libexec/smail.
#
PREFIX=/usr/pkg
# 
PATH=/usr/pkg/gcc-ssp/bin:$PATH; export PATH
CC="/usr/pkg/gcc-ssp/bin/cc"
#
# these are all OK on NetBSD-1.3.2 thorugh 1.6
# (with only minor cast-qual warnings from old gcc (2.7.2* and older?))
# 
# no, we're not that pedantic!
#CWARNFLAGS="$CWARNFLAGS -pedantic
CWARNFLAGS="$CWARNFLAGS -W"
CWARNFLAGS="$CWARNFLAGS -Wall"
# these aren't always on in "-Wall"
CWARNFLAGS="$CWARNFLAGS -Wimplicit"
CWARNFLAGS="$CWARNFLAGS -Wreturn-type"
CWARNFLAGS="$CWARNFLAGS -Wswitch"
CWARNFLAGS="$CWARNFLAGS -Wcomment"
# in addition to -Wall
CWARNFLAGS="$CWARNFLAGS -Wcast-qual"
# -Wid-clash-LEN is sadly no longer supported in 3.2.2
CWARNFLAGS="$CWARNFLAGS -Wid-clash-30"
CWARNFLAGS="$CWARNFLAGS -Wpointer-arith"
CWARNFLAGS="$CWARNFLAGS -Wshadow"
# we're not quite ready for full const-ification yet...
# Smail does not care about 'const' in enough places, yet....
#CWARNFLAGS="$CWARNFLAGS -Wwrite-strings"
# this isn't mentioned in 1.42's manual but causes no error
CWARNFLAGS="$CWARNFLAGS -Wstrict-prototypes"
# inet_makeaddr() returns an aggregate, and that's OK...
#CWARNFLAGS="$CWARNFLAGS -Waggregate-return"
CWARNFLAGS="$CWARNFLAGS -Wchar-subscripts"
CWARNFLAGS="$CWARNFLAGS -Wconversion"
CWARNFLAGS="$CWARNFLAGS -Wmissing-declarations"
CWARNFLAGS="$CWARNFLAGS -Wmissing-prototypes"
CWARNFLAGS="$CWARNFLAGS -Wno-format-extra-args"
# the rest aren't in the manual, but work on at least 2.9x.x
# -Wundef isn't in 2.7.2, but if you're still using 2.7.2 you may be
# suffering from far more bugs and problems than you might know!
CWARNFLAGS="$CWARNFLAGS -Wundef"
CWARNFLAGS="$CWARNFLAGS -Wlarger-than-65536"
CWARNFLAGS="$CWARNFLAGS -Wbad-function-cast"
#
if ${CC} -o /dev/null -c -Wnetbsd-format-audit ${ROOT}/compat/dummy.c > /dev/null 2>&1 ; then
	# format-audit is also only on newer systems (egcs-1.x?),
	# only in the stock NetBSD compiler,
	# and only on some architectures (eg. not sparc64).
	CWARNFLAGSS="$CWARNFLAGS -Wnetbsd-format-audit"
fi
CFLAGS="-g -O2 -pipe -fstack-protector $CWARNFLAGS"
LDFLAGS="-g -O2 -pipe -static"
#
# LCC doesn't like some of the system headers on NetBSD....
#CC=lcc
#CFLAGS="-g -O2"
#LFLAGS="-g -O2 -static"
#CPPFLAGS="-D__restrict="
#MISC_C_DEFINES='
##include <sys/cdefs.h>
#'
# For libraries in $PREFIX
#
CPPFLAGS="${CPPFLAGS} -I${PREFIX}/include"
LDFLAGS="${LDFLAGS} -Wl,-R${PREFIX}/lib -L${PREFIX}/lib"
#
# NOTE: Vmalloc() is more powerful and generally more useful than
# ElectricFence, though the latter can sometimes better detect
# references to freed memory.
# 
# these defines are less than useful since all calls should be from
# alloc.c:
#
#CPPFLAGS="$CPPFLAGS -DUSE_VMALLOC -DVMFL"
#LIBS="$LIBS -lvmalloc"
#
# ElectricFence
#
#LIBS="$LIBS -lefence"
#
OS_TYPE=bsd4.4-lite
#
MISC_DEFINES=SMAIL_LOG_STYLE=2
MISC_DEFINES=$MISC_DEFINES:DIAGNOSTIC
MISC_DEFINES=$MISC_DEFINES:NO_FORWARDTO_FILE
MISC_DEFINES=$MISC_DEFINES:USE_TARGET_DOMAIN
MISC_DEFINES=$MISC_DEFINES:USE_LSEARCH_REGEXCMP
MISC_DEFINES=$MISC_DEFINES:LOG_SMTP_NON_COMPLIANCE
MISC_DEFINES=$MISC_DEFINES:LOG_SMTP_ILLEGAL_OPERAND_WARNING
#
#ifdef HAVE_CYRUS
#MISC_DEFINES=$MISC_DEFINES:USE_CYRUS_IMAPD
#MISC_DEFINES=$MISC_DEFINES:CYRUS_DELIVER_PATH='"/usr/pkg/cyrus/bin/deliver"'
#endif
#
HAVE=EHLO
#
HAVE=$HAVE:RFC1413
LIBS="-lident"
#
#HAVE=$HAVE:LIBWHOSON
#LIBS="$LIBS -lwhoson"
# 
LIB_DIR=/etc/smail
# 
UTIL_BIN_DIR=$PREFIX/libexec/smail
# 
# force everything into $PREFIX/libexec/smail
# note that the pkgsrc Makefile will fix a couple things up for us...
#
SMAIL_BIN_DIR=$UTIL_BIN_DIR
# 
# Override the conf/os/bsd4.4 replacement of sendmail in /usr
# Note that the following two settings depend on having mailwrapper to
# replace sendmail.
#
NEWALIASES="$UTIL_BIN_DIR/newaliases"
OTHER_SMAIL_NAMES="$UTIL_BIN_DIR/sendmail"
# 
# set SMAIL_NAME empty to use $SMAIL_BIN_DIR/smail
#
SMAIL_NAME=''
# 
# Note that the pkg_* tools will not know about these /var places, but
# that's OK because they get created at run-time....
#
SPOOL_DIRS=/var/spool/smail
TMP_DIR=/var/spool/smail/tmp
LOG_DIR=/var/log/smail
UNSHAR_MAP_DIR=/var/spool/uumaps
NEWS_SPOOL_DIR=/var/spool/news
UUWHO_FILE=/var/spool/smail/uuwho
# 
# WARNING: some older versions of pkgsrc will need 'cd $PREFIX; ln -s . share'
# 
MAN1=$PREFIX/share/man/man1
MAN1_EXT=1
MAN5=$PREFIX/share/man/man5
MAN5_EXT=5
MAN8=$PREFIX/share/man/man8
MAN8_EXT=8
# 
# The pkg_* tools won't know about /etc/aliases either, but we're
# simply stealing it from sendmail anyway so there's no need to
# include it in the binary package.
# 
if [ -f /etc/mail/aliases ] ; then
	ALIASES_FILE=/etc/mail/aliases
else
	ALIASES_FILE=/etc/aliases
fi
# 
# ... note we are eliminating the use of db for alias files
#
ALIASES_TYPE=lsearch
# 
REWRITE_FILE=rewrite
REWRITE_TYPE=lsearch
#
# this assumes you use the HDB UUCP style config, which is
# the only one that will work with UUCP_SYSTEM_FILE anyway...
# (and if this file does not exist "uuname" is used instead)
#
UUCP_SYSTEM_FILE=/etc/uucp/Systems
