Subject: bin/3382: Correct several DPADD/LDADD inconsistencies
To: None <gnats-bugs@gnats.netbsd.org>
From: Erik Bertelsen <erik@erik-be.uni-c.dk>
List: netbsd-bugs
Date: 03/23/1997 15:11:00
>Number:         3382
>Category:       bin
>Synopsis:       Correct several DPADD/LDADD inconsistencies
>Confidential:   yes
>Severity:       serious
>Priority:       medium
>Responsible:    bin-bug-people (Utility Bug People)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Mar 23 07:50:03 1997
>Last-Modified:
>Originator:     Erik Bertelsen
>Organization:
	
>Release:        NetBSD-current 21 March 1997
>Environment:
	
System: NetBSD erik-be.uni-c.dk 1.2D NetBSD 1.2D (ERIKBE) #18: Sun Mar 16 18:30:17 MET 1997 erik@erik-be.uni-c.dk:/sw/NetBSD/src/sys/arch/i386/compile/ERIKBE i386


>Description:
	A couple of days ago I updated my sources with libedit being
	the only library being updated. I then compiled and installed
	libedit and proceeded to build the rest of the source hierarchy.
	I noticed that ftp wasn't relinked even if it was augmented
	with several new functionalities recently including support
	for line editing. Looking at ftp's Makefile reveals that it
	adds to LDADD, but does not make the corresponding addition
	to DPADD.
	By find'ing and grep'ing through all the Makefiles, I made up
	the patch included below to correct this problem throughout
	several Makefiles in the NetBSD sources.
	As part of this exercise, I also added a new variable
	LIBTELNET. This part of the patch should be reviewed to 
	ensure that it is consistent to the domestic sources which
	I don't have access to.
	I also just removed some LDADD's in comments instead of
	adding the corresponding DPADD's as comments.
	Furthermore I notice that there is inconsistencies in when
	to use assignemnt (=) and when to use addititive assignment
	(+=) to these variables, but I did not make any changes
	to resolve this problem.

	Regards
	Erik Bertelsen
>How-To-Repeat:
>Fix:
Index: gnu/usr.bin/gas/Makefile
===================================================================
RCS file: /home/cvs-base/src/gnu/usr.bin/gas/Makefile,v
retrieving revision 1.1.1.1
diff -c -r1.1.1.1 Makefile
*** Makefile	1997/01/01 18:57:58	1.1.1.1
--- Makefile	1997/03/22 20:50:06
***************
*** 25,32 ****
  CFLAGS+=	-I$(.CURDIR) ${ADDINCLUDE} -I$(.CURDIR)/config \
  		-DOLD_GAS -DSIGTY=void -Derror=as_fatal \
  		-DNETBSD_AOUT
- #LDADD+=		-lgnumalloc
- DPADD+=		/usr/lib/libgnumalloc.a
  
  CONF_HEADERS=	targ-cpu.h obj-format.h host.h targ-env.h
  
