# Compile-time configuration for ifmail FidoNet mailer and gateway
COPYRIGHT   = "Eugene G. Crosser, 1993-1995"

##############################################################
# Included a lot of code from version 2.8c-JE13JUL1995       #
# which is copyrighted by Tsuneo Tanaka <tt@efnet.com>       #
#                                                            #
# conversion code for japanese in kconv.c and kconv.h        #
# is copyrighted by Ken Lunde <lunde@adobe.com>              #
#                                                            #
# Programs in misc/contrib are copyrighted by their authors  #
#                                                            #
# The "tx" versions also includes ideas and patches from     #
# several other people, see file Credits.TX                  #
#                                                            #
# Other modifications are from me.                           #
# ( Pablo Saratxaga <srtxg@linux.chanae.stben.be> )          #
##############################################################
VERSION     = "2.8g-tx7.9"

# Where to put binaries
BINDIR = "/usr/lib/ifmail"

# Main configuration file. This default may be overwritten by -I key.
CONFIGFILE  = "/etc/ifmail/config"

# Where translations tables reside
MAPTABDIR = "/etc/ifmail/maptabs"

# Debug messages turned on by -x key are written here.
# Some error messages may occationally appear here too.
# This may be changed in the 'config' file.
DEBUGFILE   = "/var/log/ifmail/ifdebug"

# Procession log. Usually gets several lines for each invocation.
# Also look for error diagnostics here.  If HAS_SYSLOG defined,
# only stdout and stderr from the packers and unpackers go to this
# file, while actual logging is done via syslog() calls.
# This may be changed in the 'config' file.
LOGFILE     = "/var/log/ifmail/iflog"

# Use syslog() facility codes for mail gate, news gate and ifcico.
# Define -DHAS_SYSLOG (see below)
#MAILLOG    = LOG_MAIL
MAILLOG    = LOG_LOCAL0
#NEWSLOG    = LOG_NEWS
NEWSLOG    = LOG_LOCAL0
#CICOLOG    = LOG_UUCP
CICOLOG    = LOG_LOCAL0

# Directory where UUCP lock files reside.
#LOCKDIR     = "/var/spool/uucp"
LOCKDIR     = "/var/lock"

# Directory from which file requests are resolved.
# This may be changed from the 'config' file.
#PUBDIR      = "/home/ftp/pub"
PUBDIR      = "/var/spool/uucppublic"

# News spool directory (to check space only)
#NEWSSPOOL   = "/usr/spool/news"
NEWSSPOOL   = "/var/spool/news"

# Fake directory where resultant files go if `-N' key used (trailing slash
# needed)
FAKEDIR     = "/tmp/ifmail/"

# Compile-time system-dependant options. 

# If you specify "-DHAS_NDBM_H", ndbm calls will be used instead
# of dbm ones, and the feature will be activated of Cnews log processing
# to add entries to SEEN-BY if echo message is exported to several FTN
# nodes by Cnews mechanism. This works with INN too.

# If you specify "-DHAS_STATFS" or "-DHAS_STATVFS", statfs() (or statvfs()
# respectivly) call will be used to check available disk space. For statfs()
# call, you must also specify which .h file to use: "-DSTATFS_IN_VFS_H" or 
# "-DSTATFS_IN_STATFS_H" or "-DSTATFS_IN_STATVFS_H"  or "-DSTATFS_IN_MOUNT_H". 
# For statvfs() call, statvfs.h is included.

# define -DSCO_STYLE_STATFS if your statfs() call requires 4 arguments.

# If you specify "-DHAS_SETSID", setsid() call is used to detach from the
# control terminal. Otherwise setpgrp() call is used, and in this case you
# may specify "-DBSD_SETPGRP" to use BSD-style call.  Used in ifcico only.

# If you specify "-DDONT_HAVE_TM_GMTOFF", timezone offset will be calculated
# from the difference between the results of localtime() and gmtime() calls
# instead of using tm_gmtoff field of struct tm.

# If you specify "-DDONT_HAVE_GETOPT", local definitions for getopt will
# be used (but not the function itself)

# For ifcico, you must specify -DHAS_TERMIOS_H (preffered), -DHAS_TERMIO_H
# or -DHAS_SGTTY_H to use POSIX-y, SysV-ish of BSD-ish terminal control.

# in SVR4 you should specify -DHAS_DIAL (and maybe -DHAS_DIAL_H) to use
# dial() library function instead of regular open().  Lock files are
# not used in this case.

# for uucp lock files, you must specify either -DASCII_LOCKFILES or
# -DBINARY_LOCKFILES

# define -DHAS_FSYNC if there is a fsync() system call (to update .flo
# files)

# define -DPARANOID if you want iftoss to deny packets with wrong password.

# define -DRELAXED if you want iftoss to accept packets that are not
# addressed to your node.

# define -DFORCEINTL if you want ifmail to create ^aINTL even if this is
# not an inter-zone netmail.

# define -DNEED_UUCPFROM if your MTA needs a uucp "From" line in mail.

# define -DHAS_TCP if you want ifmail to be able to originate outgoing
# connections over TCP/IP (socket library needed)

# define -DHAS_TERM if you want ifmail to be able to originate outgoing
# connections over TERM (TCP "extention", client.a needed)

# define -DHAS_REGEX_H or -DHAS_LIBGEN_H if you have either of these
# header files for regular expression handler prototypes.

# define -DHAS_SYSLOG to use syslog() instead of logging to files.
# Files are necessary anyway, external programs' stdout and stderr
# are redirected there.

# define -DNEED_BSY if you want ifpack and ifcico to create .bsy
# files preventing simultaneous processing of the same node.

# define -DNEED_FORK if your system is uncapable of getting rid of the
# control terminal unless you are running not as a group leader.

# define -DREGEX_NEED_CARET if your re_comp/re_exec require that the
# mask starts with a '^' to match the beginning of the string.

# as of June 1994, FreeBSD has a nasty bug in the kernel lseek() code:
# if you make lseek() to a point before the start of the file, it
# succeeds and the writing point becomes negative.  Fortunately, 
# subsequent write()s fail :-).  To overwork this, define 
# -DNEGATIVE_SEEK_BUG, this will add an extra fseek() to restore
# zero writing point where necessary.

# define -DNEED_TRAP if you want debugging information when the programs
# are aborted with segmentation fault etc.  Currently tested and works 
# only with Linux, and only with newer kernels (1.1.20+)

# define -DSLAVE_SENDS_NAK_TOO if you have problems answering incoming
# EMSI sessions originated by FrontDoor.  FrontDoor does not follow
# EMSI specifications when originating calls, this is a workaround.

# define -DBELEIVE_ZFIN=1 if you cannot get files sent by Terminate.
# Original Zmodem source does not beleive first ZFIN packet when
# receiving file, and sends more than one ZFIN while sending.  But
# it seems that Terminate Zmodem only send one ZFIN.  I could not
# check this myself.  If not defined, BELEIVE_ZFIN will be assumed
# 2, that is, skip 1st ZFIN but acknowledge second.

# define -DDONT_HAVE_DIRENT if there is no working opendir()/readdir()
# etc. in your libc.  You will aso need to add "dirent.o" to the NEEDED
# (see below).

# define -DBSD_SIGNALS for *BSD* systems where SIGALRM and SIGPIPE do
# not interrupt system calls by default.  siginterrupt() will be used
# to force SysV-ish behavior.

# ### Defines from version 2.8c-JE

# define -DFORCE_MSGID to prevent ifmail using your address instead of that
# in the from address field in the message header part to generate
# Message-ID. and creates an X-FTN-MSGID if there isn't MSGID in the original
# ftn message. 

# define -DIGNORE_SOFTCR if you need to treat SoftCR (0x8d) as a printable
# character.

# define -DKEEP_TEARLINES_CLEAN if you want to keep tearlines clean.

# define -DREPLACE_TEARLINES_WITH=\""ifmail 2.8b-JE for 1BM OSF/2"\" if you
# want to replace tearlines with "ifmail 2.8b-JE for 1BM OSF/2."

# define -DRESTAMP_FUTURE_POSTINGS if your news transport agent
# refuses/rejects 'future postings.'

# define -DNEWDB if ndbm.h is based on the new Berkeley style database (*.db)

# ### Defines in TX versions

