From greid@ukug.uk.freebsd.org  Tue Feb 20 08:47:11 2001
Return-Path: <greid@ukug.uk.freebsd.org>
Received: from mta06-svc.ntlworld.com (mta06-svc.ntlworld.com [62.253.162.46])
	by hub.freebsd.org (Postfix) with ESMTP id 7DAE037B4EC
	for <FreeBSD-gnats-submit@freebsd.org>; Tue, 20 Feb 2001 08:47:08 -0800 (PST)
	(envelope-from greid@ukug.uk.freebsd.org)
Received: from m171-mp1-cvx1b.gui.ntl.com ([62.252.8.171])
          by mta06-svc.ntlworld.com
          (InterMail vM.4.01.02.27 201-229-119-110) with ESMTP
          id <20010220164704.HCBC285.mta06-svc.ntlworld.com@m171-mp1-cvx1b.gui.ntl.com>
          for <FreeBSD-gnats-submit@freebsd.org>;
          Tue, 20 Feb 2001 16:47:04 +0000
Message-Id: <Pine.BSF.4.21.0102201641080.8657-100000@sobek.openirc.co.uk>
Date: Tue, 20 Feb 2001 16:55:57 +0000 (GMT)
From: George Reid <greid@ukug.uk.freebsd.org>
To: FreeBSD-gnats-submit@freebsd.org
Subject: [PATCH] fix fortune out-of-tree build

>Number:         25232
>Category:       bin
>Synopsis:       [PATCH] fix fortune out-of-tree build
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Feb 20 08:50:04 PST 2001
>Closed-Date:    Wed Mar 28 03:12:19 PST 2001
>Last-Modified:  Wed Mar 28 03:12:43 PST 2001
>Originator:     George Reid
>Release:        FreeBSD 5.0-CURRENT i386
>Organization:
FreeBSD UK Usergroup
>Environment:
FreeBSD 5.0-CURRENT i386
>Description:
games/fortune out-of-tree build is broken.

make tries to include ${CURDIR}../../Makefile.inc which exists in
src/games in-tree. This prevents the program from compiling out-of-tree.

There is a Makefile.inc in fortune/ which includes src/games/Makefile.inc
if it exists (i.e. if doing an in-tree build).

>How-To-Repeat:
cd /tmp; cvs co -r HEAD fortune; cd fortune; make

>Fix:
Index: fortune/Makefile
===================================================================
RCS file: /usr/home/ncvs/src/games/fortune/fortune/Makefile,v
retrieving revision 1.3
diff -u -r1.3 Makefile
--- fortune/Makefile	1996/09/05 17:13:50	1.3
+++ fortune/Makefile	2001/02/20 16:54:08
@@ -6,5 +6,5 @@
 DPADD=	${LIBCOMPAT}
 LDADD=	-lcompat
 
-.include "${.CURDIR}/../../Makefile.inc"
+.include "${.CURDIR}/../Makefile.inc"
 .include <bsd.prog.mk>
Index: strfile/Makefile
===================================================================
RCS file: /usr/home/ncvs/src/games/fortune/strfile/Makefile,v
retrieving revision 1.2
diff -u -r1.2 Makefile
--- strfile/Makefile	1996/05/27 22:43:35	1.2
+++ strfile/Makefile	2001/02/20 16:54:14
@@ -5,5 +5,5 @@
 MLINKS= strfile.8 unstr.8
 CFLAGS+= -Wall
 
-.include "${.CURDIR}/../../Makefile.inc"
+.include "${.CURDIR}/../Makefile.inc"
 .include <bsd.prog.mk>
Index: unstr/Makefile
===================================================================
RCS file: /usr/home/ncvs/src/games/fortune/unstr/Makefile,v
retrieving revision 1.2
diff -u -r1.2 Makefile
--- unstr/Makefile	1996/05/27 22:43:41	1.2
+++ unstr/Makefile	2001/02/20 16:54:20
@@ -4,5 +4,5 @@
 NOMAN=	noman
 CFLAGS+=-Wall -I${.CURDIR}/../strfile
 
-.include "${.CURDIR}/../../Makefile.inc"
+.include "${.CURDIR}/../Makefile.inc"
 .include <bsd.prog.mk>

>Release-Note:
>Audit-Trail:

From: Bruce Evans <bde@zeta.org.au>
To: George Reid <greid@dogma.freebsd-uk.eu.org>
Cc: FreeBSD-gnats-submit@FreeBSD.ORG
Subject: Re: bin/25232: [PATCH] fix fortune out-of-tree build
Date: Wed, 21 Feb 2001 17:31:03 +1100 (EST)

 On Tue, 20 Feb 2001, George Reid wrote:
 
 > >Description:
 > games/fortune out-of-tree build is broken.
 > 
 > make tries to include ${CURDIR}../../Makefile.inc which exists in
 > src/games in-tree. This prevents the program from compiling out-of-tree.
 > ...
 > >Fix:
 > Index: fortune/Makefile
 > ===================================================================
 > RCS file: /usr/home/ncvs/src/games/fortune/fortune/Makefile,v
 > retrieving revision 1.3
 > diff -u -r1.3 Makefile
 > --- fortune/Makefile	1996/09/05 17:13:50	1.3
 > +++ fortune/Makefile	2001/02/20 16:54:08
 > @@ -6,5 +6,5 @@
 >  DPADD=	${LIBCOMPAT}
 >  LDADD=	-lcompat
 >  
 > -.include "${.CURDIR}/../../Makefile.inc"
 > +.include "${.CURDIR}/../Makefile.inc"
 >  .include <bsd.prog.mk>
 > ...
 
 I just committed an equivalent "fix" (remove these includes; your version
 of them is duplicated in <bsd.prog.mk>).
 
 But this is not really right.  The Makefile.inc at the next level up
 (still in the fortune tree) does the old version of the includes
 (include from 2 levels up, at the top of the games tree), except it
 does the include conditionally.  It should include from 1 level up
 for technical reasons (so that it doesn't know too much about the
 depth of the subdirs) and do the include unconditionally so that
 security-related macros are defined, but including it unconditionally
 would bring back your out-of-tree problem.  I'm not even sure how
 to test for its existence.  `.include' has an undocumented search
 path, which IIRC begins with the directory of the file containing the
 include statement and ends with ${.CURDIR}.  I'm not sure if this
 magic does/should apply to exists().
 
 Bruce
 
State-Changed-From-To: open->closed 
State-Changed-By: phk 
State-Changed-When: Wed Mar 28 03:12:19 PST 2001 
State-Changed-Why:  
Seems Bruce fixed this one already. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=25232 
>Unformatted:
