Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 10 Nov 2010 00:42:40 +0300
From:      Anonymous <swell.k@gmail.com>
To:        Dmitry Marakasov <amdmi3@amdmi3.ru>
Cc:        ports@FreeBSD.org, Lev Serebryakov <lev@FreeBSD.org>
Subject:   Re: Proper way to detect kernel / userland sources?
Message-ID:  <86fwvaw4vj.fsf@gmail.com>
In-Reply-To: <20101109203822.GA67706@hades.panopticon> (Dmitry Marakasov's message of "Tue, 9 Nov 2010 23:38:22 %2B0300")
References:  <241091055.20101109182834@serebryakov.spb.ru> <20101109203822.GA67706@hades.panopticon>

next in thread | previous in thread | raw e-mail | index | archive | help
Dmitry Marakasov <amdmi3@amdmi3.ru> writes:

> * Lev Serebryakov (lev@FreeBSD.org) wrote:
>
>>   I'm  preparing port which depends both on kernel source (it contains
>> kernel module) and userland sources (it needs GEOM sources).
>> 
>>   I   see,   that  ports  with  kernel  modules  check  for  hardcoded
>>   "/usr/src/sys/Makefile".  But it doesn't look good: sources could be
>>   perfectly valid, but placed in other directory!
>> 
>>   Is  here  any  standerd  variable  which  should  be used instead of
>>   hardcoded "/usr/src"?
>
> Oh, that reminded me. For now, there's no other way than to hardcode
> /usr/src (however some ports make that overridable). I've though
> of that too and made a patch that has been lying here for some time
> without purpose. As this topic is risen, I'd like to discuss it,
> possibly improve and push into Mk.
>
> http://people.freebsd.org/~amdmi3/USE_SRC.patch
>
> - Introduces SRC_BASE which defaults to /usr/src and may be used in
>   ports to access system sources

Please, also define and export SYSDIR because that what is used by bsd.kmod.mk.
And some ports only require kernel sources. I don't think there are many
ports that need userland sources.

  SRC_BASE ?= /usr/src
  SYSDIR ?= ${SRC_BASE}/sys
  MAKE_ENV += SYSDIR="${SYSDIR}"

> - Introduces USE_SRC (to be set in ports that require kernel source)
>   that checks whether system sources are installed and whether their
>   version corresponds to system version (overridable)
> - Corrects a typo



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?86fwvaw4vj.fsf>