NetBSD Problem Report #32745

From mlelstv@henery.1st.de  Sun Feb  5 10:11:28 2006
Return-Path: <mlelstv@henery.1st.de>
Received: from serpens.de (serpens.de [62.208.181.200])
	by narn.netbsd.org (Postfix) with ESMTP id 8845463B879
	for <gnats-bugs@gnats.NetBSD.org>; Sun,  5 Feb 2006 10:11:27 +0000 (UTC)
Message-Id: <200602051011.k15ABG0v009652@henery.1st.de>
Date: Sun, 5 Feb 2006 11:11:16 +0100 (CET)
From: mlelstv@serpens.de
Reply-To: mlelstv@serpens.de
To: gnats-bugs@netbsd.org
Subject: pkgsrc mk-files use wrong include paths
X-Send-Pr-Version: 3.95

>Number:         32745
>Category:       pkg
>Synopsis:       pkgsrc mk-files use wrong include paths
>Confidential:   no
>Severity:       serious
>Priority:       low
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Feb 05 10:15:01 +0000 2006
>Originator:     Michael van Elst
>Release:        NetBSD 3.0_STABLE
>Organization:
-- 
                                Michael van Elst
Internet: mlelstv@serpens.de
                                "A potential Snark may lurk in every tree."
>Environment:


System: NetBSD henery 3.0_STABLE NetBSD 3.0_STABLE (HENERY) #26: Sat Jan 28 20:13:18 CET 2006 src@henery:/usr/obj/home/src/sys/arch/i386/compile/HENERY i386
Architecture: i386
Machine: i386
>Description:
pkgsrc mk-files use relative file paths to include other mk-files.
E.g.: mk/bsd.pkg.mk includes "../../mk/bsd.prefs.mk".

This assumes that the file is read relative to the current directory
of the make process.

make however uses a more complicated scheme to locate include files.
In particular, it first appends the include path to the directory
where the file is located that contained the .include statement.

E.g.  mk/bsd.pkg.mk tries to include mk/../../mk/bsd.prefs.mk
which is even outside the pkgsrc tree.

pkgsrc still works, because you rarely have a mk-directory next
to the pkgsrc directory and make tries to locate the file also
in some standard directories and finally relative to the current
directory where it then is found.


>How-To-Repeat:

>Fix:
Replace the include paths with correct paths reflecting the
position in the pkgsrc tree. E.g.

mk/bsd.pkg.mk should simply include "bsd.prefs.mk"
mk/buildlink3/*.mk should include "../bsd.prefs.mk"

and so on..

>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2007 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.