Subject: pkg/32745: pkgsrc mk-files use wrong include paths
To: None <,,>
From: None <>
List: pkgsrc-bugs
Date: 02/05/2006 10:15:01
>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
                                Michael van Elst
                                "A potential Snark may lurk in every tree."
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
pkgsrc mk-files use relative file paths to include other mk-files.
E.g.: mk/ includes "../../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/ tries to include mk/../../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.

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

mk/ should simply include ""
mk/buildlink3/*.mk should include "../"

and so on..