From thorpej@nas.nasa.gov  Wed Sep 18 21:25:48 1996
Received: from nostromo.nas.nasa.gov (nostromo.nas.nasa.gov [129.99.223.15])
          by freefall.freebsd.org (8.7.5/8.7.3) with ESMTP id VAA26517
          for <FreeBSD-gnats-submit@freebsd.org>; Wed, 18 Sep 1996 21:25:47 -0700 (PDT)
Received: (from thorpej@localhost) by nostromo.nas.nasa.gov (8.7.5/8.6.9-rAT) id VAA08262; Wed, 18 Sep 1996 21:19:40 -0700 (PDT)
Message-Id: <199609190419.VAA08262@nostromo.nas.nasa.gov>
Date: Wed, 18 Sep 1996 21:19:40 -0700 (PDT)
From: Jason Thorpe <thorpej@nas.nasa.gov>
Reply-To: thorpej@nas.nasa.gov
To: FreeBSD-gnats-submit@freebsd.org
Subject: pkg_install Makefiles could be simplified
X-Send-Pr-Version: 3.95

>Number:         1642
>Category:       bin
>Synopsis:       pkg_install Makefiles could be simplified
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Wed Sep 18 21:30:03 PDT 1996
>Closed-Date:    Sat Jul 18 14:31:14 PDT 1998
>Last-Modified:  Sat Jul 18 14:38:06 PDT 1998
>Originator:     Jason Thorpe
>Release:        FreeBSD-current 960918, built on NetBSD/alpha
>Organization:
Numerical Aerodynamic Simulation Project - NASA Ames
>Environment:
	
System: NetBSD nostromo 1.2A NetBSD 1.2A (NOSY) #14: Wed Sep 18 14:54:10 PDT 1996 thorpej@nostromo:/work/clean-current/src/sys/arch/alpha/compile/NOSY alpha


>Description:
	The pkg_install Makefiles have 2 glitches:

		- They're overly complex (the dependency on libinstall
		  can be collapsed)

		- They don't work in the presence of obj.${MACHINE}
		  directories found on NetBSD systems.

	The libinstall Makefile has an unnecessary line, which is
	squished in the patch included.

>How-To-Repeat:
	Try to build the pkg_install suite under NetBSD alpha, in
	the presence of obj.${MACHINE} dirs (obj.alpha, obj.i386, and
	obj.sparc, in this case).  When you go to modify the Makefiles
	to deal with them, notice that there's unneeded redundancy
	that can be collapsed.

>Fix:
	Here's the diffs that "work for me".

 ----- snip -----
Index: Makefile.inc
===================================================================
RCS file: /mastersrc/netbsd/src/usr.sbin/pkg_install/Makefile.inc,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -c -r1.1.1.1 -r1.2
*** Makefile.inc	1996/09/19 03:21:30	1.1.1.1
--- Makefile.inc	1996/09/19 03:49:46	1.2
***************
*** 1,2 ****
--- 1,15 ----
  # Inherit BINDIR from one level up.
  .include "../Makefile.inc"
+ 
+ # Figure out what to use for libinstall
+ INSTALLLIBDIR=	${.CURDIR}/../lib
+ 
+ .if exists(${INSTALLLIBDIR}/obj.${MACHINE})
+ INSTALLOBJDIR=	${INSTALLLIBDIR}/obj.${MACHINE}
+ .else
+ .if exists(${INSTALLLIBDIR}/obj)
+ INSTALLOBJDIR=	${INSTALLLIBDIR}/obj
+ .else
+ INSTALLOBJDIR=	${INSTALLLIBDIR}
+ .endif
+ .endif
Index: add/Makefile
===================================================================
RCS file: /mastersrc/netbsd/src/usr.sbin/pkg_install/add/Makefile,v
retrieving revision 1.1.1.1
diff -c -r1.1.1.1 Makefile
*** Makefile	1996/09/19 03:21:31	1.1.1.1
--- Makefile	1996/09/19 02:26:36
***************
*** 2,14 ****
  
  CFLAGS+=	${DEBUG} -I${.CURDIR}/../lib
  
! .if exists(${.OBJDIR}/../lib)
! LDADD+=		-L${.OBJDIR}/../lib -linstall
! DPADD+=		${.OBJDIR}/../lib/libinstall.a
! .else
! LDADD+=		-L${.CURDIR}/../lib -linstall
! DPADD+=		${.CURDIR}/../lib/libinstall.a
! .endif
  
  LDADD+=		-lftpio -lmd
  DPADD+=		${LIBFTPIO} ${LIBMD}
--- 2,9 ----
  
  CFLAGS+=	${DEBUG} -I${.CURDIR}/../lib
  
! LDADD+=		-L${INSTALLOBJDIR} -linstall
! DPADD+=		${INSTALLOBJDIR}/libinstall.a
  
  LDADD+=		-lftpio -lmd
  DPADD+=		${LIBFTPIO} ${LIBMD}
