Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 18 Sep 1996 21:19:40 -0700 (PDT)
From:      Jason Thorpe <thorpej@nas.nasa.gov>
To:        FreeBSD-gnats-submit@freebsd.org
Subject:   bin/1642: pkg_install Makefiles could be simplified
Message-ID:  <199609190419.VAA08262@nostromo.nas.nasa.gov>
Resent-Message-ID: <199609190430.VAA28417@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         1642
>Category:       bin
>Synopsis:       pkg_install Makefiles could be simplified
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Wed Sep 18 21:30:03 PDT 1996
>Last-Modified:
>Originator:     Jason Thorpe
>Organization:
Numerical Aerodynamic Simulation Project - NASA Ames
>Release:        FreeBSD-current 960918, built on NetBSD/alpha
>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 ----
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199609190419.VAA08262>