Subject: pkg/21747: devel/SDL/buildlink2.mk has redundant .include's
To: None <gnats-bugs@gnats.netbsd.org>
From: None <tv@pobox.com>
List: netbsd-bugs
Date: 06/01/2003 10:43:48
>Number:         21747
>Category:       pkg
>Synopsis:       devel/SDL/buildlink2.mk has redundant .include's
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Jun 01 14:45:00 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator:     Todd Vierling
>Release:        NetBSD 1.6.1_STABLE
>Organization:
	DUH.ORG:  Pointing out the obvious since 1994.
>Environment:
System: NetBSD netbsd.int.duh.org 1.6.1_STABLE NetBSD 1.6.1_STABLE (TODD) #0: Fri May 30 15:13:58 EDT 2003 tv@netbsd.int.duh.org:/export/SRC/duh/netbsd-kernels/TODD i386
Architecture: i386
Machine: i386
>Description:

devel/SDL/buildlink2.mk .include's all of SDL's own dependencies.  This is
wrong, because SDL already pulls these in (and dependencies of SDL don't
give a damn what dependencies it pulls in).

This is starting to look like a disturbing trend.  I've said this before
and I'll say it again here:  A PACKAGE SHOULD ONLY PULL IN THE
DEPENDENCIES IT NEEDS, AND NO MORE.  This has the added implication that a
buildlink2.mk should, in almost all cases, refer ONLY to the package
directory in which that buildlink2.mk resides (and generic stuff in mk/).

Adding a bunch of .include's to a buildlink2.mk only complicates the build
and packaging process, and makes it very difficult for someone to pull out
a single dependency in a local pkgsrc tree.  (Case in point:  I have to
edit two places to take ESD support out of SDL -- when I should be able to
do this by editing only SDL's Makefile.)

>How-To-Repeat:
>Fix:

Index: buildlink2.mk
===================================================================
RCS file: /pub/NetBSD-CVS/pkgsrc/devel/SDL/buildlink2.mk,v
retrieving revision 1.6
diff -u -r1.6 buildlink2.mk
--- buildlink2.mk	2003/05/02 11:54:18	1.6
+++ buildlink2.mk	2003/06/01 14:39:02
@@ -19,15 +19,6 @@
 
 PTHREAD_OPTS+=		require
 
-.if defined(SDL_USE_NAS)
-.  include "../../audio/nas/buildlink2.mk"
-.endif
-.include "../../audio/esound/buildlink2.mk"
-.include "../../graphics/MesaLib/buildlink2.mk"
-.include "../../graphics/glut/buildlink2.mk"
-.include "../../graphics/aalib-x11/buildlink2.mk"
-.include "../../mk/pthread.buildlink2.mk"
-
 BUILDLINK_TARGETS+=		SDL-buildlink
 
 SDL-buildlink: _BUILDLINK_USE
>Release-Note:
>Audit-Trail:
>Unformatted: