#
# Generic configuration file
#
# Edit this file to reflect information specific to your installation.
# Then run 'make makefiles' to propagate the information to all the
# makefiles, followed by 'make' to make all programs except some dinky
# utilities hiding places like the kernel, ppsclock and adjtime
# directories.

#
# Definitions for the library
#
# You must define the byte order used by your particular machine. Most
# things sold by DEC, the NS32x32 and the 80x86 deserve a
# -DLITTLE_ENDIAN. Most of the rest of the world does it the other way
# -DBIG_ENDIAN. Once upon a time the PDP11 did it its own way
# -DPDP_ENDIAN. Choose one among the following three. If in doubt, pick
# one, compile everything and run authstuff/authcert or
# authstuff/certdata. If everything fails, do it the other way. This is
# necessary only for the authdes() library routine. Note: these are the
# preferred defines; for historical reasons XNTP_LITTLE_ENDIAN is a
# synonym for LITTLE_ENDIAN and XNTP_BIG_ENDIAN is a synonym for
# BIG_ENDIAN. 
#
#LIBDEFS= -DLITTLE_ENDIAN
LIBDEFS= -DBIG_ENDIAN
#LIBDEFS= -DPDP_ENDIAN

#
# Library loading. If you don't want your library ranlib'ed, chose the
# second line. Note that ar does the work of ranlib under System V
#
RANLIB=	ranlib
#RANLIB= :

#
# For MIPS 4.3BSD or RISCos 4.0, include a -lmld to get the nlist()
# routine. If USELIBKVM is defined below, include a -lkvm to get the
# kernel routines.
#
#DAEMONLIBS= -lmld
DAEMONLIBS= -lkvm
#DAEMONLIBS=

#
# Name resolver library included when loading xntpres, which calls
# gethostbyname(). Define this if you would rather use a different
# version of the routine than the one in libc.a.
#
#RESLIB= -lresolv
RESLIB=

#
# Definitions for programs
# 
# If your compiler doesn't understand the declaration `signed char', add
# -DNO_SIGNED_CHAR_DECL. Your `char' data type had better be signed. If
# you don't know what the compiler knows, try it without the flag. If
# you get a syntax error on line 13 of ntp.h, add it. Note that `signed
# char' is an ANSIism. Most older, pcc-derived compilers will need this
# flag.
#
# If your library already has 's_char' defined, add -DS_CHAR_DEFINED.
#
# For SunOS 3.x, add -DSUN_3_3_STINKS (otherwise it will complain about
# broadaddr and will hang if you run without a -d flag on the command
# line. I actually can't believe the latter bug. If it hangs on your
# system with the flag defined, peruse xntpd/ntp_io.c for some rude
# comments about SunOS 3.5 and try it the other way). This flag affects
# xntpd only.
#
# For Ultrix 2.0, add -DULT_2_0_SUCKS. This OS has the same hanging bug
# as SunOS 3.5 (is this an original 4.2 bug?) and in addition has some
# strangeness concerning signal masks. Ultrix 2.3 doesn't have these
# problems. If you're running something in between you're on your own.
# This flag affects xntpd only.
#
# For SunOS 4.1.1 and later, add -DDOSYNCTODR_SUCKS to include the code
# in ntp_util.c that sets the battery clock at the same time that it
# updates the driftfile. It does this by revving up the niceness, then
# sets the time of day to the current time of day. Ordinarily, you would
# need this only on non-networked machines.
#
# For Convex, define CXOS to be 10 for 10.0/10.1/10.2and 11 for 11.0
# Beta (and, one hopes, production)
#
# Under HP-UX, you must use either -Dhpux70 or -Dhpux80, as well as
# -DNOKMEM
#
# RS/6000 and SunOS 5.x require -DSTUPID_SIGNAL. The default is BSD type
# signals. On SGI machines use -DUSESELECT and -D_BSD_SIGNALS.
# -DRETSIGTYPE={void,int} can be used to set the type of the return
# value of a signal handler.
#
# It seems that SIGIO is politically incorrect on some systems. Define
# HAS_SIGACTIO if your system has sigaction().
#
# For some machines, settimeofday does not set the sub-second component
# of the time correctly. For these machines add -DSETTIMEOFDAY_BROKEN.
# If xntpd keeps STEPPING the clock by small amounts, then it is
# possible that you are suffering from this problem.
#
# Miscellany: HAVE_UNISTD_H crept in with a patch to compile xntp-alpha
# on a machine with prototypes but no <unistd.h>. USE_PROTOTYPES is a
# way of arming prototypes if you have a compiler that understands
# prototypes but does not define __STDC__. XNTP_RETROFIT_STDLIB keeps
# libc prototypes (known to work on sun/mips/solaris) from breaking
# every other platform's compiler. If you delete it, please delete all
# the libc prototypes lurking in include/stdlib.h. Won't hurt you, might
# help someone who wants to be "gcc -Wall" spotless.
#
# There are four ways to pry loose the kernel variables tick and tickadj
# needed by xntpd/ntp_unixclock.c. With -DREADKMEM, the variables are
# read directly from /dev/kmem. With -DUSELIBKVM, they are read using
# the libkvm library routine. With -DNOKMEM, builtin defaults are used.
# Suns prior to SunOS 5.x should use -DUSELIBKVM and the DAEMONLIBS
# above to get the kernel routines. Suns running SunOS 5.1 (only) should
# use -DSOLARIS and -DSLEWALWAYS. Suns running SunOS 5.2 and later
# should use -DSOLARIS, -DSOLARIS_HRTIME and -DADJTIME_IS_ACCURATE.
# Other machines based on BSD Unix should use -DREADKMEM. Exactly one of
# these four must be defined.
#
# If your gethostbyname() routine isn't based on the DNS resolver (and,
# in particular, h_errno doesn't exist) add a -DNODNS. There doesn't
# seem to be a good way to detect this automatically which works in all
# cases. This flag affects xntpres only.
#
# By default, the name resolver uses an internal routine which resolves
# host names as they are found in the configuration file. If the delay
# this causes during initial configuration is unacceptable, define
# -DRESOLVE_EXTERNAL to use the xntpres external resolver.
#
# Adding -DLOCK_PROCESS to the compilation flags will prevent xntpd from
# being swapped out on systems where the plock(3) call is available.
#
# The flag -DDEBUG includes some debugging code. To use this, include
# the define and start the daemon with one or more -d flags, depending
# on your calibration of pairannoya. The daemon will not detach your
# terminal in this case.
#
# To change the location of the configuration file, use a
# -DCONFIG_FILE=\\"/local/etc/ntp.conf\\" or something similar.
#
# If your library doesn't include the vsprintf() routine, define
# -DNEED_VSPRINTF.
#
# The flag -DREFCLOCK causes the basic reference clock support to be
# compiled into the daemon. If you set this you will also want to
# configure the particular clock drivers you want in the CLOCKDEFS= line
# below. This flag affects xntpd only.
#
# The next two sets of defines are meaningful only when radio clock
# drivers or special 1-pps signals are to be used. For systems without
# these features, these delicious complexities can be avoided.
#
#	There are three ways to utilize external 1-pps signals. Define
#	-DPPS to include just the pps routine, such as used by the DCF77
#	clock driver. Define -DPPSCLK to include a serial device driver
#	which avoids much of the jitter due to upper level port
#	processing. This requires a dedicated serial port and either the
#	tty_clock line discipline or tty_clk_streams module, both of
#	which are in the ./kernel directory. Define -DPPSCD to include a
#	special driver which intercepts carrier-detect transitions
#	generated by the pps signal. This requires a nondedicated serial
#	port and the ppsclock streams module in the ./kernel directory.
#	Only one of these three flags should be defined.
#
#	There are three serial port system software interfaces, each of
#	which is peculiar to one or more Unix versions. Define
#	-DSYSV_TTYS for basic System V compatibility; define -DSTREAM
#	for POSIX compatibility including System V Streams, and BSD_TTYS
#	for 4.3bsd compatibility. Only one of these three should be
#	defined. If none are defined, BSD_TTYS is assumed.
#
# this should work for gcc
DEFS= -DUSE_PROTOTYPES -DSTREAM -DREFCLOCK -DNO_SIGNED_CHAR_DECL -DPPSCLK -DUSELIBKVM -DDEBUG -DXNTP_RETROFIT_STDLIB -DHAVE_UNISTD_H -DHAS_SIGACTION
#
# this should work for cc
#DEFS= -DSTREAM -DREFCLOCK -DNO_SIGNED_CHAR_DECL -DPPSCLK -DUSELIBKVM -DDEBUG -DXNTP_RETROFIT_STDLIB -DHAVE_UNISTD_H -DHAS_SIGACTION

#
# Authentication types supported. Choose from DES and MD5 or both. If
# you have a 680x0 and desire the fastest speeding bullet, use the gcc
# compiler and define -DFAST_MD5.
#
AUTHDEFS=-DDES -DMD5

#
# Radio clock support definitions (these only make sense if -DREFCLOCK
# used). Note that a configuration can include more than one type of
# clock and even multiple instances of the same clock.
#
#	For most radio clocks operating with serial ports, accuracy can
#	be considerably improved through use of the tty_clk line
#	discipline or tty_clk_STREAMS streams module found in the
#	./kernel directory. These gizmos capture a timestamp upon
#	occurrence of an intercept character and stuff it in the data
#	stream for the clock driver to munch. To select this mode,
#	postfix the driver name with the string CLK; that is, WWVB
#	becomes WWVBCLK. If more than one clock is in use, the CLK
#	postfix can be used with any or all of them.
#
#	Alternatively, for the best accuracy, use the ppsclock streams
#	module in the ./ppsclock directory to steal the carrier-detect
#	transition and capture a precision timestamp. At present this
#	works only with SunOS 4.1.1 or later. To select this mode,
#	postfix the driver name with the string PPS; that is, AS2201
#	becomes AS2201PPS. If more than one clock is in use, the PPS
#	postfix should be used with only one of them.
#
# Define -DLOCAL_CLOCK for a local pseudo-clock to masquerade as a
# reference clock for those subnets without access to the real thing.
#
# Define -DPST for a PST/Traconex 1020 WWV/H receiver. The driver
# supports both the CLK and PPS modes.
#
# Define -DWWVB for a Spectracom 8170 or Netclock/2 WWVB receiver. The
# driver supports both the CLK and PPS modes.
#
# Define -DCHU for a special CHU receiver using an ordinary shortwave
# radio. This requires the chu_clk line discipline or chu_clk_STREAMS
# module in the ./kernel directory. Construction details for a suitable
# modem can be found in the ./gadget directory. The driver supports
# neither the CLK nor PPS modes.
#
# Define -DPARSE for a DCF77/GPS(GENERIC) receiver. For best performance
# this requires a special parsestreams STREAMS (SunOS 4.x) module in the
# ./kernel directory. Define -DPARSEPPS for PPS support via the
# DCF77/GPS (GENERIC) receiver; also, define -DPPS in the DEFS above.
# Define:	-DCLOCK_MEINBERG for Meinberg clocks
#		-DCLOCK_SCHMID   for Schmid receivers
#		-DCLOCK_DCF7000  for ELV DCF7000
#		-DCLOCK_RAWDCF   for simple receivers
#
# Define -DMX4200PPS for a Magnavox 4200 GPS receiver. The PPS mode is
# required.
#
# Define -DAS2201 for an Austron 2200A or 2201A GPS receiver. The driver
# does not support the CLK mode, but does support the PPS mode. If the
# radio is connected to more than one machine, the PPS mode is required.
#
# Define -DGOES for a Kinemetrics/TrueTime 468-DC GOES receiver. This
# driver is known to work with some other TrueTime products as well,
# including the GPS-DC GPS receiver. The driver does not support the CLK
# mode, but does support the PPS mode.
#
# Define -DOMEGA for a Kinemetrics/TrueTime OM-DC OMEGA receiver. The
# driver does not support the CLK mode, but does support the PPS mode.
#
# Define -DTPRO for a KSI/Odetics TPRO-S IRIG-B timecode reader. This
# requires the SunOS interface driver available from KSI. The driver
# supports neither the CLK nor PPS modes.
#
# Define -DLEITCH for a Leitch CSD 5300 Master Clock System Driver for
# the HP 5061B Cesium Clock. The driver does not support the CLK mode,
# but does support the PPS mode.
#
# Define -DMSF for a MSF receiver promised by Piete Brooks, but he ain't
# done that yet.
#
# Define -DIRIG for a preliminary IRIG-B timecode reader using the
# native audio input and modified BSD audio driver for SunOS 4.1.1 or
# later. Stay tuned for further details.
#
CLOCKDEFS= -DAS2201PPS -DCHU -DIRIG -DLOCAL_CLOCK -DMX4200 -DPSTCLK -DTPRO -DWWVBCLK

#
# Option flags for the C compiler. A -g if you are uncomfortable
#
COPTS= -O

#
# C compiler to use. gcc will work, but avoid the -fstrength-reduce
# option if the version is 1.35 or earlier (using this option caused
# incorrect code to be generated in the DES key permutation code, and
# perhaps elsewhere).
#
COMPILER= gcc -pipe -Wall -O2 -finline-functions -fdelayed-branch -fomit-frame-pointer
#COMPILER= cc -pipe

#
# Directory into which binaries should be installed
#
BINDIR=	/usr/local/bin

#
# Special library for adjtime emulation. Used under HP-UX
# (remember to run make in the adjtime directory)
#
#ADJLIB= ../adjtime/libadjtime.a
ADJLIB=

#
# BSD emulation library. In theory, this fixes signal semantics under
# HP-UX, but it doesn't work with 8.0 on a 9000s340, so there is now
# a work-around in the code (compiled when hpux80 is defined). In other
# words, use this for HP-UX prior to 8.0.
#
#COMPAT= -lBSD
COMPAT=
