Subject: install/13266: x_dhclient fails to build in distrib subtree
To: None <gnats-bugs@gnats.netbsd.org>
From: Mark Davies <mark@mcs.vuw.ac.nz>
List: netbsd-bugs
Date: 06/21/2001 15:00:51
>Number:         13266
>Category:       install
>Synopsis:       x_dhclient fails to build in distrib subtree
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    install-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Jun 20 19:59:00 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator:     Mark Davies
>Release:        2001/06/21
>Organization:
Dept. of Comp. Sci., Victoria Uni. of Wellington, New Zealand.
>Environment:
	
System: NetBSD city-art.mcs.vuw.ac.nz 1.5U NetBSD 1.5U (MCS_WORKSTATION) #0: Wed Apr 11 15:36:35 NZST 2001 mark@turakirae.mcs.vuw.ac.nz:/src/work/src/sys/arch/i386/compile/MCS_WORKSTATION i386
Architecture: i386
Machine: i386
>Description:
	Doing a "make release" from this mornings sources fails with

all ===> utils/x_dhclient
cc -O2 -Os -Werror   -DCLIENT_PATH='"PATH=/usr/bin:/usr/sbin:/bin:/sbin"' -DSMALL -I/src/work/src/distrib/utils/x_dhclient/../../../usr.sbin/dhcp -I/src/work/src/distrib/utils/x_dhclient/../../../usr.sbin/dhcp/includes -nostdinc -idirafter
/mnt/SAVE/build.base/usr/include -c /src/work/src/distrib/utils/x_dhclient/../../../usr.sbin/dhcp/client/dhclient.c
/src/work/src/distrib/utils/x_dhclient/../../../usr.sbin/dhcp/client/dhclient.c: In function `client_dns_update':
/src/work/src/distrib/utils/x_dhclient/../../../usr.sbin/dhcp/client/dhclient.c:3053: `resolver_inited' undeclared (first use in this function)
/src/work/src/distrib/utils/x_dhclient/../../../usr.sbin/dhcp/client/dhclient.c:3053: (Each undeclared identifier is reported only once
/src/work/src/distrib/utils/x_dhclient/../../../usr.sbin/dhcp/client/dhclient.c:3053: for each function it appears in.)
/src/work/src/distrib/utils/x_dhclient/../../../usr.sbin/dhcp/client/dhclient.c:3054: `resolver_state' undeclared (first use in this function)

use of resolver_state and resolver_inited are wrapped with an "#ifdef NSUPDATE"
everywhere they occur _except_ in the above and when building x_dhclient
NSUPDATE is explicitly undefined.

>How-To-Repeat:
>Fix:

I made the following patch to get it building but the ifdef probably wants to
go around the whole function.

Index: dhclient.c
===================================================================
RCS file: /src/cvs/netbsd/basesrc/usr.sbin/dhcp/client/dhclient.c,v
retrieving revision 1.39
diff -u -r1.39 dhclient.c
--- dhclient.c	2001/06/18 19:01:52	1.39
+++ dhclient.c	2001/06/21 02:21:58
@@ -3049,6 +3049,7 @@
 		return;
 	}
 
+#ifdef NSUPDATE
 	/* Start the resolver, if necessary. */
 	if (!resolver_inited) {
 		minires_ninit (&resolver_state);
@@ -3056,6 +3057,7 @@
 		resolver_state.retrans = 1;
 		resolver_state.retry = 1;
 	}
+#endif
 
 	/*
 	 * Perform updates.


(Glad I waited before sending the above)
Indeed the ifdef does need to go around more of this.  With the above patch you
now get through to the link stage and die there with:

dhclient.o: In function `client_dns_update':
dhclient.o(.text+0x41ef): undefined reference to `get_dhcid'
dhclient.o(.text+0x421f): undefined reference to `get_dhcid'
dhclient.o(.text+0x4275): undefined reference to `ddns_update_a'
dhclient.o(.text+0x429c): undefined reference to `ddns_remove_a'
clparse.o: In function `read_client_conf_file':
clparse.o(.text+0x1e0): undefined reference to `uerr2isc'
comapi.o: In function `dhcp_control_stuff_values':
comapi.o(.text+0xa17): undefined reference to `omapi_connection_put_name'
comapi.o(.text+0xa26): undefined reference to `omapi_connection_put_uint32'
comapi.o(.text+0xa36): undefined reference to `omapi_connection_put_uint32'
collect2: ld returned 1 exit status

I'll send this off now in case someone else knows what should be conditional
on NSUPDATE before I work it out.

cheers
mark
>Release-Note:
>Audit-Trail:
>Unformatted: