# Edit this file to reflect information specific to your installation.
# Then run 'make makefiles' to propagate the information to all the
# makefiles,

#
# Definitions for the library:
#
# You must define one of -DXNTP_BIG_ENDIAN, -DXNTP_LITTLE_ENDIAN or
# -DXNTP_AUTO_ENDIAN depending on which way your machine's bytes go for
# the benefit of the DES routine. Most things sold by DEC, the NS32x32
# and the 80386 deserve a -DXNTP_LITTLE_ENDIAN. Most of the rest of the
# world does it the other way. If in doubt, pick one, compile everything
# and run authstuff/authcert < authstuff/certdata. If everything fails,
# do it the other way.
#
# Under BSD, you may define -DXNTP_NETINET_ENDIAN to use netinet/in.h to
# determine which of -DXNTP_BIG_ENDIAN and XNTP_LITTLE_ENDIAN should be
# used.
#

LIBDEFS= -DXNTP_LITTLE_ENDIAN

#
# Library loading:
#
# If you don't want your library ranlib'ed, chose the second line.
#

RANLIB=		ranlib
#RANLIB=	: # ar does the work of ranlib under System V

#
# 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.x, 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 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.
#
# There are three ways to pry loose the kernel variables tick and
# tickadj needed by ntp_unixclock.c. One reads kmem and and is enabled
# with -DREADKMEM. One uses Sun's libkvm and is enabled with
# -DUSELIBKVM. The last one uses builtin defaults and is enabled with
# -DNOKMEM. Therefore, one of -DUSELIBKVM, -DREADKMEM or -DNOKMEM must
# be defined. Suns and recent BSD should use -DUSELIBKVM; others should
# use -DREADKMEM. If -DUSELIBKVM, use the DAEMONLIBS below to get the
# kernel routines.
#
# 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.
#
# 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.
#
# 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.
#
# There is an occurance of a call to rindex() in the daemon. You may
# have to include a -Drindex=strrchr to get this to load right.
#
# To change the location of the configuration file, use a
# -DCONFIG_FILE=\\"/local/etc/ntp.conf\\" or something similar.
#
# Under HP-UX, you must use either -Dhpux70 or -Dhpux80, as well as
# -DNOKMEM
#
# If your library doesn't include the vsprintf() routine, define
# -DNEED_VSPRINTF.
#
# 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 -DPPSDEV 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 compatability 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 -DPPSDEV -DNOKMEM -DDEBUG -DHAVE_UNISTD_H -DSETTIMEOFDAY_BROKEN

# this should work for cc
#DEFS= -DSTREAM -DREFCLOCK -DNO_SIGNED_CHAR_DECL -DPPSDEV -DUSELIBKVM -DDEBUG -DXNTP_RETROFIT_STDLIB -DHAVE_UNISTD_H

#
# Authentication types supported. Choose from DES and MD5. If you
# have a 680x0 type CPU and GNU-C, also choose -DFASTMD5
#

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
#	occurance 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 discipine 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(GERIC) receiver. For best performance
# this requiers a special 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= -DLOCAL_CLOCK
#CLOCKDEFS= -DAS2201PPS -DCHU -DIRIG -DLOCAL_CLOCK -DPSTCLK -DTPRO -DWWVBCLK
#CLOCKDEFS= -DAS2201 -DCHU -DGOES -DIRIG -DLEITCH -DLOCAL_CLOCK -DMX4200 -DOMEGA -DPST -DTPRO -DWWVB

#
# For MIPS 4.3BSD or RISCos 4.0, include a -lmld to get the nlist()
# routine. If USELIBKVM is defined above, 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=

#
# 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 -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= -lsocket -lnsl -lresolv -lucb