# define -DPUDDLE_GATE handle Newsgroups: line generated by puddle.fidonet.org
# (the different newsgroups are separated by ", " instead of ","), in the ftn
# messages. If you don't receive gated echoareas from there you don't need it.

# define -DPCBOARD_GATE to recognize lines generated by usenet-> PcBoard -> ftn
# gateways (I only know one, the 2:320/7)

# -DALLOW_CONTROL allows Control: headers to be gated, and Supersedes: and
# Control: cancel to be be created from their ftn counterparts and vice-versa

# -DFORCE_REPLYTO forces REPLYTO and REPLYADDR lines

# -DFORCE_REPLYTO_LOCAL use address local (bestaka), even if a REPLYTO
# with another address already exists.
# So your downlinks only saw gated mail as being from your machine

# -DRNEWSB; when compiled with it, the result of ifnews -N is an
# rnews readable file. (otherwise it puts "#!/bin/sh\nrnews <<__EOF__\n"
# at the beginning). This allows moving the file to news in.coming directory
# and running "rnews -U"; without this option, you have to shell-execute the 
# file, and you have problems with characters of special meaning for the shell
# ( \, `, $, etc.). 

# define -DRESTAMP_OLD_POSTINGS=XX if you want to allow your news transport
# agent to accept articles older tan 15 days (but not more than XX).
# This can be necessary because of the low velocity of FTN routing.

# define -DDONT_REGATE if you don't want ifmail to gate a message
# that was originally gated by another gateway system.

# -DKEEP_MSGID_ON_SPLIT keeps the Message-ID on splitted FTN messages.
# so they are not gated back to usenet on another gateway if the original
# rfc article reached the site first.

# -DREFERENCES_MSC96 keep track of MSGID / Message-ID couples, and when a
# a ^aREPLY arrives that correspond to those MSGID, it is expanded back to
# the correct References: line
# see iflib/ref.c for more complete info

# -DAREAS_HACKING allows you to define Areas.fidosite files which
# are scanned for a given fidosite. If the file doesn't exist, then it
# defaults to Areas.

# -DLEVEL=X sets the level for ^aRFC- kludges. If not set 1 is the default.
# it determines the amount of info from rfc headers that is kept when gating
# -1: really nothing is gated, not recommended at all !
#  0: only intended for points or end-leaf nodes that have only an FTN link
#  1: normal level inteded for normal gateways and nodes (points)
#  2: keeps almost everything, including lots of non relevant headers.
#  3: hey! same as 2 but in plain text, no ^aRFC- kludge is used. 
# I recommend you to leave the default value of 1 if you don't _really_ know
# what you are doing.

# -DFSC_0047 implements fsc-0047 ^aSPLIT kludges for splitted messages
# !!! NOT WORKING YET !!!!
# If someone can take a look at it and really implement it I'll highly appreciate
# !!! NOT WORKING YET !!!!

# -DDEFAULT_ORIGIN=\"string\" to specify the string to put in Origin lines
# for messages which haven't one nor an Organisation: header.
# The default is "Unknown".

# -DTERMAIL_HACK tries to correct a bug in TerMail 4 which sometimes reports
# incorrect charsets (ie: puts "LATIN-1 2" while the message use in fact 
# "IBMPC 2". Hoping that version 5 will repair it.

# -DFSCHTML text/html support from fsc proposal of Lee Kindness (2:259/7.1)
# <lkindness@csl.co.uk>

# -DPGP_LIKE_DASHES compiles the Eugene's code that changes "---" to "- ---"
# I prefer not tu use it until I don't do the reverse, it will also mess up
# the PGP signatures...

#General options:
# These are not machine dependent, and describe only ifmail/ifcico features
GEN_OPTS    = -DFORCE_REPLYTO -DALLOW_CONTROL -DTERMAIL_HACK \
		-DDONT_REGATE -DSLAVE_SENDS_NAK_TOO \
		-DPUDDLE_GATE -DPCBOARD_GATE -DRNEWSB -DJE \
		-DRESTAMP_OLD_POSTINGS=25 -DBELEIVE_ZFIN=1 \
		-DKEEP_MSGID_ON_SPLIT -DIGNORE_SOFTCR -DREFERENCES_MSC96 \
		-DRELAXED -DFORCEINTL -DHAS_TCP -DAREAS_HACKING \
		-DRESTAMP_FUTURE_POSTINGS -DFSCHTML -DMACHIGAI
