/etc/make.conf && CURDIR

Shane Ambler FreeBSD at ShaneWare.Biz
Sun Jun 9 17:33:10 UTC 2013


On 09/06/2013 23:46, Matthias Apitz wrote:
>
> Hello,
>
> I have the kernel sources not in /usr/src/sys, but elsewhere; I can
> not get set correctly SYSDIR via /etc/make.conf for some ports (or
> other values like USE_GCC, ...);
>
> if I have in /etc/make.conf these lines:
>
> .if ${.CURDIR:M*/multimedia/cuse4bsd-kmod*}
> SYSDIR=/usr/home/guru/head/src/sys
 > .endif
>
> it works, but if I let away the '*' in the line, i.e.
>
> .if ${.CURDIR:M*/multimedia/cuse4bsd-kmod}
> SYSDIR=/usr/home/guru/head/src/sys
 > .endif
>
> the 'make' asks me to set SYSDIR:
>
> # make clean install ... building shared library libcuse4bsd.so.1
> gzip -cn cuse4bsd.3 > cuse4bsd.3.gz make -f
> /usr/ports/multimedia/cuse4bsd-kmod/work/cuse4bsd-kmod-0.1.27/Makefile.kmod
> all "/usr/share/mk/bsd.kmod.mk", line 12: Unable to locate the kernel
> source tree. Set SYSDIR to override. *** [all] Error code 1
>
> Why is this? Thanks. The system runs 10-CUR r250588 i386.
>

You'll find the trailing asterix is a wildcard to match any sub dirs.
When building CURDIR only contains multimedia/cuse4bsd-kmod - CURDIR
will be something like
/usr/ports/multimedia/cuse4bsd-kmod/work/cuse4-bsd-kmod-0.1.27/
The pre and post * matches all paths with multimedia/cuse4bsd-kmod in
them - usually pretty unique when building within the ports dirs.



More information about the freebsd-questions mailing list