From owner-freebsd-bugs Sat Feb 3 9:10:25 2001 Delivered-To: freebsd-bugs@hub.freebsd.org Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id 233D037B503 for ; Sat, 3 Feb 2001 09:10:01 -0800 (PST) Received: (from gnats@localhost) by freefall.freebsd.org (8.11.1/8.11.1) id f13HA1f72037; Sat, 3 Feb 2001 09:10:01 -0800 (PST) (envelope-from gnats) Received: from mail.gmx.net (pop.gmx.net [194.221.183.20]) by hub.freebsd.org (Postfix) with SMTP id 2892A37B401 for ; Sat, 3 Feb 2001 09:00:06 -0800 (PST) Received: (qmail 4900 invoked by uid 0); 3 Feb 2001 17:00:04 -0000 Received: from pd9508808.dip.t-dialin.net (HELO speedy.gsinet) (217.80.136.8) by mail.gmx.net (mp010-rz3) with SMTP; 3 Feb 2001 17:00:04 -0000 Received: (from sittig@localhost) by speedy.gsinet (8.8.8/8.8.8) id RAA21882 for FreeBSD-gnats-submit@freebsd.org; Sat, 3 Feb 2001 17:49:38 +0100 Message-Id: <20010203174937.N253@speedy.gsinet> Date: Sat, 3 Feb 2001 17:49:38 +0100 From: Gerhard Sittig To: FreeBSD-gnats-submit@freebsd.org X-Send-Pr-Version: 3.2 Subject: bin/24828: [PATCH] ntpd compilation and additional refclocks Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org >Number: 24828 >Category: bin >Synopsis: [PATCH] ntpd compilation and additional refclocks >Confidential: no >Severity: non-critical >Priority: medium >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Sat Feb 03 09:10:00 PST 2001 >Closed-Date: >Last-Modified: >Originator: Gerhard Sittig >Release: FreeBSD 4.2-STABLE i386 >Organization: System Defenestrators Inc. >Environment: ntp using refclock #35 ("Conrad parallel port radio clock") as a source of information >Description: ntpd lives in src/contrib/ntp and is shadowed(id? term?) in src/usr.sbin/ntp, while the latter tree comes with a preset config.h file and its own Makefiles. The config.h file has almost no drivers activated and the Makefile tries to enumerate the sourcefiles itself which live in the contrib tree. The cut down driver list is done by will. But in my try to extend the list of drivers I ended up with build errors. This is where I stumbled across the second aspect: The src/usr.sbin/ntp/ntpd/Makefile tries to duplicate the contrib filelist and maybe should do some 'ls' in this directory instead of enumerating all the files itself. Since I just wanted to get the parport device to run I didn't check for the other drivers. >How-To-Repeat: Use some "server 127.127.35.0" line in /etc/ntp.conf and have your ntpd complain about failed initialization due to unsupported refclock devices. refclock_newpeer: clock type 35 invalid configuration of 127.127.35.0 failed Apply this patch and run "make all" in src/usr.sbin/ntp and see ld(1) barf. The problem is that there's no refclock_pcf.o object file since the source file is missing in SRCS. Index: config.h =================================================================== RCS file: /CVSREPO/fbsd/src/usr.sbin/ntp/config.h,v retrieving revision 1.4 diff -u -r1.4 config.h --- config.h 2000/03/12 13:25:14 1.4 +++ config.h 2001/02/03 17:03:44 @@ -173,7 +173,7 @@ #define CLOCK_PARSE 1 /* Conrad parallel port radio clock */ -/* #undef CLOCK_PCF */ +#define CLOCK_PCF 1 /* PCL 720 clock support */ /* #undef CLOCK_PPS720 */ This will result in the following error message: [ ... lengthy link command snipped ... ] refclock_conf.o(.data+0xa8): undefined reference to `refclock_pcf' *** Error code 1 A more verbose description can be found in message <20010203140459.L253@speedy.gsinet> I sent earlier today to freebsd-questions. >Fix: For the situation I found myself in the following patch resolved the problem. But as sketched above it might be useful to derive the SRCS list from an ls(1) run in the contrib dir. Index: ntpd/Makefile =================================================================== RCS file: /CVSREPO/fbsd/src/usr.sbin/ntp/ntpd/Makefile,v retrieving revision 1.3 diff -u -r1.3 Makefile --- ntpd/Makefile 2000/01/01 23:57:59 1.3 +++ ntpd/Makefile 2001/02/03 17:03:44 @@ -19,7 +19,8 @@ refclock_hpgps.c refclock_irig.c refclock_jupiter.c \ refclock_leitch.c refclock_local.c refclock_msfees.c \ refclock_mx4200.c refclock_nmea.c refclock_oncore.c \ - refclock_palisade.c refclock_parse.c refclock_pst.c \ + refclock_palisade.c refclock_parse.c \ + refclock_pcf.c refclock_pst.c \ refclock_ptbacts.c refclock_shm.c refclock_tpro.c \ refclock_trak.c refclock_true.c refclock_usno.c \ refclock_wwvb.c version.c virtually yours 82D1 9B9C 01DC 4FB4 D7B4 61BE 3F49 4F77 72DE DA76 Gerhard Sittig true | mail -s "get gpg key" Gerhard.Sittig@gmx.net -- If you don't understand or are scared by any of the above ask your parents or an adult to help you. >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message