--- 25,30 ----
Index: gnu/usr.bin/gdb/xgdb/Makefile
===================================================================
RCS file: /home/cvs-base/src/gnu/usr.bin/gdb/xgdb/Makefile,v
retrieving revision 1.1.1.1
diff -c -r1.1.1.1 Makefile
*** Makefile	1997/01/01 19:00:49	1.1.1.1
--- Makefile	1997/03/22 20:51:08
***************
*** 17,22 ****
--- 17,23 ----
  		-DHAVE_VPRINTF -DVI_MODE -DKERNELDEBUG
  LDFLAGS+=	-L/usr/lib/X11
  LDADD+=		$(GDBOBJS:S/^/..\//g) -lXaw -lXmu -lXt -lXext -lX11 -ltermcap
+ DPADD+=		${LIBTERMCAP}
  NOMAN=		noman
  
  .include "../../Makefile.inc"
Index: gnu/usr.bin/grep/Makefile
===================================================================
RCS file: /home/cvs-base/src/gnu/usr.bin/grep/Makefile,v
retrieving revision 1.1.1.1
diff -c -r1.1.1.1 Makefile
*** Makefile	1997/01/01 19:00:51	1.1.1.1
--- Makefile	1997/03/22 20:51:55
***************
*** 7,13 ****
  	-DHAVE_VALLOC=1
  
  LDADD+=	-lgnumalloc -lcompat
! DPADD+=	${DESTDIR}/usr/lib/libgnumalloc.a
  
  LINKS+= ${BINDIR}/grep ${BINDIR}/egrep \
  	${BINDIR}/grep ${BINDIR}/fgrep
--- 7,13 ----
  	-DHAVE_VALLOC=1
  
  LDADD+=	-lgnumalloc -lcompat
! DPADD+=	${DESTDIR}/usr/lib/libgnumalloc.a ${LIBCOMPAT}
  
  LINKS+= ${BINDIR}/grep ${BINDIR}/egrep \
  	${BINDIR}/grep ${BINDIR}/fgrep
Index: libexec/telnetd/Makefile
===================================================================
RCS file: /home/cvs-base/src/libexec/telnetd/Makefile,v
retrieving revision 1.1.1.1
diff -c -r1.1.1.1 Makefile
*** Makefile	1997/01/01 19:13:49	1.1.1.1
--- Makefile	1997/03/22 20:57:10
***************
*** 6,12 ****
  CFLAGS+=-DOLD_ENVIRON -DENV_HACK -I${.CURDIR}
  SRCS=	authenc.c global.c slc.c state.c sys_term.c telnetd.c \
  	termstat.c utility.c
! DPADD=	${LIBUTIL} ${LIBTERM}
  LDADD+=	-lutil -ltermcap -ltelnet
  MAN=	telnetd.8
  
--- 6,12 ----
  CFLAGS+=-DOLD_ENVIRON -DENV_HACK -I${.CURDIR}
  SRCS=	authenc.c global.c slc.c state.c sys_term.c telnetd.c \
  	termstat.c utility.c
! DPADD=	${LIBUTIL} ${LIBTERM} ${LIBTELNET}
  LDADD+=	-lutil -ltermcap -ltelnet
  MAN=	telnetd.8
  
Index: sbin/edlabel/Makefile
===================================================================
RCS file: /home/cvs-base/src/sbin/edlabel/Makefile,v
retrieving revision 1.1.1.1
diff -c -r1.1.1.1 Makefile
*** Makefile	1997/01/01 19:14:24	1.1.1.1
--- Makefile	1997/03/22 20:58:20
***************
*** 5,10 ****
--- 5,11 ----
  NOMAN=
  CFLAGS += -Wall
  LDADD  += -lutil
+ DPADD  += ${LIBUTIL}
  
  all: ${PROG}
  
Index: share/mk/bsd.prog.mk
===================================================================
RCS file: /home/cvs-base/src/share/mk/bsd.prog.mk,v
retrieving revision 1.1.1.3
diff -c -r1.1.1.3 bsd.prog.mk
*** bsd.prog.mk	1997/03/15 19:41:00	1.1.1.3
--- bsd.prog.mk	1997/03/22 20:57:04
***************
*** 33,38 ****
--- 33,39 ----
  LIBRPCSVC?=	${DESTDIR}/usr/lib/librpcsvc.a
  LIBSKEY?=	${DESTDIR}/usr/lib/libskey.a
  LIBTERMCAP?=	${DESTDIR}/usr/lib/libtermcap.a
+ LIBTELNET?=	${DESTDIR}/usr/lib/libtelnet.a
  LIBUTIL?=	${DESTDIR}/usr/lib/libutil.a
  LIBWRAP?=	${DESTDIR}/usr/lib/libwrap.a
  LIBY?=		${DESTDIR}/usr/lib/liby.a
Index: usr.bin/ftp/Makefile
===================================================================
RCS file: /home/cvs-base/src/usr.bin/ftp/Makefile,v
retrieving revision 1.1.1.4
diff -c -r1.1.1.4 Makefile
*** Makefile	1997/03/15 19:42:21	1.1.1.4
--- Makefile	1997/03/22 20:58:57
***************
*** 6,10 ****
--- 6,11 ----
  	util.c
  
  LDADD+=	-ledit -ltermcap
+ DPADD+= ${LIBEDIT} ${LIBTERMCAP}
  
  .include <bsd.prog.mk>
Index: usr.bin/telnet/Makefile
===================================================================
RCS file: /home/cvs-base/src/usr.bin/telnet/Makefile,v
retrieving revision 1.1.1.1
diff -c -r1.1.1.1 Makefile
*** Makefile	1997/01/01 19:33:23	1.1.1.1
--- Makefile	1997/03/22 20:59:14
***************
*** 40,46 ****
  CFLAGS+=-DENV_HACK
  CFLAGS+=-I${.CURDIR}/../../lib
  LDADD+=	-ltermcap -ltelnet
! DPADD=	${LIBTERMCAP}
  
  
  SRCS=	authenc.c commands.c main.c network.c ring.c sys_bsd.c telnet.c \
--- 40,46 ----
  CFLAGS+=-DENV_HACK
  CFLAGS+=-I${.CURDIR}/../../lib
  LDADD+=	-ltermcap -ltelnet
! DPADD=	${LIBTERMCAP} ${LIBTELNET}
  
  
  SRCS=	authenc.c commands.c main.c network.c ring.c sys_bsd.c telnet.c \
Index: usr.bin/tn3270/tn3270/Makefile
===================================================================
RCS file: /home/cvs-base/src/usr.bin/tn3270/tn3270/Makefile,v
retrieving revision 1.1.1.4
diff -c -r1.1.1.4 Makefile
*** Makefile	1997/03/15 19:42:27	1.1.1.4
--- Makefile	1997/03/22 21:02:13
***************
*** 5,11 ****
  
  CFLAGS += -I${.CURDIR} -I.
  LDADD += -lcurses -ltermcap -lcrypt
! DPADD += ${LIBCURSES} ${LIBTERMCAP} /usr/lib/libtelnet.a ${LIBCRYPT}
  
  SRCS += apilib.c api_bsd.c api_exch.c asc_ebc.c astosc.c dctype.c
  SRCS += disp_asc.c ebc_disp.c
--- 5,11 ----
  
  CFLAGS += -I${.CURDIR} -I.
  LDADD += -lcurses -ltermcap -lcrypt
! DPADD += ${LIBCURSES} ${LIBTERMCAP} ${LIBCRYPT}
  
  SRCS += apilib.c api_bsd.c api_exch.c asc_ebc.c astosc.c dctype.c
  SRCS += disp_asc.c ebc_disp.c
Index: usr.bin/vi/build/Makefile
===================================================================
RCS file: /home/cvs-base/src/usr.bin/vi/build/Makefile,v
retrieving revision 1.1.1.2
diff -c -r1.1.1.2 Makefile
*** Makefile	1997/01/30 21:35:24	1.1.1.2
--- Makefile	1997/03/22 20:53:43
***************
*** 5,10 ****
--- 5,11 ----
  CFLAGS+=-I${.CURDIR} -I${.CURDIR}/../include
  
  LDADD+= -lcurses -ltermcap
+ DPADD+= ${LIBCURSES} ${LIBTERMCAP}
  PROG=	vi
  SRCS=	cl_bsd.c cl_funcs.c cl_main.c cl_read.c cl_screen.c cl_term.c \
  	cut.c delete.c ex.c ex_abbrev.c ex_append.c ex_args.c ex_argv.c \
Index: usr.sbin/apm/Makefile
===================================================================
RCS file: /home/cvs-base/src/usr.sbin/apm/Makefile,v
retrieving revision 1.1.1.1
diff -c -r1.1.1.1 Makefile
*** Makefile	1997/01/01 19:41:06	1.1.1.1
--- Makefile	1997/03/22 21:42:11
***************
*** 1,7 ****
  #	$NetBSD: Makefile,v 1.1 1996/08/25 23:40:51 jtk Exp $
  
  SRCS=	apm.c apmsubr.c
- #LDADD+=	-lutil
  
  .PATH:	${.CURDIR}/../apmd
  
--- 1,6 ----
Index: usr.sbin/apmd/Makefile
===================================================================
RCS file: /home/cvs-base/src/usr.sbin/apmd/Makefile,v
retrieving revision 1.1.1.1
diff -c -r1.1.1.1 Makefile
*** Makefile	1997/01/01 19:41:06	1.1.1.1
--- Makefile	1997/03/22 21:42:26
***************
*** 1,7 ****
  #	$NetBSD: Makefile,v 1.1 1996/08/25 23:40:57 jtk Exp $
  
  SRCS=	apmd.c apmsubr.c
- #LDADD+=	-lutil
  
  CFLAGS+=	-g  -O2 -Wmissing-prototypes -Wall
  PROG=	apmd
--- 1,6 ----
Index: usr.sbin/rpc.pcnfsd/Makefile
===================================================================
RCS file: /home/cvs-base/src/usr.sbin/rpc.pcnfsd/Makefile,v
retrieving revision 1.1.1.1
diff -c -r1.1.1.1 Makefile
*** Makefile	1997/01/01 19:38:32	1.1.1.1
--- Makefile	1997/03/22 21:43:07
***************
*** 8,14 ****
  SRCS=	pcnfsd_v1.c pcnfsd_v2.c pcnfsd_misc.c \
  	pcnfsd_cache.c pcnfsd_print.c pcnfsd_svc.c pcnfsd_xdr.c
  
! DPADD=	${LIBRPCSVC}
  LDADD=	-lrpcsvc -lcrypt
  
  pcnfsd_svc.c: pcnfsd.x
--- 8,14 ----
  SRCS=	pcnfsd_v1.c pcnfsd_v2.c pcnfsd_misc.c \
  	pcnfsd_cache.c pcnfsd_print.c pcnfsd_svc.c pcnfsd_xdr.c
  
! DPADD=	${LIBRPCSVC} ${LIBCRYPT}
  LDADD=	-lrpcsvc -lcrypt
  
  pcnfsd_svc.c: pcnfsd.x
Index: usr.sbin/rpc.yppasswdd/Makefile
===================================================================
RCS file: /home/cvs-base/src/usr.sbin/rpc.yppasswdd/Makefile,v
retrieving revision 1.1.1.1
diff -c -r1.1.1.1 Makefile
*** Makefile	1997/01/01 19:41:26	1.1.1.1
--- Makefile	1997/03/22 21:43:35
***************
*** 7,13 ****
  BINMODE=555
  BINDIR=/usr/sbin
  MLINKS= rpc.yppasswdd.8 yppasswdd.8
! DPADD+= ${LIBUTIL}
  LDADD+= -lcrypt -lutil
  
  .include <bsd.prog.mk>
--- 7,13 ----
  BINMODE=555
  BINDIR=/usr/sbin
  MLINKS= rpc.yppasswdd.8 yppasswdd.8
! DPADD+= ${LIBCRYPT} ${LIBUTIL}
  LDADD+= -lcrypt -lutil
  
  .include <bsd.prog.mk>
Index: usr.sbin/sendmail/src/Makefile
===================================================================
RCS file: /home/cvs-base/src/usr.sbin/sendmail/src/Makefile,v
retrieving revision 1.1.1.1
diff -c -r1.1.1.1 Makefile
*** Makefile	1997/01/01 19:38:46	1.1.1.1
--- Makefile	1997/03/22 21:44:44
***************
*** 20,25 ****
--- 20,26 ----
  
  CFLAGS+=-I${.CURDIR} ${DBMDEF} -DNETISO -DTCPWRAPPERS
  LDADD+=-lwrap
+ DPADD+=${LIBWRAP}
  
  SRCS=	alias.c arpadate.c clock.c collect.c conf.c convtime.c daemon.c \
  	deliver.c domain.c envelope.c err.c headers.c macro.c main.c map.c \
Index: usr.sbin/tcpdchk/Makefile
===================================================================
RCS file: /home/cvs-base/src/usr.sbin/tcpdchk/Makefile,v
retrieving revision 1.1.1.1
diff -c -r1.1.1.1 Makefile
*** Makefile	1997/01/11 17:37:08	1.1.1.1
--- Makefile	1997/03/22 21:44:08
***************
*** 4,9 ****
--- 4,10 ----
  SRCS=	tcpdchk.c fakelog.c inetcf.c scaffold.c percent_m.c
  MAN=	tcpdchk.8
  LDADD=	-lwrap
+ DPADD=  ${LIBWRAP}
  
  CFLAGS+= -I${.CURDIR}/../../lib/libwrap
  
Index: usr.sbin/tcpdmatch/Makefile
===================================================================
RCS file: /home/cvs-base/src/usr.sbin/tcpdmatch/Makefile,v
retrieving revision 1.1.1.1
diff -c -r1.1.1.1 Makefile
*** Makefile	1997/01/11 17:37:10	1.1.1.1
--- Makefile	1997/03/22 21:44:25
***************
*** 6,11 ****
--- 6,12 ----
  .PATH:	${.CURDIR}/../tcpdchk
  CFLAGS+= -I${.CURDIR}/../tcpdchk -I${.CURDIR}/../../lib/libwrap
  LDADD=	-lwrap
+ DPADD=  ${LIBWRAP}
  
  .include "${.CURDIR}/../../lib/libwrap/Makefile.cflags"
  
>Audit-Trail:
>Unformatted: