Bug 25232 - [PATCH] fix fortune out-of-tree build
Summary: [PATCH] fix fortune out-of-tree build
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: 5.0-CURRENT
Hardware: Any Any
: Normal Affects Only Me
Assignee: freebsd-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2001-02-20 16:50 UTC by George Reid
Modified: 2001-03-28 12:12 UTC (History)
0 users

See Also:


Attachments
file.diff (1.32 KB, patch)
2001-02-20 16:50 UTC, George Reid
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description George Reid 2001-02-20 16:50:04 UTC
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
Comment 1 Bruce Evans 2001-02-21 06:31:03 UTC
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
Comment 2 Poul-Henning Kamp freebsd_committer freebsd_triage 2001-03-28 12:12:19 UTC
State Changed
From-To: open->closed

Seems Bruce fixed this one already.