#		-DIRTY_CHRS
#		-DPARANOID -DNEED_UUCPFROM
 
# Linux:
OPTS        = -DHAS_STATFS -DSTATFS_IN_VFS_H -DHAS_SETSID -DHAS_NDBM_H \
		-DDONT_HAVE_TM_GMTOFF -DHAS_TERMIOS_H -DASCII_LOCKFILES \
		-DHAS_FSYNC -DHAS_IOCTL_H -DHAS_REGEX_H \
		-DHAS_SYSLOG -DNEED_BSY \
		-DREGEX_NEED_CARET -DNEED_TRAP \
		-DNEED_FORK \
		${GEN_OPTS}

# 386BSD:
#OPTS        = -D_HAVE_PARAM_H \
		-DHAS_STATFS -DSTATFS_IN_MOUNT_H -DHAS_SETSID -DHAS_NDBM_H \
		-DHAS_TERMIOS_H -DASCII_LOCKFILES -DHAS_FSYNC -DHAS_IOCTL_H \
		-DHAS_REGEX_H -DHAS_SYSLOG \
		-DNEED_BSY -DNEED_FORK -DNEGATIVE_SEEK_BUG \
		-DREGEX_NEED_CARET -DBSD_SIGNALS \
		${GEN_OPTS}

# SVR4:
#OPTS        = -DHAS_STATVFS -DDONT_HAVE_TM_GMTOFF -DHAS_SETSID -DHAS_NDBM_H \
		-DHAS_TERMIOS_H -DHAS_DIAL -DHAS_DIAL_H -DASCII_LOCKFILES \
		-DHAS_FSYNC -DHAS_IOCTL_H -DHAS_LIBGEN_H \
		-DHAS_SYSLOG -DREGEX_NEED_CARET ${GEN_OPTS}

# RISCOS5:
#OPTS        = -DHAS_STATVFS -DDONT_HAVE_TM_GMTOFF -DHAS_SETSID -DHAS_NDBM_H \
                -DHAS_TERMIOS_H -DHAS_DIAL -DHAS_DIAL_H -DASCII_LOCKFILES \
                -DHAS_FSYNC -DHAS_IOCTL_H -DHAS_LIBGEN_H \
                -DHAS_SYSLOG -DREGEX_NEED_CARET \
		-DCRTSFL_COMMAND=\"${BINDIR}/rtscts\" \
		-DMIPS_RTSCTS_HACKING=\"${BINDIR}/rtscts\" \
		-DMIPS_DATE_HACKING -DMIPS_SPEED_HACKING ${GEN_OPTS}

# SunOS:
#OPTS        = -DHAS_STATFS -DSTATFS_IN_VFS_H -DHAS_SETSID -DHAS_NDBM_H \
		-DDONT_HAVE_GETOPT -DHAS_TERMIOS_H -DASCII_LOCKFILES \
		-DHAS_FSYNC -DHAS_SYSLOG \
		-DREGEX_NEED_CARET -DBSD_SIGNALS \
		${GEN_OPTS}

# SCO Unix 3.2v4.2
#OPTS        = -DHAS_STATFS -DSTATFS_IN_STATFS_H -DSCO_STYLE_STATFS \
		-DHAS_TERMIOS_H -DDONT_HAVE_TM_GMTOFF -DDO_NEED_TIME \
		-DDONT_HAVE_GETOPT -DASCII_LOCKFILES -DHAS_IOCTL_H \
		-DHAS_SYSLOG \
		-DREGEX_NEED_CARET ${GEN_OPTS}

# ISC Unix 3.2 v3.0
#OPTS        = -DHAS_STATFS -DSTATFS_IN_STATFS_H -DHAS_TERMIO_H \
		-DDONT_HAVE_TM_GMTOFF -DDONT_HAVE_GETOPT \
		-DASCII_LOCKFILES -DHAS_IOCTL_H -DSCO_STYLE_STATFS \
		-DUSE_POLL -DHAS_NET_ERRNO_H -DSHORT_PID_T \
		-DHAS_SYSLOG \
		-DREGEX_NEED_CARET ${GEN_OPTS}
# On ISC, if you are suing gcc, you can run into a trouble with sscanf()
# function.  It appears that sscanf(string,"%d.%d",&int1,&int2) where
# string is a constant segfaults unless you specify "-fwritable-strings"
# to gcc.  I would say that this is a bug in ISC libc.  If nessecary,
# add this to the defines above.  If you have ISC version 4.0 or later,
# you can add "-posix", remove "-DSHORT_PID_T" and specify "-DHAS_TERMIOS"
# to get benefit of posix terminal control.

# AIX 3.2.5
#OPTS        = -DDONT_HAVE_TM_GMTOFF -DDO_NEED_TIME \
		-DHAS_TERMIOS_H -DASCII_LOCKFILES -DHAS_FSYNC \
		-DHAS_IOCTL_H -DHAS_STATFS -DSTATFS_IN_STATFS_H \
		-DNEED_BSY ${GEN_OPTS}

# NeXTSTEP
#OPTS         = -DHAS_STATFS -DSTATFS_IN_VFS_H -DHAS_SETSID \
		-DHAS_TERMIOS_H -DASCII_LOCKFILES -DHAS_FSYNC -DHAS_IOCTL_H \
		-DHAS_REGEX_H -DHAS_SYSLOG \
		-DNEED_BSY -DNEED_FORK -DNEGATIVE_SEEK_BUG \
		-DREGEX_NEED_CARET -DDONT_HAVE_GETOPT ${GEN_OPTS}

# for make install, where to put binaries and what owner to set
# (owner should be a `trusted user' for your MTA)
OWNER = fnet
GROUP = uucp
MODE = 0711
SMODE = 4710
MANDIR = "/usr/man"
MANOWNER = man
MANGROUP = man
MANMODE = 0644

INSTALL = install
AR = ar
RANLIB = ranlib
#RANLIB = touch
SHELL = /bin/sh
ECHO = echo -e
CC = gcc
#YACC = bison -y
YACC = yacc
#LEX = flex
LEX = lex
AWK = awk
TAR = tar

#CFLAGS = -g -Wall
# Linux, 386BSD, SunOS:
CFLAGS = -O2 -Wall
# SVR4:
#CFLAGS = -O -Xa
# NeXTSTEP
#CFLAGS = -O2 -Wall -posix -g
#LDFLAGS =  -g -L/usr/gnu/lib -nostartfiles /lib/posixcrt0.o

LDFLAGS =

# For LIBS, you may need to add "-lfl" if you are using flex 2.4.x
# If you need TERM also add e.g. "/usr/src/term112/client.a"

# Linux
LIBS = -lgdbm
# SunOS:
#LIBS =
# 386BSD:
#LIBS = -lgdbm -lgnuregex
# SVR4
#LIBS = -ldbm -lform -lnsl -lsocket -lc -L/usr/ucblib -lucb
# SCO
#LIBS = -ldbm -lsocket -lintl
# ISC
#LIBS = -lcposix -lmalloc -ldbm -linet -lPW
# NeXTSTEP
#LIBS = -lgdbm -lposix

INCLUDES = -I${INCDIR}
# ISC
#INCLUDES = -I/usr/include/rpcsvc -I${INCDIR}

# What programs are absent at your system?
## !!! tx version uses a lot the strcasestr() function. I have had comments 
## on only Linux and 386BSD, so I don't know if others need to add it or 
## already have in their standard libc. Check out and tell me - P.Saratxaga 
#NEEDED = strcasestr.o strncasecmp.o strcasecmp.o rename.o mkdir.o usleep.o \
		regexpr.o
# Linux
NEEDED = strcasestr.o
# SVR4
#NEEDED = regexpr.o
# SCO
#NEEDED = strcasestr.o strncasecmp.o strcasecmp.o usleep.o regexpr.o
# SunOS and 386BSD
#NEEDED = signal.o strcasestr.o
# ISC
#NEEDED = usleep.o regexpr.o vsyslog.o
# AIX
#NEEDED = strcasestr.o strncasecmp.o strcasecmp.o