Index: create/Makefile
===================================================================
RCS file: /mastersrc/netbsd/src/usr.sbin/pkg_install/create/Makefile,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -c -r1.1.1.1 -r1.2
*** Makefile	1996/09/19 03:21:34	1.1.1.1
--- Makefile	1996/09/19 03:49:55	1.2
***************
*** 2,14 ****
  
  CFLAGS+=	${DEBUG} -I${.CURDIR}/../lib
  
! .if exists(${.OBJDIR}/../lib)
! LDADD+=		-L${.OBJDIR}/../lib -linstall
! DPADD+=		${.OBJDIR}/../lib/libinstall.a
! .else
! LDADD+=		-L${.CURDIR}/../lib -linstall
! DPADD+=		${.CURDIR}/../lib/libinstall.a
! .endif
  
  LDADD+=         -lftpio -lmd
  DPADD+=         ${LIBFTPIO} ${LIBMD}
--- 2,9 ----
  
  CFLAGS+=	${DEBUG} -I${.CURDIR}/../lib
  
! LDADD+=		-L${INSTALLOBJDIR} -linstall
! DPADD+=		${INSTALLOBJDIR}/libinstall.a
  
  LDADD+=         -lftpio -lmd
  DPADD+=         ${LIBFTPIO} ${LIBMD}
Index: delete/Makefile
===================================================================
RCS file: /mastersrc/netbsd/src/usr.sbin/pkg_install/delete/Makefile,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -c -r1.1.1.1 -r1.2
*** Makefile	1996/09/19 03:21:33	1.1.1.1
--- Makefile	1996/09/19 03:49:58	1.2
***************
*** 1,13 ****
  PROG= pkg_delete
  CFLAGS+=	${DEBUG} -I${.CURDIR}/../lib
  
! .if exists(${.OBJDIR}/../lib)
! LDADD+=		-L${.OBJDIR}/../lib -linstall
! DPADD+=		${.OBJDIR}/../lib/libinstall.a
! .else
! LDADD+=		-L${.CURDIR}/../lib -linstall
! DPADD+=		${.CURDIR}/../lib/libinstall.a
! .endif
  
  LDADD+=         -lftpio -lmd
  DPADD+=         ${LIBFTPIO} ${LIBMD}
--- 1,8 ----
  PROG= pkg_delete
  CFLAGS+=	${DEBUG} -I${.CURDIR}/../lib
  
! LDADD+=		-L${INSTALLOBJDIR} -linstall
! DPADD+=		${INSTALLOBJDIR}/libinstall.a
  
  LDADD+=         -lftpio -lmd
  DPADD+=         ${LIBFTPIO} ${LIBMD}
Index: info/Makefile
===================================================================
RCS file: /mastersrc/netbsd/src/usr.sbin/pkg_install/info/Makefile,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -c -r1.1.1.1 -r1.2
*** Makefile	1996/09/19 03:21:32	1.1.1.1
--- Makefile	1996/09/19 03:50:01	1.2
***************
*** 1,13 ****
  PROG= pkg_info
  CFLAGS+=	${DEBUG} -I${.CURDIR}/../lib
  
! .if exists(${.OBJDIR}/../lib)
! LDADD+=		-L${.OBJDIR}/../lib -linstall
! DPADD+=		${.OBJDIR}/../lib/libinstall.a
! .else
! LDADD+=		-L${.CURDIR}/../lib -linstall
! DPADD+=		${.CURDIR}/../lib/libinstall.a
! .endif
  
  LDADD+=         -lftpio -lmd
  DPADD+=         ${LIBFTPIO} ${LIBMD}
--- 1,8 ----
  PROG= pkg_info
  CFLAGS+=	${DEBUG} -I${.CURDIR}/../lib
  
! LDADD+=		-L${INSTALLOBJDIR} -linstall
! DPADD+=		${INSTALLOBJDIR}/libinstall.a
  
  LDADD+=         -lftpio -lmd
  DPADD+=         ${LIBFTPIO} ${LIBMD}
Index: lib/Makefile
===================================================================
RCS file: /mastersrc/netbsd/src/usr.sbin/pkg_install/lib/Makefile,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -c -r1.1.1.1 -r1.2
*** Makefile	1996/09/19 03:21:32	1.1.1.1
--- Makefile	1996/09/19 03:50:04	1.2
***************
*** 5,10 ****
  NOPIC=	yes
  
  install:
- 	@echo -n
  
  .include <bsd.lib.mk>
--- 5,9 ----
>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->analyzed 
State-Changed-By: peter 
State-Changed-When: Thu Sep 19 10:36:12 PDT 1996 
State-Changed-Why:  
I don't think we can use these in this form, this would 
break our build since ${.OBJDIR} means something quite different 
on our system, it's normally a full path to the target obj 
directory, there is no ./obj symlink or directory by default. 
State-Changed-From-To: analyzed->closed 
State-Changed-By: hoek 
State-Changed-When: Sat Jul 18 14:31:14 PDT 1998 
State-Changed-Why:  
1)  peter noted on Thu Sep 19 10:36:12 PDT 1996 that we can't simplify 
the Makefiles as suggested. 
2)  No further suggestions have been made. 
3)  Bruce seems to have solved all the problems.  Yay bde!  Yay! 
>Unformatted:
