#!/bin/sh
# Remove the files created by this script before running it.
#rm -f config.cache config.status config.log
rm -f makefile src/Makefile include/autoconf.h

if test ! -f configure
then
	autoconf
fi

OUT=td-conf.out
cat >>$OUT <<EOF/
** `date`
** node: `uname -a`
** from: `pwd`
** user: `id`
** conf: $*
EOF/
OPTS="$*"

CC="${CC-cc}"

# a few things missing in configure

if test -z "$CFLAGS" ; then
	case `uname -s` in
	HP-UX)
		# The basic K&R compiler on HP/UX doesn't
		# support -O/-g options, but the commercial one does
		# -> trust $CFLAGS
		test "$CC" != "cc" && test -z "$CFLAGS" && CFLAGS="-O"
		;;
	*)
	CFLAGS="-O"
	esac
fi

# set --with-mail-gateway or --with-mail-domain and
#     --with-nntp-default-server to your local needs

CFLAGS="$CFLAGS" \
CC="$CC" \
./configure --verbose \
	--disable-echo \
	--enable-nntp-only \
	--disable-mime-strict-charset \
	--with-domain-name="/etc/NNTP_INEWS_DOMAIN" \
        $OPTS $* 2>&1 |tee -a $OUT
